From e29dcb8a1b84fb647ec3ef5fd98514b23f1d6558 Mon Sep 17 00:00:00 2001 From: tb Date: Fri, 14 Jan 2022 07:57:17 +0000 Subject: [PATCH] Remove ASN1{_const,}_check_infinite_end Suggested by schwarze ok inoguchi jsing --- lib/libcrypto/asn1/asn1.h | 4 +--- lib/libcrypto/asn1/asn1_old_lib.c | 28 +--------------------------- 2 files changed, 2 insertions(+), 30 deletions(-) diff --git a/lib/libcrypto/asn1/asn1.h b/lib/libcrypto/asn1/asn1.h index e73b3655a00..e850f2b8019 100644 --- a/lib/libcrypto/asn1/asn1.h +++ b/lib/libcrypto/asn1/asn1.h @@ -1,4 +1,4 @@ -/* $OpenBSD: asn1.h,v 1.58 2022/01/14 07:55:29 tb Exp $ */ +/* $OpenBSD: asn1.h,v 1.59 2022/01/14 07:57:17 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -787,8 +787,6 @@ int ASN1_PRINTABLE_type(const unsigned char *s, int max); /* SPECIALS */ int ASN1_get_object(const unsigned char **pp, long *plength, int *ptag, int *pclass, long omax); -int ASN1_check_infinite_end(unsigned char **p, long len); -int ASN1_const_check_infinite_end(const unsigned char **p, long len); void ASN1_put_object(unsigned char **pp, int constructed, int length, int tag, int xclass); int ASN1_put_eoc(unsigned char **pp); diff --git a/lib/libcrypto/asn1/asn1_old_lib.c b/lib/libcrypto/asn1/asn1_old_lib.c index 958c15b30cd..e41a5ea2575 100644 --- a/lib/libcrypto/asn1/asn1_old_lib.c +++ b/lib/libcrypto/asn1/asn1_old_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: asn1_old_lib.c,v 1.2 2021/12/25 07:04:03 jsing Exp $ */ +/* $OpenBSD: asn1_old_lib.c,v 1.3 2022/01/14 07:57:17 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -67,32 +67,6 @@ static void asn1_put_length(unsigned char **pp, int length); -static int -_asn1_check_infinite_end(const unsigned char **p, long len) -{ - /* If there is 0 or 1 byte left, the length check should pick - * things up */ - if (len <= 0) - return (1); - else if ((len >= 2) && ((*p)[0] == 0) && ((*p)[1] == 0)) { - (*p) += 2; - return (1); - } - return (0); -} - -int -ASN1_check_infinite_end(unsigned char **p, long len) -{ - return _asn1_check_infinite_end((const unsigned char **)p, len); -} - -int -ASN1_const_check_infinite_end(const unsigned char **p, long len) -{ - return _asn1_check_infinite_end(p, len); -} - int ASN1_get_object(const unsigned char **pp, long *plength, int *ptag, int *pclass, long omax) -- 2.20.1