mirror of
https://github.com/openssl/openssl.git
synced 2024-12-09 05:51:54 +08:00
Reject setting invalid CSR versions
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org> (Merged from https://github.com/openssl/openssl/pull/23965)
This commit is contained in:
parent
e582b2b22b
commit
397051a40d
@ -17,8 +17,10 @@
|
||||
|
||||
int X509_REQ_set_version(X509_REQ *x, long version)
|
||||
{
|
||||
if (x == NULL)
|
||||
if (x == NULL || version != X509_REQ_VERSION_1) {
|
||||
ERR_raise(ERR_LIB_X509, ERR_R_PASSED_INVALID_ARGUMENT);
|
||||
return 0;
|
||||
}
|
||||
x->req_info.enc.modified = 1;
|
||||
return ASN1_INTEGER_set(x->req_info.version, version);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user