Skip to content

Commit

Permalink
CA-404640 XSI-1781 accept in PEM key/cert in any order
Browse files Browse the repository at this point in the history
We have so far hard-coded the exectation that in a PEM file a private
key is followed by a certficate but this is actually not required by the
PEM standard and let to a failure in XSI-1781.

This is a simple fix first collects all keys and certificates while
skipping over other content and the uses the first key and certificate.

Signed-off-by: Christian Lindig <[email protected]>
  • Loading branch information
Christian Lindig committed Jan 16, 2025
1 parent f58d8d3 commit aac5802
Show file tree
Hide file tree
Showing 7 changed files with 423 additions and 13 deletions.
45 changes: 34 additions & 11 deletions ocaml/gencert/pem.ml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ let data = take_while1 is_data

type kind = RSA | EC | OTHER

type block = Key of string | Cert of string

let fail_fmt fmt = Printf.ksprintf (fun str -> fail str) fmt

let kind =
string " RSA " *> return RSA
<|> string " EC " *> return EC
Expand Down Expand Up @@ -60,24 +64,39 @@ let key =
key_footer kind *> return (String.concat "" [header kind; body; footer kind])
<?> "key"

let line = take_till is_eol *> end_of_line

(* try to read a key, or skip a line and try again *)
let until_key = fix (fun m -> key <|> line *> m) <?> "until_key"

let cert =
cert_header >>= fun hd ->
data >>= fun body ->
cert_footer >>= fun tl -> return (String.concat "" [hd; body; tl]) <?> "cert"

(* try to read a cert, or skip a line and try again *)
let until_cert = fix (fun m -> cert <|> line *> m) <?> "until_cert"
let line = take_till is_eol *> end_of_line

let any_block =
cert >>= (fun c -> return (Cert c)) <|> (key >>= fun k -> return (Key k))

(* this skips over junk until we succeed finding the next block *)
let block = fix (fun m -> any_block <|> line *> m) <?> "until_block"

(* collect and tag all blocks *)
let blocks = many block <?> "PEM blocks"

(* decompose blocks into certs and keys *)
let pem =
until_key >>= fun private_key ->
until_cert >>= fun host_cert ->
many until_cert >>= fun other_certs ->
many end_of_line *> return {private_key; host_cert; other_certs} <?> "pem"
let ( let* ) = ( >>= ) in
let strip = function Cert c -> c | Key k -> k in
blocks >>= fun bs ->
match List.partition (function Key _ -> true | Cert _ -> false) bs with
| [Key k], Cert c :: xs ->
return {private_key= k; host_cert= c; other_certs= List.map strip xs}
| [_], [] ->
let* p = pos in
fail_fmt "PEM is lacking a certificate (at offset %d)" p
| [], _ ->
let* p = pos in
fail_fmt "PEM is missing a private key (at offset %d)" p
| _ :: _, _ ->
let* p = pos in
fail_fmt "PEM has more than one private key (at offset %d)" p

let defer f = Fun.protect ~finally:f

Expand All @@ -86,6 +105,10 @@ let read_file path =
defer (fun () -> close_in ic) @@ fun () ->
really_input_string ic (in_channel_length ic)

let _parse_with t path =
let consume = Consume.Prefix in
read_file path |> parse_string ~consume t

let parse_string str =
let consume = Consume.Prefix in
parse_string ~consume pem str
Expand Down
93 changes: 91 additions & 2 deletions ocaml/gencert/test_data/pems/fail-06.pem
Original file line number Diff line number Diff line change
@@ -1,4 +1,74 @@
-----BEGIN RSA PRIVATE KEY-----
This fails because we have two keys (rather than just one).

-----BEGIN CERTIFICATE-----
MIIC5jCCAc6gAwIBAgIIaYRSm3Q7zc8wDQYJKoZIhvcNAQELBQAwIDEeMBwGA1UE
AwwVbGN5Mi1kdDExMC54ZW5ydGNsb3VkMB4XDTIwMTAxNDE1NTc1MloXDTMwMTAx
MjE1NTc1MlowIDEeMBwGA1UEAwwVbGN5Mi1kdDExMC54ZW5ydGNsb3VkMIIBIjAN
BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA+5SOY1AKwqp3B7c3EhSvjiYFzL9e
gItLI7CypsVFQp5RJXp/9FRCMk1sLB3gfqMcQ5bhhPM4QfW0iK9wtcRxFILYI/oH
+vwNEJ5f3yBpIbjhbD6IaJcV1xpNkJD0JRqxPRUcRTRkKSLq9Hp4nqScOCvkjKgG
hlL3cFn3uOKWIzrJgEtyFixEXaY8XLqYLxy8BJ5PuM4Xsqafd4lb5qsK1/KJC4iS
WWqdXsOhICs3itpsPR1HneHdABigpAIYIcxk5fyLC8+EDjhXrK2OGsEMMytUsAbx
ePcQLjokW1EXc7fiuxrKDdJZuT/AsWZqw0h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AXghVsY3kyLWR0MTEwLnhlbnJ0Y2xvdWQwDQYJKoZIhvcN
AQELBQADggEBAHEkeEjHilXdVgQhD/z46prXObB26uO97yFUcUIalzhb/P3zmfjb
LFatTFn5jgienMmdP90uj7Ly1R6VOa+tX/o+XtSJaZwuNMtixv9qwo3nrFZdw8yF
GgsmbAR+1hu0TG3RNpDIiES4D3JmVP8MgmwLw1kN3cBVptx73lE3uc8vZnNtIDOl
erJb9fD3IOv/RZ78mxMnajZTHY5kg2e96d/a6HgY39vXMwycjp8wIE/+4g94fIc/
/a2+BGYjCWJZyoLgmHcXEU8fOxe9yUWbFQf0wnqsLJIqzaQU1w2w6mkh4+xsI/nA
JwFfXQKd3fzsvgmufpAbXt/AHljFvC/qjTI=
-----END CERTIFICATE-----

