Skip to content

Commit

Permalink
Fix PKCS#12 file creation (trailofbits#14558)
Browse files Browse the repository at this point in the history
  • Loading branch information
omgagg committed Feb 4, 2023
1 parent 651f949 commit 904bf5e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions roles/strongswan/tasks/openssl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,19 @@
format: OpenSSH
with_items: "{{ users }}"

- name: Gather the package facts
ansible.builtin.package_facts:
manager: auto

- name: Get OpenSSL version
set_fact:
openssl_version: "{{ ansible_facts.packages['openssl'][0]['version'] }}"

- name: Build the client's p12
shell: >
umask 077;
{{ openssl_bin }} pkcs12
{{ (openssl_version is version('3', '<=')) | ternary('-legacy', '') }}
-in certs/{{ item }}.crt
-inkey private/{{ item }}.key
-export
Expand All @@ -175,6 +184,7 @@
shell: >
umask 077;
{{ openssl_bin }} pkcs12
{{ (openssl_version is version('3', '<=')) | ternary('-legacy', '') }}
-in certs/{{ item }}.crt
-inkey private/{{ item }}.key
-export
Expand Down

0 comments on commit 904bf5e

Please sign in to comment.