summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjob <>2024-03-25 11:27:00 +0000
committerjob <>2024-03-25 11:27:00 +0000
commitef284a2af9d4d8fec41aea934c529a8a2e705277 (patch)
treedc4e613431421611399899079aa75aa2d288392c
parent2a5ebb2a37fd09d8085c0ead2daa1360f7a23332 (diff)
downloadopenbsd-ef284a2af9d4d8fec41aea934c529a8a2e705277.tar.gz
openbsd-ef284a2af9d4d8fec41aea934c529a8a2e705277.tar.bz2
openbsd-ef284a2af9d4d8fec41aea934c529a8a2e705277.zip
Error on setting an invalid CSR version
Reported by David Benjamin (BoringSSL) OK tb@
-rw-r--r--src/lib/libcrypto/x509/x509rset.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libcrypto/x509/x509rset.c b/src/lib/libcrypto/x509/x509rset.c
index f097a379fb..9154e33845 100644
--- a/src/lib/libcrypto/x509/x509rset.c
+++ b/src/lib/libcrypto/x509/x509rset.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509rset.c,v 1.12 2023/02/16 08:38:17 tb Exp $ */ 1/* $OpenBSD: x509rset.c,v 1.13 2024/03/25 11:27:00 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 *
@@ -68,7 +68,7 @@
68int 68int
69X509_REQ_set_version(X509_REQ *x, long version) 69X509_REQ_set_version(X509_REQ *x, long version)
70{ 70{
71 if (x == NULL) 71 if (x == NULL || version != 0)
72 return (0); 72 return (0);
73 x->req_info->enc.modified = 1; 73 x->req_info->enc.modified = 1;
74 return (ASN1_INTEGER_set(x->req_info->version, version)); 74 return (ASN1_INTEGER_set(x->req_info->version, version));