Check for malformed public key on payment channel

This commit is contained in:
seelabs
2017-02-24 11:16:12 -05:00
parent b7e2a3bd5f
commit 35f4698aed
3 changed files with 70 additions and 3 deletions

View File

@@ -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);