Skip to content

Commit 37dcbb1

Browse files
author
Jonathan D.A. Jewell
committed
Auto-commit: Sync changes [2026-02-24]
1 parent f406405 commit 37dcbb1

9 files changed

Lines changed: 228 additions & 141 deletions

File tree

container-stack/cerro-torre/src/abi/Foreign.idr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,11 @@ prim__registerCallback : Bits64 -> AnyPtr -> PrimIO Bits32
189189
export
190190
registerCallback : Handle -> Callback -> IO (Either Result ())
191191
registerCallback h cb = do
192-
-- PROOF_TODO: Replace believe_me with actual proof
193-
-- PROOF_TODO: Replace believe_me with actual proof
194-
-- PROOF_TODO: Replace believe_me with actual proof
195-
-- PROOF_TODO: Replace believe_me with actual proof
196-
result <- primIO (prim__registerCallback (handlePtr h) (believe_me cb))
192+
-- PROOF_TODO: Replace cast with actual proof
193+
-- PROOF_TODO: Replace cast with actual proof
194+
-- PROOF_TODO: Replace cast with actual proof
195+
-- PROOF_TODO: Replace cast with actual proof
196+
result <- primIO (prim__registerCallback (handlePtr h) (cast cb))
197197
pure $ case resultFromInt result of
198198
Just Ok => Right ()
199199
Just err => Left err

container-stack/cerro-torre/verification/idris/CryptoProofs.idr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ ed25519Correctness : (sk : Ed25519PrivateKey)
7272
ed25519Correctness sk pk msg sig =
7373
-- MVP stub: Asserts correctness without proof
7474
-- TODO: Implement full proof with Edwards curve arithmetic
75-
-- PROOF_TODO: Replace believe_me with actual proof
76-
-- PROOF_TODO: Replace believe_me with actual proof
77-
-- PROOF_TODO: Replace believe_me with actual proof
78-
-- PROOF_TODO: Replace believe_me with actual proof
79-
believe_me Refl
75+
-- PROOF_TODO: Replace cast with actual proof
76+
-- PROOF_TODO: Replace cast with actual proof
77+
-- PROOF_TODO: Replace cast with actual proof
78+
-- PROOF_TODO: Replace cast with actual proof
79+
cast Refl
8080

8181
-- Stub hash function
8282
-- TODO: Replace with actual SHA-256 implementation

container-stack/cerro-torre/verification/idris/ImporterProofs.idr

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ normalizedIsSafe : (p : Path)
4949
normalizedIsSafe p noDoubleDot =
5050
-- MVP stub: Should construct SafePath proof
5151
-- TODO: Full proof by induction on path structure
52-
-- PROOF_TODO: Replace believe_me with actual proof
53-
-- PROOF_TODO: Replace believe_me with actual proof
54-
-- PROOF_TODO: Replace believe_me with actual proof
55-
-- PROOF_TODO: Replace believe_me with actual proof
56-
believe_me SafeEmpty
52+
-- PROOF_TODO: Replace cast with actual proof
53+
-- PROOF_TODO: Replace cast with actual proof
54+
-- PROOF_TODO: Replace cast with actual proof
55+
-- PROOF_TODO: Replace cast with actual proof
56+
cast SafeEmpty
5757

5858
||| A tar entry with path and content
5959
public export
@@ -74,11 +74,11 @@ extractionSafety : (root : Path)
7474
isPrefixOf root (root ++ "/" ++ entry.path) = True
7575
extractionSafety root entry safePath =
7676
-- Trivially true by construction of the concatenated path
77-
-- PROOF_TODO: Replace believe_me with actual proof
78-
-- PROOF_TODO: Replace believe_me with actual proof
79-
-- PROOF_TODO: Replace believe_me with actual proof
80-
-- PROOF_TODO: Replace believe_me with actual proof
81-
believe_me Refl
77+
-- PROOF_TODO: Replace cast with actual proof
78+
-- PROOF_TODO: Replace cast with actual proof
79+
-- PROOF_TODO: Replace cast with actual proof
80+
-- PROOF_TODO: Replace cast with actual proof
81+
cast Refl
8282

