Skip to content

Commit ab6e2dc

Browse files
committed
lib/openssl/BN: add BN_bn2bin() wrapper
1 parent 962facc commit ab6e2dc

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

libcommon

src/openssl/SerializeBN.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include "SerializeBN.hxx"
66
#include "ssh/Serializer.hxx"
7+
#include "lib/openssl/BN.hxx"
78
#include "lib/openssl/Error.hxx"
89

910
#include <stdexcept>
@@ -18,7 +19,7 @@ Serialize(SSH::Serializer &s, const BIGNUM &bn)
1819
throw std::invalid_argument{"Invalid BN size"};
1920

2021
auto dest = s.BeginWriteN(length);
21-
if (BN_bn2bin(&bn, reinterpret_cast<unsigned char *>(dest.data())) != length)
22+
if (BN_bn2bin(bn, dest.data()) != length)
2223
throw SslError{};
2324

2425
s.CommitBignum2(length);

0 commit comments

Comments
 (0)