Page MenuHomePhorge

D164.1732278081.diff
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

D164.1732278081.diff

diff --git a/src/crypto/inbound-group-session.cpp b/src/crypto/inbound-group-session.cpp
--- a/src/crypto/inbound-group-session.cpp
+++ b/src/crypto/inbound-group-session.cpp
@@ -41,7 +41,9 @@
: InboundGroupSessionPrivate()
{
ed25519Key = that.ed25519Key;
- valid = unpickle(that.pickle());
+ if (that.valid) {
+ valid = unpickle(that.pickle());
+ }
decryptedEvents = that.decryptedEvents;
}
diff --git a/src/crypto/outbound-group-session.cpp b/src/crypto/outbound-group-session.cpp
--- a/src/crypto/outbound-group-session.cpp
+++ b/src/crypto/outbound-group-session.cpp
@@ -41,7 +41,9 @@
, creationTime(that.creationTime)
, initialSessionKey(that.initialSessionKey)
{
- valid = unpickle(that.pickle());
+ if (that.valid) {
+ valid = unpickle(that.pickle());
+ }
}
std::string OutboundGroupSessionPrivate::pickle() const
diff --git a/src/tests/crypto/inbound-group-session-test.cpp b/src/tests/crypto/inbound-group-session-test.cpp
--- a/src/tests/crypto/inbound-group-session-test.cpp
+++ b/src/tests/crypto/inbound-group-session-test.cpp
@@ -74,3 +74,11 @@
REQUIRE(!session.valid());
}
}
+
+TEST_CASE("invalid InboundGroupSession is copyable")
+{
+ InboundGroupSession session("AAAAAA", "ed25519Key");
+ REQUIRE(!session.valid());
+ auto session2 = session;
+ REQUIRE(!session.valid());
+}
diff --git a/src/tests/crypto/outbound-group-session-test.cpp b/src/tests/crypto/outbound-group-session-test.cpp
--- a/src/tests/crypto/outbound-group-session-test.cpp
+++ b/src/tests/crypto/outbound-group-session-test.cpp
@@ -57,3 +57,11 @@
REQUIRE(res.empty());
REQUIRE(originalIndex == session.messageIndex());
}
+
+TEST_CASE("invalid OutboundGroupSession is copyable")
+{
+ OutboundGroupSession session;
+ REQUIRE(!session.valid());
+ auto session2 = session;
+ REQUIRE(!session.valid());
+}

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 22, 4:21 AM (20 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38835
Default Alt Text
D164.1732278081.diff (1 KB)

Event Timeline