]> granicus.if.org Git - openssl/commit
Add test corpus for PEM reading
authorBenjamin Kaduk <bkaduk@akamai.com>
Thu, 23 Feb 2017 20:28:32 +0000 (14:28 -0600)
committerRichard Levitte <levitte@openssl.org>
Tue, 28 Feb 2017 20:23:26 +0000 (21:23 +0100)
commite8cee55718bb9cb957f449fbe7145a77f252bb73
treea62a7b048051a3df2dc363293032b84310b55650
parent5ea564f154ebe8bda2a0e091a312e2058edf437f
Add test corpus for PEM reading

Generate a fresh certificate and DSA private key in their respective PEM
files.  Modify the resulting ASCII in various ways so as to produce input
files that might be generated by non-openssl programs (openssl always
generates "standard" PEM files, with base64 data in 64-character lines
except for a possible shorter last line).

Exercise various combinations of line lengths, leading/trailing
whitespace, non-base64 characters, comments, and padding, for both
unencrypted and encrypted files.  (We do not have any other test coverage
that uses encrypted files, as far as I can see, and the parser enforces
different rules for the body of encrypted files.)

Add a recipe to parse these test files and verify that they contain the
expected string or are rejected, according to the expected status.
Some of the current behavior is perhaps suboptimal and could be revisited.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2756)
53 files changed:
test/recipes/04-test_pem.t [new file with mode: 0644]
test/recipes/04-test_pem_data/NOTES [new file with mode: 0644]
test/recipes/04-test_pem_data/cert-1023line.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/cert-1024line.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/cert-1025line.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/cert-255line.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/cert-256line.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/cert-257line.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/cert-blankline.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/cert-comment.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/cert-earlypad.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/cert-extrapad.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/cert-infixwhitespace.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/cert-junk.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/cert-leadingwhitespace.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/cert-longline.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/cert-misalignedpad.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/cert-onecolumn.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/cert-oneline.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/cert-shortandlongline.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/cert-shortline.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/cert-threecolumn.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/cert-trailingwhitespace.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/cert.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/csr.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/dsa-1023line.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/dsa-1024line.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/dsa-1025line.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/dsa-255line.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/dsa-256line.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/dsa-257line.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/dsa-blankline.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/dsa-comment.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/dsa-corruptedheader.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/dsa-corruptiv.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/dsa-earlypad.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/dsa-extrapad.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/dsa-infixwhitespace.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/dsa-junk.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/dsa-leadingwhitespace.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/dsa-longline.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/dsa-misalignedpad.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/dsa-onecolumn.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/dsa-oneline.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/dsa-onelineheader.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/dsa-shortandlongline.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/dsa-shortline.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/dsa-threecolumn.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/dsa-trailingwhitespace.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/dsa.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/dsaparam.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/key.pem [new file with mode: 0644]
test/recipes/04-test_pem_data/wellknown [new file with mode: 0644]