From b6583b86b7b1108c26b7992638ce8de077058d1a Mon Sep 17 00:00:00 2001 From: 5HT Date: Mon, 28 Oct 2024 11:28:50 +0200 Subject: [PATCH] separate folder for oids --- lib/services/est.ex | 4 ++-- lib/services/http/get.ex | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/services/est.ex b/lib/services/est.ex index 6f614a9..50564a9 100644 --- a/lib/services/est.ex +++ b/lib/services/est.ex @@ -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"), [ @@ -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 diff --git a/lib/services/http/get.ex b/lib/services/http/get.ex index f925e33..6141690 100644 --- a/lib/services/http/get.ex +++ b/lib/services/http/get.ex @@ -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)))