diff --git a/src/ripple/app/transactors/Transactor.cpp b/src/ripple/app/transactors/Transactor.cpp index 63330f786..1e4fee0c9 100644 --- a/src/ripple/app/transactors/Transactor.cpp +++ b/src/ripple/app/transactors/Transactor.cpp @@ -251,7 +251,7 @@ TER Transactor::preCheck () if (!mTxn.isKnownGood ()) { if (mTxn.isKnownBad () || - (!(mParams & tapNO_CHECK_SIGN) && !mTxn.checkSign (mSigningPubKey))) + (!(mParams & tapNO_CHECK_SIGN) && !mTxn.checkSign())) { mTxn.setBad (); m_journal.warning << "apply: Invalid transaction (bad signature)"; diff --git a/src/ripple/app/tx/Transaction.cpp b/src/ripple/app/tx/Transaction.cpp index 0ba88e4be..8c7f83ec5 100644 --- a/src/ripple/app/tx/Transaction.cpp +++ b/src/ripple/app/tx/Transaction.cpp @@ -69,7 +69,7 @@ Transaction::pointer Transaction::sharedTransaction ( bool Transaction::checkSign () const { if (mFromPubKey.isValid ()) - return mTransaction->checkSign (mFromPubKey); + return mTransaction->checkSign(); WriteLog (lsWARNING, Ledger) << "Transaction has bad source public key"; return false; diff --git a/src/ripple/protocol/STTx.h b/src/ripple/protocol/STTx.h index 1d1b1d911..abe045bb5 100644 --- a/src/ripple/protocol/STTx.h +++ b/src/ripple/protocol/STTx.h @@ -111,7 +111,6 @@ public: void sign (RippleAddress const& private_key); bool checkSign () const; - bool checkSign (RippleAddress const& public_key) const; bool isKnownGood () const { diff --git a/src/ripple/protocol/impl/STTx.cpp b/src/ripple/protocol/impl/STTx.cpp index 03ed1ccd0..1b0e67d32 100644 --- a/src/ripple/protocol/impl/STTx.cpp +++ b/src/ripple/protocol/impl/STTx.cpp @@ -181,10 +181,15 @@ bool STTx::checkSign () const { try { + ECDSA const fullyCanonical = (getFlags() & tfFullyCanonicalSig) + ? ECDSA::strict + : ECDSA::not_strict; + RippleAddress n; n.setAccountPublic (getFieldVL (sfSigningPubKey)); - sig_state_ = checkSign (n); + sig_state_ = n.accountPublicVerify (getSigningHash (), + getFieldVL (sfTxnSignature), fullyCanonical); } catch (...) { @@ -197,23 +202,6 @@ bool STTx::checkSign () const return static_cast (sig_state_); } -bool STTx::checkSign (RippleAddress const& public_key) const -{ - try - { - ECDSA const fullyCanonical = (getFlags() & tfFullyCanonicalSig) - ? ECDSA::strict - : ECDSA::not_strict; - - return public_key.accountPublicVerify (getSigningHash (), - getFieldVL (sfTxnSignature), fullyCanonical); - } - catch (...) - { - return false; - } -} - void STTx::setSigningPubKey (RippleAddress const& naSignPubKey) { setFieldVL (sfSigningPubKey, naSignPubKey.getAccountPublic ());