mirror of
https://github.com/ansible-collections/community.crypto.git
synced 2026-05-08 14:22:56 +00:00
Fix openssl_pkcs12 crash with cryptography backend when loading passphrase-protected files (#248)
* Convert passphrase to bytes when loading PKCS#12 file with cryptography. * Add tests with PKCS#12 passphrase. * Add changelog fragment.
This commit is contained in:
@@ -107,11 +107,12 @@
|
||||
check_mode: true
|
||||
register: p12_dumped_check_mode
|
||||
|
||||
- name: "({{ select_crypto_backend }}) Generate PKCS#12 file with multiple certs"
|
||||
- name: "({{ select_crypto_backend }}) Generate PKCS#12 file with multiple certs and passphrase"
|
||||
openssl_pkcs12:
|
||||
select_crypto_backend: '{{ select_crypto_backend }}'
|
||||
path: '{{ output_dir }}/ansible_multi_certs.p12'
|
||||
friendly_name: abracadabra
|
||||
passphrase: hunter3
|
||||
privatekey_path: '{{ output_dir }}/ansible_pkey1.pem'
|
||||
certificate_path: '{{ output_dir }}/ansible1.crt'
|
||||
other_certificates:
|
||||
@@ -120,11 +121,12 @@
|
||||
state: present
|
||||
register: p12_multiple_certs
|
||||
|
||||
- name: "({{ select_crypto_backend }}) Generate PKCS#12 file with multiple certs, again (idempotency)"
|
||||
- name: "({{ select_crypto_backend }}) Generate PKCS#12 file with multiple certs and passphrase, again (idempotency)"
|
||||
openssl_pkcs12:
|
||||
select_crypto_backend: '{{ select_crypto_backend }}'
|
||||
path: '{{ output_dir }}/ansible_multi_certs.p12'
|
||||
friendly_name: abracadabra
|
||||
passphrase: hunter3
|
||||
privatekey_path: '{{ output_dir }}/ansible_pkey1.pem'
|
||||
certificate_path: '{{ output_dir }}/ansible1.crt'
|
||||
other_certificates:
|
||||
@@ -133,11 +135,12 @@
|
||||
state: present
|
||||
register: p12_multiple_certs_idempotency
|
||||
|
||||
- name: "({{ select_crypto_backend }}) Dump PKCS#12 with multiple certs"
|
||||
- name: "({{ select_crypto_backend }}) Dump PKCS#12 with multiple certs and passphrase"
|
||||
openssl_pkcs12:
|
||||
select_crypto_backend: '{{ select_crypto_backend }}'
|
||||
src: '{{ output_dir }}/ansible_multi_certs.p12'
|
||||
path: '{{ output_dir }}/ansible_parse_multi_certs.pem'
|
||||
passphrase: hunter3
|
||||
action: parse
|
||||
state: present
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
register: p12_validate_no_pkey
|
||||
|
||||
- name: '({{ select_crypto_backend }}) Validate PKCS#12 with multiple certs'
|
||||
shell: "{{ openssl_binary }} pkcs12 -info -in {{ output_dir }}/ansible_multi_certs.p12 -nodes -passin pass:'' | grep subject"
|
||||
shell: "{{ openssl_binary }} pkcs12 -info -in {{ output_dir }}/ansible_multi_certs.p12 -nodes -passin pass:'hunter3' | grep subject"
|
||||
register: p12_validate_multi_certs
|
||||
|
||||
- name: '({{ select_crypto_backend }}) Validate PKCS#12 (assert)'
|
||||
|
||||
Reference in New Issue
Block a user