mirror of
https://github.com/urbit/shrub.git
synced 2024-12-12 10:29:01 +03:00
adds life-mismatch checks to pre-boot validation
This commit is contained in:
parent
345cc92578
commit
7269c09771
@ -8117,6 +8117,10 @@
|
|||||||
::
|
::
|
||||||
?~ net.hull
|
?~ net.hull
|
||||||
[%| %parent-not-keyed]
|
[%| %parent-not-keyed]
|
||||||
|
:: life must match parent's
|
||||||
|
::
|
||||||
|
?. =(lyf.seed life.u.net.hull)
|
||||||
|
[%| %life-mismatch]
|
||||||
=/ loy (com:nu:crub:crypto pass.u.net.hull)
|
=/ loy (com:nu:crub:crypto pass.u.net.hull)
|
||||||
=/ hax (shaf %earl (sham who.seed lyf.seed pub:ex:cub))
|
=/ hax (shaf %earl (sham who.seed lyf.seed pub:ex:cub))
|
||||||
:: the signature must be valid
|
:: the signature must be valid
|
||||||
@ -8138,6 +8142,10 @@
|
|||||||
::
|
::
|
||||||
?. =(pub:ex:cub pass.u.net.hull)
|
?. =(pub:ex:cub pass.u.net.hull)
|
||||||
[%| %key-mismatch]
|
[%| %key-mismatch]
|
||||||
|
:: life must match the contract
|
||||||
|
::
|
||||||
|
?. =(lyf.seed life.u.net.hull)
|
||||||
|
[%| %life-mismatch]
|
||||||
:: the boot life must be greater than and discontinuous with
|
:: the boot life must be greater than and discontinuous with
|
||||||
:: the last seen life (per the sponsor)
|
:: the last seen life (per the sponsor)
|
||||||
::
|
::
|
||||||
|
@ -168,6 +168,12 @@
|
|||||||
!> [%| %key-mismatch]
|
!> [%| %key-mismatch]
|
||||||
!> (veri:dawn sed hul ~)
|
!> (veri:dawn sed hul ~)
|
||||||
::
|
::
|
||||||
|
++ test-veri-life-mismatch
|
||||||
|
=/ sed [~zod 2 sec ~]
|
||||||
|
%+ expect-eq
|
||||||
|
!> [%| %life-mismatch]
|
||||||
|
!> (veri:dawn sed hul ~)
|
||||||
|
::
|
||||||
++ test-veri-already-booted
|
++ test-veri-already-booted
|
||||||
=/ sed [~zod 1 sec ~]
|
=/ sed [~zod 1 sec ~]
|
||||||
;: weld
|
;: weld
|
||||||
@ -213,6 +219,18 @@
|
|||||||
!> [%| %parent-not-keyed]
|
!> [%| %parent-not-keyed]
|
||||||
!> (veri:dawn sed =>(hul .(net ~)) ~)
|
!> (veri:dawn sed =>(hul .(net ~)) ~)
|
||||||
::
|
::
|
||||||
|
++ test-veri-earl-life-mismatch
|
||||||
|
=/ cub (pit:nu:crub:crypto 24 %foo)
|
||||||
|
=/ who ~simtel-mithet-dozzod-dozzod
|
||||||
|
=/ sed
|
||||||
|
=/ sig
|
||||||
|
%- sign:as:(nol:nu:crub:crypto sec)
|
||||||
|
(shaf %earl (sham who 1 pub:ex:cub))
|
||||||
|
[who 2 sec:ex:cub `sig]
|
||||||
|
%+ expect-eq
|
||||||
|
!> [%| %life-mismatch]
|
||||||
|
!> (veri:dawn sed hul ~)
|
||||||
|
::
|
||||||
++ test-veri-earl-invalid-sig
|
++ test-veri-earl-invalid-sig
|
||||||
=/ cub (pit:nu:crub:crypto 24 %foo)
|
=/ cub (pit:nu:crub:crypto 24 %foo)
|
||||||
=/ who ~simtel-mithet-dozzod-dozzod
|
=/ who ~simtel-mithet-dozzod-dozzod
|
||||||
|
Loading…
Reference in New Issue
Block a user