Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Matt Johnston
dropbear
Commits
2293e3d1
Commit
2293e3d1
authored
Nov 25, 2015
by
Matt Johnston
Browse files
check for zero K value from curve25519
parent
550b3056
Changes
1
Hide whitespace changes
Inline
Side-by-side
common-kex.c
View file @
2293e3d1
...
...
@@ -760,6 +760,7 @@ void kexcurve25519_comb_key(struct kex_curve25519_param *param, buffer *buf_pub_
unsigned
char
out
[
CURVE25519_LEN
];
const
unsigned
char
*
Q_C
=
NULL
;
const
unsigned
char
*
Q_S
=
NULL
;
char
zeroes
[
CURVE25519_LEN
]
=
{
0
};
if
(
buf_pub_them
->
len
!=
CURVE25519_LEN
)
{
...
...
@@ -767,6 +768,11 @@ void kexcurve25519_comb_key(struct kex_curve25519_param *param, buffer *buf_pub_
}
curve25519_donna
(
out
,
param
->
priv
,
buf_pub_them
->
data
);
if
(
constant_time_memcmp
(
zeroes
,
out
,
CURVE25519_LEN
)
==
0
)
{
dropbear_exit
(
"Bad curve25519"
);
}
m_mp_alloc_init_multi
(
&
ses
.
dh_K
,
NULL
);
bytes_to_mp
(
ses
.
dh_K
,
out
,
CURVE25519_LEN
);
m_burn
(
out
,
sizeof
(
out
));
...
...
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