summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ec/ec_ameth.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/ec/ec_ameth.c')
-rw-r--r--src/lib/libcrypto/ec/ec_ameth.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/lib/libcrypto/ec/ec_ameth.c b/src/lib/libcrypto/ec/ec_ameth.c
index 567d16e307..dd1c31883e 100644
--- a/src/lib/libcrypto/ec/ec_ameth.c
+++ b/src/lib/libcrypto/ec/ec_ameth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_ameth.c,v 1.15 2015/02/11 03:55:42 beck Exp $ */ 1/* $OpenBSD: ec_ameth.c,v 1.16 2015/02/11 04:05:14 beck Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2006. 3 * project 2006.
4 */ 4 */
@@ -65,6 +65,9 @@
65#include <openssl/err.h> 65#include <openssl/err.h>
66#include <openssl/x509.h> 66#include <openssl/x509.h>
67 67
68#ifndef OPENSSL_NO_CMS
69#include <openssl/cms.h>
70#endif
68 71
69#include "asn1_locl.h" 72#include "asn1_locl.h"
70 73
@@ -570,6 +573,24 @@ ec_pkey_ctrl(EVP_PKEY * pkey, int op, long arg1, void *arg2)
570 X509_ALGOR_set0(alg2, OBJ_nid2obj(snid), V_ASN1_UNDEF, 0); 573 X509_ALGOR_set0(alg2, OBJ_nid2obj(snid), V_ASN1_UNDEF, 0);
571 } 574 }
572 return 1; 575 return 1;
576#ifndef OPENSSL_NO_CMS
577 case ASN1_PKEY_CTRL_CMS_SIGN:
578 if (arg1 == 0) {
579 int snid, hnid;
580 X509_ALGOR *alg1, *alg2;
581 CMS_SignerInfo_get0_algs(arg2, NULL, NULL,
582 &alg1, &alg2);
583 if (alg1 == NULL || alg1->algorithm == NULL)
584 return -1;
585 hnid = OBJ_obj2nid(alg1->algorithm);
586 if (hnid == NID_undef)
587 return -1;
588 if (!OBJ_find_sigid_by_algs(&snid, hnid, EVP_PKEY_id(pkey)))
589 return -1;
590 X509_ALGOR_set0(alg2, OBJ_nid2obj(snid), V_ASN1_UNDEF, 0);
591 }
592 return 1;
593#endif
573 594
574 case ASN1_PKEY_CTRL_DEFAULT_MD_NID: 595 case ASN1_PKEY_CTRL_DEFAULT_MD_NID:
575 *(int *) arg2 = NID_sha1; 596 *(int *) arg2 = NID_sha1;