Index: net/data/verify_signed_data_unittest/rsa-pkcs1-sha256-key-encoded-ber.pem |
diff --git a/net/data/verify_signed_data_unittest/rsa-pkcs1-sha256-key-encoded-ber.pem b/net/data/verify_signed_data_unittest/rsa-pkcs1-sha256-key-encoded-ber.pem |
new file mode 100644 |
index 0000000000000000000000000000000000000000..2a8db4a6b6a5c6e1fd2d25bd4946cf33becb447a |
--- /dev/null |
+++ b/net/data/verify_signed_data_unittest/rsa-pkcs1-sha256-key-encoded-ber.pem |
@@ -0,0 +1,62 @@ |
+This is the same test as rsa-pkcs1-sha256.pem except the SPKI has been encoded |
+using a non-minimal length for the outtermost SEQUENCE. |
+ |
+Under DER, the tag-length-value encodings should be minimal and hence this should fail. |
+ |
+Specifically the SPKI start was changed from: |
+ 30 81 9f |
+To: |
+ 30 82 00 9f |
+ |
+(the length of 0x9F is being expressed using 2 bytes instead of 1) |
+ |
+ |
+ |
+-----BEGIN PUBLIC KEY----- |
+MIIAnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAqkfgdjI9YqzadSZ2Ns0CEEUD8+8m7OplIx0 |
+94X+QD8mooNrunwT04asbLIINGL4qiI/+9IVSvyV3Kj9c4EeQIbANGoJ8AI3wf6MOBB/txxGFed |
+qqcTffKVMQvtZdoYFbZ/MQkvyRsoyvunb/pWcN4sSaF9kY1bXSeP3J99fBIYUCAwEAAQ== |
+-----END PUBLIC KEY----- |
+ |
+$ openssl asn1parse -i < [PUBLIC KEY] |
+ 0:d=0 hl=4 l= 159 cons: SEQUENCE |
+ 4:d=1 hl=2 l= 13 cons: SEQUENCE |
+ 6:d=2 hl=2 l= 9 prim: OBJECT :rsaEncryption |
+ 17:d=2 hl=2 l= 0 prim: NULL |
+ 19:d=1 hl=3 l= 141 prim: BIT STRING |
+ |
+ |
+ |
+-----BEGIN ALGORITHM----- |
+MA0GCSqGSIb3DQEBCwUA |
+-----END ALGORITHM----- |
+ |
+$ openssl asn1parse -i < [ALGORITHM] |
+ 0:d=0 hl=2 l= 13 cons: SEQUENCE |
+ 2:d=1 hl=2 l= 9 prim: OBJECT :sha256WithRSAEncryption |
+ 13:d=1 hl=2 l= 0 prim: NULL |
+ |
+ |
+ |
+-----BEGIN DATA----- |
+MIIB46ADAgECAgkA3l4tFOVii0UwDQYJKoZIhvcNAQELBQAwVjELMAkGA1UEBhMCQVUxEzARBgN |
+VBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDEPMA0GA1 |
+UEAwwGTXkga2V5MB4XDTE1MDcwMjE3MDYzOVoXDTE2MDcwMTE3MDYzOVowVjELMAkGA1UEBhMCQ |
+VUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoMGEludGVybmV0IFdpZGdpdHMgUHR5IEx0 |
+ZDEPMA0GA1UEAwwGTXkga2V5MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqR+B2Mj1irNp |
+1JnY2zQIQRQPz7ybs6mUjHT3hf5APyaig2u6fBPThqxssgg0YviqIj/70hVK/JXcqP1zgR5AhsA |
+0agnwAjfB/ow4EH+3HEYV52qpxN98pUxC+1l2hgVtn8xCS/JGyjK+6dv+lZw3ixJoX2RjVtdJ4/ |
+cn318EhhQIDAQABo1AwTjAdBgNVHQ4EFgQUzQBVKTEknyLndWd2HTsBdTKvyikwHwYDVR0jBBgw |
+FoAUzQBVKTEknyLndWd2HTsBdTKvyikwDAYDVR0TBAUwAwEB/w== |
+-----END DATA----- |
+ |
+ |
+ |
+-----BEGIN SIGNATURE----- |
+A4GBADrHSmFSJw/Gv7hs5PNzpaJwAri/sitarIZfzN/SjR+n8L8yeTEoiDb1+BkxlFvXvPHTaOK |
+oO3WlslNNOxh1W5/JkYYGOUkCcyIjnln6qS560imcr3VNjomT/M8M2Iss+rJiKau1TRuaP7H8i6 |
++Gqf3saGdr8/LnvFAdNQvkalQt |
+-----END SIGNATURE----- |
+ |
+$ openssl asn1parse -i < [SIGNATURE] |
+ 0:d=0 hl=3 l= 129 prim: BIT STRING |