From: Sergey Matveev Date: Thu, 3 Apr 2025 06:18:13 +0000 (+0300) Subject: Many strings must be >0 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=ba99354d865a27c05bb3f17981aad8e7da54ee7a3f723a75f26e31b97674c3e8;p=keks.git Many strings must be >0 --- diff --git a/spec/cm/hashed.cddl b/spec/cm/hashed.cddl index ac3a220..eb906ca 100644 --- a/spec/cm/hashed.cddl +++ b/spec/cm/hashed.cddl @@ -1,8 +1,8 @@ -ai = text ; algorithm identifier +ai = text .ge 0 ; algorithm identifier cm-hashed = { a: [+ ai], - t: text, ; type of the content + t: text .gt 0, ; type of the content ? v: bytes / blob, ; content itself hash: [+ bytes], ; hash values } diff --git a/spec/cm/prv.cddl b/spec/cm/prv.cddl index 22b97e5..b0b1e68 100644 --- a/spec/cm/prv.cddl +++ b/spec/cm/prv.cddl @@ -1,4 +1,4 @@ -ai = text ; algorithm identifier +ai = text .ge 0 ; algorithm identifier av = {a: ai, v: bytes} cm-prv = av diff --git a/spec/cm/pub-load.cddl b/spec/cm/pub-load.cddl index a2cc418..d3d98e2 100644 --- a/spec/cm/pub-load.cddl +++ b/spec/cm/pub-load.cddl @@ -1,4 +1,4 @@ -ai = text ; algorithm identifier +ai = text .ge 0 ; algorithm identifier av = {a: ai, v: bytes} fpr = bytes .size 32 ku = "sig" / "kem" / "app-name" / text diff --git a/spec/cm/signed.cddl b/spec/cm/signed.cddl index 2a223e5..dc6a358 100644 --- a/spec/cm/signed.cddl +++ b/spec/cm/signed.cddl @@ -1,15 +1,15 @@ -ai = text ; algorithm identifier +ai = text .ge 0 ; algorithm identifier cm-signed = { load: { - t: text, + t: text .ge 0, ? v: bytes / text / map / list, }, ? sigs: [+ sig], ? pubs: [+ cm-pub], } -url = text +url = text .ge 0 sig = { tbs: sig-tbs, @@ -23,7 +23,7 @@ fpr = bytes .size 32 sig-tbs = { sid: fpr, ; signer's public key fingerprint ? when: tai64 / tai64n, - ? nonce: bytes, ; some optional random bytes + ? nonce: bytes .gt 0, ; some optional random bytes ? encrypted-to: [+ fpr], ; recipient's public key fingerprints * text => any }