Commit Graph

32 Commits

Author SHA1 Message Date
Rudolf Mayerhofer ef81ea62d1 Unify key_algorithm handling for elipic curves (change naming to ECC but stay backwards compatible) 2023-07-12 16:10:21 +02:00
Jan c15b6ec441 Instantiate HashAlgorithm in OCSPRequestBuilder
Installations of more recent cryptography require parameter hash
algorithm to be an instance of hashes.HashAlgorithm, not the bare object
itself.

Fixes #63
2023-07-10 19:27:44 +02:00
Kishi85 6f0ccfdc91 logging: Add real counterparts of IDNA-mapped domains in brackets 2021-09-20 09:26:47 +02:00
Kishi85 460b0119ac configuration: Simplify too complex IDNA conversion 2021-09-13 09:00:59 +02:00
David Klaftenegger e2f7b09b18 certs already contain idna domain names
The idna_convert call here does nothing: when reading a certificate, it
already contains idna domain names. Converting them to idna is
equivalent to the identity function, and can thus be removed.
2021-05-30 16:21:54 +02:00
Kishi85 2e1f5cd894 acertmgr/v2: Handle CA certificate chains properly 2021-05-21 22:50:44 +02:00
Kishi85 0648cb7b38 tools: Fix IDNA handler (again) 2020-03-04 14:50:05 +01:00
Kishi85 b37d0cad94 acertmgr: Add a OCSP validation to certificate verification 2020-03-04 14:50:05 +01:00
Kishi85 c33a39a433 tools: make pem file writable by owner before tryting to write
A PEM file might not be writable by the owner when it should be written
(e.g. on Windows), so we have to ensure the file has write permissions
before doing so
2020-03-04 14:40:49 +01:00
Kishi85 97e9be80cf acertmgr: Fix module/function issues on windows 2019-10-28 10:50:09 +01:00
Kishi85 0b8e49d6ee tools: Display warning about IDNA only if unicode names are in use 2019-06-11 10:05:37 +02:00
Kishi85 7a019d1ac9 idna: unify usage as tools function 2019-05-06 21:24:24 +02:00
Kishi85 6a07ab1188 tools/configuration: Add support for EC/Ed25519/Ed448 generation 2019-04-19 15:29:44 +02:00
Kishi85 4f0fe2c74a tools: Add support for Ed25519 and Ed448 account keys
Add support for Ed25519 and Ed448 account keys in addition
to already supported algorithms
2019-04-16 19:12:25 +02:00
Kishi85 88d4a52ab9 tools: use cryptography conversion instead of custom function
Use cryptography's int_to_bytes consistently instead of our own number
to byte conversion function
2019-04-16 19:12:15 +02:00
Kishi85 4df74d67d5 tools: add support for EC account keys
Allows usage of pre-generated EC account keys (P-256, P-384, P-521)
in addition to already supported RSA keys.
2019-04-16 19:12:05 +02:00
Kishi85 1f5ef9322b tools: remove six dependency
Always decode string if the functions is available, assume normal string
otherwise
2019-04-07 15:31:07 +02:00
Kishi85 4510aaf393 acertmgr: properly format action output 2019-04-07 15:31:07 +02:00
Kishi85 79791c53bc tools: update the get_cert_domain function
Add all domains for SAN certificates and convert IDNA values to the
correct representation
2019-04-07 15:31:07 +02:00
Kishi85 b63a0bc424 tools: add log function, update log messages mentioning certificates
This simple implementation writes log messages to stdout/err and flushes
the buffers immediately after the message has been written.

Also update log messages with the certificate CN to a better readable format
Introduce functions for get_cert_cn and get_cert_valid_until to
encapsulate all cryptographic functions consistently in tools.
2019-04-07 15:31:06 +02:00
Kishi85 2046215e37 tools: encapsulate key parameter determination in tools function
This is will isolate more cryptographic functions in the tools module
and allow for easier replacement of any cryptographic function should
the need ever arise
2019-04-07 15:31:02 +02:00
Kishi85 54cb334600 acertmgr: add support for the ocsp must-staple extension
Introduces a new config directive and requires at least cryptography 2.1
2019-04-04 13:39:05 +02:00
Kishi85 737578159b acertmgr: Add support for account.key based certificate revocation 2019-03-28 00:53:54 +01:00
Kishi85 ed96f2bbf2 acertmgr: store CSR and support static CSR usage
Store the generated CSR for later review/usage and allow the stored
CSR to be used for future request. Configuration directives csr_file
(path) and csr_static (=true) have been added for this.

This allows simplified deployment of DANE/TLSA due the former requiring
updates to DNS with every public key change, which will not be the case
with a static CSR. A new CSR can be triggered manually by deleting the
CSR file upon which the next certificate will require an update of any
TLSA records in DNS.

This may also be used to specify a custom CSR to use, as long as the
csr_file path and the domains in the CSR match the ones given in the
acertmgr configuration.
2019-03-25 10:13:02 +01:00
Kishi85 7ee34912c1 acertmgr: rework how files are handled in general
- Remove unnecessary tempfiles and keep as much in memory as possible
- Unify the way PEM files are written and read
2019-03-25 10:12:59 +01:00
Kishi85 fd2134753a tools: cleanup function names and add crypto wrappers 2019-03-24 16:49:03 +01:00
Kishi85 cda4be09f4 acertmgr: don't fail when no issuer CA can be retrieved
Do not fail if there is no issuer CA download possible in any way. Just
let the user provide the (static) CA certifiate at ca_file or fail during
certificate deployment.
2019-03-23 08:31:27 +01:00
Kishi85 c0d23631b6 tools: add wrapper for urlopen and use it throughout acertmgr 2019-03-22 16:09:21 +01:00
Markus 5b3993e9ef tools: optimize imports (remove unused import) 2019-03-21 22:03:58 +01:00
Kishi85 c054ecebe9 acertmgr: change the way the issuer CA is fetched
This changes the way the issuer CA is retrieved if no static_ca file is
used. Previously we would always download the CA using the AIA Info but
API v2 provides normally the full chain PEM upon certificate retrieval
and does not need this step. For the APIv2 case we now use the CA
provided with the certificate which required some changes to the basic
handling of CA files. APIv1 has been adapted to this new handling.
APIv2 has a fallback option to the way APIv1 handles it in case no CA
has been provided.
2019-03-21 12:26:32 +01:00
Kishi85 67c83d8fce configuration: cleanup handling+defaults and add commandline options
This adds a few basic command line parameters to allow further
customization of the configuration locations. As well as defining new
default locations for the acertmgr config files and updating the parser
with missing values, so that the config dictionary provided to the
acertmgr process after parsing is complete and no cross reference to the
configuration module is necessary. The parser error handling is also
improved.
2019-02-20 12:03:40 +01:00
Kishi85 f1f2d5c7cd move everything to package 'acertmgr' 2019-02-20 11:43:44 +01:00