use another buffer for signing

pull/16/head
Jeff Becker 6 years ago
parent 4e7c6ee90a
commit 7c90e13299
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -185,19 +185,19 @@ namespace llarp
D = buf;
// zero out signature
Z.Zero();
// reset buffer
buf = llarp::StackBuffer< decltype(tmp) >(tmp);
auto buf2 = llarp::StackBuffer< decltype(tmp) >(tmp);
// encode frame
if(!BEncode(&buf))
if(!BEncode(&buf2))
{
llarp::LogError("frame too big to encode");
llarp::DumpBuffer(buf2);
return false;
}
// rewind
buf.sz = buf.cur - buf.base;
buf.cur = buf.base;
buf2.sz = buf2.cur - buf2.base;
buf2.cur = buf2.base;
// sign
if(!localIdent.Sign(crypto, Z, buf))
if(!localIdent.Sign(crypto, Z, buf2))
{
llarp::LogError("failed to sign? wtf?!");
return false;

Loading…
Cancel
Save