Skip to content

Commit eba2ef0

Browse files
authored
docs: Fixed DER encoding of DigestInfo for PIV signing command
DER encoding was missing the mandatory NULL value (05 00) to ensure signatures are compatible with OpenSSL/BoringSSL
1 parent 76e5dd6 commit eba2ef0

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

docs/users-manual/application-piv/commands.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -880,21 +880,22 @@ For example, if using PKCS 1 v 1.5, before calling, build the following block.
880880
881881
For a 2048-bit key, the block is 256 bytes long (the leading 00 byte is one of the 256).
882882
883-
If the digest algorithm is SHA-256, the DER of the DigestInfo will be 49 bytes long:
883+
If the digest algorithm is SHA-256, the DER of the DigestInfo will be 51 bytes long:
884884
885-
30 2f
886-
30 0b
885+
30 31
886+
30 0d
887887
06 09
888888
60 86 48 01 65 03 04 02 01
889+
05 00
889890
04 20
890891
<32-byte digest>
891892
892893
The block to pass to the YubiKey will be
893894
894-
00 01 FF FF ... FF 00 \<49-byte DER of DigestInfo\>
895+
00 01 FF FF ... FF 00 \<51-byte DER of DigestInfo\>
895896
^ ^
896897
| |
897-
-------------- 204 bytes of 0xFF
898+
-------------- 202 bytes of 0xFF
898899
```
899900

900901
PSS (Probabilistic Signature Scheme) is much more complicated. If you want to learn how to

0 commit comments

Comments
 (0)