OLD | NEW |
(Empty) | |
| 1 This is the same test as rsa-pkcs1-sha256.pem except the SPKI has been encoded |
| 2 using a non-minimal length for the outtermost SEQUENCE. |
| 3 |
| 4 Under DER, the tag-length-value encodings should be minimal and hence this shoul
d fail. |
| 5 |
| 6 Specifically the SPKI start was changed from: |
| 7 30 81 9f |
| 8 To: |
| 9 30 82 00 9f |
| 10 |
| 11 (the length of 0x9F is being expressed using 2 bytes instead of 1) |
| 12 |
| 13 |
| 14 |
| 15 -----BEGIN PUBLIC KEY----- |
| 16 MIIAnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAqkfgdjI9YqzadSZ2Ns0CEEUD8+8m7OplIx0 |
| 17 94X+QD8mooNrunwT04asbLIINGL4qiI/+9IVSvyV3Kj9c4EeQIbANGoJ8AI3wf6MOBB/txxGFed |
| 18 qqcTffKVMQvtZdoYFbZ/MQkvyRsoyvunb/pWcN4sSaF9kY1bXSeP3J99fBIYUCAwEAAQ== |
| 19 -----END PUBLIC KEY----- |
| 20 |
| 21 $ openssl asn1parse -i < [PUBLIC KEY] |
| 22 0:d=0 hl=4 l= 159 cons: SEQUENCE |
| 23 4:d=1 hl=2 l= 13 cons: SEQUENCE |
| 24 6:d=2 hl=2 l= 9 prim: OBJECT :rsaEncryption |
| 25 17:d=2 hl=2 l= 0 prim: NULL |
| 26 19:d=1 hl=3 l= 141 prim: BIT STRING |
| 27 |
| 28 |
| 29 |
| 30 -----BEGIN ALGORITHM----- |
| 31 MA0GCSqGSIb3DQEBCwUA |
| 32 -----END ALGORITHM----- |
| 33 |
| 34 $ openssl asn1parse -i < [ALGORITHM] |
| 35 0:d=0 hl=2 l= 13 cons: SEQUENCE |
| 36 2:d=1 hl=2 l= 9 prim: OBJECT :sha256WithRSAEncryption |
| 37 13:d=1 hl=2 l= 0 prim: NULL |
| 38 |
| 39 |
| 40 |
| 41 -----BEGIN DATA----- |
| 42 MIIB46ADAgECAgkA3l4tFOVii0UwDQYJKoZIhvcNAQELBQAwVjELMAkGA1UEBhMCQVUxEzARBgN |
| 43 VBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEPMA0GA1 |
| 44 UEAwwGTXkga2V5MB4XDTE1MDcwMjE3MDYzOVoXDTE2MDcwMTE3MDYzOVowVjELMAkGA1UEBhMCQ |
| 45 VUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0 |
| 46 ZDEPMA0GA1UEAwwGTXkga2V5MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqR+B2Mj1irNp |
| 47 1JnY2zQIQRQPz7ybs6mUjHT3hf5APyaig2u6fBPThqxssgg0YviqIj/70hVK/JXcqP1zgR5AhsA |
| 48 0agnwAjfB/ow4EH+3HEYV52qpxN98pUxC+1l2hgVtn8xCS/JGyjK+6dv+lZw3ixJoX2RjVtdJ4/ |
| 49 cn318EhhQIDAQABo1AwTjAdBgNVHQ4EFgQUzQBVKTEknyLndWd2HTsBdTKvyikwHwYDVR0jBBgw |
| 50 FoAUzQBVKTEknyLndWd2HTsBdTKvyikwDAYDVR0TBAUwAwEB/w== |
| 51 -----END DATA----- |
| 52 |
| 53 |
| 54 |
| 55 -----BEGIN SIGNATURE----- |
| 56 A4GBADrHSmFSJw/Gv7hs5PNzpaJwAri/sitarIZfzN/SjR+n8L8yeTEoiDb1+BkxlFvXvPHTaOK |
| 57 oO3WlslNNOxh1W5/JkYYGOUkCcyIjnln6qS560imcr3VNjomT/M8M2Iss+rJiKau1TRuaP7H8i6 |
| 58 +Gqf3saGdr8/LnvFAdNQvkalQt |
| 59 -----END SIGNATURE----- |
| 60 |
| 61 $ openssl asn1parse -i < [SIGNATURE] |
| 62 0:d=0 hl=3 l= 129 prim: BIT STRING |
OLD | NEW |