You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (ok&&test_local_pub_rc==0&&test_local_pub_len==CURVE25519_KEYSIZE) {
657
+
if (test_local_pub[CURVE25519_KEYSIZE-1] &0x80) {
658
+
fprintf(stderr, "[X25519-DEBUG] wp_x25519_derive: [BEFORE] WARNING: LOCAL key MSB is SET (0x%02x) but not fixing to avoid clearing pubSet/privSet flags\n",
659
+
test_local_pub[CURVE25519_KEYSIZE-1]);
660
+
fflush(stderr);
661
+
/* Note: This might cause -199 if wolfSSL checks MSB, but re-importing might clear flags */
662
+
}
663
+
}
664
+
680
665
if (ok&& (test_local_priv_rc!=0||test_local_priv_len!=CURVE25519_KEYSIZE)) {
681
666
fprintf(stderr, "[X25519-DEBUG] wp_x25519_derive: [BEFORE] ERROR: LOCAL key privSet is FALSE (cannot export private key) rc=%d, len=%u\n",
682
667
test_local_priv_rc, test_local_priv_len);
683
668
fflush(stderr);
684
669
ok=0;
685
670
}
686
671
672
+
/* CRITICAL: Normalize PEER key public key by re-importing with MSB cleared */
673
+
/* PEER key is public-only, so re-importing is safe and won't affect privSet */
674
+
/* This ensures the INTERNAL structure (p.point[]) has MSB clear */
687
675
if (ok&&test_peer_pub_rc==0&&test_peer_pub_len==CURVE25519_KEYSIZE) {
688
676
/* Always clear MSB and re-import PEER public key to ensure internal structure is correct */
fprintf(stderr, "[X25519-DEBUG] wp_x25519_derive: [COMPILE-CHECK] WOLFSSL_SE050 is DEFINED - privSet check will be SKIPPED\n");
716
+
#else
717
+
fprintf(stderr, "[X25519-DEBUG] wp_x25519_derive: [COMPILE-CHECK] WOLFSSL_SE050 is NOT defined - privSet check will be PERFORMED\n");
718
+
#endif
719
+
#ifdefWOLF_CRYPTO_CB
720
+
fprintf(stderr, "[X25519-DEBUG] wp_x25519_derive: [COMPILE-CHECK] WOLF_CRYPTO_CB is DEFINED - crypto callback path available\n");
721
+
#else
722
+
fprintf(stderr, "[X25519-DEBUG] wp_x25519_derive: [COMPILE-CHECK] WOLF_CRYPTO_CB is NOT defined - no crypto callback path\n");
723
+
#endif
724
+
#ifdefWOLFSSL_CURVE25519_BLINDING
725
+
fprintf(stderr, "[X25519-DEBUG] wp_x25519_derive: [COMPILE-CHECK] WOLFSSL_CURVE25519_BLINDING is DEFINED - using blinded scalar multiplication\n");
726
+
#else
727
+
fprintf(stderr, "[X25519-DEBUG] wp_x25519_derive: [COMPILE-CHECK] WOLFSSL_CURVE25519_BLINDING is NOT defined - using standard scalar multiplication\n");
0 commit comments