Skip to content

Commit b107ae1

Browse files
committed
Hopefully fix DH nonce bug for real
1 parent d4750e1 commit b107ae1

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed
Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
diff --git a/initiator/initiator.go b/initiator/initiator.go
2-
index f91430c..0aa983f 100644
2+
index f91430c..e9d5179 100644
33
--- a/initiator/initiator.go
44
+++ b/initiator/initiator.go
55
@@ -38,6 +38,12 @@ type Initiator struct {
6-
//@ ghost YT tm.Term
6+
//@ ghost YT tm.Term
77
}
88

99
+// DIODON ARTIFACT ONLY
1010
+// Leaks nonce data
1111
+func (i *Initiator) GetX() []byte {
12-
+ return i.x
12+
+ return i.x
1313
+}
1414
+
1515
type InitiatorState int
@@ -20,11 +20,10 @@ index 8bbba36..3c7d688 100644
2020
--- a/main.go
2121
+++ b/main.go
2222
@@ -63,6 +63,7 @@ func main() {
23-
if !success {
24-
reportAndExit(errors.New("Producing handshake msg 1 failed"))
25-
}
26-
+ hsMsg1 = initor.GetX() // bug: leak nonce data to connection
27-
if _, err := conn.Write(hsMsg1); err != nil {
28-
reportAndExit(err)
29-
}
30-
23+
if !success {
24+
reportAndExit(errors.New("Producing handshake msg 1 failed"))
25+
}
26+
+ hsMsg1 = initor.GetX() // bug: leak nonce data to connection
27+
if _, err := conn.Write(hsMsg1); err != nil {
28+
reportAndExit(err)
29+
}

0 commit comments

Comments
 (0)