diff options
| author | beck <> | 2015-01-28 04:14:31 +0000 |
|---|---|---|
| committer | beck <> | 2015-01-28 04:14:31 +0000 |
| commit | 36ad7f26648c87c63edaa9659d100b44b14f0ae1 (patch) | |
| tree | f7e3e1ca2ec359adbc6581af16b8421550c018d8 /src/lib/libcrypto/asn1/x_algor.c | |
| parent | c899559ffef49152f98a2504c0b30edb540fb863 (diff) | |
| download | openbsd-36ad7f26648c87c63edaa9659d100b44b14f0ae1.tar.gz openbsd-36ad7f26648c87c63edaa9659d100b44b14f0ae1.tar.bz2 openbsd-36ad7f26648c87c63edaa9659d100b44b14f0ae1.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 'src/lib/libcrypto/asn1/x_algor.c')
| -rw-r--r-- | src/lib/libcrypto/asn1/x_algor.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/lib/libcrypto/asn1/x_algor.c b/src/lib/libcrypto/asn1/x_algor.c index c069a5225c..71aeaaade0 100644 --- a/src/lib/libcrypto/asn1/x_algor.c +++ b/src/lib/libcrypto/asn1/x_algor.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: x_algor.c,v 1.12 2014/06/12 15:49:27 deraadt Exp $ */ | 1 | /* $OpenBSD: x_algor.c,v 1.13 2015/01/28 04:14:31 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 2000. | 3 | * project 2000. |
| 4 | */ | 4 | */ |
| @@ -136,3 +136,17 @@ X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md) | |||
| 136 | 136 | ||
| 137 | X509_ALGOR_set0(alg, OBJ_nid2obj(EVP_MD_type(md)), param_type, NULL); | 137 | X509_ALGOR_set0(alg, OBJ_nid2obj(EVP_MD_type(md)), param_type, NULL); |
| 138 | } | 138 | } |
| 139 | |||
| 140 | /* Returns 0 if they are equal, != 0 otherwise. */ | ||
| 141 | int | ||
| 142 | X509_ALGOR_cmp(const X509_ALGOR *a, const X509_ALGOR *b) | ||
| 143 | { | ||
| 144 | int rv = OBJ_cmp(a->algorithm, b->algorithm); | ||
| 145 | if (!rv) { | ||
| 146 | if (!a->parameter && !b->parameter) | ||
| 147 | rv = 0; | ||
| 148 | else | ||
| 149 | rv = ASN1_TYPE_cmp(a->parameter, b->parameter); | ||
| 150 | } | ||
| 151 | return(rv); | ||
| 152 | } | ||
