aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/objects/obj_dat.c
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2015-06-11 17:56:16 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2015-06-11 17:56:16 +0000
commita9745f9a849725cad34f84351bed202839aade59 (patch)
tree686ec4279139441a2f9d947dceec492e54ff569c /crypto/objects/obj_dat.c
parent3d2030852da420b820a661e7b19bb757487e2599 (diff)
downloadsrc-a9745f9a849725cad34f84351bed202839aade59.tar.gz
src-a9745f9a849725cad34f84351bed202839aade59.zip
Import OpenSSL 1.0.1n.vendor/openssl/1.0.1n
Notes
Notes: svn path=/vendor-crypto/openssl/dist/; revision=284278 svn path=/vendor-crypto/openssl/1.0.1n/; revision=284279; tag=vendor/openssl/1.0.1n
Diffstat (limited to 'crypto/objects/obj_dat.c')
-rw-r--r--crypto/objects/obj_dat.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/crypto/objects/obj_dat.c b/crypto/objects/obj_dat.c
index e42a1c147de8..aca382a6e9f3 100644
--- a/crypto/objects/obj_dat.c
+++ b/crypto/objects/obj_dat.c
@@ -142,7 +142,7 @@ static unsigned long added_obj_hash(const ADDED_OBJ *ca)
return 0;
}
ret &= 0x3fffffffL;
- ret |= ca->type << 30L;
+ ret |= ((unsigned long)ca->type) << 30L;
return (ret);
}
@@ -400,6 +400,8 @@ static int obj_cmp(const ASN1_OBJECT *const *ap, const unsigned int *bp)
j = (a->length - b->length);
if (j)
return (j);
+ if (a->length == 0)
+ return 0;
return (memcmp(a->data, b->data, a->length));
}
@@ -415,6 +417,9 @@ int OBJ_obj2nid(const ASN1_OBJECT *a)
if (a->nid != 0)
return (a->nid);
+ if (a->length == 0)
+ return NID_undef;
+
if (added != NULL) {
ad.type = ADDED_DATA;
ad.obj = (ASN1_OBJECT *)a; /* XXX: ugly but harmless */