Skip to content

Commit

Permalink
zen.pem: extend
Browse files Browse the repository at this point in the history
- add an unknown section that is base64
- add an unknown section that is not base64
- add an SPKI

Delete unused zen2.pem (which was two copies of zen.pem
originally, but fell out of sync and is now unreferenced).
  • Loading branch information
ctz committed Sep 18, 2024
1 parent baa6e33 commit 583d68f
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 241 deletions.
27 changes: 27 additions & 0 deletions tests/data/zen.pem
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ z5b9HjkOxffbtCZhWGg+bnxuD6wwHwYDVR0jBBgwFoAUz5b9HjkOxffbtCZhWGg+
bnxuD6wwDwYDVR0TAQH/BAUwAwEB/zAFBgMrZXADQQBNlt7z4bZ7KhzecxZEe3i5
lH9MRqbpP9Rg4HyzAJfTzFGT183HoJiISdPLbxwMn0KaqSGlVe+9GgNKswoaRAwH
-----END CERTIFICATE-----
-----BEGIN ZEN MASTER JOKE-----
QSBaZW4gbWFzdGVyIHZpc2l0aW5nIE5ldyBZb3JrIENpdHkgZ29lcyB1cCB0byBhIGhvdCBkb2cg
dmVuZG9yIGFuZCBzYXlzLCAiTWFrZSBtZSBvbmUgd2l0aCBldmVyeXRoaW5nLiIKVGhlIGhvdCBk
b2cgdmVuZG9yIGZpeGVzIGEgaG90IGRvZyBhbmQgaGFuZHMgaXQgdG8gdGhlIFplbiBtYXN0ZXIs
IHdobyBwYXlzIHdpdGggYSAkMjAgYmlsbC4KVGhlIHZlbmRvciBwdXRzIHRoZSBiaWxsIGluIHRo
ZSBjYXNoIGJveCBhbmQgY2xvc2VzIGl0LiAiRXhjdXNlIG1lLCBidXQgd2hlcmUncyBteSBjaGFu
Z2U/IiBhc2tzIHRoZSBaZW4gbWFzdGVyLgpUaGUgdmVuZG9yIHJlc3BvbmRzLCAiQ2hhbmdlIG11
c3QgY29tZSBmcm9tIHdpdGhpbi4iCg==
-----END ZEN MASTER JOKE-----
-----BEGIN CERTIFICATE-----
MIIEnzCCAoegAwIBAgIBezANBgkqhkiG9w0BAQsFADAaMRgwFgYDVQQDDA9wb255
dG93biBSU0EgQ0EwHhcNMTkwNjA5MTcxNTEyWhcNMjkwNjA2MTcxNTEyWjAsMSow
Expand Down Expand Up @@ -57,6 +66,10 @@ H+tAI/OfdZuNUCES00F5UAFdU8zBUZo19ao2ZqfEADimE7Epk2s0bUe4GSqEXJp6
68oVSMhZmMf/RCSNlr97f34sNiUA1YJ0JbCRZmw8KWNm9H1PARLbrgeRBZ/k31Li
WLDr3fiEVk7SGxj3zo94cS6AT55DyXLiSD/bFmL1QXgZweA=
-----END CERTIFICATE-----
-----BEGIN NOT SUPPORTED-----
This is not required to be valid base64, it should be exactly
ignored.
-----END NOT SUPPORTED-----
-----BEGIN EC PARAMETERS-----
BggqhkjOPQMBBw==
-----END EC PARAMETERS-----
Expand All @@ -70,6 +83,20 @@ MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgxoDtsWuMMMFKKTTn
tsgqjtRBclk3Asr0CNhlDvIhYWWhRANCAATG7Rn/DydAlkBd45c6dm6f0eJmxxj0
f8rBhxel5ke75/0/2Y5QSQflnRq/4kq3OEWymOeA0tWBZyOUDUvkAkt0
-----END PRIVATE KEY-----
-----BEGIN PUBLIC KEY-----
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAqIh8FTj9DIgI8DAoCBh+
6UXOfaWkvNaGZx2GwXl4WDAa/ZSE5/8ofg/6V59bmk9yry57UR4F+blscBvE4g3U
dTvWJOBRD900l21vwpDLKzZguyGOCmKwJu3vCnAQKzBRXW5sDgvO67GeU6kpaic9
LYPYnYaoxCRTYTZu0wy72rW5G0Fe8Gg/duJmUH7vqGIZupTTVzIBMbFVPBMJqprT
MStDhaUL0JiAz0ZgTeNLRIBZWV9mY4PG3rZtbV0BZGR1ipAq9xfgqJcURCcKl/ZT
UMtzvgk8s5hYkIJX0ZL3qsfdM4BMgIFhHq/GisQKbbu9kWldBrxQylOwa6r0m3Jv
KJX2ViDSORndaCz2sppmVx5HDHnj+Bw381yawphnpumP3BJK4iof//uYKvfdc4RC
y2EXL8PYPsT5DMB0jaBt92ytR5sLhn8Sl9Hk0buN4IjrYPISrdhS45xQXUqxcp9O
9hcU+rSaQyZ45cj+VlWhKq8MDvGvaAONBFSEh01mnUwoJObsAZNVFVtuOkwAli0F
kGouMycQY1BGscpdC516Nya361Hk/ICyby2Y0BJrrVGaSM6poXH9yEjglzAdtSDb
Cvhn/zlAI5ltm4Nv2qTgYBDns5JRGVhBym6RbbZ1C/KfCgn0hOxiw3N7AN4d0K5n
LI6p7U9RnNVbWgbqsuoxBtkCAwEAAQ==
-----END PUBLIC KEY-----
-----BEGIN RSA PRIVATE KEY-----
MIICXAIBAAKBgQC1Dt8tFmGS76ciuNXvk/QRrV8wCcArWxvl7Ku0aSQXgcFBAav6
P5RD8b+dC9DihSu/r+6OOfjsAZ6oKCq3OTUfmoUhLpoBomxPczJgLyyLD+nQkp5q
Expand Down
236 changes: 0 additions & 236 deletions tests/data/zen2.pem

This file was deleted.

11 changes: 6 additions & 5 deletions tests/pem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,17 +181,18 @@ fn parse_in_order() {
let items = pem::Item::iter_from_buf(&mut BufReader::new(&data[..]))
.collect::<Result<Vec<_>, _>>()
.unwrap();
assert_eq!(items.len(), 10);
assert_eq!(items.len(), 11);
assert!(matches!(items[0], pem::Item::X509Certificate(_)));
assert!(matches!(items[1], pem::Item::X509Certificate(_)));
assert!(matches!(items[2], pem::Item::X509Certificate(_)));
assert!(matches!(items[3], pem::Item::X509Certificate(_)));
assert!(matches!(items[4], pem::Item::Sec1Key(_)));
assert!(matches!(items[5], pem::Item::Pkcs8Key(_)));
assert!(matches!(items[6], pem::Item::Pkcs1Key(_)));
assert!(matches!(items[7], pem::Item::Pkcs8Key(_)));
assert!(matches!(items[8], pem::Item::Crl(_)));
assert!(matches!(items[9], pem::Item::Csr(_)));
assert!(matches!(items[6], pem::Item::SubjectPublicKeyInfo(_)));
assert!(matches!(items[7], pem::Item::Pkcs1Key(_)));
assert!(matches!(items[8], pem::Item::Pkcs8Key(_)));
assert!(matches!(items[9], pem::Item::Crl(_)));
assert!(matches!(items[10], pem::Item::Csr(_)));
}

#[test]
Expand Down

0 comments on commit 583d68f

Please sign in to comment.