update master-with-bazel from master branch
This commit is contained in:
@@ -68,48 +68,6 @@
|
||||
#include "internal.h"
|
||||
|
||||
|
||||
X509_REQ *X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey, const EVP_MD *md)
|
||||
{
|
||||
X509_REQ *ret;
|
||||
X509_REQ_INFO *ri;
|
||||
int i;
|
||||
EVP_PKEY *pktmp;
|
||||
|
||||
ret = X509_REQ_new();
|
||||
if (ret == NULL) {
|
||||
OPENSSL_PUT_ERROR(X509, ERR_R_MALLOC_FAILURE);
|
||||
goto err;
|
||||
}
|
||||
|
||||
ri = ret->req_info;
|
||||
|
||||
ri->version->length = 1;
|
||||
ri->version->data = (unsigned char *)OPENSSL_malloc(1);
|
||||
if (ri->version->data == NULL)
|
||||
goto err;
|
||||
ri->version->data[0] = 0; /* version == 0 */
|
||||
|
||||
if (!X509_REQ_set_subject_name(ret, X509_get_subject_name(x)))
|
||||
goto err;
|
||||
|
||||
pktmp = X509_get_pubkey(x);
|
||||
if (pktmp == NULL)
|
||||
goto err;
|
||||
i = X509_REQ_set_pubkey(ret, pktmp);
|
||||
EVP_PKEY_free(pktmp);
|
||||
if (!i)
|
||||
goto err;
|
||||
|
||||
if (pkey != NULL) {
|
||||
if (!X509_REQ_sign(ret, pkey, md))
|
||||
goto err;
|
||||
}
|
||||
return (ret);
|
||||
err:
|
||||
X509_REQ_free(ret);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
long X509_REQ_get_version(const X509_REQ *req)
|
||||
{
|
||||
return ASN1_INTEGER_get(req->req_info->version);
|
||||
|
||||
@@ -817,9 +817,6 @@ OPENSSL_EXPORT const char *X509_get_default_cert_dir_env(void);
|
||||
OPENSSL_EXPORT const char *X509_get_default_cert_file_env(void);
|
||||
OPENSSL_EXPORT const char *X509_get_default_private_dir(void);
|
||||
|
||||
OPENSSL_EXPORT X509_REQ *X509_to_X509_REQ(X509 *x, EVP_PKEY *pkey,
|
||||
const EVP_MD *md);
|
||||
|
||||
DECLARE_ASN1_ENCODE_FUNCTIONS(X509_ALGORS, X509_ALGORS, X509_ALGORS)
|
||||
|
||||
DECLARE_ASN1_FUNCTIONS(X509_PUBKEY)
|
||||
|
||||
Reference in New Issue
Block a user