Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
apk
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
apk
Commits
d2a6fa4d
Commit
d2a6fa4d
authored
Dec 23, 2013
by
DrKLO
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed last commit
parent
50a92dc4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
12 deletions
+6
-12
HandshakeAction.java
...src/main/java/org/telegram/messenger/HandshakeAction.java
+2
-2
MessagesController.java
.../main/java/org/telegram/messenger/MessagesController.java
+2
-2
Utilities.java
...sProj/src/main/java/org/telegram/messenger/Utilities.java
+2
-8
No files found.
TMessagesProj/src/main/java/org/telegram/messenger/HandshakeAction.java
View file @
d2a6fa4d
...
@@ -345,12 +345,12 @@ public class HandshakeAction extends Action implements TcpConnection.TcpConnecti
...
@@ -345,12 +345,12 @@ public class HandshakeAction extends Action implements TcpConnection.TcpConnecti
}
}
BigInteger
p
=
new
BigInteger
(
1
,
dhInnerData
.
dh_prime
);
BigInteger
p
=
new
BigInteger
(
1
,
dhInnerData
.
dh_prime
);
BigInteger
g_b
=
BigInteger
.
valueOf
(
dhInnerData
.
g
);
BigInteger
g_a
=
new
BigInteger
(
1
,
dhInnerData
.
g_a
);
BigInteger
g_a
=
new
BigInteger
(
1
,
dhInnerData
.
g_a
);
if
(!
Utilities
.
isGoodGaAndGb
(
g_a
,
g_b
,
p
))
{
if
(!
Utilities
.
isGoodGaAndGb
(
g_a
,
p
))
{
throw
new
RuntimeException
(
"bad prime"
);
throw
new
RuntimeException
(
"bad prime"
);
}
}
BigInteger
g_b
=
BigInteger
.
valueOf
(
dhInnerData
.
g
);
g_b
=
g_b
.
modPow
(
new
BigInteger
(
1
,
b
),
p
);
g_b
=
g_b
.
modPow
(
new
BigInteger
(
1
,
b
),
p
);
g_a
=
g_a
.
modPow
(
new
BigInteger
(
1
,
b
),
p
);
g_a
=
g_a
.
modPow
(
new
BigInteger
(
1
,
b
),
p
);
...
...
TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java
View file @
d2a6fa4d
...
@@ -4814,7 +4814,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
...
@@ -4814,7 +4814,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
BigInteger
p
=
new
BigInteger
(
1
,
MessagesStorage
.
secretPBytes
);
BigInteger
p
=
new
BigInteger
(
1
,
MessagesStorage
.
secretPBytes
);
BigInteger
i_authKey
=
new
BigInteger
(
1
,
encryptedChat
.
g_a_or_b
);
BigInteger
i_authKey
=
new
BigInteger
(
1
,
encryptedChat
.
g_a_or_b
);
if
(!
Utilities
.
isGoodGaAndGb
(
null
,
i_authKey
,
p
))
{
if
(!
Utilities
.
isGoodGaAndGb
(
i_authKey
,
p
))
{
declineSecretChat
(
encryptedChat
.
id
);
declineSecretChat
(
encryptedChat
.
id
);
return
;
return
;
}
}
...
@@ -4911,7 +4911,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
...
@@ -4911,7 +4911,7 @@ public class MessagesController implements NotificationCenter.NotificationCenter
g_b
=
g_b
.
modPow
(
new
BigInteger
(
1
,
salt
),
p
);
g_b
=
g_b
.
modPow
(
new
BigInteger
(
1
,
salt
),
p
);
BigInteger
g_a
=
new
BigInteger
(
1
,
encryptedChat
.
g_a
);
BigInteger
g_a
=
new
BigInteger
(
1
,
encryptedChat
.
g_a
);
if
(!
Utilities
.
isGoodGaAndGb
(
g_a
,
g_b
,
p
))
{
if
(!
Utilities
.
isGoodGaAndGb
(
g_a
,
p
))
{
acceptingChats
.
remove
(
encryptedChat
.
id
);
acceptingChats
.
remove
(
encryptedChat
.
id
);
declineSecretChat
(
encryptedChat
.
id
);
declineSecretChat
(
encryptedChat
.
id
);
return
;
return
;
...
...
TMessagesProj/src/main/java/org/telegram/messenger/Utilities.java
View file @
d2a6fa4d
...
@@ -124,14 +124,8 @@ public class Utilities {
...
@@ -124,14 +124,8 @@ public class Utilities {
return
true
;
return
true
;
}
}
public
static
boolean
isGoodGaAndGb
(
BigInteger
g_a
,
BigInteger
g_b
,
BigInteger
p
)
{
public
static
boolean
isGoodGaAndGb
(
BigInteger
g_a
,
BigInteger
p
)
{
if
(
g_a
!=
null
&&
g_a
.
compareTo
(
BigInteger
.
valueOf
(
1
))
!=
1
)
{
return
!(
g_a
.
compareTo
(
BigInteger
.
valueOf
(
1
))
!=
1
||
g_a
.
compareTo
(
p
.
subtract
(
BigInteger
.
valueOf
(
1
)))
!=
-
1
);
return
false
;
}
if
(
g_b
!=
null
&&
p
!=
null
&&
g_b
.
compareTo
(
p
.
subtract
(
BigInteger
.
valueOf
(
1
)))
!=
-
1
)
{
return
false
;
}
return
true
;
}
}
public
static
TPFactorizedValue
getFactorizedValue
(
long
what
)
{
public
static
TPFactorizedValue
getFactorizedValue
(
long
what
)
{
...
...
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