openssl/test/recipes/04-test_pem_data/cert-onecolumn.pem
Benjamin Kaduk e8cee55718 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)
2017-02-28 21:23:26 +01:00

1646 lines
3.3 KiB
Text

-----BEGIN CERTIFICATE-----
M
I
I
E
z
D
C
C
A
7
Q
C
C
Q
C
g
x
k
R
o
x
+
Y
l
j
j
A
N
B
g
k
q
h
k
i
G
9
w
0
B
A
Q
s
F
A
D
C
C
A
S
Y
x
Y
z
B
h
B
g
N
V
B
A
g
M
W
l
R
o
Z
S
B
H
c
m
V
h
d
C
B
T
d
G
F
0
Z
S
B
v
Z
i
B
M
b
2
5
n
L
V
d
p
b
m
R
l
Z
C
B
D
Z
X
J
0
a
W
Z
p
Y
2
F
0
Z
S
B
G
a
W
V
s
Z
C
B
O
Y
W
1
l
c
y
B
X
a
G
V
y
Z
W
J
5
I
H
R
v
I
E
l
u
Y
3
J
l
Y
X
N
l
I
H
R
o
Z
S
B
P
d
X
R
w
d
X
Q
g
U
2
l
6
Z
T
E
f
M
B
0
G
A
1
U
E
B
w
w
W
V
G
9
v
b
W
F
u
e
W
N
o
Y
X
J
h
Y
3
R
l
c
n
N
2
a
W
x
s
Z
T
F
I
M
E
Y
G
A
1
U
E
C
g
w
/
V
G
h
l
I
E
J
l
b
m
V
2
b
2
x
l
b
n
Q
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