Skip to content

Commit

Permalink
docs update
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarBasem committed May 10, 2021
1 parent c451525 commit 9bbadd5
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 12 deletions.
Binary file modified android/.idea/caches/build_file_checksums.ser
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -416,15 +416,21 @@ public void initPairwiseSession(JSONObject bundle) {
SignalProtocolStore store = new MyProtocolStore(context);
SignalProtocolAddress signalProtocolAddress = new SignalProtocolAddress(bundle.getString("userId"), 0);
SessionBuilder sessionBuilder = new SessionBuilder(store, signalProtocolAddress);
ECPublicKey preKey = Curve.decodePoint(Base64.decode(bundle.getString("preKey")), 0);
ECPublicKey signedPreKey = Curve.decodePoint(Base64.decode(bundle.getString("signedPreKey")), 0);
ECPublicKey identityKey = Curve.decodePoint(Base64.decode(bundle.getString("identityKey")), 0);
IdentityKey identityPublicKey = new IdentityKey(identityKey);

ECPublicKey preKey = null;
int preKeyId = -1;
if (bundle.has("preKey")) {
preKey = Curve.decodePoint(Base64.decode(bundle.getString("preKey")), 0);
preKeyId = bundle.getInt("preKeyId");
}

PreKeyBundle preKeyBundle = new PreKeyBundle(
bundle.getInt("localId"),
0,
bundle.getInt("preKeyId"),
preKeyId,
preKey,
bundle.getInt("signedPreKeyId"),
signedPreKey,
Expand Down
2 changes: 1 addition & 1 deletion ios/StickProtocol/StickProtocol.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Pod::Spec.new do |spec|


spec.name = "StickProtocol"
spec.version = "1.1.62"
spec.version = "1.1.63"
spec.summary = "End-to-End Encryption protocol for Social Networks based on the Signal Protocol"
spec.swift_version = "5.0"

Expand Down
4 changes: 4 additions & 0 deletions ios/StickProtocol/StickProtocol.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
Expand Down Expand Up @@ -940,6 +941,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
Expand Down Expand Up @@ -1000,6 +1002,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 480B013D7D38AF279D597F4E /* Pods-StickProtocol.debug.xcconfig */;
buildSettings = {
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
Expand Down Expand Up @@ -1032,6 +1035,7 @@
isa = XCBuildConfiguration;
baseConfigurationReference = 6B35F7AC4594F4E0AADA3578 /* Pods-StickProtocol.release.xcconfig */;
buildSettings = {
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
Expand Down
2 changes: 1 addition & 1 deletion server/setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = stick-protocol-server
version = 1.1.60
version = 1.1.62
description = Stick protocol server for Django.
long_description = file: README.rst
long_description_content_type = text/x-rst
Expand Down
18 changes: 10 additions & 8 deletions server/stick_protocol/stick_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def __init__(self, UserModel, DeviceModel, GroupModel, sessionAge):

def process_pre_key_bundle(self, data, user):
"""
A user must upload their PreKeyBundle at registration time. Before uploading their PreKeyBundle, they need to verify
A user must upload their PreKeyBundles at registration time. Before uploading their PreKeyBundles, they need to verify
their phone number, and get their LimitedAccessToken.
"""
identityKey = data["identityKey"]
Expand Down Expand Up @@ -87,14 +87,15 @@ def get_pre_key_bundle(self, data):
"signedPreKey": signedPreKey.public,
"signedPreKeyId": signedPreKey.keyId,
"signature": signedPreKey.signature,
"preKey": preKey.public,
"preKeyId": preKey.keyId,
"oneTimeId": user.oneTimeId,
"phone": user.phone
}
if preKey:
PKB["preKey"] = preKey.public
PKB["preKeyId"] = preKey.keyId
if not isSticky:
preKey.delete()
else:
elif preKey:
preKey.used = True
preKey.save()
return PKB
Expand Down Expand Up @@ -131,11 +132,12 @@ def get_pre_key_bundles(self, currentUser, users_id):
"signedPreKey": signedPreKey.public,
"signedPreKeyId": signedPreKey.keyId,
"signature": signedPreKey.signature,
"preKey": preKey.public,
"preKeyId": preKey.keyId,
}
preKey.used = True
preKey.save()
if preKey:
PKB["preKey"] = preKey.public
PKB["preKeyId"] = preKey.keyId
preKey.used = True
preKey.save()
bundles[id] = PKB
for id in toBeRemoved:
users_id.remove(id)
Expand Down

0 comments on commit 9bbadd5

Please sign in to comment.