2
0
mirror of https://github.com/mozilla/cipherscan.git synced 2024-10-05 18:53:40 +02:00

clean up the extracted certificate

the certificate extracted in the above way will contain some junk
from openssl s_client output we don't want like verification status
we can remove it ro reduce disk usage for saved certificates
This commit is contained in:
Hubert Kario 2014-07-11 17:29:57 +02:00 committed by Hubert Kario
parent eaa64e48a3
commit ea9f0056eb

View File

@ -179,6 +179,8 @@ test_cipher_on_target() {
/-----END CERTIFICATE-----/ {split_after=1} /-----END CERTIFICATE-----/ {split_after=1}
{if (n == i) print } {if (n == i) print }
' <<<"$tmp") ' <<<"$tmp")
# clean up the cert from junk before BEGIN CERTIFICATE
cert=$(${OPENSSLBIN} x509 <<<"$cert" 2>/dev/null)
# compute sha256 fingerprint of the certificate # compute sha256 fingerprint of the certificate
local sha256sum=$(${OPENSSLBIN} x509 -outform DER <<<"$cert" 2>/dev/null |\ local sha256sum=$(${OPENSSLBIN} x509 -outform DER <<<"$cert" 2>/dev/null |\