summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/x509/x509.h
diff options
context:
space:
mode:
authorjob <>2023-04-23 21:31:16 +0000
committerjob <>2023-04-23 21:31:16 +0000
commit182c5d6fe4249dcf1252e2a8985431d3f12968d6 (patch)
tree6845cb5f4e2722640f5effb72fa388651a08a748 /src/lib/libcrypto/x509/x509.h
parent13ba643374d5ff84130d05ec7c88f7fd1e4c2308 (diff)
downloadopenbsd-182c5d6fe4249dcf1252e2a8985431d3f12968d6.tar.gz
openbsd-182c5d6fe4249dcf1252e2a8985431d3f12968d6.tar.bz2
openbsd-182c5d6fe4249dcf1252e2a8985431d3f12968d6.zip
Add compliance checks for the X.509 version field
Check whether the X.509 version is in the range of valid version values, and also checks whether the version is consistent with fields new to those versions (such as X.509 v3 extensions). X.690 section 11.5 states: "The encoding of a set value or a sequence value shall not include an encoding for any component value which is equal to its default value." However, enforcing version 1 (value 0) to be absent reportedly caused some issues as recent as July 2020, so accept version 1 even if it is explicitly encoded. OK tb@ beck@
Diffstat (limited to 'src/lib/libcrypto/x509/x509.h')
-rw-r--r--src/lib/libcrypto/x509/x509.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/libcrypto/x509/x509.h b/src/lib/libcrypto/x509/x509.h
index 9f87700c60..e8cedaae13 100644
--- a/src/lib/libcrypto/x509/x509.h
+++ b/src/lib/libcrypto/x509/x509.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509.h,v 1.96 2023/04/18 08:47:28 tb Exp $ */ 1/* $OpenBSD: x509.h,v 1.97 2023/04/23 21:31:16 job 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 *
@@ -1200,6 +1200,7 @@ void ERR_load_X509_strings(void);
1200#define X509_R_UNSUPPORTED_ALGORITHM 111 1200#define X509_R_UNSUPPORTED_ALGORITHM 111
1201#define X509_R_WRONG_LOOKUP_TYPE 112 1201#define X509_R_WRONG_LOOKUP_TYPE 112
1202#define X509_R_WRONG_TYPE 122 1202#define X509_R_WRONG_TYPE 122
1203#define X509_R_INVALID_VERSION 123
1203 1204
1204#ifdef __cplusplus 1205#ifdef __cplusplus
1205} 1206}