Commit 6942a8e
committed
examples/wrap: use modulus size for RSA NULL-pad test message
The RSA encrypt/decrypt test with TPM_ALG_NULL padding hardcoded
message.size = 256, which is only valid for 2048-bit RSA keys.
With TPM_ALG_NULL padding the TPM returns a full modulus-sized
plaintext on decrypt, so with a 4096-bit key the 256-byte message
never equals the 512-byte plaintext and the test reports
TPM_RC_TESTING.
Derive the message size from the key's own keyBits so the test
passes for any modulus size.
Reported against wolfTPM 4.0.0 on Nations NS350 hardware (NSING).1 parent 72bd518 commit 6942a8e
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
338 | 338 | | |
339 | 339 | | |
340 | 340 | | |
341 | | - | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
342 | 344 | | |
343 | 345 | | |
344 | 346 | | |
| |||
0 commit comments