From 36ad7f26648c87c63edaa9659d100b44b14f0ae1 Mon Sep 17 00:00:00 2001 From: beck <> Date: Wed, 28 Jan 2015 04:14:31 +0000 Subject: 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@ --- src/lib/libcrypto/asn1/x_algor.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/lib/libcrypto/asn1/x_algor.c') 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 @@ -/* $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); +} -- cgit v1.2.3-55-g6feb