Skip to content

Commit

Permalink
log rdn subj on enroll
Browse files Browse the repository at this point in the history
  • Loading branch information
5HT committed Nov 7, 2024
1 parent ccbf972 commit 269f95f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/services/cmp.ex
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,13 @@ defmodule CA.CMP do
end

def message(socket, header, {:p10cr, csr} = body, code) do
{:PKIHeader, pvno, from, to, messageTime, protectionAlg, senderKID, _recipKID,
{:PKIHeader, pvno, from, to, messageTime, protectionAlg, _senderKID, _recipKID,
transactionID, senderNonce, _recipNonce, _freeText, _generalInfo} = header
true = code == validateProtection(header, body, code)
:logger.info 'P10CR ~p~n', [senderKID]

{ca_key, ca} = CA.CSR.read_ca()
subject = X509.CSR.subject(csr)
:logger.info 'P10CR ~tp~n', [CA.CRT.rdn(subject)]
true = X509.CSR.valid?(parseSubj(csr))
cert = X509.Certificate.new(X509.CSR.public_key(csr), CA.CRT.subj(subject), ca, ca_key,
extensions: [subject_alt_name: X509.Certificate.Extension.subject_alt_name(["synrc.com"]) ])
Expand Down
2 changes: 2 additions & 0 deletions lib/services/est.ex
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ defmodule CA.EST do
post "/.well-known/est/serverkeygen" do CA.EST.Post.post(conn, [], "Authority", [], "KEYGEN") end
post "/.well-known/est/fullcmc" do CA.EST.Post.post(conn, [], "Authority", [], "CMC") end

post "/.well-known/cmp/p/:profile" do CA.EST.Post.post(conn, [], "Authority", [], "CMC") end

# See Page 36 of RFC 7030
# [1] https://www.rfc-editor.org/rfc/rfc7030
# [2] https://www.ietf.org/archive/id/draft-ietf-lamps-rfc7030-csrattrs-07.html
Expand Down

0 comments on commit 269f95f

Please sign in to comment.