summaryrefslogtreecommitdiff
path: root/lib/libcrypto/asn1/x_algor.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libcrypto/asn1/x_algor.c')
-rw-r--r--lib/libcrypto/asn1/x_algor.c16
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);
+}