[BACK]Return to kexc25519.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Diff for /src/usr.bin/ssh/kexc25519.c between version 1.11 and 1.12

version 1.11, 2018/12/27 03:25:25 version 1.12, 2019/01/21 09:49:37
Line 62 
Line 62 
     const u_char pub[CURVE25519_SIZE], struct sshbuf *out)      const u_char pub[CURVE25519_SIZE], struct sshbuf *out)
 {  {
         u_char shared_key[CURVE25519_SIZE];          u_char shared_key[CURVE25519_SIZE];
           u_char zero[CURVE25519_SIZE];
         int r;          int r;
   
         /* Check for all-zero public key */          crypto_scalarmult_curve25519(shared_key, key, pub);
         explicit_bzero(shared_key, CURVE25519_SIZE);  
         if (timingsafe_bcmp(pub, shared_key, CURVE25519_SIZE) == 0)          /* Check for all-zero shared secret */
           explicit_bzero(zero, CURVE25519_SIZE);
           if (timingsafe_bcmp(zero, shared_key, CURVE25519_SIZE) == 0)
                 return SSH_ERR_KEY_INVALID_EC_VALUE;                  return SSH_ERR_KEY_INVALID_EC_VALUE;
   
         crypto_scalarmult_curve25519(shared_key, key, pub);  
 #ifdef DEBUG_KEXECDH  #ifdef DEBUG_KEXECDH
         dump_digest("shared secret", shared_key, CURVE25519_SIZE);          dump_digest("shared secret", shared_key, CURVE25519_SIZE);
 #endif  #endif

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12