-----BEGIN CERTIFICATE-----
MIIC5jCCAc6gAwIBAgIIaYRSm3Q7zc8wDQYJKoZIhvcNAQELBQAwIDEeMBwGA1UE
Expand All @@ -47,3 +135,4 @@ erJb9fD3IOv/RZ78mxMnajZTHY5kg2e96d/a6HgY39vXMwycjp8wIE/+4g94fIc/
JwFfXQKd3fzsvgmufpAbXt/AHljFvC/qjTI=
-----END CERTIFICATE-----


File renamed without changes.
109 changes: 109 additions & 0 deletions ocaml/gencert/test_data/pems/pass-06.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
Multiple certificates and one key.

-----BEGIN CERTIFICATE-----
MIIC5jCCAc6gAwIBAgIIaYRSm3Q7zc8wDQYJKoZIhvcNAQELBQAwIDEeMBwGA1UE
AwwVbGN5Mi1kdDExMC54ZW5ydGNsb3VkMB4XDTIwMTAxNDE1NTc1MloXDTMwMTAx
MjE1NTc1MlowIDEeMBwGA1UEAwwVbGN5Mi1kdDExMC54ZW5ydGNsb3VkMIIBIjAN
BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA+5SOY1AKwqp3B7c3EhSvjiYFzL9e
gItLI7CypsVFQp5RJXp/9FRCMk1sLB3gfqMcQ5bhhPM4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fD3IOv/RZ78mxMnajZTHY5kg2e96d/a6HgY39vXMwycjp8wIE/+4g94fIc/
/a2+BGYjCWJZyoLgmHcXEU8fOxe9yUWbFQf0wnqsLJIqzaQU1w2w6mkh4+xsI/nA
JwFfXQKd3fzsvgmufpAbXt/AHljFvC/qjTI=
-----END CERTIFICATE-----


51 changes: 51 additions & 0 deletions ocaml/gencert/test_data/pems/pass-xsi-1781-reformat.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC7qKYiCfucgzLI
X78/NTAtFXA97Cp3PfnQwpi90tF0YmWUObOdVdxP2FHvUTyMhItpvimsvztX503D
C0Q7lI9/omK3AbPPy51lhRCKTMiz8ic2fmiHU9lePmkZMZJv0p/eHgAIcOmIl5Kc
uvoKvOutLnFTRKrYhUQMu2eyBz0f8rzY/4yhLLNflkQUJ3zc3W0jeMuAUei7Zmtz
jpj+s3Ll5rwzVYG3xLbndzpCR7NaP5uZcchByhsirohR90m3dQtrFdtLTkiDJ8vJ
hW7z3AzAA0Btw/CtH1/Ef/rHt3XHKGMJoJ3nQ2zRvSutdrRSAknNqYONe0hyrLvy
MRGno7SjAgMBAAECggEANHjKw1fRQAk7aOXE3xKrPt/wu4/Oq/rrYGEZPnK1WHqu
9oxP2d2JNdZBys4HRS9GoDGpC4GJQWIOz0vWL2ax3Tl1qsBSG/dOMnXLkzA3KoG6
TzV3WueqLvz6fC3tSVE2nG/9CF8yHZxsRWDOy7PZnloPG/5mWxagWYMJUrFNeSH2
nXd40Rff5uM43OzKtiOOzoKv2bKlKReyJVcI98MkyqSbUiie6qO1/NqrOUhq7rsV
zFmbtjy8UL4gXR2VVz0itb/w/iV/SDVHdMQ36obo8EM9eyxUFu4QPscrbK0FvjHV
lsKTnzu1zj/fm68NafXDy/KL5I9jethsj8ReNaQzoQKBgQDLkaIxBtNtAZfcFK7S
dXtR7fIQfU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