summaryrefslogtreecommitdiffstats
path: root/crypto/x509
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2016-08-17 13:50:48 +0100
committerDr. Stephen Henson <steve@openssl.org>2016-08-17 13:59:04 +0100
commit8900f3e3982a016a25ad87a2270446e780038ec9 (patch)
tree686da17998e72e5a54c75bb511459e55bc5344f9 /crypto/x509
parent5e6089f0eba7b12f21b3237c57f2bd56049eb1ae (diff)
Convert X509* functions to use const getters
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/x509')
-rw-r--r--crypto/x509/t_x509.c6
-rw-r--r--crypto/x509/x509_set.c7
-rw-r--r--crypto/x509/x509type.c4
3 files changed, 9 insertions, 8 deletions
diff --git a/crypto/x509/t_x509.c b/crypto/x509/t_x509.c
index 9fec3ed99b..bfd6f6d8ff 100644
--- a/crypto/x509/t_x509.c
+++ b/crypto/x509/t_x509.c
@@ -110,7 +110,7 @@ int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags,
}
if (!(cflag & X509_FLAG_NO_SIGNAME)) {
- X509_ALGOR *tsig_alg = X509_get0_tbs_sigalg(x);
+ const X509_ALGOR *tsig_alg = X509_get0_tbs_sigalg(x);
if (X509_signature_print(bp, tsig_alg, NULL) <= 0)
goto err;
}
@@ -170,8 +170,8 @@ int X509_print_ex(BIO *bp, X509 *x, unsigned long nmflags,
}
if (!(cflag & X509_FLAG_NO_IDS)) {
- ASN1_BIT_STRING *iuid, *suid;
- X509_get0_uids(&iuid, &suid, x);
+ const ASN1_BIT_STRING *iuid, *suid;
+ X509_get0_uids(x, &iuid, &suid);
if (iuid != NULL) {
if (BIO_printf(bp, "%8sIssuer Unique ID: ", "") <= 0)
goto err;
diff --git a/crypto/x509/x509_set.c b/crypto/x509/x509_set.c
index ecf5f04f20..dfcecb15c2 100644
--- a/crypto/x509/x509_set.c
+++ b/crypto/x509/x509_set.c
@@ -135,12 +135,13 @@ X509_PUBKEY *X509_get_X509_PUBKEY(const X509 *x)
return x->cert_info.key;
}
-STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x)
+const STACK_OF(X509_EXTENSION) *X509_get0_extensions(const X509 *x)
{
return x->cert_info.extensions;
}
-void X509_get0_uids(ASN1_BIT_STRING **piuid, ASN1_BIT_STRING **psuid, X509 *x)
+void X509_get0_uids(const X509 *x, const ASN1_BIT_STRING **piuid,
+ const ASN1_BIT_STRING **psuid)
{
if (piuid != NULL)
*piuid = x->cert_info.issuerUID;
@@ -148,7 +149,7 @@ void X509_get0_uids(ASN1_BIT_STRING **piuid, ASN1_BIT_STRING **psuid, X509 *x)
*psuid = x->cert_info.subjectUID;
}
-X509_ALGOR *X509_get0_tbs_sigalg(X509 *x)
+const X509_ALGOR *X509_get0_tbs_sigalg(const X509 *x)
{
return &x->cert_info.signature;
}
diff --git a/crypto/x509/x509type.c b/crypto/x509/x509type.c
index 9acab04401..8c7242cc66 100644
--- a/crypto/x509/x509type.c
+++ b/crypto/x509/x509type.c
@@ -13,9 +13,9 @@
#include <openssl/objects.h>
#include <openssl/x509.h>
-int X509_certificate_type(X509 *x, EVP_PKEY *pkey)
+int X509_certificate_type(X509 *x, const EVP_PKEY *pkey)
{
- EVP_PKEY *pk;
+ const EVP_PKEY *pk;
int ret = 0, i;
if (x == NULL)