diff options
| author | job <> | 2024-03-25 11:27:00 +0000 |
|---|---|---|
| committer | job <> | 2024-03-25 11:27:00 +0000 |
| commit | ec375ef313c6e05bac01515399bc03875319c473 (patch) | |
| tree | dc4e613431421611399899079aa75aa2d288392c /src | |
| parent | 464510c2ed8faa15b251bedb8307ad1fcc8114b8 (diff) | |
| download | openbsd-ec375ef313c6e05bac01515399bc03875319c473.tar.gz openbsd-ec375ef313c6e05bac01515399bc03875319c473.tar.bz2 openbsd-ec375ef313c6e05bac01515399bc03875319c473.zip | |
Error on setting an invalid CSR version
Reported by David Benjamin (BoringSSL)
OK tb@
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/x509/x509rset.c | 4 |
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 @@ | |||
| 68 | int | 68 | int |
| 69 | X509_REQ_set_version(X509_REQ *x, long version) | 69 | X509_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)); |
