diff options
author | Felix Fontein <felix@fontein.de> | 2018-12-23 10:23:31 +0100 |
---|---|---|
committer | René Moser <mail@renemoser.net> | 2018-12-23 10:23:31 +0100 |
commit | e1218ca10f7ecb6a163a59fe18201bc2598a1215 (patch) | |
tree | 9136b5660ef6dbb72b283a24d97c964abead5542 /test/integration/targets/openssl_publickey | |
parent | 344b6002b12f361be52e586f39cc5b223f48e10c (diff) | |
download | ansible-e1218ca10f7ecb6a163a59fe18201bc2598a1215.tar.gz |
Elliptic curve tests for crypto modules (#50109)
* Add openssl_csr ECC test.
* Add openssl_publickey ECC test.
* Add openssl_certificate ECC test.
Diffstat (limited to 'test/integration/targets/openssl_publickey')
-rw-r--r-- | test/integration/targets/openssl_publickey/tasks/main.yml | 12 | ||||
-rw-r--r-- | test/integration/targets/openssl_publickey/tests/validate.yml | 15 |
2 files changed, 27 insertions, 0 deletions
diff --git a/test/integration/targets/openssl_publickey/tasks/main.yml b/test/integration/targets/openssl_publickey/tasks/main.yml index 7cb45c7ab8..b8e93933c8 100644 --- a/test/integration/targets/openssl_publickey/tasks/main.yml +++ b/test/integration/targets/openssl_publickey/tasks/main.yml @@ -1,3 +1,4 @@ +--- - block: - name: Generate privatekey openssl_privatekey: @@ -66,6 +67,17 @@ path: '{{ output_dir }}/publickey4.pub' privatekey_path: '{{ output_dir }}/privatekey.pem' + - name: Generate privatekey 5 (ECC) + openssl_privatekey: + path: '{{ output_dir }}/privatekey5.pem' + type: ECC + curve: secp256k1 + + - name: Generate publickey 5 - PEM format + openssl_publickey: + path: '{{ output_dir }}/publickey5.pub' + privatekey_path: '{{ output_dir }}/privatekey5.pem' + - import_tasks: ../tests/validate.yml when: pyopenssl_version.stdout is version('16.0.0', '>=') diff --git a/test/integration/targets/openssl_publickey/tests/validate.yml b/test/integration/targets/openssl_publickey/tests/validate.yml index 477a6cb99e..6e42294638 100644 --- a/test/integration/targets/openssl_publickey/tests/validate.yml +++ b/test/integration/targets/openssl_publickey/tests/validate.yml @@ -1,3 +1,4 @@ +--- - name: Validate public key (test - privatekey modulus) shell: 'openssl rsa -noout -modulus -in {{ output_dir }}/privatekey.pem' register: privatekey_modulus @@ -81,3 +82,17 @@ that: - publickey4_modulus.stdout == privatekey4_modulus.stdout when: openssl_version.stdout is version('0.9.8zh', '>=') + +- name: Validate public key 5 (test - privatekey's pubkey) + command: 'openssl ec -in {{ output_dir }}/privatekey5.pem -pubout' + register: privatekey5_pubkey + +- name: Validate public key 5 (test - publickey pubkey) + # Fancy way of writing "cat {{ output_dir }}/publickey5.pub" + command: 'openssl ec -pubin -in {{ output_dir }}/publickey5.pub -pubout' + register: publickey5_pubkey + +- name: Validate public key 5 (assert) + assert: + that: + - publickey5_pubkey.stdout == privatekey5_pubkey.stdout |