Browse Subversion Repository
Diff of /branches/ssh_chacha20poly1305/ttssh2/ttxssh/crypt.c
Parent Directory
| Revision Log
| Patch
| 558 |
return TRUE; |
return TRUE; |
| 559 |
|
|
| 560 |
if (mac->key == NULL) { |
if (mac->key == NULL) { |
| 561 |
logprintf(pvar, LOG_LEVEL_VERBOSE, "HMAC key is NULL(seq %lu len %d)", sequence_number, len); |
logprintf(LOG_LEVEL_VERBOSE, "HMAC key is NULL(seq %lu len %d)", sequence_number, len); |
| 562 |
goto error; |
goto error; |
| 563 |
} |
} |
| 564 |
|
|
| 565 |
if ((u_int)mac->mac_len > sizeof(m)) { |
if ((u_int)mac->mac_len > sizeof(m)) { |
| 566 |
logprintf(pvar, LOG_LEVEL_VERBOSE, "HMAC len(%d) is larger than %d bytes(seq %lu len %d)", |
logprintf(LOG_LEVEL_VERBOSE, "HMAC len(%d) is larger than %d bytes(seq %lu len %d)", |
| 567 |
mac->mac_len, sizeof(m), sequence_number, len); |
mac->mac_len, sizeof(m), sequence_number, len); |
| 568 |
goto error; |
goto error; |
| 569 |
} |
} |
| 576 |
HMAC_cleanup(&c); |
HMAC_cleanup(&c); |
| 577 |
|
|
| 578 |
if (memcmp(m, MAC, mac->mac_len)) { |
if (memcmp(m, MAC, mac->mac_len)) { |
| 579 |
logprintf(pvar, LOG_LEVEL_VERBOSE, "HMAC key is not matched(seq %lu len %d)", sequence_number, len); |
logprintf(LOG_LEVEL_VERBOSE, "HMAC key is not matched(seq %lu len %d)", sequence_number, len); |
| 580 |
logprintf_hexdump(pvar, LOG_LEVEL_VERBOSE, m, mac->mac_len, "m:"); |
logprintf_hexdump(LOG_LEVEL_VERBOSE, m, mac->mac_len, "m:"); |
| 581 |
logprintf_hexdump(pvar, LOG_LEVEL_VERBOSE, MAC, mac->mac_len, "MAC:"); |
logprintf_hexdump(LOG_LEVEL_VERBOSE, MAC, mac->mac_len, "MAC:"); |
| 582 |
goto error; |
goto error; |
| 583 |
} |
} |
| 584 |
|
|
|
|
Legend:
| Removed from v.6801 |
|
| changed lines |
| |
Added in v.6808 |
|
|
| |