From 82a45c70367154c6ff71237fe886ebbb24055091 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Thu, 11 Jan 2007 09:55:09 +0000 Subject: [PATCH] constify git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19839 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/hx509/crypto.c | 4 ++-- lib/hx509/error.c | 3 ++- lib/hx509/hx_locl.h | 2 +- lib/hx509/keyset.c | 6 +++--- lib/hx509/ks_p11.c | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/hx509/crypto.c b/lib/hx509/crypto.c index 91cbf5356..b7cefa266 100644 --- a/lib/hx509/crypto.c +++ b/lib/hx509/crypto.c @@ -96,7 +96,7 @@ struct hx509_private_key { */ struct signature_alg { - char *name; + const char *name; const heim_oid *(*sig_oid)(void); const AlgorithmIdentifier *(*sig_alg)(void); const heim_oid *(*key_oid)(void); @@ -1296,7 +1296,7 @@ _hx509_generate_private_key(hx509_context context, * */ -static const heim_octet_string null_entry_oid = { 2, "\x05\x00" }; +static const heim_octet_string null_entry_oid = { 2, rk_UNCONST("\x05\x00") }; static const unsigned sha512_oid_tree[] = { 2, 16, 840, 1, 101, 3, 4, 3 }; const AlgorithmIdentifier _hx509_signature_sha512_data = { diff --git a/lib/hx509/error.c b/lib/hx509/error.c index 8c357edba..5c3f536be 100644 --- a/lib/hx509/error.c +++ b/lib/hx509/error.c @@ -128,7 +128,8 @@ void hx509_err(hx509_context context, int exit_code, int error_code, char *fmt, ...) { va_list ap; - char *msg, *str; + const char *msg; + char *str; va_start(ap, fmt); vasprintf(&str, fmt, ap); diff --git a/lib/hx509/hx_locl.h b/lib/hx509/hx_locl.h index 60504a3fe..efc4bbe25 100644 --- a/lib/hx509/hx_locl.h +++ b/lib/hx509/hx_locl.h @@ -144,7 +144,7 @@ struct hx509_query_data { }; struct hx509_keyset_ops { - char *name; + const char *name; int flags; int (*init)(hx509_context, hx509_certs, void **, int, const char *, hx509_lock); diff --git a/lib/hx509/keyset.c b/lib/hx509/keyset.c index dd00ab1fe..593f4e5c1 100644 --- a/lib/hx509/keyset.c +++ b/lib/hx509/keyset.c @@ -358,7 +358,7 @@ hx509_get_one_cert(hx509_context context, hx509_certs certs, hx509_cert *c) } static int -certs_info_stdio(void *ctx, char *str) +certs_info_stdio(void *ctx, const char *str) { FILE *f = ctx; fprintf(f, "%s\n", str); @@ -368,7 +368,7 @@ certs_info_stdio(void *ctx, char *str) int hx509_certs_info(hx509_context context, hx509_certs certs, - int (*func)(void *, char *), + int (*func)(void *, const char *), void *ctx) { if (func == NULL) { @@ -385,7 +385,7 @@ hx509_certs_info(hx509_context context, } void -_hx509_pi_printf(int (*func)(void *, char *), void *ctx, +_hx509_pi_printf(int (*func)(void *, const char *), void *ctx, char *fmt, ...) { va_list ap; diff --git a/lib/hx509/ks_p11.c b/lib/hx509/ks_p11.c index 534c4ecea..f7893541f 100644 --- a/lib/hx509/ks_p11.c +++ b/lib/hx509/ks_p11.c @@ -1113,7 +1113,7 @@ static int p11_printinfo(hx509_context context, hx509_certs certs, void *data, - int (*func)(void *, char *), + int (*func)(void *, const char *), void *ctx) { struct p11_module *p = data;