summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorasynts <asynts@gmail.com>2020-07-27 14:37:30 +0200
committerAndreas Kling <kling@serenityos.org>2020-07-27 19:58:09 +0200
commit68cf22d580a91885bc97a8ecca8a37eb31237e50 (patch)
tree0bcaad2a85daadaf421c94354458c4791cc74450
parent7f70a6f0cbeff93c59e86885ed9b40711753b5d2 (diff)
downloadserenity-68cf22d580a91885bc97a8ecca8a37eb31237e50.zip
LibCrypto: This method wrote to a const pointer.
-rw-r--r--Libraries/LibCrypto/BigInt/SignedBigInteger.h3
-rw-r--r--Libraries/LibCrypto/BigInt/UnsignedBigInteger.h3
2 files changed, 4 insertions, 2 deletions
diff --git a/Libraries/LibCrypto/BigInt/SignedBigInteger.h b/Libraries/LibCrypto/BigInt/SignedBigInteger.h
index 1ff220daa1..b76ed51c2d 100644
--- a/Libraries/LibCrypto/BigInt/SignedBigInteger.h
+++ b/Libraries/LibCrypto/BigInt/SignedBigInteger.h
@@ -67,8 +67,9 @@ public:
static SignedBigInteger import_data(const u8* ptr, size_t length);
size_t export_data(AK::ByteBuffer& data) const;
- size_t export_data(const u8* ptr, size_t length) const
+ size_t export_data(u8* ptr, size_t length) const
{
+ // Note: ByteBuffer::wrap() does a const_cast!
auto buffer = ByteBuffer::wrap(ptr, length);
return export_data(buffer);
}
diff --git a/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h b/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h
index b63409543f..b4e995e602 100644
--- a/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h
+++ b/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h
@@ -59,8 +59,9 @@ public:
}
size_t export_data(AK::ByteBuffer& data) const;
- size_t export_data(const u8* ptr, size_t length) const
+ size_t export_data(u8* ptr, size_t length) const
{
+ // Note: ByteBuffer::wrap() does a const_cast!
auto buffer = ByteBuffer::wrap(ptr, length);
return export_data(buffer);
}