aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRhys Weatherley <rhys.weatherley@gmail.com>2017-06-17 08:22:19 +1000
committerRhys Weatherley <rhys.weatherley@gmail.com>2017-06-17 08:22:19 +1000
commite0de564626f74ecd59107568366a7229729862cd (patch)
treeb6b4110ba0962e55a4bcc7a4df0a9e84ae7c8f80
parentABNF grammar modifications for rev32 (diff)
downloadnoise-e0de564626f74ecd59107568366a7229729862cd.tar.xz
noise-e0de564626f74ecd59107568366a7229729862cd.zip
ABNF for Noise protocol names
-rw-r--r--patterns/grammar-abnf.txt22
1 files changed, 19 insertions, 3 deletions
diff --git a/patterns/grammar-abnf.txt b/patterns/grammar-abnf.txt
index f1c2c04..e968d6f 100644
--- a/patterns/grammar-abnf.txt
+++ b/patterns/grammar-abnf.txt
@@ -7,6 +7,9 @@
; The "pattern-single" element is intended for applications that wish to
; provide an API to define the specific pattern to use in a handshake.
;
+; The "protocol-name" lexical token describes the structure of Noise
+; protocol names in ABNF.
+;
; Productions that start with "extension-" apply to extension features like
; Hybrid Forward Secrecy and are not part of the core Noise standard.
@@ -18,7 +21,7 @@ pattern-single = wsp pattern wsp
pattern = header wsp [pre-message wsp "..." wsp] messages
-header = name wsp "(" wsp params wsp ")" wsp ":"
+header = "Noise_" pattern-name wsp "(" wsp params wsp ")" wsp ":"
params = param *(wsp "," wsp param)
@@ -49,9 +52,22 @@ extension-token = "f" / "ff" ; Hybrid Forward Secrecy
; Lexical tokens
-name = "Noise_" name-component *("+" name-component)
+protocol-name = "Noise_" pattern-name "_" dh-algorithms
+ "_" cipher-algorithms "_" hash-algorithms
+
+pattern-name = base-pattern-name [modifier-name *("+" modifier-name)]
+
+base-pattern-name = 1*(%x41-5A) ; 1 or more uppercase letters
+
+modifier-name = 1*(%x61-7A / DIGIT) ; Lower case and digits
+
+dh-algorithms = name-component *("+" name-component)
+
+cipher-algorithms = name-component *("+" name-component)
+
+hash-algorithms = name-component *("+" name-component)
-name-component = 1*(ALPHA / DIGIT)
+name-component = 1*(ALPHA / DIGIT / "/")
wsp = *(WSP / eol / comment)