From 358ca5a6a801bc18759b766ef2c1f9d85b849a4a Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Mon, 24 Jun 2019 21:25:35 -0700 Subject: [PATCH] removes +join from :acme and lib/pkcs, uses en-turf:html --- app/acme.hoon | 26 +++++++++++++++++--------- lib/pkcs.hoon | 20 +++----------------- 2 files changed, 20 insertions(+), 26 deletions(-) diff --git a/app/acme.hoon b/app/acme.hoon index a62f39b43..f5fbdfdb0 100644 --- a/app/acme.hoon +++ b/app/acme.hoon @@ -12,6 +12,14 @@ :: ++ de-base64url ~(de base64 | &) +:: +join-turf +:: +++ join-turf + |= hot=(list turf) + ^- cord + %+ rap 3 + %- (bake join ,[cord wain]) + [', ' (turn hot en-turf:html)] :: |octn: encode/decode unsigned atoms as big-endian octet stream :: ++ octn @@ -457,8 +465,8 @@ ?~ rod :: XX shouldn't happen :: - (join '.' /network/arvo/(crip +:(scow %p our.bow))) - (join ', ' (turn ~(tap in dom.u.rod) |=(a=turf (join '.' a)))) + (en-turf:html /network/arvo/(crip +:(scow %p our.bow))) + (join-turf ~(tap in dom.u.rod)) '. retrying in ~d7.' == (emit (notify msg ~)) @@ -474,7 +482,7 @@ ' too many certificates issued for ' :: XX get from detail :: - (join '.' /network/arvo) + (en-turf:html /network/arvo) '. retrying in ' (scot %dr lul) '.' == @@ -588,7 +596,7 @@ :- %a %+ turn ~(tap in ~(key by `(map turf *)`u.next-order)) - |=(a=turf [%o (my type+s+'dns' value+s+(join '.' a) ~)]) + |=(a=turf [%o (my type+s+'dns' value+s+(en-turf:html a) ~)]) == =/ wire-params [try %new-order /(scot %da now.bow)] (stateful-request wire-params new-order.dir json) @@ -762,7 +770,7 @@ =/ msg=cord %+ rap 3 :~ 'unable to reach ' (scot %p our.bow) - ' via http at ' (join '.' turf.i.item) ':80' + ' via http at ' (en-turf:html turf.i.item) ':80' == (emit(next-order ~) (notify msg [(sell !>(rep)) ~])) ?: ?=(~ (skip ~(val by u.next-order) |=([@ud valid=?] valid))) @@ -957,7 +965,7 @@ => =/ msg=cord %+ rap 3 :~ 'received https certificate for ' - (join ', ' (turn ~(tap in dom.u.liv) |=(a=turf (join '.' a)))) + (join-turf ~(tap in dom.u.liv)) == (emit (notify msg ~)) :: set renewal timer, install certificate in %eyre @@ -1029,7 +1037,7 @@ =/ msg=cord %+ rap 3 :~ 'unable to retrieve self-hosted domain validation token ' - 'via ' (join '.' dom.aut) '. ' + 'via ' (en-turf:html dom.aut) '. ' 'please confirm your urbit has network connectivity.' == (emit (notify msg [(sell !>(rep)) ~])) @@ -1260,7 +1268,7 @@ ~& [%cert `wain`cer.u.liv] ~& [%expires exp.u.liv] ~& :- %domains - (join ', ' (turn ~(tap in dom.u.liv) |=(a=turf (join '.' a)))) + (join-turf ~(tap in dom.u.liv)) this :: %dbug-history @@ -1382,7 +1390,7 @@ =/ msg=cord %+ rap 3 :~ 'requesting an https certificate for ' - (join ', ' (turn ~(tap in dom) |=(a=turf (join '.' a)))) + (join-turf ~(tap in dom)) == (emit (notify msg ~)) :: if registered, create order diff --git a/lib/pkcs.hoon b/lib/pkcs.hoon index 8bbd09599..7b72452bc 100644 --- a/lib/pkcs.hoon +++ b/lib/pkcs.hoon @@ -3,20 +3,6 @@ =* rsa primitive-rsa :::: %/lib/pkcs |% -:: +join: join list of cords with separator -:: -:: XX move to zuse? -:: -++ join - |= [sep=@t hot=(list @t)] - ^- @t - =| out=(list @t) - ?> ?=(^ hot) - |- ^- @t - ?~ t.hot - (rap 3 [i.hot out]) - $(out [sep i.hot out], hot t.hot) -:: :: +rs256: RSA signatures over a sha-256 digest :: ++ rs256 @@ -312,7 +298,7 @@ => |% :: +csr:pkcs10: certificate request :: - += csr [key=key:rsa hot=(list (list @t))] + +$ csr [key=key:rsa hot=(list turf)] -- |% :: |spec:pkcs10: ASN.1 specs for certificate signing requests @@ -362,13 +348,13 @@ :: +san:en:spec:pkcs10: subject-alternate-names :: ++ san - |= hot=(list (list @t)) + |= hot=(list turf) ^- spec:asn1 :- %seq %+ turn hot :: implicit, context-specific tag #2 (IA5String) :: XX sanitize string? - |=(h=(list @t) [%con `bespoke:asn1`[& 2] (rip 3 (join '.' h))]) + |=(=turf [%con `bespoke:asn1`[& 2] (trip (en-turf:html turf))]) -- :: |de:spec:pkcs10: ASN.1 decoding for certificate signing requests ++ de !!