diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2014-12-14 23:14:15 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2015-01-05 14:54:46 +0000 |
commit | 5951cc004b96cd681ffdf39d3fc9238a1ff597ae (patch) | |
tree | bf534dcc2a7bf6ef5961cea6b9bfe8887c79cc39 /crypto/asn1 | |
parent | a8565530e27718760220df469f0a071c85b9e731 (diff) |
Constify ASN1_TYPE_cmp add X509_ALGOR_cmp.
Reviewed-by: Emilia Käsper <emilia@openssl.org>
(cherry picked from commit 4c52816d35681c0533c25fdd3abb4b7c6962302d)
Diffstat (limited to 'crypto/asn1')
-rw-r--r-- | crypto/asn1/a_type.c | 2 | ||||
-rw-r--r-- | crypto/asn1/asn1.h | 2 | ||||
-rw-r--r-- | crypto/asn1/x_algor.c | 11 |
3 files changed, 13 insertions, 2 deletions
diff --git a/crypto/asn1/a_type.c b/crypto/asn1/a_type.c index a45d2f9d12..5e1bc762d0 100644 --- a/crypto/asn1/a_type.c +++ b/crypto/asn1/a_type.c @@ -113,7 +113,7 @@ IMPLEMENT_STACK_OF(ASN1_TYPE) IMPLEMENT_ASN1_SET_OF(ASN1_TYPE) /* Returns 0 if they are equal, != 0 otherwise. */ -int ASN1_TYPE_cmp(ASN1_TYPE *a, ASN1_TYPE *b) +int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b) { int result = -1; diff --git a/crypto/asn1/asn1.h b/crypto/asn1/asn1.h index 672c97f792..3c45d5d03f 100644 --- a/crypto/asn1/asn1.h +++ b/crypto/asn1/asn1.h @@ -776,7 +776,7 @@ DECLARE_ASN1_FUNCTIONS_fname(ASN1_TYPE, ASN1_ANY, ASN1_TYPE) int ASN1_TYPE_get(ASN1_TYPE *a); void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value); int ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value); -int ASN1_TYPE_cmp(ASN1_TYPE *a, ASN1_TYPE *b); +int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b); ASN1_OBJECT * ASN1_OBJECT_new(void ); void ASN1_OBJECT_free(ASN1_OBJECT *a); diff --git a/crypto/asn1/x_algor.c b/crypto/asn1/x_algor.c index 274e456c73..57cc956c20 100644 --- a/crypto/asn1/x_algor.c +++ b/crypto/asn1/x_algor.c @@ -142,3 +142,14 @@ void X509_ALGOR_set_md(X509_ALGOR *alg, const EVP_MD *md) X509_ALGOR_set0(alg, OBJ_nid2obj(EVP_MD_type(md)), param_type, NULL); } + +int X509_ALGOR_cmp(const X509_ALGOR *a, const X509_ALGOR *b) + { + int rv; + rv = OBJ_cmp(a->algorithm, b->algorithm); + if (rv) + return rv; + if (!a->parameter && !b->parameter) + return 0; + return ASN1_TYPE_cmp(a->parameter, b->parameter); + } |