2016-05-17 18:52:22 +00:00
|
|
|
/*
|
|
|
|
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
|
1998-12-21 10:52:47 +00:00
|
|
|
*
|
2018-12-06 13:00:36 +00:00
|
|
|
* Licensed under the Apache License 2.0 (the "License"). You may not use
|
2016-05-17 18:52:22 +00:00
|
|
|
* this file except in compliance with the License. You can obtain a copy
|
|
|
|
* in the file LICENSE in the source distribution or at
|
|
|
|
* https://www.openssl.org/source/license.html
|
1998-12-21 10:52:47 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdio.h>
|
2015-05-14 14:56:48 +00:00
|
|
|
#include "internal/cryptlib.h"
|
1999-04-23 22:13:45 +00:00
|
|
|
#include <openssl/asn1.h>
|
|
|
|
#include <openssl/objects.h>
|
|
|
|
#include <openssl/evp.h>
|
|
|
|
#include <openssl/x509.h>
|
2015-08-31 11:58:07 +00:00
|
|
|
#include "internal/x509_int.h"
|
1998-12-21 10:52:47 +00:00
|
|
|
|
1999-04-19 21:31:43 +00:00
|
|
|
int X509_REQ_set_version(X509_REQ *x, long version)
|
2015-01-22 03:40:55 +00:00
|
|
|
{
|
|
|
|
if (x == NULL)
|
2017-10-17 14:04:09 +00:00
|
|
|
return 0;
|
2015-09-16 17:46:16 +00:00
|
|
|
x->req_info.enc.modified = 1;
|
2017-10-17 14:04:09 +00:00
|
|
|
return ASN1_INTEGER_set(x->req_info.version, version);
|
2015-01-22 03:40:55 +00:00
|
|
|
}
|
1998-12-21 10:52:47 +00:00
|
|
|
|
1999-04-19 21:31:43 +00:00
|
|
|
int X509_REQ_set_subject_name(X509_REQ *x, X509_NAME *name)
|
2015-01-22 03:40:55 +00:00
|
|
|
{
|
2015-09-16 17:46:16 +00:00
|
|
|
if (x == NULL)
|
2017-10-17 14:04:09 +00:00
|
|
|
return 0;
|
2015-09-16 17:46:16 +00:00
|
|
|
x->req_info.enc.modified = 1;
|
2017-10-17 14:04:09 +00:00
|
|
|
return X509_NAME_set(&x->req_info.subject, name);
|
2015-01-22 03:40:55 +00:00
|
|
|
}
|
1998-12-21 10:52:47 +00:00
|
|
|
|
1999-04-19 21:31:43 +00:00
|
|
|
int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey)
|
2015-01-22 03:40:55 +00:00
|
|
|
{
|
2015-09-16 17:46:16 +00:00
|
|
|
if (x == NULL)
|
2017-10-17 14:04:09 +00:00
|
|
|
return 0;
|
2015-09-16 17:46:16 +00:00
|
|
|
x->req_info.enc.modified = 1;
|
2017-10-17 14:04:09 +00:00
|
|
|
return X509_PUBKEY_set(&x->req_info.pubkey, pkey);
|
2015-01-22 03:40:55 +00:00
|
|
|
}
|