提交 141eb8c6 编写于 作者: M Matt Caswell

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: NTim Hudson <tjh@openssl.org>
Reviewed-by: NRichard Levitte <levitte@openssl.org>
上级 8481f583
...@@ -1442,9 +1442,8 @@ MSG_PROCESS_RETURN tls_process_server_hello(SSL *s, PACKET *pkt) ...@@ -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 * Add new shared key for SCTP-Auth, will be ignored if
* no SCTP used. * no SCTP used.
*/ */
snprintf((char *)labelbuffer, memcpy(labelbuffer, DTLS1_SCTP_AUTH_LABEL,
sizeof(DTLS1_SCTP_AUTH_LABEL), sizeof(DTLS1_SCTP_AUTH_LABEL));
DTLS1_SCTP_AUTH_LABEL);
if (SSL_export_keying_material(s, sctpauthkey, if (SSL_export_keying_material(s, sctpauthkey,
sizeof(sctpauthkey), sizeof(sctpauthkey),
...@@ -2962,8 +2961,8 @@ int tls_client_key_exchange_post_work(SSL *s) ...@@ -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 * Add new shared key for SCTP-Auth, will be ignored if no SCTP
* used. * used.
*/ */
snprintf((char *)labelbuffer, sizeof(DTLS1_SCTP_AUTH_LABEL), memcpy(labelbuffer, DTLS1_SCTP_AUTH_LABEL,
DTLS1_SCTP_AUTH_LABEL); sizeof(DTLS1_SCTP_AUTH_LABEL));
if (SSL_export_keying_material(s, sctpauthkey, if (SSL_export_keying_material(s, sctpauthkey,
sizeof(sctpauthkey), labelbuffer, sizeof(sctpauthkey), labelbuffer,
......
...@@ -635,8 +635,8 @@ WORK_STATE ossl_statem_server_post_work(SSL *s, WORK_STATE wst) ...@@ -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 * Add new shared key for SCTP-Auth, will be ignored if no
* SCTP used. * SCTP used.
*/ */
snprintf((char *)labelbuffer, sizeof(DTLS1_SCTP_AUTH_LABEL), memcpy(labelbuffer, DTLS1_SCTP_AUTH_LABEL,
DTLS1_SCTP_AUTH_LABEL); sizeof(DTLS1_SCTP_AUTH_LABEL));
if (SSL_export_keying_material(s, sctpauthkey, if (SSL_export_keying_material(s, sctpauthkey,
sizeof(sctpauthkey), labelbuffer, sizeof(sctpauthkey), labelbuffer,
...@@ -2905,8 +2905,8 @@ WORK_STATE tls_post_process_client_key_exchange(SSL *s, WORK_STATE wst) ...@@ -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 * Add new shared key for SCTP-Auth, will be ignored if no SCTP
* used. * used.
*/ */
snprintf((char *)labelbuffer, sizeof(DTLS1_SCTP_AUTH_LABEL), memcpy(labelbuffer, DTLS1_SCTP_AUTH_LABEL,
DTLS1_SCTP_AUTH_LABEL); sizeof(DTLS1_SCTP_AUTH_LABEL));
if (SSL_export_keying_material(s, sctpauthkey, if (SSL_export_keying_material(s, sctpauthkey,
sizeof(sctpauthkey), labelbuffer, sizeof(sctpauthkey), labelbuffer,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册