diff options
Diffstat (limited to 'src/lib/x509')
-rw-r--r-- | src/lib/x509/ocsp.cpp | 2 | ||||
-rw-r--r-- | src/lib/x509/x509_obj.cpp | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/x509/ocsp.cpp b/src/lib/x509/ocsp.cpp index 7907d08e2..249ce7817 100644 --- a/src/lib/x509/ocsp.cpp +++ b/src/lib/x509/ocsp.cpp @@ -170,7 +170,7 @@ Certificate_Status_Code Response::verify_signature(const X509_Certificate& issue return Certificate_Status_Code::OCSP_RESPONSE_INVALID; std::string padding = sig_info[1]; - Signature_Format format = (pub_key->message_parts() >= 2) ? DER_SEQUENCE : IEEE_1363; + const Signature_Format format = pub_key->default_x509_signature_format(); PK_Verifier verifier(*pub_key, padding, format); diff --git a/src/lib/x509/x509_obj.cpp b/src/lib/x509/x509_obj.cpp index 74786c224..a48e088ac 100644 --- a/src/lib/x509/x509_obj.cpp +++ b/src/lib/x509/x509_obj.cpp @@ -197,8 +197,7 @@ Certificate_Status_Code X509_Object::verify_signature(const Public_Key& pub_key) else return Certificate_Status_Code::SIGNATURE_ALGO_BAD_PARAMS; - const Signature_Format format = - (pub_key.message_parts() >= 2) ? DER_SEQUENCE : IEEE_1363; + const Signature_Format format = pub_key.default_x509_signature_format(); if(padding == "EMSA4") { @@ -369,7 +368,7 @@ std::unique_ptr<PK_Signer> X509_Object::choose_sig_format(AlgorithmIdentifier& s const std::string& hash_fn, const std::string& padding_algo) { - const Signature_Format format = (key.message_parts() > 1) ? DER_SEQUENCE : IEEE_1363; + const Signature_Format format = key.default_x509_signature_format(); const std::string emsa = choose_sig_algo(sig_algo, key, hash_fn, padding_algo); |