diff options
author | 2015-01-28 04:14:31 +0000 | |
---|---|---|
committer | 2015-01-28 04:14:31 +0000 | |
commit | df47532e50d49e27310270ee8f66ad3811b510c9 (patch) | |
tree | f9448050e68442d99a4b7d7837d453a79a843c1a /lib/libcrypto/asn1/x_algor.c | |
parent | Remove an unused macro and a stale comment. No functional change. (diff) | |
download | wireguard-openbsd-df47532e50d49e27310270ee8f66ad3811b510c9.tar.xz wireguard-openbsd-df47532e50d49e27310270ee8f66ad3811b510c9.zip |
Fix a number of issues relating to algorithms in signatures, Mostly
from OpenSSL with a hint of boring and some things done here. Addresses
CVE-2014-8275 for OpenSSL fully
ok miod@ doug@
Diffstat (limited to 'lib/libcrypto/asn1/x_algor.c')
-rw-r--r-- | lib/libcrypto/asn1/x_algor.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/libcrypto/asn1/x_algor.c b/lib/libcrypto/asn1/x_algor.c index c069a5225c8..71aeaaade07 100644 --- a/lib/libcrypto/asn1/x_algor.c +++ b/lib/libcrypto/asn1/x_algor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_algor.c,v 1.12 2014/06/12 15:49:27 deraadt Exp $ */ +/* $OpenBSD: x_algor.c,v 1.13 2015/01/28 04:14:31 beck Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -136,3 +136,17 @@ X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md) X509_ALGOR_set0(alg, OBJ_nid2obj(EVP_MD_type(md)), param_type, NULL); } + +/* Returns 0 if they are equal, != 0 otherwise. */ +int +X509_ALGOR_cmp(const X509_ALGOR *a, const X509_ALGOR *b) +{ + int rv = OBJ_cmp(a->algorithm, b->algorithm); + if (!rv) { + if (!a->parameter && !b->parameter) + rv = 0; + else + rv = ASN1_TYPE_cmp(a->parameter, b->parameter); + } + return(rv); +} |