summaryrefslogtreecommitdiff
path: root/usr.bin/openssl
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2023-11-21 17:56:20 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2023-11-21 17:56:20 +0000
commit01bfa319dcc4681bebdc49dc1d7bc5be2304f140 (patch)
tree33f01e2a38ac9217c15c67512b55179ef7991691 /usr.bin/openssl
parent7a25b0d02454a5d642e306731f1af121eca117a0 (diff)
Make a few purpose things const
This should allow us to constify a sizable table in libcrypto in an upcoming bump.
Diffstat (limited to 'usr.bin/openssl')
-rw-r--r--usr.bin/openssl/apps.c4
-rw-r--r--usr.bin/openssl/cms.c4
-rw-r--r--usr.bin/openssl/verify.c4
-rw-r--r--usr.bin/openssl/x509.c10
4 files changed, 11 insertions, 11 deletions
diff --git a/usr.bin/openssl/apps.c b/usr.bin/openssl/apps.c
index 70857e0423e..6ffbe6f0c4d 100644
--- a/usr.bin/openssl/apps.c
+++ b/usr.bin/openssl/apps.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apps.c,v 1.66 2023/07/23 11:39:29 tb Exp $ */
+/* $OpenBSD: apps.c,v 1.67 2023/11/21 17:56:19 tb Exp $ */
/*
* Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
*
@@ -1716,7 +1716,7 @@ args_verify(char ***pargs, int *pargc, int *badarg, BIO *err,
}
(*pargs)++;
} else if (strcmp(arg, "-purpose") == 0) {
- X509_PURPOSE *xptmp;
+ const X509_PURPOSE *xptmp;
if (!argn)
*badarg = 1;
else {
diff --git a/usr.bin/openssl/cms.c b/usr.bin/openssl/cms.c
index 121a413a213..b94e14675bb 100644
--- a/usr.bin/openssl/cms.c
+++ b/usr.bin/openssl/cms.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cms.c,v 1.34 2023/04/14 15:27:13 tb Exp $ */
+/* $OpenBSD: cms.c,v 1.35 2023/11/21 17:56:19 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project.
*/
@@ -1140,7 +1140,7 @@ cms_usage(void)
fprintf(stderr, "\nValid purposes:\n\n");
for (i = 0; i < X509_PURPOSE_get_count(); i++) {
- X509_PURPOSE *ptmp = X509_PURPOSE_get0(i);
+ const X509_PURPOSE *ptmp = X509_PURPOSE_get0(i);
fprintf(stderr, " %-18s%s\n", X509_PURPOSE_get0_sname(ptmp),
X509_PURPOSE_get0_name(ptmp));
}
diff --git a/usr.bin/openssl/verify.c b/usr.bin/openssl/verify.c
index b4e0f33f6a7..a87d5d47dfa 100644
--- a/usr.bin/openssl/verify.c
+++ b/usr.bin/openssl/verify.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: verify.c,v 1.17 2023/04/14 15:27:13 tb Exp $ */
+/* $OpenBSD: verify.c,v 1.18 2023/11/21 17:56:19 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -251,7 +251,7 @@ verify_usage(void)
fprintf(stderr, "\nValid purposes:\n\n");
for (i = 0; i < X509_PURPOSE_get_count(); i++) {
- X509_PURPOSE *ptmp = X509_PURPOSE_get0(i);
+ const X509_PURPOSE *ptmp = X509_PURPOSE_get0(i);
fprintf(stderr, " %-18s%s\n", X509_PURPOSE_get0_sname(ptmp),
X509_PURPOSE_get0_name(ptmp));
}
diff --git a/usr.bin/openssl/x509.c b/usr.bin/openssl/x509.c
index 8e8a9f2dc32..7f60110c47d 100644
--- a/usr.bin/openssl/x509.c
+++ b/usr.bin/openssl/x509.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509.c,v 1.34 2023/11/13 11:50:36 tb Exp $ */
+/* $OpenBSD: x509.c,v 1.35 2023/11/21 17:56:19 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -86,7 +86,7 @@ static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest,
X509 *x, X509 *xca, EVP_PKEY *pkey, STACK_OF(OPENSSL_STRING) *sigopts,
char *serial, int create, int days, int clrext, CONF *conf, char *section,
ASN1_INTEGER *sno);
-static int purpose_print(BIO *bio, X509 *cert, X509_PURPOSE *pt);
+static int purpose_print(BIO *bio, X509 *cert, const X509_PURPOSE *pt);
static struct {
char *alias;
@@ -1022,7 +1022,7 @@ x509_main(int argc, char **argv)
}
#endif
else if (cfg.pprint == i) {
- X509_PURPOSE *ptmp;
+ const X509_PURPOSE *ptmp;
int j;
BIO_printf(STDout, "Certificate purposes:\n");
@@ -1534,10 +1534,10 @@ sign(X509 *x, EVP_PKEY *pkey, int days, int clrext, const EVP_MD *digest,
}
static int
-purpose_print(BIO *bio, X509 *cert, X509_PURPOSE *pt)
+purpose_print(BIO *bio, X509 *cert, const X509_PURPOSE *pt)
{
int id, i, idret;
- char *pname;
+ const char *pname;
id = X509_PURPOSE_get_id(pt);
pname = X509_PURPOSE_get0_name(pt);