@@ -560,7 +560,7 @@ static int noise_handshake_init
560560 /* Sets the initiator, s => ephemeral keys are set afterwards */
561561 noise_handshake -> initiator = initiator ;
562562 if (self_secret_key != nullptr ) {
563- memcpy (noise_handshake -> static_private , self_secret_key , CRYPTO_PUBLIC_KEY_SIZE );
563+ memcpy (noise_handshake -> static_private , self_secret_key , CRYPTO_SECRET_KEY_SIZE );
564564 crypto_derive_public_key (noise_handshake -> static_public , self_secret_key );
565565
566566 //TODO: remove
@@ -661,7 +661,7 @@ static int create_crypto_handshake(const Net_Crypto *c, uint8_t *packet, const u
661661 */
662662 if (noise_handshake -> initiator ) {
663663 /* set ephemeral private+public */
664- memcpy (noise_handshake -> ephemeral_private , ephemeral_private , CRYPTO_PUBLIC_KEY_SIZE );
664+ memcpy (noise_handshake -> ephemeral_private , ephemeral_private , CRYPTO_SECRET_KEY_SIZE );
665665 memcpy (noise_handshake -> ephemeral_public , ephemeral_public , CRYPTO_PUBLIC_KEY_SIZE );
666666
667667 /* e */
@@ -756,7 +756,7 @@ static int create_crypto_handshake(const Net_Crypto *c, uint8_t *packet, const u
756756 */
757757 else {
758758 /* set ephemeral private+public */
759- memcpy (noise_handshake -> ephemeral_private , ephemeral_private , CRYPTO_PUBLIC_KEY_SIZE );
759+ memcpy (noise_handshake -> ephemeral_private , ephemeral_private , CRYPTO_SECRET_KEY_SIZE );
760760 memcpy (noise_handshake -> ephemeral_public , ephemeral_public , CRYPTO_PUBLIC_KEY_SIZE );
761761
762762 /* e */
0 commit comments