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

Loading…
Cancel
Save