Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Silence-Android
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
268
Issues
268
List
Boards
Labels
Service Desk
Milestones
Merge Requests
11
Merge Requests
11
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Silence
Silence-Android
Commits
3ec87c19
Commit
3ec87c19
authored
Feb 20, 2018
by
William Desportes
🛠
Committed by
Bastien Le Querrec
Apr 14, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed 2 NPEs when having no identity
parent
85f0218c
Pipeline
#155
passed with stages
in 42 minutes and 52 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
6 deletions
+18
-6
src/org/smssecure/smssecure/KeyScanningActivity.java
src/org/smssecure/smssecure/KeyScanningActivity.java
+8
-2
src/org/smssecure/smssecure/crypto/KeyExchangeInitiator.java
src/org/smssecure/smssecure/crypto/KeyExchangeInitiator.java
+10
-4
No files found.
src/org/smssecure/smssecure/KeyScanningActivity.java
View file @
3ec87c19
...
...
@@ -119,8 +119,14 @@ public abstract class KeyScanningActivity extends PassphraseRequiredActionBarAct
}
protected
void
initiateDisplay
()
{
IntentIntegrator
intentIntegrator
=
getIntentIntegrator
();
intentIntegrator
.
shareText
(
Base64
.
encodeBytes
(
getIdentityKeyToDisplay
().
serialize
()));
IdentityKey
identityKey
=
getIdentityKeyToDisplay
();
if
(
identityKey
!=
null
)
{
IntentIntegrator
intentIntegrator
=
getIntentIntegrator
();
intentIntegrator
.
shareText
(
Base64
.
encodeBytes
(
identityKey
.
serialize
()));
}
else
{
Toast
.
makeText
(
this
,
R
.
string
.
VerifyIdentityActivity_you_do_not_have_an_identity_key
,
Toast
.
LENGTH_LONG
).
show
();
}
}
protected
void
initiateShare
()
{
...
...
src/org/smssecure/smssecure/crypto/KeyExchangeInitiator.java
View file @
3ec87c19
...
...
@@ -23,6 +23,7 @@ import android.content.DialogInterface;
import
android.os.Build
;
import
android.telephony.SubscriptionInfo
;
import
android.telephony.SubscriptionManager
;
import
android.widget.Toast
;
import
org.smssecure.smssecure.R
;
import
org.smssecure.smssecure.crypto.SessionBuilder
;
...
...
@@ -95,11 +96,16 @@ public class KeyExchangeInitiator {
SessionBuilder
sessionBuilder
=
new
SessionBuilder
(
sessionStore
,
preKeyStore
,
signedPreKeyStore
,
identityKeyStore
,
new
SignalProtocolAddress
(
recipient
.
getNumber
(),
1
));
KeyExchangeMessage
keyExchangeMessage
=
sessionBuilder
.
process
();
String
serializedMessage
=
Base64
.
encodeBytesWithoutPadding
(
keyExchangeMessage
.
serialize
());
OutgoingKeyExchangeMessage
textMessage
=
new
OutgoingKeyExchangeMessage
(
recipients
,
serializedMessage
,
subscriptionId
);
if
(
identityKeyStore
.
getIdentityKeyPair
()
!=
null
)
{
KeyExchangeMessage
keyExchangeMessage
=
sessionBuilder
.
process
();
String
serializedMessage
=
Base64
.
encodeBytesWithoutPadding
(
keyExchangeMessage
.
serialize
());
OutgoingKeyExchangeMessage
textMessage
=
new
OutgoingKeyExchangeMessage
(
recipients
,
serializedMessage
,
subscriptionId
);
MessageSender
.
send
(
context
,
masterSecret
,
textMessage
,
-
1
,
false
);
MessageSender
.
send
(
context
,
masterSecret
,
textMessage
,
-
1
,
false
);
}
else
{
Toast
.
makeText
(
context
,
R
.
string
.
VerifyIdentityActivity_you_do_not_have_an_identity_key
,
Toast
.
LENGTH_LONG
).
show
();
}
}
private
static
boolean
hasInitiatedSession
(
Context
context
,
MasterSecret
masterSecret
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment