summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2026-01-02 08:03:02 +0000
committertb <>2026-01-02 08:03:02 +0000
commit4376bb91f1ab33cad1db683b8428434fbc4b67bf (patch)
treee15f5632171d96ab6f6c4d04108b0b70c9c03307
parent17255ba650aa0774866aa85ba1d21ef0e5086566 (diff)
downloadopenbsd-4376bb91f1ab33cad1db683b8428434fbc4b67bf.tar.gz
openbsd-4376bb91f1ab33cad1db683b8428434fbc4b67bf.tar.bz2
openbsd-4376bb91f1ab33cad1db683b8428434fbc4b67bf.zip
Unexport ASN1_LONG_UNDEF
This is another one of these weird magic values that nothing outside of libcrypto uses. Fix a confusing comment in long_i2c() while there. The skipping behavior is used in particular for omitting the optional length value in the non-standard OpenSSL-specific DHparam() ASN.1 encoding. ok jsing kenjiro
-rw-r--r--src/lib/libcrypto/asn1/asn1.h5
-rw-r--r--src/lib/libcrypto/asn1/x_long.c10
2 files changed, 8 insertions, 7 deletions
diff --git a/src/lib/libcrypto/asn1/asn1.h b/src/lib/libcrypto/asn1/asn1.h
index 7285ad0590..2b19f58717 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.94 2025/12/31 13:48:00 tb Exp $ */ 1/* $OpenBSD: asn1.h,v 1.95 2026/01/02 08:03:02 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 *
@@ -199,9 +199,6 @@ typedef struct ASN1_ENCODING_st {
199 int modified; /* set to 1 if 'enc' is invalid */ 199 int modified; /* set to 1 if 'enc' is invalid */
200} ASN1_ENCODING; 200} ASN1_ENCODING;
201 201
202/* Used with ASN1 LONG type: if a long is set to this it is omitted */
203#define ASN1_LONG_UNDEF 0x7fffffffL
204
205/* Used by security/xca */ 202/* Used by security/xca */
206#define STABLE_NO_MASK 0x02 203#define STABLE_NO_MASK 0x02
207 204
diff --git a/src/lib/libcrypto/asn1/x_long.c b/src/lib/libcrypto/asn1/x_long.c
index a72411f30c..ed463bf7c5 100644
--- a/src/lib/libcrypto/asn1/x_long.c
+++ b/src/lib/libcrypto/asn1/x_long.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x_long.c,v 1.22 2025/05/10 05:54:38 tb Exp $ */ 1/* $OpenBSD: x_long.c,v 1.23 2026/01/02 08:03:02 tb Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2000. 3 * project 2000.
4 */ 4 */
@@ -70,6 +70,9 @@
70 * ASN1_INTEGER and a long directly. 70 * ASN1_INTEGER and a long directly.
71 */ 71 */
72 72
73/* Used with ASN1 LONG type: if a long is set to this it is omitted */
74#define ASN1_LONG_UNDEF 0x7fffffffL
75
73static int long_new(ASN1_VALUE **pval, const ASN1_ITEM *it); 76static int long_new(ASN1_VALUE **pval, const ASN1_ITEM *it);
74static void long_free(ASN1_VALUE **pval, const ASN1_ITEM *it); 77static void long_free(ASN1_VALUE **pval, const ASN1_ITEM *it);
75static void long_clear(ASN1_VALUE **pval, const ASN1_ITEM *it); 78static void long_clear(ASN1_VALUE **pval, const ASN1_ITEM *it);
@@ -159,8 +162,9 @@ long_i2c(ASN1_VALUE **pval, unsigned char *content, int *putype,
159 long_get(pval, &val); 162 long_get(pval, &val);
160 163
161 /* 164 /*
162 * The zero value for this type (stored in the overloaded it->size 165 * Omit this field if it has the zero value for this type (stored
163 * field) is considered to be invalid. 166 * in the overloaded it->size field) - asn1_i2d_ex_primitive()
167 * specifically checks for a -1 return value.
164 */ 168 */
165 if (val == it->size) 169 if (val == it->size)
166 return -1; 170 return -1;