summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/x509/x509cset.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/x509/x509cset.c')
-rw-r--r--src/lib/libcrypto/x509/x509cset.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/libcrypto/x509/x509cset.c b/src/lib/libcrypto/x509/x509cset.c
index 7904a7d670..a80d5f21d3 100644
--- a/src/lib/libcrypto/x509/x509cset.c
+++ b/src/lib/libcrypto/x509/x509cset.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509cset.c,v 1.19 2023/02/16 08:38:17 tb Exp $ */ 1/* $OpenBSD: x509cset.c,v 1.20 2024/03/26 11:09:37 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 2001. 3 * project 2001.
4 */ 4 */
@@ -78,6 +78,12 @@ X509_CRL_set_version(X509_CRL *x, long version)
78{ 78{
79 if (x == NULL) 79 if (x == NULL)
80 return (0); 80 return (0);
81 /*
82 * RFC 5280, 4.1: versions 1 - 3 are specified as follows.
83 * Version ::= INTEGER { v1(0), v2(1), v3(2) }
84 */
85 if (version < 0 || version > 1)
86 return (0);
81 if (x->crl->version == NULL) { 87 if (x->crl->version == NULL) {
82 if ((x->crl->version = ASN1_INTEGER_new()) == NULL) 88 if ((x->crl->version = ASN1_INTEGER_new()) == NULL)
83 return (0); 89 return (0);