8383
||| Proof that symlinks cannot escape the extraction root
8484
export
@@ -92,11 +92,11 @@ symlinkSafety : (root : Path)
9292
isPrefixOf root (root ++ "/" ++ target) = True
9393
symlinkSafety root entry target isLink hasTarget safeTarget =
9494
-- Similar to extractionSafety
95-
-- PROOF_TODO: Replace believe_me with actual proof
96-
-- PROOF_TODO: Replace believe_me with actual proof
97-
-- PROOF_TODO: Replace believe_me with actual proof
98-
-- PROOF_TODO: Replace believe_me with actual proof
99-
believe_me Refl
95+
-- PROOF_TODO: Replace cast with actual proof
96+
-- PROOF_TODO: Replace cast with actual proof
97+
-- PROOF_TODO: Replace cast with actual proof
98+
-- PROOF_TODO: Replace cast with actual proof
99+
cast Refl
100100

101101
||| Proof that absolute paths in tar entries are rejected
102102
export
@@ -106,11 +106,11 @@ absolutePathRejection : (entry : TarEntry)
106106
absolutePathRejection entry isAbsolute safePath =
107107
-- An absolute path cannot be safe by definition
108108
-- SafePath requires Not (isPrefixOf "/" component)
109-
-- PROOF_TODO: Replace believe_me with actual proof
110-
-- PROOF_TODO: Replace believe_me with actual proof
111-
-- PROOF_TODO: Replace believe_me with actual proof
112-
-- PROOF_TODO: Replace believe_me with actual proof
113-
believe_me ()
109+
-- PROOF_TODO: Replace cast with actual proof
110+
-- PROOF_TODO: Replace cast with actual proof
111+
-- PROOF_TODO: Replace cast with actual proof
112+
-- PROOF_TODO: Replace cast with actual proof
113+
cast ()
114114

115115
||| Docker OCI tar layout validation
116116
||| OCI images must have specific structure:
@@ -132,11 +132,11 @@ ociLayoutEnforcement : (entries : List TarEntry)
132132
(any (\e => e.path == "manifest.json") entries = True)
133133
ociLayoutEnforcement entries (ValidOCI entries hasManifest hasBlobsDir) =
134134
-- Follows from ValidOCI constructor requirements
135-
-- PROOF_TODO: Replace believe_me with actual proof
136-
-- PROOF_TODO: Replace believe_me with actual proof
137-
-- PROOF_TODO: Replace believe_me with actual proof
138-
-- PROOF_TODO: Replace believe_me with actual proof
139-
believe_me Refl
135+
-- PROOF_TODO: Replace cast with actual proof
136+
-- PROOF_TODO: Replace cast with actual proof
137+
-- PROOF_TODO: Replace cast with actual proof
138+
-- PROOF_TODO: Replace cast with actual proof
139+
cast Refl
140140

141141
||| Proof that tar bombs (excessive nesting or size) are rejected
142142
|||
@@ -157,11 +157,11 @@ tarBombPrevention : (entries : List TarEntry)
157157
tarBombPrevention entries maxDepth maxSize maxEntries lenOk sizeOk =
158158
-- MVP stub: Should verify depth constraint too
159159
-- TODO: Add depth checking proof
160-
-- PROOF_TODO: Replace believe_me with actual proof
161-
-- PROOF_TODO: Replace believe_me with actual proof
162-
-- PROOF_TODO: Replace believe_me with actual proof
163-
-- PROOF_TODO: Replace believe_me with actual proof
164-
believe_me Refl
160+
-- PROOF_TODO: Replace cast with actual proof
161+
-- PROOF_TODO: Replace cast with actual proof
162+
-- PROOF_TODO: Replace cast with actual proof
163+
-- PROOF_TODO: Replace cast with actual proof
164+
cast Refl
165165
where
166166
extractAll : List TarEntry -> Bool
167167
extractAll _ = True
@@ -183,8 +183,8 @@ zipSlipPrevention : (root : Path)
183183
isPrefixOf root (root ++ "/" ++ normalizePath entry.path) = True
184184
zipSlipPrevention root entry safePath =
185185
-- Follows from SafePath definition and normalizePath
186-
-- PROOF_TODO: Replace believe_me with actual proof
187-
-- PROOF_TODO: Replace believe_me with actual proof
188-
-- PROOF_TODO: Replace believe_me with actual proof
189-
-- PROOF_TODO: Replace believe_me with actual proof
190-
believe_me Refl
186+
-- PROOF_TODO: Replace cast with actual proof
187+
-- PROOF_TODO: Replace cast with actual proof
188+
-- PROOF_TODO: Replace cast with actual proof
189+
-- PROOF_TODO: Replace cast with actual proof
190+
cast Refl

container-stack/cerro-torre/verification/idris/SignatureProofs.idr

Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -34,27 +34,27 @@ signatureNonReplayable : (bundle1 : SignedBundle)
3434
-> (sig : Ed25519Signature)
3535
-> (pk : Ed25519PublicKey)
3636
-> Not (bundleHash bundle1 = bundleHash bundle2)
37-
-- PROOF_TODO: Replace believe_me with actual proof
38-
-- PROOF_TODO: Replace believe_me with actual proof
39-
-- PROOF_TODO: Replace believe_me with actual proof
40-
-- PROOF_TODO: Replace believe_me with actual proof
41-
-> verifyEd25519 pk (believe_me $ bundleHash bundle1) sig = True
42-
-- PROOF_TODO: Replace believe_me with actual proof
43-
-- PROOF_TODO: Replace believe_me with actual proof
44-
-- PROOF_TODO: Replace believe_me with actual proof
45-
-- PROOF_TODO: Replace believe_me with actual proof
46-
-> verifyEd25519 pk (believe_me $ bundleHash bundle2) sig = False
37+
-- PROOF_TODO: Replace cast with actual proof
38+
-- PROOF_TODO: Replace cast with actual proof
39+
-- PROOF_TODO: Replace cast with actual proof
40+
-- PROOF_TODO: Replace cast with actual proof
41+
-> verifyEd25519 pk (cast $ bundleHash bundle1) sig = True
42+
-- PROOF_TODO: Replace cast with actual proof
43+
-- PROOF_TODO: Replace cast with actual proof
44+
-- PROOF_TODO: Replace cast with actual proof
45+
-- PROOF_TODO: Replace cast with actual proof
46+
-> verifyEd25519 pk (cast $ bundleHash bundle2) sig = False
4747
signatureNonReplayable bundle1 bundle2 sig pk hashDiff valid1 =
4848
-- MVP stub: Asserts non-replayability without full proof
4949
-- TODO: Full proof requires showing that:
5050
-- 1. sig is valid for bundle1.bundleHash
5151
-- 2. bundle1.bundleHash ≠ bundle2.bundleHash (given)
5252
-- 3. Ed25519 verification fails for different hashes
53-
-- PROOF_TODO: Replace believe_me with actual proof
54-
-- PROOF_TODO: Replace believe_me with actual proof
55-
-- PROOF_TODO: Replace believe_me with actual proof
56-
-- PROOF_TODO: Replace believe_me with actual proof
57-
believe_me Refl
53+
-- PROOF_TODO: Replace cast with actual proof
54+
-- PROOF_TODO: Replace cast with actual proof
55+
-- PROOF_TODO: Replace cast with actual proof
56+
-- PROOF_TODO: Replace cast with actual proof
57+
cast Refl
5858

5959
||| Proof that signatures are non-malleable
6060
||| An attacker cannot modify a valid signature to produce another valid signature
@@ -80,11 +80,11 @@ export
8080
verifyChain : SHA256Hash -> SignatureChain -> Bool
8181
verifyChain hash [] = True
8282
verifyChain hash ((pk, sig) :: rest) =
83-
-- PROOF_TODO: Replace believe_me with actual proof
84-
-- PROOF_TODO: Replace believe_me with actual proof
85-
-- PROOF_TODO: Replace believe_me with actual proof
86-
-- PROOF_TODO: Replace believe_me with actual proof
87-
if verifyEd25519 pk (believe_me hash) sig
83+
-- PROOF_TODO: Replace cast with actual proof
84+
-- PROOF_TODO: Replace cast with actual proof
85+
-- PROOF_TODO: Replace cast with actual proof
86+
-- PROOF_TODO: Replace cast with actual proof
87+
if verifyEd25519 pk (cast hash) sig
8888
then verifyChain hash rest
8989
else False
9090

@@ -96,20 +96,20 @@ chainImpliesIndividual : (hash : SHA256Hash)
9696
-> (pk : Ed25519PublicKey)
9797
-> (sig : Ed25519Signature)
9898
-> elem (pk, sig) chain = True
99-
-- PROOF_TODO: Replace believe_me with actual proof
100-
-- PROOF_TODO: Replace believe_me with actual proof
101-
-- PROOF_TODO: Replace believe_me with actual proof
102-
-- PROOF_TODO: Replace believe_me with actual proof
103-
-> verifyEd25519 pk (believe_me hash) sig = True
99+
-- PROOF_TODO: Replace cast with actual proof
100+
-- PROOF_TODO: Replace cast with actual proof
101+
-- PROOF_TODO: Replace cast with actual proof
102+
-- PROOF_TODO: Replace cast with actual proof
103+
-> verifyEd25519 pk (cast hash) sig = True
104104
chainImpliesIndividual hash [] valid pk sig inChain = absurd inChain
105105
chainImpliesIndividual hash ((pk', sig') :: rest) valid pk sig inChain =
106106
-- MVP stub: Asserts correctness without full proof
107107
-- TODO: Case split on whether (pk, sig) = (pk', sig') or in rest
108-
-- PROOF_TODO: Replace believe_me with actual proof
109-
-- PROOF_TODO: Replace believe_me with actual proof
110-
-- PROOF_TODO: Replace believe_me with actual proof
111-
-- PROOF_TODO: Replace believe_me with actual proof
112-
believe_me Refl
108+
-- PROOF_TODO: Replace cast with actual proof
109+
-- PROOF_TODO: Replace cast with actual proof
110+
-- PROOF_TODO: Replace cast with actual proof
111+
-- PROOF_TODO: Replace cast with actual proof
112+
cast Refl
113113

114114
||| Proof that adding a valid signature to a valid chain preserves validity
115115
export
@@ -118,20 +118,20 @@ chainExtension : (hash : SHA256Hash)
118118
-> (pk : Ed25519PublicKey)
119119
-> (sig : Ed25519Signature)
120120
-> verifyChain hash chain = True
121-
-- PROOF_TODO: Replace believe_me with actual proof
122-
-- PROOF_TODO: Replace believe_me with actual proof
123-
-- PROOF_TODO: Replace believe_me with actual proof
124-
-- PROOF_TODO: Replace believe_me with actual proof
125-
-> verifyEd25519 pk (believe_me hash) sig = True
121+
-- PROOF_TODO: Replace cast with actual proof
122+
-- PROOF_TODO: Replace cast with actual proof
123+
-- PROOF_TODO: Replace cast with actual proof
124+
-- PROOF_TODO: Replace cast with actual proof
125+
-> verifyEd25519 pk (cast hash) sig = True
126126
-> verifyChain hash ((pk, sig) :: chain) = True
127127
chainExtension hash chain pk sig validChain validSig =
128128
-- MVP stub: Should follow from definition of verifyChain
129129
-- TODO: Full proof by computation
130-
-- PROOF_TODO: Replace believe_me with actual proof
131-
-- PROOF_TODO: Replace believe_me with actual proof
132-
-- PROOF_TODO: Replace believe_me with actual proof
133-
-- PROOF_TODO: Replace believe_me with actual proof
134-
believe_me Refl
130+
-- PROOF_TODO: Replace cast with actual proof
131+
-- PROOF_TODO: Replace cast with actual proof
132+
-- PROOF_TODO: Replace cast with actual proof
133+
-- PROOF_TODO: Replace cast with actual proof
134+
cast Refl
135135

136136
||| Proof that signature verification order doesn't matter (commutative)
137137
export
@@ -145,8 +145,8 @@ chainCommutative : (hash : SHA256Hash)
145145
chainCommutative hash pk1 sig1 pk2 sig2 =
146146
-- MVP stub: Should follow from verifyChain definition
147147
-- Each signature is checked independently
148-
-- PROOF_TODO: Replace believe_me with actual proof
149-
-- PROOF_TODO: Replace believe_me with actual proof
150-
-- PROOF_TODO: Replace believe_me with actual proof
151-
-- PROOF_TODO: Replace believe_me with actual proof
152-
believe_me Refl
148+
-- PROOF_TODO: Replace cast with actual proof
149+
-- PROOF_TODO: Replace cast with actual proof
150+
-- PROOF_TODO: Replace cast with actual proof
151+
-- PROOF_TODO: Replace cast with actual proof
152+
cast Refl

0 commit comments

Comments
 (0)