From ba39f42b81b643531401f1cb7ab12f2e29bfcd4a Mon Sep 17 00:00:00 2001 From: Viktor Dukhovni Date: Wed, 4 Mar 2015 19:51:11 -0500 Subject: [PATCH] TBS vs Certificate sigalg consistency for RSA --- lib/hx509/crypto.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/hx509/crypto.c b/lib/hx509/crypto.c index b308ee2e6..8e15ec9e9 100644 --- a/lib/hx509/crypto.c +++ b/lib/hx509/crypto.c @@ -121,8 +121,12 @@ struct signature_alg { static const struct signature_alg * find_sig_alg(const heim_oid *oid); -/* +/*- + * RFC5758 specifies no parameters for ecdsa-with-SHA signatures + * RFC5754 specifies NULL parameters for shaWithRSAEncryption signatures * + * XXX: Make sure that the parameters are either NULL in both the tbs and the + * signature, or absent from both the tbs and the signature. */ static const heim_octet_string null_entry_oid = { 2, rk_UNCONST("\x05\x00") }; @@ -169,27 +173,27 @@ const AlgorithmIdentifier _hx509_signature_ecdsa_with_sha1_data = { static const unsigned rsa_with_sha512_oid[] ={ 1, 2, 840, 113549, 1, 1, 13 }; const AlgorithmIdentifier _hx509_signature_rsa_with_sha512_data = { - { 7, rk_UNCONST(rsa_with_sha512_oid) }, NULL + { 7, rk_UNCONST(rsa_with_sha512_oid) }, rk_UNCONST(&null_entry_oid) }; static const unsigned rsa_with_sha384_oid[] ={ 1, 2, 840, 113549, 1, 1, 12 }; const AlgorithmIdentifier _hx509_signature_rsa_with_sha384_data = { - { 7, rk_UNCONST(rsa_with_sha384_oid) }, NULL + { 7, rk_UNCONST(rsa_with_sha384_oid) }, rk_UNCONST(&null_entry_oid) }; static const unsigned rsa_with_sha256_oid[] ={ 1, 2, 840, 113549, 1, 1, 11 }; const AlgorithmIdentifier _hx509_signature_rsa_with_sha256_data = { - { 7, rk_UNCONST(rsa_with_sha256_oid) }, NULL + { 7, rk_UNCONST(rsa_with_sha256_oid) }, rk_UNCONST(&null_entry_oid) }; static const unsigned rsa_with_sha1_oid[] ={ 1, 2, 840, 113549, 1, 1, 5 }; const AlgorithmIdentifier _hx509_signature_rsa_with_sha1_data = { - { 7, rk_UNCONST(rsa_with_sha1_oid) }, NULL + { 7, rk_UNCONST(rsa_with_sha1_oid) }, rk_UNCONST(&null_entry_oid) }; static const unsigned rsa_with_md5_oid[] ={ 1, 2, 840, 113549, 1, 1, 4 }; const AlgorithmIdentifier _hx509_signature_rsa_with_md5_data = { - { 7, rk_UNCONST(rsa_with_md5_oid) }, NULL + { 7, rk_UNCONST(rsa_with_md5_oid) }, rk_UNCONST(&null_entry_oid) }; static const unsigned rsa_oid[] ={ 1, 2, 840, 113549, 1, 1, 1 }; -- 2.11.4.GIT