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
BC
public
external
mbedtls
Commits
ff29f9c8
Commit
ff29f9c8
authored
Sep 18, 2013
by
Manuel Pégourié-Gonnard
Browse files
Compute public key if absent when reading EC key
parent
4fc090af
Changes
1
Hide whitespace changes
Inline
Side-by-side
library/pkparse.c
View file @
ff29f9c8
...
...
@@ -513,7 +513,7 @@ static int pk_parse_key_sec1_der( ecp_keypair *eck,
}
/*
* Is 'publickey' present?
* Is 'publickey' present?
If not, create it from the private key.
*/
if
(
(
ret
=
asn1_get_tag
(
&
p
,
end
,
&
len
,
ASN1_CONTEXT_SPECIFIC
|
ASN1_CONSTRUCTED
|
1
)
)
==
0
)
...
...
@@ -535,6 +535,12 @@ static int pk_parse_key_sec1_der( ecp_keypair *eck,
ecp_keypair_free
(
eck
);
return
(
POLARSSL_ERR_PK_KEY_INVALID_FORMAT
+
ret
);
}
else
if
(
(
ret
=
ecp_mul
(
&
eck
->
grp
,
&
eck
->
Q
,
&
eck
->
d
,
&
eck
->
grp
.
G
,
NULL
,
NULL
)
)
!=
0
)
{
ecp_keypair_free
(
eck
);
return
(
POLARSSL_ERR_PK_KEY_INVALID_FORMAT
+
ret
);
}
if
(
(
ret
=
ecp_check_privkey
(
&
eck
->
grp
,
&
eck
->
d
)
)
!=
0
)
{
...
...
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