mirror of
https://github.com/PurpleI2P/i2pd-tools.git
synced 2025-01-22 13:27:17 +01:00
GOST R 34.10 added
This commit is contained in:
parent
46232a102d
commit
20e8513daf
|
@ -27,6 +27,8 @@ std::string SigTypeToName(uint16_t keytype)
|
||||||
return "RSA-4096-SHA512";
|
return "RSA-4096-SHA512";
|
||||||
case i2p::data::SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519:
|
case i2p::data::SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519:
|
||||||
return "ED25519-SHA512";
|
return "ED25519-SHA512";
|
||||||
|
case i2p::data::SIGNING_KEY_TYPE_GOSTR3410_A_GOSTR3411:
|
||||||
|
return "GOSTR3410-A-GOSTR3411";
|
||||||
default:
|
default:
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
ss << "unknown: " << keytype;
|
ss << "unknown: " << keytype;
|
||||||
|
@ -62,7 +64,9 @@ uint16_t NameToSigType(const std::string & keyname)
|
||||||
if(name.find("RSA-SHA512") != npos) return i2p::data::SIGNING_KEY_TYPE_RSA_SHA512_4096;
|
if(name.find("RSA-SHA512") != npos) return i2p::data::SIGNING_KEY_TYPE_RSA_SHA512_4096;
|
||||||
|
|
||||||
if(name.find("ED25519") != npos) return i2p::data::SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519;
|
if(name.find("ED25519") != npos) return i2p::data::SIGNING_KEY_TYPE_EDDSA_SHA512_ED25519;
|
||||||
|
|
||||||
|
if(name.find("GOSTR3410") != npos) return i2p::data::SIGNING_KEY_TYPE_GOSTR3410_A_GOSTR3411;
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
i2pd
2
i2pd
|
@ -1 +1 @@
|
||||||
Subproject commit b3ab85f3b538d0fab9194e5a33632e0e694e7705
|
Subproject commit 6fc80e9b67c8ee0a4c2c82c9173d2c1fb56b0efb
|
|
@ -18,6 +18,8 @@ int main (int argc, char * argv[])
|
||||||
std::string str(argv[2]);
|
std::string str(argv[2]);
|
||||||
type = NameToSigType(str);
|
type = NameToSigType(str);
|
||||||
}
|
}
|
||||||
|
if (type == i2p::data::SIGNING_KEY_TYPE_GOSTR3410_A_GOSTR3411)
|
||||||
|
i2p::crypto::InitGost ();
|
||||||
auto keys = i2p::data::PrivateKeys::CreateRandomKeys (type);
|
auto keys = i2p::data::PrivateKeys::CreateRandomKeys (type);
|
||||||
std::ofstream f (argv[1], std::ofstream::binary | std::ofstream::out);
|
std::ofstream f (argv[1], std::ofstream::binary | std::ofstream::out);
|
||||||
if (f)
|
if (f)
|
||||||
|
@ -32,6 +34,10 @@ int main (int argc, char * argv[])
|
||||||
else
|
else
|
||||||
std::cout << "Can't create file " << argv[1] << std::endl;
|
std::cout << "Can't create file " << argv[1] << std::endl;
|
||||||
|
|
||||||
|
if (type == i2p::data::SIGNING_KEY_TYPE_GOSTR3410_A_GOSTR3411)
|
||||||
|
i2p::crypto::TerminateGost ();
|
||||||
|
i2p::crypto::TerminateCrypto ();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue