summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2022-01-14 07:57:17 +0000
committertb <>2022-01-14 07:57:17 +0000
commita9871b55b9a026f214ae984128906982db52af3b (patch)
tree1d4b55fcf0d89268610b3e2c025284f0ff344412
parent8c8007bf955ce3345ba1ca8f30a60dca3e25ec28 (diff)
downloadopenbsd-a9871b55b9a026f214ae984128906982db52af3b.tar.gz
openbsd-a9871b55b9a026f214ae984128906982db52af3b.tar.bz2
openbsd-a9871b55b9a026f214ae984128906982db52af3b.zip
Remove ASN1{_const,}_check_infinite_end
Suggested by schwarze ok inoguchi jsing
-rw-r--r--src/lib/libcrypto/asn1/asn1.h4
-rw-r--r--src/lib/libcrypto/asn1/asn1_old_lib.c28
2 files changed, 2 insertions, 30 deletions
diff --git a/src/lib/libcrypto/asn1/asn1.h b/src/lib/libcrypto/asn1/asn1.h
index e73b3655a0..e850f2b801 100644
--- a/src/lib/libcrypto/asn1/asn1.h
+++ b/src/lib/libcrypto/asn1/asn1.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: asn1.h,v 1.58 2022/01/14 07:55:29 tb Exp $ */ 1/* $OpenBSD: asn1.h,v 1.59 2022/01/14 07:57:17 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -787,8 +787,6 @@ int ASN1_PRINTABLE_type(const unsigned char *s, int max);
787/* SPECIALS */ 787/* SPECIALS */
788int ASN1_get_object(const unsigned char **pp, long *plength, int *ptag, 788int ASN1_get_object(const unsigned char **pp, long *plength, int *ptag,
789 int *pclass, long omax); 789 int *pclass, long omax);
790int ASN1_check_infinite_end(unsigned char **p, long len);
791int ASN1_const_check_infinite_end(const unsigned char **p, long len);
792void ASN1_put_object(unsigned char **pp, int constructed, int length, int tag, 790void ASN1_put_object(unsigned char **pp, int constructed, int length, int tag,
793 int xclass); 791 int xclass);
794int ASN1_put_eoc(unsigned char **pp); 792int ASN1_put_eoc(unsigned char **pp);
diff --git a/src/lib/libcrypto/asn1/asn1_old_lib.c b/src/lib/libcrypto/asn1/asn1_old_lib.c
index 958c15b30c..e41a5ea257 100644
--- a/src/lib/libcrypto/asn1/asn1_old_lib.c
+++ b/src/lib/libcrypto/asn1/asn1_old_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: asn1_old_lib.c,v 1.2 2021/12/25 07:04:03 jsing Exp $ */ 1/* $OpenBSD: asn1_old_lib.c,v 1.3 2022/01/14 07:57:17 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -67,32 +67,6 @@
67 67
68static void asn1_put_length(unsigned char **pp, int length); 68static void asn1_put_length(unsigned char **pp, int length);
69 69
70static int
71_asn1_check_infinite_end(const unsigned char **p, long len)
72{
73 /* If there is 0 or 1 byte left, the length check should pick
74 * things up */
75 if (len <= 0)
76 return (1);
77 else if ((len >= 2) && ((*p)[0] == 0) && ((*p)[1] == 0)) {
78 (*p) += 2;
79 return (1);
80 }
81 return (0);
82}
83
84int
85ASN1_check_infinite_end(unsigned char **p, long len)
86{
87 return _asn1_check_infinite_end((const unsigned char **)p, len);
88}
89
90int
91ASN1_const_check_infinite_end(const unsigned char **p, long len)
92{
93 return _asn1_check_infinite_end(p, len);
94}
95
96int 70int
97ASN1_get_object(const unsigned char **pp, long *plength, int *ptag, 71ASN1_get_object(const unsigned char **pp, long *plength, int *ptag,
98 int *pclass, long omax) 72 int *pclass, long omax)