TLS-SCT: compile on old versions of OpenSSL (1.0.1...)

This commit is contained in:
Johanna Amann 2017-03-27 20:13:12 +00:00
parent aec62aeee9
commit b8e81029f8

View file

@ -624,7 +624,9 @@ function sct_verify%(cert: opaque of x509, logid: string, log_key: string, signa
}
#endif
X509_EXTENSION_free(X509_delete_ext(x, pos));
#ifdef NID_ct_precert_scts
assert( X509_get_ext_by_NID(x, NID_ct_precert_scts, -1) == -1 );
#endif
}
unsigned char *cert_out = nullptr;
@ -684,7 +686,14 @@ function sct_verify%(cert: opaque of x509, logid: string, log_key: string, signa
goto sct_verify_err;
}
#ifdef NID_ct_precert_scts
success = EVP_DigestVerifyFinal(mdctx, signature->Bytes(), signature->Len());
#else
// older versions of OpenSSL use a non-const-char *sigh*
// I don't think they actually manipulate the value though.
// todo - this needs a cmake test
success = EVP_DigestVerifyFinal(mdctx, (unsigned char*) signature->Bytes(), signature->Len());
#endif
EVP_MD_CTX_destroy(mdctx);
return new Val(success, TYPE_BOOL);