mirror of
https://github.com/shadps4-emu/ext-cryptopp.git
synced 2024-11-26 19:30:21 +00:00
PublicKey is optional for curve25519
This commit is contained in:
parent
d5338fd212
commit
0c658f5a7c
10
xed25519.cpp
10
xed25519.cpp
@ -173,9 +173,12 @@ void x25519::BERDecode(BufferedTransformation &bt)
|
||||
BERDecodePrivateKey(octetString, false, (size_t)privateKeyInfo.RemainingLength());
|
||||
octetString.MessageEnd();
|
||||
|
||||
// publicKey [1] IMPLICIT PublicKey OPTIONAL
|
||||
bool generatePublicKey = true;
|
||||
if (version == 1)
|
||||
if (privateKeyInfo.EndReached() == false /*version == 1?*/)
|
||||
{
|
||||
// Should we test this before decoding? In either case we
|
||||
// just throw a BERDecodeErr() when we can't parse it.
|
||||
BERGeneralDecoder publicKey(privateKeyInfo, CONTEXT_SPECIFIC | CONSTRUCTED | 1);
|
||||
SecByteBlock subjectPublicKey;
|
||||
unsigned int unusedBits;
|
||||
@ -510,9 +513,12 @@ void ed25519PrivateKey::BERDecode(BufferedTransformation &bt)
|
||||
BERDecodePrivateKey(octetString, false, (size_t)privateKeyInfo.RemainingLength());
|
||||
octetString.MessageEnd();
|
||||
|
||||
// publicKey [1] IMPLICIT PublicKey OPTIONAL
|
||||
bool generatePublicKey = true;
|
||||
if (version == 1)
|
||||
if (privateKeyInfo.EndReached() == false /*version == 1?*/)
|
||||
{
|
||||
// Should we test this before decoding? In either case we
|
||||
// just throw a BERDecodeErr() when we can't parse it.
|
||||
BERGeneralDecoder publicKey(privateKeyInfo, CONTEXT_SPECIFIC | CONSTRUCTED | 1);
|
||||
SecByteBlock subjectPublicKey;
|
||||
unsigned int unusedBits;
|
||||
|
Loading…
Reference in New Issue
Block a user