diff options
Diffstat (limited to 'common/rfb/CSecurityRSAAES.cxx')
-rw-r--r-- | common/rfb/CSecurityRSAAES.cxx | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/common/rfb/CSecurityRSAAES.cxx b/common/rfb/CSecurityRSAAES.cxx index db6e43ad..c84422b6 100644 --- a/common/rfb/CSecurityRSAAES.cxx +++ b/common/rfb/CSecurityRSAAES.cxx @@ -100,31 +100,31 @@ bool CSecurityRSAAES::processMsg() { switch (state) { case ReadPublicKey: - if (readPublicKey()) { - verifyServer(); - writePublicKey(); - writeRandom(); - state = ReadRandom; - } - return false; + if (!readPublicKey()) + return false; + verifyServer(); + writePublicKey(); + writeRandom(); + state = ReadRandom; + /* fall through */ case ReadRandom: - if (readRandom()) { - setCipher(); - writeHash(); - state = ReadHash; - } - return false; + if (!readRandom()) + return false; + setCipher(); + writeHash(); + state = ReadHash; + /* fall through */ case ReadHash: - if (readHash()) { - clearSecrets(); - state = ReadSubtype; - } + if (!readHash()) + return false; + clearSecrets(); + state = ReadSubtype; + /* fall through */ case ReadSubtype: - if (readSubtype()) { - writeCredentials(); - return true; - } - return false; + if (!readSubtype()) + return false; + writeCredentials(); + return true; } assert(!"unreachable"); return false; |