scmno****@osdn*****
scmno****@osdn*****
2017年 11月 26日 (日) 00:26:22 JST
Revision: 6980 http://sourceforge.jp/projects/ttssh2/scm/svn/commits/6980 Author: doda Date: 2017-11-26 00:26:22 +0900 (Sun, 26 Nov 2017) Log Message: ----------- if 文を簡略化 Modified Paths: -------------- trunk/ttssh2/ttxssh/crypt.c -------------- next part -------------- Modified: trunk/ttssh2/ttxssh/crypt.c =================================================================== --- trunk/ttssh2/ttxssh/crypt.c 2017-11-22 10:24:19 UTC (rev 6979) +++ trunk/ttssh2/ttxssh/crypt.c 2017-11-25 15:26:22 UTC (rev 6980) @@ -189,17 +189,10 @@ return DEATTACK_OK; } -BOOL CRYPT_detect_attack(PTInstVar pvar, unsigned char *buf, - int bytes) +BOOL CRYPT_detect_attack(PTInstVar pvar, unsigned char *buf, int bytes) { - if (SSHv1(pvar)) { - if (pvar->crypt_state.sender_cipher == SSH_CIPHER_NONE) { - return FALSE; - } - else { - return detect_attack(&pvar->crypt_state.detect_attack_statics, - buf, bytes, NULL) == DEATTACK_DETECTED; - } + if (SSHv1(pvar) && pvar->crypt_state.sender_cipher != SSH_CIPHER_NONE) { + return detect_attack(&pvar->crypt_state.detect_attack_statics, buf, bytes, NULL) == DEATTACK_DETECTED; } else { return FALSE; }