diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2018-10-24 17:57:23 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2018-10-24 17:57:23 +0000 |
commit | 83c1b055dcf426a5e83e5b279d445aa2a726ed92 (patch) | |
tree | 3f5cad472ec028ca8fc8226bc8cdf0a97e8ae74c /lib/libcrypto/asn1/asn1_lib.c | |
parent | 3b3f8afefb495baa0564e51d59ee5db52ee2c4d6 (diff) |
Remove a bunch of ancient and highly crufty ASN.1 related code from
libcrypto (the "new" stuff replaced this back around 2000 or so...).
ok tb@
Diffstat (limited to 'lib/libcrypto/asn1/asn1_lib.c')
-rw-r--r-- | lib/libcrypto/asn1/asn1_lib.c | 58 |
1 files changed, 1 insertions, 57 deletions
diff --git a/lib/libcrypto/asn1/asn1_lib.c b/lib/libcrypto/asn1/asn1_lib.c index ffd3ad6a467..2a123d1d9a5 100644 --- a/lib/libcrypto/asn1/asn1_lib.c +++ b/lib/libcrypto/asn1/asn1_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: asn1_lib.c,v 1.41 2018/04/25 11:48:21 tb Exp $ */ +/* $OpenBSD: asn1_lib.c,v 1.42 2018/10/24 17:57:22 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -285,62 +285,6 @@ ASN1_object_size(int constructed, int length, int tag) return (ret); } -static int -_asn1_Finish(ASN1_const_CTX *c) -{ - if ((c->inf == (1|V_ASN1_CONSTRUCTED)) && (!c->eos)) { - if (!ASN1_const_check_infinite_end(&c->p, c->slen)) { - c->error = ERR_R_MISSING_ASN1_EOS; - return (0); - } - } - if (((c->slen != 0) && !(c->inf & 1)) || - ((c->slen < 0) && (c->inf & 1))) { - c->error = ERR_R_ASN1_LENGTH_MISMATCH; - return (0); - } - return (1); -} - -int -asn1_Finish(ASN1_CTX *c) -{ - return _asn1_Finish((ASN1_const_CTX *)c); -} - -int -asn1_const_Finish(ASN1_const_CTX *c) -{ - return _asn1_Finish(c); -} - -int -asn1_GetSequence(ASN1_const_CTX *c, long *length) -{ - const unsigned char *q; - - q = c->p; - c->inf = ASN1_get_object(&(c->p), &(c->slen), &(c->tag), &(c->xclass), - *length); - if (c->inf & 0x80) { - c->error = ERR_R_BAD_GET_ASN1_OBJECT_CALL; - return (0); - } - if (c->tag != V_ASN1_SEQUENCE) { - c->error = ERR_R_EXPECTING_AN_ASN1_SEQUENCE; - return (0); - } - (*length) -= (c->p - q); - if (c->max && (*length < 0)) { - c->error = ERR_R_ASN1_LENGTH_MISMATCH; - return (0); - } - if (c->inf == (1|V_ASN1_CONSTRUCTED)) - c->slen= *length+ *(c->pp) - c->p; - c->eos = 0; - return (1); -} - int ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING *str) { |