Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F112272
D164.1732286722.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D164.1732286722.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 22, 6:45 AM (13 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38835
Default Alt Text
D164.1732286722.diff (1 KB)
Attached To
Mode
D164: Make invalid megolm sessions copyable
Attached
Detach File
Event Timeline
Log In to Comment