|
|
@ -338,12 +338,13 @@ namespace data |
|
|
|
case SIGNING_KEY_TYPE_ECDSA_SHA512_P521: |
|
|
|
case SIGNING_KEY_TYPE_ECDSA_SHA512_P521: |
|
|
|
return new i2p::crypto::ECDSAP521Verifier (); |
|
|
|
return new i2p::crypto::ECDSAP521Verifier (); |
|
|
|
case SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519: |
|
|
|
case SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519: |
|
|
|
case SIGNING_KEY_TYPE_REDDSA_SHA512_ED25519: |
|
|
|
|
|
|
|
return new i2p::crypto::EDDSA25519Verifier (); |
|
|
|
return new i2p::crypto::EDDSA25519Verifier (); |
|
|
|
case SIGNING_KEY_TYPE_GOSTR3410_CRYPTO_PRO_A_GOSTR3411_256: |
|
|
|
case SIGNING_KEY_TYPE_GOSTR3410_CRYPTO_PRO_A_GOSTR3411_256: |
|
|
|
return new i2p::crypto::GOSTR3410_256_Verifier (i2p::crypto::eGOSTR3410CryptoProA); |
|
|
|
return new i2p::crypto::GOSTR3410_256_Verifier (i2p::crypto::eGOSTR3410CryptoProA); |
|
|
|
case SIGNING_KEY_TYPE_GOSTR3410_TC26_A_512_GOSTR3411_512: |
|
|
|
case SIGNING_KEY_TYPE_GOSTR3410_TC26_A_512_GOSTR3411_512: |
|
|
|
return new i2p::crypto::GOSTR3410_512_Verifier (i2p::crypto::eGOSTR3410TC26A512); |
|
|
|
return new i2p::crypto::GOSTR3410_512_Verifier (i2p::crypto::eGOSTR3410TC26A512); |
|
|
|
|
|
|
|
case SIGNING_KEY_TYPE_REDDSA_SHA512_ED25519: |
|
|
|
|
|
|
|
return new i2p::crypto::RedDSA25519Verifier (); |
|
|
|
case SIGNING_KEY_TYPE_RSA_SHA256_2048: |
|
|
|
case SIGNING_KEY_TYPE_RSA_SHA256_2048: |
|
|
|
case SIGNING_KEY_TYPE_RSA_SHA384_3072: |
|
|
|
case SIGNING_KEY_TYPE_RSA_SHA384_3072: |
|
|
|
case SIGNING_KEY_TYPE_RSA_SHA512_4096: |
|
|
|
case SIGNING_KEY_TYPE_RSA_SHA512_4096: |
|
|
@ -611,7 +612,6 @@ namespace data |
|
|
|
LogPrint (eLogError, "Identity: RSA signing key type ", (int)m_Public->GetSigningKeyType (), " is not supported"); |
|
|
|
LogPrint (eLogError, "Identity: RSA signing key type ", (int)m_Public->GetSigningKeyType (), " is not supported"); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519: |
|
|
|
case SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519: |
|
|
|
case SIGNING_KEY_TYPE_REDDSA_SHA512_ED25519: |
|
|
|
|
|
|
|
m_Signer.reset (new i2p::crypto::EDDSA25519Signer (m_SigningPrivateKey, IsOfflineSignature () ? nullptr: m_Public->GetStandardIdentity ().certificate - i2p::crypto::EDDSA25519_PUBLIC_KEY_LENGTH)); // TODO: remove public key check
|
|
|
|
m_Signer.reset (new i2p::crypto::EDDSA25519Signer (m_SigningPrivateKey, IsOfflineSignature () ? nullptr: m_Public->GetStandardIdentity ().certificate - i2p::crypto::EDDSA25519_PUBLIC_KEY_LENGTH)); // TODO: remove public key check
|
|
|
|
break; |
|
|
|
break; |
|
|
|
case SIGNING_KEY_TYPE_GOSTR3410_CRYPTO_PRO_A_GOSTR3411_256: |
|
|
|
case SIGNING_KEY_TYPE_GOSTR3410_CRYPTO_PRO_A_GOSTR3411_256: |
|
|
@ -620,6 +620,9 @@ namespace data |
|
|
|
case SIGNING_KEY_TYPE_GOSTR3410_TC26_A_512_GOSTR3411_512: |
|
|
|
case SIGNING_KEY_TYPE_GOSTR3410_TC26_A_512_GOSTR3411_512: |
|
|
|
m_Signer.reset (new i2p::crypto::GOSTR3410_512_Signer (i2p::crypto::eGOSTR3410TC26A512, m_SigningPrivateKey)); |
|
|
|
m_Signer.reset (new i2p::crypto::GOSTR3410_512_Signer (i2p::crypto::eGOSTR3410TC26A512, m_SigningPrivateKey)); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
case SIGNING_KEY_TYPE_REDDSA_SHA512_ED25519: |
|
|
|
|
|
|
|
m_Signer.reset (new i2p::crypto::RedDSA25519Signer (m_SigningPrivateKey)); |
|
|
|
|
|
|
|
break; |
|
|
|
default: |
|
|
|
default: |
|
|
|
LogPrint (eLogError, "Identity: Signing key type ", (int)m_Public->GetSigningKeyType (), " is not supported"); |
|
|
|
LogPrint (eLogError, "Identity: Signing key type ", (int)m_Public->GetSigningKeyType (), " is not supported"); |
|
|
|
} |
|
|
|
} |
|
|
@ -704,7 +707,6 @@ namespace data |
|
|
|
LogPrint (eLogWarning, "Identity: RSA signature type is not supported. Creating EdDSA"); |
|
|
|
LogPrint (eLogWarning, "Identity: RSA signature type is not supported. Creating EdDSA"); |
|
|
|
// no break here
|
|
|
|
// no break here
|
|
|
|
case SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519: |
|
|
|
case SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519: |
|
|
|
case SIGNING_KEY_TYPE_REDDSA_SHA512_ED25519: |
|
|
|
|
|
|
|
i2p::crypto::CreateEDDSA25519RandomKeys (priv, pub); |
|
|
|
i2p::crypto::CreateEDDSA25519RandomKeys (priv, pub); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case SIGNING_KEY_TYPE_GOSTR3410_CRYPTO_PRO_A_GOSTR3411_256: |
|
|
|
case SIGNING_KEY_TYPE_GOSTR3410_CRYPTO_PRO_A_GOSTR3411_256: |
|
|
@ -713,6 +715,9 @@ namespace data |
|
|
|
case SIGNING_KEY_TYPE_GOSTR3410_TC26_A_512_GOSTR3411_512: |
|
|
|
case SIGNING_KEY_TYPE_GOSTR3410_TC26_A_512_GOSTR3411_512: |
|
|
|
i2p::crypto::CreateGOSTR3410RandomKeys (i2p::crypto::eGOSTR3410TC26A512, priv, pub); |
|
|
|
i2p::crypto::CreateGOSTR3410RandomKeys (i2p::crypto::eGOSTR3410TC26A512, priv, pub); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
case SIGNING_KEY_TYPE_REDDSA_SHA512_ED25519: |
|
|
|
|
|
|
|
i2p::crypto::CreateRedDSA25519RandomKeys (priv, pub); |
|
|
|
|
|
|
|
break; |
|
|
|
default: |
|
|
|
default: |
|
|
|
LogPrint (eLogWarning, "Identity: Signing key type ", (int)type, " is not supported. Create DSA-SHA1"); |
|
|
|
LogPrint (eLogWarning, "Identity: Signing key type ", (int)type, " is not supported. Create DSA-SHA1"); |
|
|
|
i2p::crypto::CreateDSARandomKeys (priv, pub); // DSA-SHA1
|
|
|
|
i2p::crypto::CreateDSARandomKeys (priv, pub); // DSA-SHA1
|
|
|
|