Fix: don't accept unencrypted messages
This commit is contained in:
@@ -55,6 +55,10 @@ var _ = Describe("Client", func() {
|
||||
written := <-conn.write_ch
|
||||
Expect(written).To(HavePrefix("/create:"))
|
||||
|
||||
// First complete handshake
|
||||
conn.read_ch <- "/session:" + session_id + ":" + server_pub_b64 + ":" + salt_b64 + ":12:34"
|
||||
|
||||
// Then send encrypted history (now processed normally)
|
||||
history_enc, err := sdk.EncryptAESGCM(shared_key, session_id_bytes, []byte("hist"), 10, false)
|
||||
Expect(err).To(BeNil())
|
||||
|
||||
@@ -68,8 +72,6 @@ var _ = Describe("Client", func() {
|
||||
"created_at": int64(1),
|
||||
})
|
||||
conn.read_ch <- string(history_json)
|
||||
|
||||
conn.read_ch <- "/session:" + session_id + ":" + server_pub_b64 + ":" + salt_b64 + ":12:34"
|
||||
}()
|
||||
|
||||
err = client.Connect(ctx, "")
|
||||
|
||||
Reference in New Issue
Block a user