ames, gall: strip sigpams, re-enable key checking

This commit is contained in:
Liam Fitzgerald 2023-09-26 09:50:53 +01:00
parent 754215f9ae
commit 9a3daeb646
2 changed files with 4 additions and 33 deletions

View File

@ -2946,7 +2946,6 @@
++ on-plug ++ on-plug
|= [vane=term =path] |= [vane=term =path]
^+ event-core ^+ event-core
~& plug/[vane path]
=/ key=@ (shaz eny) :: TODO: check key width =/ key=@ (shaz eny) :: TODO: check key width
=/ num=@ud =/ num=@ud
?~ latest=(pry:on:chain chain.ames-state) ?~ latest=(pry:on:chain chain.ames-state)
@ -2981,9 +2980,7 @@
++ on-keen ++ on-keen
|= [sec=(unit [idx=@ key=@]) spar] |= [sec=(unit [idx=@ key=@]) spar]
^+ event-core ^+ event-core
~& path/path
=? path ?=(^ sec) =? path ?=(^ sec)
=- ~&(new-path/- -)
=/ enc (scot %uv (~(en cbcc:aes:crypto [key.u.sec 0]) (spat path))) =/ enc (scot %uv (~(en cbcc:aes:crypto [key.u.sec 0]) (spat path)))
/a/e/(scot %ud idx.u.sec)/[enc] /a/e/(scot %ud idx.u.sec)/[enc]
=+ ~:(spit path) :: assert length =+ ~:(spit path) :: assert length
@ -5494,14 +5491,6 @@
:: so we need to give it the right shape :: so we need to give it the right shape
:: ::
?~ blk=(de-path-soft:balk pax.tyl) ~ ?~ blk=(de-path-soft:balk pax.tyl) ~
~& blk/blk
=- ~& :- %result
?- -
~ ~
[~ ~] [~ ~]
[~ ~ ^] (scag 500 (text q.u.u.-))
==
-
:: ::
?. ?& =(our her.u.blk) ?. ?& =(our her.u.blk)
=(rift.ames-state rif.u.blk) =(rift.ames-state rif.u.blk)
@ -5532,20 +5521,15 @@
:: ::
%a %a
=/ kyr ?@(vis.nom (rsh 3 vis.nom) car.vis.nom) =/ kyr ?@(vis.nom (rsh 3 vis.nom) car.vis.nom)
~& kyr/kyr
?. =(kyr %e) ?. =(kyr %e)
~ ~
~& nom
?. ?=(%ud -.r.bem.nom) ?. ?=(%ud -.r.bem.nom)
[~ ~] [~ ~]
=/ key =/ key
(got:on:chain chain.ames-state p.r.bem.nom) (got:on:chain chain.ames-state p.r.bem.nom)
~& key/key
?~ new=(shutter key.key) ?~ new=(shutter key.key)
[~ ~] [~ ~]
~& new/(as-omen:balk u.new)
=/ res (rof ~ /ames (as-omen:balk u.new)) =/ res (rof ~ /ames (as-omen:balk u.new))
~& res/res
%- en-hunk %- en-hunk
(handle-shut spr.u.new p.r.bem.nom res) (handle-shut spr.u.new p.r.bem.nom res)
:: ::
@ -5563,7 +5547,6 @@
?~ raw=(slaw %uv q.bem.nom) ?~ raw=(slaw %uv q.bem.nom)
~ ~
=/ txt `@t`(de:(aes key) `@t`u.raw) =/ txt `@t`(de:(aes key) `@t`u.raw)
~& txt/txt
?~ pat=`(unit path)`(rush txt stap) ?~ pat=`(unit path)`(rush txt stap)
~ ~
(de-path-soft:balk (welp /(scot %p our)/(scot %ud 0)/(scot %ud 1) u.pat)) (de-path-soft:balk (welp /(scot %p our)/(scot %ud 0)/(scot %ud 1) u.pat))
@ -5573,7 +5556,6 @@
?. ?=([~ ~ *] value) ?. ?=([~ ~ *] value)
~& %bailing-close ~& %bailing-close
value value
~& close/[key-idx chain.ames-state]
?~ key=(get:on:chain chain.ames-state key-idx) ?~ key=(get:on:chain chain.ames-state key-idx)
~ ~
``noun+!>((en:(aes key.u.key) (jam [p q.q]:u.u.value))) ``noun+!>((en:(aes key.u.key) (jam [p q.q]:u.u.value)))
@ -5581,7 +5563,6 @@
++ check-key ++ check-key
|= [=path key-idx=@] |= [=path key-idx=@]
^- ? ^- ?
~& check-key/path
=. path =. path
=> .(path `(pole knot)`path) => .(path `(pole knot)`path)
?. ?=([van=@ car=@ cas=@ app=@ sig=@ rest=*] path) ?. ?=([van=@ car=@ cas=@ app=@ sig=@ rest=*] path)
@ -5591,7 +5572,6 @@
| |
=/ gol path.u.link =/ gol path.u.link
|- ^- ? |- ^- ?
~& comparing/[path gol]
?~ gol & ?~ gol &
?~ path | ?~ path |
?. =(i.path i.gol) ?. =(i.path i.gol)
@ -5601,9 +5581,9 @@
++ handle-shut ++ handle-shut
|= [=path key-idx=@ value=(unit (unit cage))] |= [=path key-idx=@ value=(unit (unit cage))]
^- (unit (unit cage)) ^- (unit (unit cage))
:: ?. (check-key path key-idx) ?. (check-key path key-idx)
:: ~& key-validation-failed/[path key-idx ~(key by chain.ames-state)] ~& key-validation-failed/[path key-idx ~(key by chain.ames-state)]
:: ~ ~
(close key-idx value) (close key-idx value)
:: ::
++ en-hunk-shut ++ en-hunk-shut

