/*
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
*
- * Licensed under the OpenSSL license (the "License"). You may not use
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
* 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
#include <openssl/asn1.h>
#include <openssl/asn1t.h>
#include <openssl/x509.h>
-#include "internal/x509_int.h"
+#include "crypto/x509.h"
#include <openssl/objects.h>
#include <openssl/buffer.h>
#include <openssl/pem.h>
if (!X509_REQ_sign(ret, pkey, md))
goto err;
}
- return (ret);
+ return ret;
err:
X509_REQ_free(ret);
- return (NULL);
+ return NULL;
}
EVP_PKEY *X509_REQ_get_pubkey(X509_REQ *req)
{
if (req == NULL)
- return (NULL);
- return (X509_PUBKEY_get(req->req_info.pubkey));
+ return NULL;
+ return X509_PUBKEY_get(req->req_info.pubkey);
}
EVP_PKEY *X509_REQ_get0_pubkey(X509_REQ *req)
{
if (req == NULL)
return NULL;
- return (X509_PUBKEY_get0(req->req_info.pubkey));
+ return X509_PUBKEY_get0(req->req_info.pubkey);
}
X509_PUBKEY *X509_REQ_get_X509_PUBKEY(X509_REQ *req)
}
EVP_PKEY_free(xk);
- return (ok);
+ return ok;
}
/*
const unsigned char *p;
if ((req == NULL) || !ext_nids)
- return (NULL);
+ return NULL;
for (pnid = ext_nids; *pnid != NID_undef; pnid++) {
idx = X509_REQ_get_attr_by_NID(req, *pnid, -1);
if (idx == -1)
return X509at_get_attr_by_NID(req->req_info.attributes, nid, lastpos);
}
-int X509_REQ_get_attr_by_OBJ(const X509_REQ *req, ASN1_OBJECT *obj,
+int X509_REQ_get_attr_by_OBJ(const X509_REQ *req, const ASN1_OBJECT *obj,
int lastpos)
{
return X509at_get_attr_by_OBJ(req->req_info.attributes, obj, lastpos);
return 0;
}
-long X509_REQ_get_version(X509_REQ *req)
+long X509_REQ_get_version(const X509_REQ *req)
{
return ASN1_INTEGER_get(req->req_info.version);
}
-X509_NAME *X509_REQ_get_subject_name(X509_REQ *req)
+X509_NAME *X509_REQ_get_subject_name(const X509_REQ *req)
{
return req->req_info.subject;
}
-void X509_REQ_get0_signature(ASN1_BIT_STRING **psig, X509_ALGOR **palg,
- X509_REQ *req)
+void X509_REQ_get0_signature(const X509_REQ *req, const ASN1_BIT_STRING **psig,
+ const X509_ALGOR **palg)
{
if (psig != NULL)
*psig = req->signature;