diff options
author | David von Oheimb <David.von.Oheimb@siemens.com> | 2019-01-15 21:51:25 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2019-03-06 16:10:09 +0000 |
commit | 9fdcc21fdc9d148f78d9cd5be34030f38cc45812 (patch) | |
tree | 20cba464edf2befc97c1888631dd782cba830c89 /ssl/ssl_asn1.c | |
parent | 27d5631236325c3fd8a3bd06af282ac496aac64b (diff) |
constify *_dup() and *i2d_*() and related functions as far as possible, introducing DECLARE_ASN1_DUP_FUNCTION
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/8029)
Diffstat (limited to 'ssl/ssl_asn1.c')
-rw-r--r-- | ssl/ssl_asn1.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ssl/ssl_asn1.c b/ssl/ssl_asn1.c index 4b70e38e76..e54d5309ef 100644 --- a/ssl/ssl_asn1.c +++ b/ssl/ssl_asn1.c @@ -83,9 +83,9 @@ IMPLEMENT_STATIC_ASN1_ENCODE_FUNCTIONS(SSL_SESSION_ASN1) /* Initialise OCTET STRING from buffer and length */ static void ssl_session_oinit(ASN1_OCTET_STRING **dest, ASN1_OCTET_STRING *os, - unsigned char *data, size_t len) + const unsigned char *data, size_t len) { - os->data = data; + os->data = (unsigned char *)data; /* justified cast: data is not modified */ os->length = (int)len; os->flags = 0; *dest = os; @@ -93,15 +93,15 @@ static void ssl_session_oinit(ASN1_OCTET_STRING **dest, ASN1_OCTET_STRING *os, /* Initialise OCTET STRING from string */ static void ssl_session_sinit(ASN1_OCTET_STRING **dest, ASN1_OCTET_STRING *os, - char *data) + const char *data) { if (data != NULL) - ssl_session_oinit(dest, os, (unsigned char *)data, strlen(data)); + ssl_session_oinit(dest, os, (const unsigned char *)data, strlen(data)); else *dest = NULL; } -int i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp) +int i2d_SSL_SESSION(const SSL_SESSION *in, unsigned char **pp) { SSL_SESSION_ASN1 as; |