View File

@ -275,6 +275,7 @@
|= [seg=@ta f=^farm] |= [seg=@ta f=^farm]
^- (list [path plot]) ^- (list [path plot])
tap-plot(wer (snoc wer seg), farm f) tap-plot(wer (snoc wer seg), farm f)
::
++ run-plot ++ run-plot
|* fun=gate |* fun=gate
%- ~(gas by *(map path _(fun))) %- ~(gas by *(map path _(fun)))
@ -781,7 +782,6 @@
++ mo-handle-key ++ mo-handle-key
~/ %mo-handle-stub ~/ %mo-handle-stub
|= [=(pole knot) syn=sign-arvo] |= [=(pole knot) syn=sign-arvo]
~& mo-handle-key/pole
?. ?=([agent=@ nonce=@ rest=*] pole) ?. ?=([agent=@ nonce=@ rest=*] pole)
~& [%mo-handle-key-bad-wire wire] ~& [%mo-handle-key-bad-wire wire]
!! !!
@ -1063,7 +1063,6 @@
++ mo-handle-key-request ++ mo-handle-key-request
|= [=ship agent-name=term =path] |= [=ship agent-name=term =path]
^+ mo-core ^+ mo-core
~& key-req/[ship agent-name path]
=/ yok=(unit yoke) (~(get by yokes.state) agent-name) =/ yok=(unit yoke) (~(get by yokes.state) agent-name)
?. ?=([~ %live *] yok) ?. ?=([~ %live *] yok)
(mo-give %done ~) (mo-give %done ~)
@ -1200,7 +1199,6 @@
?. ?=([%g %x cas=@ app=@ rest=*] pole) ?. ?=([%g %x cas=@ app=@ rest=*] pole)
~& malformed-path/pole ~& malformed-path/pole
ap-core ap-core
~& pole/pole
=. pen.yoke (~(put by pen.yoke) [ship pole] wire) =. pen.yoke (~(put by pen.yoke) [ship pole] wire)
=/ =plea:ames [%g /gk/[app.pole] rest.pole] =/ =plea:ames [%g /gk/[app.pole] rest.pole]
=/ out=^wire (welp /key/[agent-name]/[run-nonce.yoke]/bod/(scot %p ship) pole) =/ out=^wire (welp /key/[agent-name]/[run-nonce.yoke]/bod/(scot %p ship) pole)
@ -1216,24 +1214,20 @@
=/ =ship (slav %p i.wire) =/ =ship (slav %p i.wire)
?+ syn ~|(weird-sign-ap-take-brood/-.syn !!) ?+ syn ~|(weird-sign-ap-take-brood/-.syn !!)
[%ames %boon *] [%ames %boon *]
~& boon/wire
=+ bod=((soft ,brood) payload.syn) =+ bod=((soft ,brood) payload.syn)
?~ bod :: TODO: what happens ?~ bod :: TODO: what happens
~& weird-take-brood/payload.syn !! ~& weird-take-brood/payload.syn !!
=/ key key.lock.u.bod =/ key key.lock.u.bod
=/ out=^wire (~(got by pen.yoke) [ship t.wire]) =/ out=^wire (~(got by pen.yoke) [ship t.wire])
~& sending-keen/[out t.wire]
(ap-pass out %arvo %a %keen `[idx key]:lock.u.bod ship t.wire) (ap-pass out %arvo %a %keen `[idx key]:lock.u.bod ship t.wire)
:: ::
[%ames %done *] [%ames %done *]
~& acked-brood/[t.wire syn]
ap-core ap-core
== ==
:: ::
++ ap-serve-brood ++ ap-serve-brood
|= [=ship =(pole knot)] |= [=ship =(pole knot)]
^- [(unit brood) _mo-core] ^- [(unit brood) _mo-core]
~& serve-pole/pole
?. ?=([%$ rest=*] pole) ?. ?=([%$ rest=*] pole)
`ap-abet `ap-abet
?~ cop=(ap-match-coop rest.pole) ?~ cop=(ap-match-coop rest.pole)
@ -2267,7 +2261,6 @@
=/ =path path.plea.task =/ =path path.plea.task
=/ =noun payload.plea.task =/ =noun payload.plea.task
:: ::
~& plea/[ship=ship plea-path=path]
?: ?=([%gk @ ~] path) ?: ?=([%gk @ ~] path)
=/ agent-name i.t.path =/ agent-name i.t.path
=< mo-abet =< mo-abet
@ -2683,7 +2676,6 @@
``case/!>(ud/key.u.las) ``case/!>(ud/key.u.las)
:: ::
?: ?=(%x care) ?: ?=(%x care)
~& bem/bem
?. =(p.bem our) ~ ?. =(p.bem our) ~
:: ::
?: ?=(%$ q.bem) :: app %$ reserved ?: ?=(%$ q.bem) :: app %$ reserved
@ -2715,7 +2707,6 @@
:: ::
?~ yok=(~(get by yokes.state) q.bem) ~ ?~ yok=(~(get by yokes.state) q.bem) ~
?: ?=(%nuke -.u.yok) ~ ?: ?=(%nuke -.u.yok) ~
~& path/path
?~ ski=(~(get of:farm sky.u.yok) path) ?~ ski=(~(get of:farm sky.u.yok) path)
~ ~
=/ res=(unit (each page @uvI)) =/ res=(unit (each page @uvI))