Skip to content

Commit

Permalink
Fix: Update wallet_propose method to use ED25519 as the default crypt…
Browse files Browse the repository at this point in the history
…ographic 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
  • Loading branch information
ckeshava committed Nov 8, 2024
1 parent ec61f5e commit 4665214
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/test/rpc/KeyGeneration_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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;
}

Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/xrpld/rpc/handlers/WalletPropose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ walletPropose(Json::Value const& params)
}

if (!keyType)
keyType = KeyType::secp256k1;
keyType = KeyType::ed25519;

auto const publicKey = generateKeyPair(*keyType, *seed).first;

Expand Down

0 comments on commit 4665214

Please sign in to comment.