From 4665214b42108aaeec41f847f22b12a435a8ddac Mon Sep 17 00:00:00 2001 From: Chenna Keshava B S Date: Fri, 8 Nov 2024 11:32:43 -0800 Subject: [PATCH] Fix: Update wallet_propose method to use ED25519 as the default cryptographic algorithm Note: keyPairForSignature method still uses secp256k1 as the default cryptographic signing algorithm. Since, this method is not user-facing, I will not update keyPairsForSignature method in this commit --- src/test/rpc/KeyGeneration_test.cpp | 10 +++++----- src/xrpld/rpc/handlers/WalletPropose.cpp | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/test/rpc/KeyGeneration_test.cpp b/src/test/rpc/KeyGeneration_test.cpp index e136bb04beb..c31c525265b 100644 --- a/src/test/rpc/KeyGeneration_test.cpp +++ b/src/test/rpc/KeyGeneration_test.cpp @@ -112,8 +112,8 @@ class WalletPropose_test : public ripple::TestSuite expectEquals( result[jss::key_type], - params.isMember(jss::key_type) ? params[jss::key_type] - : "secp256k1"); + params.isMember(jss::key_type) ? params[jss::key_type] : "ed25519", + "Logs from testRandomWallet unit test: "); BEAST_EXPECT(!result.isMember(jss::warning)); std::string seed = result[jss::master_seed].asString(); @@ -137,8 +137,8 @@ class WalletPropose_test : public ripple::TestSuite expectEquals(result[jss::public_key_hex], s.public_key_hex); expectEquals( result[jss::key_type], - params.isMember(jss::key_type) ? params[jss::key_type] - : "secp256k1"); + params.isMember(jss::key_type) ? params[jss::key_type] : "ed25519", + "Logs from testSecretWallet unit test: "); return result; } @@ -874,7 +874,7 @@ class WalletPropose_test : public ripple::TestSuite void run() override { - testKeyType(std::nullopt, secp256k1_strings); + testKeyType(std::nullopt, ed25519_strings); testKeyType(std::string("secp256k1"), secp256k1_strings); testKeyType(std::string("ed25519"), ed25519_strings); testKeyType(std::string("secp256k1"), strong_brain_strings); diff --git a/src/xrpld/rpc/handlers/WalletPropose.cpp b/src/xrpld/rpc/handlers/WalletPropose.cpp index f3300b9ed04..6ad12b7e956 100644 --- a/src/xrpld/rpc/handlers/WalletPropose.cpp +++ b/src/xrpld/rpc/handlers/WalletPropose.cpp @@ -130,7 +130,7 @@ walletPropose(Json::Value const& params) } if (!keyType) - keyType = KeyType::secp256k1; + keyType = KeyType::ed25519; auto const publicKey = generateKeyPair(*keyType, *seed).first;