summaryrefslogtreecommitdiff
path: root/Libraries/LibCrypto
diff options
context:
space:
mode:
authorasynts <asynts@gmail.com>2021-01-09 18:51:44 +0100
committerAndreas Kling <kling@serenityos.org>2021-01-09 21:11:09 +0100
commit938e5c7719ee546538bdfc44339b6c561b45edc9 (patch)
tree098bcb7d707e3a5e747eb5d5bc7381bb2146d67a /Libraries/LibCrypto
parent40b8e2111595affb0a6ad8eb643c8f730f7a3c77 (diff)
downloadserenity-938e5c7719ee546538bdfc44339b6c561b45edc9.zip
Everywhere: Replace a bundle of dbg with dbgln.
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.Everything: The modifications in this commit were automatically made using the following command: find . -name '*.cpp' -exec sed -i -E 's/dbg\(\) << ("[^"{]*");/dbgln\(\1\);/' {} \;
Diffstat (limited to 'Libraries/LibCrypto')
-rw-r--r--Libraries/LibCrypto/NumberTheory/ModularFunctions.cpp2
-rw-r--r--Libraries/LibCrypto/PK/RSA.cpp22
2 files changed, 12 insertions, 12 deletions
diff --git a/Libraries/LibCrypto/NumberTheory/ModularFunctions.cpp b/Libraries/LibCrypto/NumberTheory/ModularFunctions.cpp
index 92d0bd90f6..9f6e49ef45 100644
--- a/Libraries/LibCrypto/NumberTheory/ModularFunctions.cpp
+++ b/Libraries/LibCrypto/NumberTheory/ModularFunctions.cpp
@@ -221,7 +221,7 @@ UnsignedBigInteger LCM(const UnsignedBigInteger& a, const UnsignedBigInteger& b)
GCD_without_allocation(a, b, temp_a, temp_b, temp_1, temp_2, temp_3, temp_4, temp_quotient, temp_remainder, gcd_output);
if (gcd_output == 0) {
#ifdef NT_DEBUG
- dbg() << "GCD is zero";
+ dbgln("GCD is zero");
#endif
return output;
}
diff --git a/Libraries/LibCrypto/PK/RSA.cpp b/Libraries/LibCrypto/PK/RSA.cpp
index 5f1de4c039..d1ca1ab629 100644
--- a/Libraries/LibCrypto/PK/RSA.cpp
+++ b/Libraries/LibCrypto/PK/RSA.cpp
@@ -85,7 +85,7 @@ RSA::KeyPairType RSA::parse_rsa_key(ReadonlyBytes in)
ASN1::Kind::Integer, 1, &n)) {
// that's no key
// that's a death star
- dbg() << "that's a death star";
+ dbgln("that's a death star");
return keypair;
}
@@ -105,7 +105,7 @@ RSA::KeyPairType RSA::parse_rsa_key(ReadonlyBytes in)
}
if (n == 1) {
// multiprime key, we don't know how to deal with this
- dbg() << "Unsupported key type";
+ dbgln("Unsupported key type");
return keypair;
}
// it's a broken public key
@@ -120,7 +120,7 @@ void RSA::encrypt(ReadonlyBytes in, Bytes& out)
#endif
auto in_integer = UnsignedBigInteger::import_data(in.data(), in.size());
if (!(in_integer < m_public_key.modulus())) {
- dbg() << "value too large for key";
+ dbgln("value too large for key");
out = {};
return;
}
@@ -175,7 +175,7 @@ void RSA::import_private_key(ReadonlyBytes bytes, bool pem)
auto key = parse_rsa_key(bytes);
if (!key.private_key.length()) {
- dbg() << "We expected to see a private key, but we found none";
+ dbgln("We expected to see a private key, but we found none");
ASSERT_NOT_REACHED();
}
m_private_key = key.private_key;
@@ -191,7 +191,7 @@ void RSA::import_public_key(ReadonlyBytes bytes, bool pem)
auto key = parse_rsa_key(bytes);
if (!key.public_key.length()) {
- dbg() << "We expected to see a public key, but we found none";
+ dbgln("We expected to see a public key, but we found none");
ASSERT_NOT_REACHED();
}
m_public_key = key.public_key;
@@ -235,12 +235,12 @@ void RSA_PKCS1_EME::encrypt(ReadonlyBytes in, Bytes& out)
dbg() << "key size: " << mod_len;
#endif
if (in.size() > mod_len - 11) {
- dbg() << "message too long :(";
+ dbgln("message too long :(");
out = out.trim(0);
return;
}
if (out.size() < mod_len) {
- dbg() << "output buffer too small";
+ dbgln("output buffer too small");
return;
}
@@ -303,14 +303,14 @@ void RSA_PKCS1_EME::decrypt(ReadonlyBytes in, Bytes& out)
++offset;
if (offset == out.size()) {
- dbg() << "garbage data, no zero to split padding";
+ dbgln("garbage data, no zero to split padding");
return;
}
++offset;
if (offset - 3 < 8) {
- dbg() << "PS too small";
+ dbgln("PS too small");
return;
}
@@ -319,11 +319,11 @@ void RSA_PKCS1_EME::decrypt(ReadonlyBytes in, Bytes& out)
void RSA_PKCS1_EME::sign(ReadonlyBytes, Bytes&)
{
- dbg() << "FIXME: RSA_PKCS_EME::sign";
+ dbgln("FIXME: RSA_PKCS_EME::sign");
}
void RSA_PKCS1_EME::verify(ReadonlyBytes, Bytes&)
{
- dbg() << "FIXME: RSA_PKCS_EME::verify";
+ dbgln("FIXME: RSA_PKCS_EME::verify");
}
}
}