summaryrefslogtreecommitdiff
path: root/main/openssl/crypto/x509
diff options
context:
space:
mode:
Diffstat (limited to 'main/openssl/crypto/x509')
-rw-r--r--main/openssl/crypto/x509/x509.h1
-rw-r--r--main/openssl/crypto/x509/x509_vpm.c2
-rw-r--r--main/openssl/crypto/x509/x_all.c2
3 files changed, 5 insertions, 0 deletions
diff --git a/main/openssl/crypto/x509/x509.h b/main/openssl/crypto/x509/x509.h
index 092dd745..ed767f84 100644
--- a/main/openssl/crypto/x509/x509.h
+++ b/main/openssl/crypto/x509/x509.h
@@ -768,6 +768,7 @@ int X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval);
void X509_ALGOR_get0(ASN1_OBJECT **paobj, int *pptype, void **ppval,
X509_ALGOR *algor);
void X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md);
+int X509_ALGOR_cmp(const X509_ALGOR *a, const X509_ALGOR *b);
X509_NAME *X509_NAME_dup(X509_NAME *xn);
X509_NAME_ENTRY *X509_NAME_ENTRY_dup(X509_NAME_ENTRY *ne);
diff --git a/main/openssl/crypto/x509/x509_vpm.c b/main/openssl/crypto/x509/x509_vpm.c
index dfd89d89..ba546bd1 100644
--- a/main/openssl/crypto/x509/x509_vpm.c
+++ b/main/openssl/crypto/x509/x509_vpm.c
@@ -89,6 +89,8 @@ X509_VERIFY_PARAM *X509_VERIFY_PARAM_new(void)
{
X509_VERIFY_PARAM *param;
param = OPENSSL_malloc(sizeof(X509_VERIFY_PARAM));
+ if (!param)
+ return NULL;
memset(param, 0, sizeof(X509_VERIFY_PARAM));
x509_verify_param_zero(param);
return param;
diff --git a/main/openssl/crypto/x509/x_all.c b/main/openssl/crypto/x509/x_all.c
index e06602d6..fef55f89 100644
--- a/main/openssl/crypto/x509/x_all.c
+++ b/main/openssl/crypto/x509/x_all.c
@@ -72,6 +72,8 @@
int X509_verify(X509 *a, EVP_PKEY *r)
{
+ if (X509_ALGOR_cmp(a->sig_alg, a->cert_info->signature))
+ return 0;
return(ASN1_item_verify(ASN1_ITEM_rptr(X509_CINF),a->sig_alg,
a->signature,a->cert_info,r));
}