1. Added compile flag to show the shared master secret.

2. Fixed bug where the client DH e-value wasn't being used.
pull/1/head
John Safranek 2014-09-02 11:52:08 -07:00
parent 6be28d3437
commit 8be65978bb
1 changed files with 5 additions and 1 deletions

View File

@ -836,7 +836,7 @@ static int DoKexDhInit(WOLFSSH* ssh, uint8_t* buf, uint32_t len, uint32_t* idx)
e = buf + begin;
begin += eSz;
if (eSz <= sizeof(ssh->handshake->eSz)) {
if (eSz <= sizeof(ssh->handshake->e)) {
WMEMCPY(ssh->handshake->e, e, eSz);
ssh->handshake->eSz = eSz;
}
@ -1275,6 +1275,10 @@ int SendKexDhReply(WOLFSSH* ssh)
ssh->handshake->e, ssh->handshake->eSz);
kPad = (ssh->k[0] & 0x80) != 0;
FreeDhKey(&dhKey);
#ifdef SHOW_MASTER_SECRET
printf("Master secret:\n");
DumpOctetString(ssh->k, ssh->kSz);
#endif
c32toa(fSz + fPad, scratchLen);
ShaUpdate(&ssh->handshake->hash, scratchLen, LENGTH_SZ);