forked from wolfSSL/wolfssl
fix sniffer with new decrypt/verify code
This commit is contained in:
@ -1593,10 +1593,19 @@ static void Decrypt(SSL* ssl, byte* output, const byte* input, word32 sz)
|
|||||||
static const byte* DecryptMessage(SSL* ssl, const byte* input, word32 sz,
|
static const byte* DecryptMessage(SSL* ssl, const byte* input, word32 sz,
|
||||||
byte* output)
|
byte* output)
|
||||||
{
|
{
|
||||||
|
int ivExtra = 0;
|
||||||
|
|
||||||
Decrypt(ssl, output, input, sz);
|
Decrypt(ssl, output, input, sz);
|
||||||
ssl->keys.encryptSz = sz;
|
ssl->keys.encryptSz = sz;
|
||||||
if (ssl->options.tls1_1 && ssl->specs.cipher_type == block)
|
if (ssl->options.tls1_1 && ssl->specs.cipher_type == block) {
|
||||||
return output + ssl->specs.block_size; /* go past TLSv1.1 IV */
|
output += ssl->specs.block_size; /* go past TLSv1.1 IV */
|
||||||
|
ivExtra = ssl->specs.block_size;
|
||||||
|
}
|
||||||
|
|
||||||
|
ssl->keys.padSz = ssl->specs.hash_size;
|
||||||
|
|
||||||
|
if (ssl->specs.cipher_type == block)
|
||||||
|
ssl->keys.padSz += *(output + sz - ivExtra - 1) + 1;
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
@ -278,7 +278,7 @@ int main(int argc, char** argv)
|
|||||||
printf("ssl_Decode ret = %d, %s\n", ret, err);
|
printf("ssl_Decode ret = %d, %s\n", ret, err);
|
||||||
if (ret > 0) {
|
if (ret > 0) {
|
||||||
data[ret] = 0;
|
data[ret] = 0;
|
||||||
printf("SSL App Data:%s\n", data);
|
printf("SSL App Data(%d):%s\n", ret, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (saveFile)
|
else if (saveFile)
|
||||||
|
Reference in New Issue
Block a user