Skip to content

Commit

Permalink
Update openssl.yml
Browse files Browse the repository at this point in the history
Fix PKCS#12 mobileconfig installation errors when using openssl version > 3 (trailofbits#14558) trailofbits#14622
https://github.com/trailofbits/algo/pull/14622/files
  • Loading branch information
gh0st-network committed Dec 10, 2023
1 parent 67aa5fe commit 68cb12d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions roles/strongswan/tasks/openssl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,27 @@
format: OpenSSH
with_items: "{{ users }}"

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

- name: Get OpenSSL version
shell: |
set -o pipefail
{{ openssl_bin }} version |
cut -f 2 -d ' '
register: ssl_version
run_once: true

- name: Set OpenSSL version fact
set_fact:
openssl_version: "{{ ssl_version.stdout }}"

- 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 +192,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 68cb12d

Please sign in to comment.