|
|
|
@ -103,6 +103,8 @@ namespace data
@@ -103,6 +103,8 @@ namespace data
|
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
case SIGNING_KEY_TYPE_GOSTR3410_A_GOSTR3411: |
|
|
|
|
case SIGNING_KEY_TYPE_GOSTR3410_B_GOSTR3411: |
|
|
|
|
case SIGNING_KEY_TYPE_GOSTR3410_C_GOSTR3411: |
|
|
|
|
{ |
|
|
|
|
size_t padding = 128 - i2p::crypto::GOSTR3410_PUBLIC_KEY_LENGTH; // 64 = 128 - 64
|
|
|
|
|
RAND_bytes (m_StandardIdentity.signingKey, padding); |
|
|
|
@ -382,7 +384,19 @@ namespace data
@@ -382,7 +384,19 @@ namespace data
|
|
|
|
|
size_t padding = 128 - i2p::crypto::GOSTR3410_PUBLIC_KEY_LENGTH; // 64 = 128 - 64
|
|
|
|
|
UpdateVerifier (new i2p::crypto::GOSTR3410Verifier (i2p::crypto::eGOSTR3410CryptoProA, m_StandardIdentity.signingKey + padding)); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
case SIGNING_KEY_TYPE_GOSTR3410_B_GOSTR3411: |
|
|
|
|
{ |
|
|
|
|
size_t padding = 128 - i2p::crypto::GOSTR3410_PUBLIC_KEY_LENGTH; // 64 = 128 - 64
|
|
|
|
|
UpdateVerifier (new i2p::crypto::GOSTR3410Verifier (i2p::crypto::eGOSTR3410CryptoProB, m_StandardIdentity.signingKey + padding)); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
case SIGNING_KEY_TYPE_GOSTR3410_C_GOSTR3411: |
|
|
|
|
{ |
|
|
|
|
size_t padding = 128 - i2p::crypto::GOSTR3410_PUBLIC_KEY_LENGTH; // 64 = 128 - 64
|
|
|
|
|
UpdateVerifier (new i2p::crypto::GOSTR3410Verifier (i2p::crypto::eGOSTR3410CryptoProC, m_StandardIdentity.signingKey + padding)); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
default: |
|
|
|
|
LogPrint (eLogError, "Identity: Signing key type ", (int)keyType, " is not supported"); |
|
|
|
|
} |
|
|
|
@ -527,6 +541,12 @@ namespace data
@@ -527,6 +541,12 @@ namespace data
|
|
|
|
|
case SIGNING_KEY_TYPE_GOSTR3410_A_GOSTR3411: |
|
|
|
|
m_Signer.reset (new i2p::crypto::GOSTR3410Signer (i2p::crypto::eGOSTR3410CryptoProA, m_SigningPrivateKey)); |
|
|
|
|
break; |
|
|
|
|
case SIGNING_KEY_TYPE_GOSTR3410_B_GOSTR3411: |
|
|
|
|
m_Signer.reset (new i2p::crypto::GOSTR3410Signer (i2p::crypto::eGOSTR3410CryptoProB, m_SigningPrivateKey)); |
|
|
|
|
break; |
|
|
|
|
case SIGNING_KEY_TYPE_GOSTR3410_C_GOSTR3411: |
|
|
|
|
m_Signer.reset (new i2p::crypto::GOSTR3410Signer (i2p::crypto::eGOSTR3410CryptoProC, m_SigningPrivateKey)); |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
LogPrint (eLogError, "Identity: Signing key type ", (int)m_Public->GetSigningKeyType (), " is not supported"); |
|
|
|
|
} |
|
|
|
@ -565,6 +585,12 @@ namespace data
@@ -565,6 +585,12 @@ namespace data
|
|
|
|
|
case SIGNING_KEY_TYPE_GOSTR3410_A_GOSTR3411: |
|
|
|
|
i2p::crypto::CreateGOSTR3410RandomKeys (i2p::crypto::eGOSTR3410CryptoProA, keys.m_SigningPrivateKey, signingPublicKey); |
|
|
|
|
break; |
|
|
|
|
case SIGNING_KEY_TYPE_GOSTR3410_B_GOSTR3411: |
|
|
|
|
i2p::crypto::CreateGOSTR3410RandomKeys (i2p::crypto::eGOSTR3410CryptoProB, keys.m_SigningPrivateKey, signingPublicKey); |
|
|
|
|
break; |
|
|
|
|
case SIGNING_KEY_TYPE_GOSTR3410_C_GOSTR3411: |
|
|
|
|
i2p::crypto::CreateGOSTR3410RandomKeys (i2p::crypto::eGOSTR3410CryptoProC, keys.m_SigningPrivateKey, signingPublicKey); |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
LogPrint (eLogError, "Identity: Signing key type ", (int)type, " is not supported. Create DSA-SHA1"); |
|
|
|
|
return PrivateKeys (i2p::data::CreateRandomKeys ()); // DSA-SHA1
|
|
|
|
|