The check for extra data was not dereferencing the pointer, but avoid
complaints about such uses by freeing the decrypted data only after the
check. The hexdump could have read freed memory, so that needs to be
before the freeing.
Fixes: 54ac6ff8c4a2 ("PKCS 1: Add function for checking v1.5 RSA signature")
Signed-off-by: Jouni Malinen <j@w1.fi>
return -1;
}
- os_free(decrypted);
-
if (hdr.payload + hdr.length != decrypted + decrypted_len) {
wpa_printf(MSG_INFO,
"PKCS #1: Extra data after signature - reject");
hdr.payload + hdr.length,
decrypted + decrypted_len - hdr.payload -
hdr.length);
+
+ os_free(decrypted);
return -1;
}
+ os_free(decrypted);
+
return 0;
}