Skip to content

Commit

Permalink
separate folder for oids
Browse files Browse the repository at this point in the history
  • Loading branch information
5HT committed Oct 28, 2024
1 parent e8fbbf7 commit b6583b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/services/est.ex
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ defmodule CA.EST do
def csrattributes() do
{:ok, bin} = :"EST".encode(:CsrAttrs, [
oid: CA.AT.oid(:"id-at-challengePassword"),
oid: CA.X962.oid(:"id-ds-ecdsa-with-SHA384")
oid: CA.X962.oid(:"id-ds-ecdsa-with-SHA384"),
attribute: {:Attribute, CA.X962.oid(:"id-kt-ecPublicKey"), [objectIdentifier(CA.ALG.oid(:secp384r1))] },
attribute: {:Attribute, CA.AT.oid(:"id-at-rsaEncryption"), [integer(4096)]},
attribute: {:Attribute, CA.AT.oid(:"id-at-extensionRequest"), [
Expand All @@ -42,7 +42,7 @@ defmodule CA.EST do
CA.KP.oid(:"id-kp-clientAuth"),
CA.KP.oid(:"id-kp-codeSigning"),
CA.KP.oid(:"id-kp-emailProtection") ])})
]},
]}
])
bin
end
Expand Down
2 changes: 1 addition & 1 deletion lib/services/http/get.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ defmodule CA.EST.Get do
def get(conn, [], "Authority" = type, [] = id, "ABAC" = spec) do
:io.format 'CSRATTRS: GET/4:#{type}/#{id}/#{spec}', []
bin = CA.EST.csrattributes()
base64 = :base64.encode bin <> "\r\n\r\n"
base64 = :base64.encode(bin)
conn |> put_resp_content_type("application/csrattrs")
|> put_resp_header("Content-Transfer-Encoding", "base64")
|> put_resp_header("Content-Length", :erlang.integer_to_binary(:erlang.size(base64)))
Expand Down

0 comments on commit b6583b8

Please sign in to comment.