summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/a_verify.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/asn1/a_verify.c')
-rw-r--r--src/lib/libcrypto/asn1/a_verify.c59
1 files changed, 0 insertions, 59 deletions
diff --git a/src/lib/libcrypto/asn1/a_verify.c b/src/lib/libcrypto/asn1/a_verify.c
index fc84cd3d19..5eb47d768c 100644
--- a/src/lib/libcrypto/asn1/a_verify.c
+++ b/src/lib/libcrypto/asn1/a_verify.c
@@ -72,65 +72,6 @@
72#include <openssl/buffer.h> 72#include <openssl/buffer.h>
73#include <openssl/evp.h> 73#include <openssl/evp.h>
74 74
75#ifndef NO_ASN1_OLD
76
77int ASN1_verify(i2d_of_void *i2d, X509_ALGOR *a, ASN1_BIT_STRING *signature,
78 char *data, EVP_PKEY *pkey)
79 {
80 EVP_MD_CTX ctx;
81 const EVP_MD *type;
82 unsigned char *p,*buf_in=NULL;
83 int ret= -1,i,inl;
84
85 EVP_MD_CTX_init(&ctx);
86 i=OBJ_obj2nid(a->algorithm);
87 type=EVP_get_digestbyname(OBJ_nid2sn(i));
88 if (type == NULL)
89 {
90 ASN1err(ASN1_F_ASN1_VERIFY,ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM);
91 goto err;
92 }
93
94 inl=i2d(data,NULL);
95 buf_in=OPENSSL_malloc((unsigned int)inl);
96 if (buf_in == NULL)
97 {
98 ASN1err(ASN1_F_ASN1_VERIFY,ERR_R_MALLOC_FAILURE);
99 goto err;
100 }
101 p=buf_in;
102
103 i2d(data,&p);
104 if (!EVP_VerifyInit_ex(&ctx,type, NULL)
105 || !EVP_VerifyUpdate(&ctx,(unsigned char *)buf_in,inl))
106 {
107 ASN1err(ASN1_F_ASN1_VERIFY,ERR_R_EVP_LIB);
108 ret=0;
109 goto err;
110 }
111
112 OPENSSL_cleanse(buf_in,(unsigned int)inl);
113 OPENSSL_free(buf_in);
114
115 if (EVP_VerifyFinal(&ctx,(unsigned char *)signature->data,
116 (unsigned int)signature->length,pkey) <= 0)
117 {
118 ASN1err(ASN1_F_ASN1_VERIFY,ERR_R_EVP_LIB);
119 ret=0;
120 goto err;
121 }
122 /* we don't need to zero the 'ctx' because we just checked
123 * public information */
124 /* memset(&ctx,0,sizeof(ctx)); */
125 ret=1;
126err:
127 EVP_MD_CTX_cleanup(&ctx);
128 return(ret);
129 }
130
131#endif
132
133
134int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a, 75int ASN1_item_verify(const ASN1_ITEM *it, X509_ALGOR *a,
135 ASN1_BIT_STRING *signature, void *asn, EVP_PKEY *pkey) 76 ASN1_BIT_STRING *signature, void *asn, EVP_PKEY *pkey)
136 { 77 {