From d3d5dc607a27859594be59be90cda9f474073b5a Mon Sep 17 00:00:00 2001 From: FdaSilvaYY Date: Fri, 8 Jul 2016 00:43:32 +0200 Subject: [PATCH] Enforce and explicit some const casting Reviewed-by: Matt Caswell Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/1300) --- crypto/asn1/tasn_prn.c | 2 +- crypto/x509v3/v3_prn.c | 2 +- ssl/ssl_txt.c | 2 +- ssl/t1_trce.c | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crypto/asn1/tasn_prn.c b/crypto/asn1/tasn_prn.c index 096c8415df..c79ecb587a 100644 --- a/crypto/asn1/tasn_prn.c +++ b/crypto/asn1/tasn_prn.c @@ -423,7 +423,7 @@ static int asn1_print_obstring(BIO *out, ASN1_STRING *str, int indent) } else if (BIO_puts(out, "\n") <= 0) return 0; if ((str->length > 0) - && BIO_dump_indent(out, (char *)str->data, str->length, + && BIO_dump_indent(out, (const char *)str->data, str->length, indent + 2) <= 0) return 0; return 1; diff --git a/crypto/x509v3/v3_prn.c b/crypto/x509v3/v3_prn.c index 86666363a1..3048b67588 100644 --- a/crypto/x509v3/v3_prn.c +++ b/crypto/x509v3/v3_prn.c @@ -188,7 +188,7 @@ static int unknown_ext_print(BIO *out, const unsigned char *ext, int extlen, case X509V3_EXT_PARSE_UNKNOWN: return ASN1_parse_dump(out, ext, extlen, indent, -1); case X509V3_EXT_DUMP_UNKNOWN: - return BIO_dump_indent(out, (char *)ext, extlen, indent); + return BIO_dump_indent(out, (const char *)ext, extlen, indent); default: return 1; diff --git a/ssl/ssl_txt.c b/ssl/ssl_txt.c index df7c74b4f3..2da3c0a86b 100644 --- a/ssl/ssl_txt.c +++ b/ssl/ssl_txt.c @@ -128,7 +128,7 @@ int SSL_SESSION_print(BIO *bp, const SSL_SESSION *x) if (x->tlsext_tick) { if (BIO_puts(bp, "\n TLS session ticket:\n") <= 0) goto err; - if (BIO_dump_indent(bp, (char *)x->tlsext_tick, x->tlsext_ticklen, 4) + if (BIO_dump_indent(bp, (const char *)x->tlsext_tick, x->tlsext_ticklen, 4) <= 0) goto err; } diff --git a/ssl/t1_trce.c b/ssl/t1_trce.c index 562ac09e85..ab6cfa2d6c 100644 --- a/ssl/t1_trce.c +++ b/ssl/t1_trce.c @@ -728,7 +728,7 @@ static int ssl_print_extension(BIO *bio, int indent, int server, int extype, break; default: - BIO_dump_indent(bio, (char *)ext, extlen, indent + 2); + BIO_dump_indent(bio, (const char *)ext, extlen, indent + 2); } return 1; } @@ -1257,7 +1257,7 @@ static int ssl_print_handshake(BIO *bio, SSL *ssl, default: BIO_indent(bio, indent + 2, 80); BIO_puts(bio, "Unsupported, hex dump follows:\n"); - BIO_dump_indent(bio, (char *)msg, msglen, indent + 4); + BIO_dump_indent(bio, (const char *)msg, msglen, indent + 4); } return 1; } -- 2.25.1