Commit Graph

293 Commits (605cf2631e0df0fa2ce410503e5973e7d483a735)

Author SHA1 Message Date
Felix Fontein e9bc7c7163
openssl_pkcs12: add cryptography backend (#234)
* Began refactoring.

* Continue.

* Factor PyOpenSSL backend out.

* Add basic cryptography backend.

* Update plugins/modules/openssl_pkcs12.py

Co-authored-by: Ajpantuso <ajpantuso@gmail.com>

* Only run tests when new enough pyOpenSSL or cryptography is around.

* Reduce required pyOpenSSL version from 17.1.0 to 0.15.

I have no idea why 17.1.0 was there (in the tests), and not something smaller.
The module itself did not mention any version.

* Linting.

* Linting.

* Increase compatibility by selecting pyopenssl backend when iter_size or maciter_size is used.

* Improve docs, add changelog fragment.

* Move hackish code to cryptography_support.

* Update plugins/modules/openssl_pkcs12.py

Co-authored-by: Ajpantuso <ajpantuso@gmail.com>

* Update plugins/modules/openssl_pkcs12.py

Co-authored-by: Ajpantuso <ajpantuso@gmail.com>

* Streamline cert creation.

* Convert range to list.

Co-authored-by: Ajpantuso <ajpantuso@gmail.com>
2021-05-20 19:36:07 +02:00
Felix Fontein 0a0d0f2bdf
openssl_csr_info and x509_certificate_info: return more public key information (#233)
* Return more public key information.

* Make sure bit size is converted to int first.

* Apply suggestions from code review

Co-authored-by: Ajpantuso <ajpantuso@gmail.com>

* Remove no longer necessary code.

* Use correct return value's name.

* Add trailing commas.

Co-authored-by: Ajpantuso <ajpantuso@gmail.com>
2021-05-19 14:02:45 +02:00
Felix Fontein 3293b77f18
Remove unnecessary and undocumented return values. (#235) 2021-05-19 14:02:26 +02:00
Felix Fontein 69aeb2d86f
x509_crl_info: allow to not enumerate revoked certificates (#232)
* Allow to not enumerate revoked certificates.

* Forgot to remove one instance.

* Add example.
2021-05-19 09:32:30 +02:00
Felix Fontein 7298c1f49a
Add openssl_publickey_info module (#231)
* Add openssl_publickey_info module. Share code between openssl_privatekey_info and the new module, and improve documentation of it.

* Move public key loading to support module.

* Require pyOpenSSL 16.0.0 for public key loading.

* Linting.

* Apply suggestions from code review

Co-authored-by: Ajpantuso <ajpantuso@gmail.com>

Co-authored-by: Ajpantuso <ajpantuso@gmail.com>
2021-05-18 17:47:10 +02:00
Felix Fontein ba03580659
x509_certificate_info: move main code to module_utils to allow easier implementation of diff mode (#206)
* Move x509_certificate_info code to module_utils.

* Add changelog fragment.

* Apply suggestions from code review

Co-authored-by: Ajpantuso <ajpantuso@gmail.com>

Co-authored-by: Ajpantuso <ajpantuso@gmail.com>
2021-05-15 22:48:08 +02:00
Felix Fontein a93f07c651
openssl_privatekey_info: move main code to module_utils to allow easier implementation of diff mode (#205)
* Move openssl_privatekey_info code to module_utils.

* Add changelog fragment.

* Apply suggestions from code review

Co-authored-by: Ajpantuso <ajpantuso@gmail.com>

Co-authored-by: Ajpantuso <ajpantuso@gmail.com>
2021-05-15 08:24:09 +02:00
Felix Fontein c0edfb46bb
openssl_csr_info: move main code to module_utils to allow easier implementation of diff mode (#204)
* Move openssl_csr_info code to module_utils.

* Add changelog fragment.

* Apply suggestions from code review

Co-authored-by: Ajpantuso <ajpantuso@gmail.com>

Co-authored-by: Ajpantuso <ajpantuso@gmail.com>
2021-05-13 22:08:28 +02:00
Felix Fontein 6c5a0c6df1
x509_crl_info: move main code to module_utils to allow easier implementation of diff mode (#203)
* Move x509_crl_info code to module_utils.

* Add changelog fragment.

* Make sure PyOpenSSL is also installed.

* Implement review comments.
2021-05-12 23:30:19 +02:00
Ajpantuso 80d64e7b64
openssh_keypair: Populate return values when keypair exists and check_mode=true (#230)
* Swapping statement order for check_mode to initialize return values

* Adding changelog fragment

* Updated changelog to reflect bugfix
2021-05-12 16:10:08 +02:00
Felix Fontein 3e7362200a
Update Python versions for integration tests: add Python 3.10 (#229)
* Update Python versions for integration tests.

* 3.10 in YAML is 3.1...
2021-05-10 19:28:59 +02:00
Felix Fontein c400744040 Improve changelog fragment. 2021-05-10 17:58:42 +02:00
Felix Fontein 91552d5fd2
Clarify Windows (non-)support. (#228) 2021-05-10 17:14:41 +02:00
Ajpantuso 6100d9b4df
openssh_keypair: Adding passphrase parameter (#225)
* Integrating openssh module utils with openssh_keypair

* Added explicit PEM formatting for OpenSSH < 7.8

* Adding changelog fragment

* Adding OpenSSL/cryptography dependency for integration tests

* Adding private_key_format option and removing forced cryptography update for CI

* Fixed version check for bcrypt and key_format option name

* Setting no_log=False for private_key_format

* Docs correction and simplification of control flow for private_key_format
2021-05-10 14:47:01 +02:00
Ajpantuso 37c1540ff4
New module_utils openssh (#213)
* Adding openssh utils and unit tests

* Adding changelog fragment and correcting RSA default size

* Adding changelog fragment

* Added passphrase update, test cases, and check for SSH private key loader

* corrected ecdsa type when loading

* Resolving inital review comments

* Fixed import in unit tests

* Cleaning up validation functions

* Separating private/public key related errors; Adding verify method

* Expressed generate/load functions as classmethods and cleaned up method comments

* Added support for loading asymmetric key pairs of PEM and DER formats

* Refactored loading/generation for Asym keypairs into classmethods

* Rescoped helper functions and classmethods for OpenSSH Keypair

* Corrected docstring for OpenSSH_Keypair.generate()

* Fixed import errors for sanity tests

* Improvements to comparison, key verification, and password validation

* Added comparison tests, simplified password validation, fixed Ed25519 load bug

* Adding additional equivalence tests with passphrases
2021-05-03 21:10:48 +02:00
Felix Fontein 3239701ba4
Add ansible-test config file. (#224) 2021-05-01 22:20:50 +02:00
Felix Fontein 81408bb853
Add Fedora 34 and remove Fedora 32 from devel tests. (#223) 2021-04-30 20:07:41 +00:00
Felix Fontein 6414301936
Use Ansible's codecov uploader. (#222) 2021-04-30 04:28:13 +02:00
Felix Fontein db513d1b27 Next expected release is 1.7.0. 2021-04-28 08:46:14 +02:00
Felix Fontein 0ecdf2ccbd Release 1.6.2. 2021-04-28 07:53:36 +02:00
Felix Fontein c05e20cf1e Prepare 1.6.2 release. 2021-04-28 07:32:33 +02:00
Felix Fontein f4334d7307
acme_* modules: make sure 'meta' is always in directory (#221)
* Make sure 'meta' is always in directory.

* Update plugins/module_utils/acme/acme.py
2021-04-28 07:31:06 +02:00
Felix Fontein 201920d161
Replace FreeBSD 11.4 with 13.0 for devel testing. (#218) 2021-04-22 07:08:11 +02:00
Felix Fontein e809ee19ee Next expected release is 1.7.0. 2021-04-11 16:51:35 +02:00
Felix Fontein 4684f36c38 Release 1.6.1. 2021-04-11 15:47:23 +02:00
Felix Fontein bb3ddf1961 Prepare 1.6.1 bugfix release. 2021-04-11 15:45:37 +02:00
Felix Fontein 0e1f0fd730
ACME exception fixes (#217)
* Fix wrong usages of ACMEProtocolException.

* Add changelog fragment.

* Fix error handling when content could not be decoded.

* Make sure that content_json is a dict or None.

* Improve acme_inspect's ACMEProtocolException handling.

* Improve error handling.

* Add tests.

* Fix challenge error.

* Add challenges tests.

* Provide content if available.

* Add some order tests.

* Linting.
2021-04-11 14:44:44 +02:00
Felix Fontein 7b1d4770e9
ansible/ansible's stable-2.11 branch has been created. (#214) 2021-04-06 08:52:35 +02:00
Felix Fontein befa690d9e
Stop using ansible-galaxy collection install to install a collection due to https://github.com/ansible/galaxy/issues/2429. (#211) 2021-03-27 09:57:50 +01:00
Andrew Klychkov bcf2a17257
AZP: update default container version (#210) 2021-03-26 12:31:36 +01:00
Felix Fontein 8c6b28cd81 Next expected release is 1.7.0. 2021-03-22 13:37:07 +01:00
Felix Fontein b916f95d4d Release 1.6.0. 2021-03-22 12:55:25 +01:00
Felix Fontein 42d94dd44b Prepare 1.6.0 release. 2021-03-22 07:55:12 +01:00
Felix Fontein f5fd5fdf5b
acme: improve error handling in backend's parse_key() (#208)
* Improve error handling in backend's parse_key().

* Adjust unit tests.
2021-03-22 07:30:06 +01:00
Felix Fontein e85554827f
acme_* modules: support private key passprases (#207)
* Support private key passprases.

* Use c.c modules for key generation, add first passphrase tests.

* Some more passphrase tests.
2021-03-21 17:53:20 +01:00
Felix Fontein 5d32937321
ACME modules refactor (#187)
* Move acme.py to acme/__init__.py to prepare splitup.

* Began moving generic code out.

* Creating backends.

* Update unit tests.

* Move remaining new code out.

* Use new interface.

* Rewrite module init code.

* Add changelog.

* Add BackendException for crypto backend errors.

* Improve / uniformize ACME error reporting.

* Create ACMELegacyAccount for backwards compatibility.

* Split up ACMEAccount into ACMEClient and ACMEAccount.

* Move get_keyauthorization into module_utils.acme.challenges.

* Improve error handling.

* Move challenge and authorization handling code into module_utils.

* Add split_identifier helper.

* Move order code into module_utils.

* Move ACME v2 certificate handling code to module_utils.

* Fix/move ACME v1 certificate retrieval to module_utils as well.

* Refactor alternate chain handling code by splitting it up into simpler functions.

* Make chain matcher creation part of backend.
2021-03-21 09:40:25 +01:00
Felix Fontein 8de9376a10
Make action_module plugin utils compatible with latest changes in ansible-core 2.11.0b3 (#202)
* Make compatible with latest changes in ansible-core 2.11.0b3.

* Add missing import.

* Use correct class.
2021-03-20 23:36:48 +01:00
Felix Fontein 35a78dbc4e
Improve openssl_privatekey docs. (#198) 2021-03-15 08:28:02 +01:00
Felix Fontein 2e69113688 Next expected version is 1.6.0. 2021-03-08 07:44:55 +01:00
Felix Fontein eb97f8ee75 Release 1.5.0. 2021-03-08 06:54:42 +01:00
Felix Fontein ea4aac6af1 Add 1.5.0 release summary. 2021-03-08 02:16:11 +01:00
Felix Fontein a1897fd3b1
luks_device: add sector_size option (#193)
* Add sector_size option to luks_device.

* Trying to improve error handling.

* Improve error handling.
2021-03-02 22:02:31 +01:00
Felix Fontein ea889ce2ad
Linting. (#191) 2021-02-11 07:53:50 +01:00
Felix Fontein c20553ce68
Update targets for CI for devel branch; move some targets to stable-2.10. (#190) 2021-02-10 22:52:40 +01:00
Felix Fontein 9732107ba6
Bump AZP test container version. (#189) 2021-02-10 13:47:04 +01:00
Felix Fontein b22c4fb65a
Fix CI (#188)
* Limit cryptography to < 3.4 for Python < 3.6.

* Make sure cryptography 3.3+ is installed on Darwin.

* Work around old pip versions.
2021-02-09 06:47:30 +01:00
Felix Fontein 4b638a9608
Improve documentation, in particular of ACME modules (#181)
* Use B(...) instead of RST formatting (which does not work for options).

* Improve the documentation on acme_directory.

It now mentions the ACME v1 deprecation for Let's Encrypt,
and mentions that ZeroSSL works.

* Improve ACME module documentation.

* Update plugins/doc_fragments/acme.py
2021-02-02 19:29:49 +01:00
Ed Schaller b0dbccaf3c
openssl_csr: handle missing basic constraint (#180)
* openssl_csr: handle missing basic constraint

* openssl_csr: condense missing basic constraint check

As suggested by felixfontein

* add changelog fragment

* Update changelogs/fragments/179-openssl-csr-basic-constraint.yml

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-02-01 21:40:51 +01:00
Felix Fontein 36683e1dd7
Fedora 30 and 31 are EOL and will eventually be removed from devel. (#182) 2021-02-01 15:30:52 +00:00
Felix Fontein 15a0be6107
Deprecate returning orders when retrieve_orders=url_list. (#178)
This allows to get rid of the ignore.txt entries for the return value syntax
error since then orders will always have the same type when returned.
2021-01-27 09:03:34 +01:00