aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Yu <tlyu@mit.edu>2016-10-04 18:14:51 -0400
committerTom Yu <tlyu@mit.edu>2016-10-05 12:13:24 -0400
commitfded9063c23daa3dbd9ffaf32f8145844293f472 (patch)
tree4f0635dccd8c62881dab6bde4f959387f82a1841
parent6fd74a89ac6c2444a347a357fac51b3490467284 (diff)
downloadkrb5-fded9063c23daa3dbd9ffaf32f8145844293f472.zip
krb5-fded9063c23daa3dbd9ffaf32f8145844293f472.tar.gz
krb5-fded9063c23daa3dbd9ffaf32f8145844293f472.tar.bz2
Set alg param correctly for PKCS1
When using a smart card and constructing a DigestInfo to pass to the CKM_RSA_PKCS mechanism, make sure to set the AlgorithmIdentifier parameters correctly. This is typically an ASN.1 NULL value. Reported to Ubuntu in Launchpad #1629370. ticket: 8506 target_version: 1.14-next target_version: 1.13-next tags: pullup
-rw-r--r--src/plugins/preauth/pkinit/pkinit_crypto_openssl.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c b/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c
index 776d89f..7dcdf04 100644
--- a/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c
+++ b/src/plugins/preauth/pkinit/pkinit_crypto_openssl.c
@@ -1319,8 +1319,7 @@ cms_signeddata_create(krb5_context context,
alg = X509_ALGOR_new();
if (alg == NULL)
goto cleanup2;
- alg->algorithm = OBJ_nid2obj(NID_sha1);
- alg->parameter = NULL;
+ X509_ALGOR_set0(alg, OBJ_nid2obj(NID_sha1), V_ASN1_NULL, NULL);
alg_len = i2d_X509_ALGOR(alg, NULL);
alg_buf = malloc(alg_len);
if (alg_buf == NULL)