diff options
author | Matt Caswell <matt@openssl.org> | 2015-10-26 12:00:00 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2015-10-30 08:39:47 +0000 |
commit | 141eb8c679a316278651d1e50b2259a989e030c9 (patch) | |
tree | ca8cca5e8e5d6774cb23393361e7a6eb20a6f80d | |
parent | 8481f583d3aebd7383ba5824bfbe854242231e1b (diff) |
Change snprintf to memcpy
There was a few uses of snprintf in the DTLS SCTP code which made more
sense to be a memcpy.
Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
-rw-r--r-- | ssl/statem/statem_clnt.c | 9 | ||||
-rw-r--r-- | ssl/statem/statem_srvr.c | 8 |
2 files changed, 8 insertions, 9 deletions
diff --git a/ssl/statem/statem_clnt.c b/ssl/statem/statem_clnt.c index b4c9a59b14..2ad41f5276 100644 --- a/ssl/statem/statem_clnt.c +++ b/ssl/statem/statem_clnt.c @@ -1442,9 +1442,8 @@ MSG_PROCESS_RETURN tls_process_server_hello(SSL *s, PACKET *pkt) * Add new shared key for SCTP-Auth, will be ignored if * no SCTP used. */ - snprintf((char *)labelbuffer, - sizeof(DTLS1_SCTP_AUTH_LABEL), - DTLS1_SCTP_AUTH_LABEL); + memcpy(labelbuffer, DTLS1_SCTP_AUTH_LABEL, + sizeof(DTLS1_SCTP_AUTH_LABEL)); if (SSL_export_keying_material(s, sctpauthkey, sizeof(sctpauthkey), @@ -2962,8 +2961,8 @@ int tls_client_key_exchange_post_work(SSL *s) * Add new shared key for SCTP-Auth, will be ignored if no SCTP * used. */ - snprintf((char *)labelbuffer, sizeof(DTLS1_SCTP_AUTH_LABEL), - DTLS1_SCTP_AUTH_LABEL); + memcpy(labelbuffer, DTLS1_SCTP_AUTH_LABEL, + sizeof(DTLS1_SCTP_AUTH_LABEL)); if (SSL_export_keying_material(s, sctpauthkey, sizeof(sctpauthkey), labelbuffer, diff --git a/ssl/statem/statem_srvr.c b/ssl/statem/statem_srvr.c index 6423522efa..b68366cb33 100644 --- a/ssl/statem/statem_srvr.c +++ b/ssl/statem/statem_srvr.c @@ -635,8 +635,8 @@ WORK_STATE ossl_statem_server_post_work(SSL *s, WORK_STATE wst) * Add new shared key for SCTP-Auth, will be ignored if no * SCTP used. */ - snprintf((char *)labelbuffer, sizeof(DTLS1_SCTP_AUTH_LABEL), - DTLS1_SCTP_AUTH_LABEL); + memcpy(labelbuffer, DTLS1_SCTP_AUTH_LABEL, + sizeof(DTLS1_SCTP_AUTH_LABEL)); if (SSL_export_keying_material(s, sctpauthkey, sizeof(sctpauthkey), labelbuffer, @@ -2905,8 +2905,8 @@ WORK_STATE tls_post_process_client_key_exchange(SSL *s, WORK_STATE wst) * Add new shared key for SCTP-Auth, will be ignored if no SCTP * used. */ - snprintf((char *)labelbuffer, sizeof(DTLS1_SCTP_AUTH_LABEL), - DTLS1_SCTP_AUTH_LABEL); + memcpy(labelbuffer, DTLS1_SCTP_AUTH_LABEL, + sizeof(DTLS1_SCTP_AUTH_LABEL)); if (SSL_export_keying_material(s, sctpauthkey, sizeof(sctpauthkey), labelbuffer, |