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)
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);
}