mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Check for malformed public key on payment channel
This commit is contained in:
@@ -171,6 +171,9 @@ PayChanCreate::preflight (PreflightContext const& ctx)
|
||||
if (ctx.tx[sfAccount] == ctx.tx[sfDestination])
|
||||
return temDST_IS_SRC;
|
||||
|
||||
if (!publicKeyType(ctx.tx[sfPublicKey]))
|
||||
return temMALFORMED;
|
||||
|
||||
return preflight2 (ctx);
|
||||
}
|
||||
|
||||
@@ -378,6 +381,8 @@ PayChanClaim::preflight (PreflightContext const& ctx)
|
||||
return tecNO_PERMISSION;
|
||||
|
||||
Keylet const k (ltPAYCHAN, ctx.tx[sfPayChannel]);
|
||||
if (!publicKeyType(ctx.tx[sfPublicKey]))
|
||||
return temMALFORMED;
|
||||
PublicKey const pk (ctx.tx[sfPublicKey]);
|
||||
Serializer msg;
|
||||
serializePayChanAuthorization (msg, k.key, authAmt);
|
||||
|
||||
Reference in New Issue
Block a user