-// Copyright (C) 2014-2016 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2017 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
"Unknown hash algorithm: " <<
static_cast<int>(hash_algorithm));
} catch (const Botan::Exception& exc) {
- isc_throw(isc::cryptolink::LibraryError, exc.what());
+ isc_throw(isc::cryptolink::LibraryError,
+ "Botan error: " << exc.what());
}
hash_.reset(hash);
try {
hash_->update(static_cast<const Botan::byte*>(data), len);
} catch (const Botan::Exception& exc) {
- isc_throw(isc::cryptolink::LibraryError, exc.what());
+ isc_throw(isc::cryptolink::LibraryError,
+ "Botan error: " << exc.what());
}
}
}
result.writeData(&b_result[0], len);
} catch (const Botan::Exception& exc) {
- isc_throw(isc::cryptolink::LibraryError, exc.what());
+ isc_throw(isc::cryptolink::LibraryError,
+ "Botan error: " << exc.what());
}
}
}
std::memcpy(result, &b_result[0], output_size);
} catch (const Botan::Exception& exc) {
- isc_throw(isc::cryptolink::LibraryError, exc.what());
+ isc_throw(isc::cryptolink::LibraryError,
+ "Botan error: " << exc.what());
}
}
}
return (std::vector<uint8_t>(&b_result[0], &b_result[len]));
} catch (const Botan::Exception& exc) {
- isc_throw(isc::cryptolink::LibraryError, exc.what());
+ isc_throw(isc::cryptolink::LibraryError,
+ "Botan error: " << exc.what());
}
}
-// Copyright (C) 2011-2016 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2017 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
"Unknown hash algorithm: " <<
static_cast<int>(hash_algorithm));
} catch (const Botan::Exception& exc) {
- isc_throw(LibraryError, exc.what());
+ isc_throw(LibraryError, "Botan error: " << exc.what());
}
hmac_.reset(new Botan::HMAC(hash));
} catch (const Botan::Invalid_Key_Length& ikl) {
isc_throw(BadKey, ikl.what());
} catch (const Botan::Exception& exc) {
- isc_throw(LibraryError, exc.what());
+ isc_throw(LibraryError, "Botan error: " << exc.what());
}
}
try {
hmac_->update(static_cast<const Botan::byte*>(data), len);
} catch (const Botan::Exception& exc) {
- isc_throw(LibraryError, exc.what());
+ isc_throw(LibraryError, "Botan error: " << exc.what());
}
}
}
result.writeData(&b_result[0], len);
} catch (const Botan::Exception& exc) {
- isc_throw(LibraryError, exc.what());
+ isc_throw(LibraryError, "Botan error: " << exc.what());
}
}
}
std::memcpy(result, &b_result[0], output_size);
} catch (const Botan::Exception& exc) {
- isc_throw(LibraryError, exc.what());
+ isc_throw(LibraryError, "Botan error: " << exc.what());
}
}
}
return (std::vector<uint8_t>(&b_result[0], &b_result[len]));
} catch (const Botan::Exception& exc) {
- isc_throw(LibraryError, exc.what());
+ isc_throw(LibraryError, "Botan error: " << exc.what());
}
}
static_cast<const unsigned char*>(sig),
len));
} catch (const Botan::Exception& exc) {
- isc_throw(LibraryError, exc.what());
+ isc_throw(LibraryError, "Botan error: " << exc.what());
}
}
-// Copyright (C) 2011-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2015,2017 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
try {
c.impl_ = new CryptoLinkImpl();
} catch (const Botan::Exception& ex) {
- isc_throw(InitializationError, ex.what());
+ isc_throw(InitializationError, "Botan error: " << ex.what());
}
}
}
-// Copyright (C) 2014-2016 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2017 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
md_ = EVP_MD_CTX_new();
if (md_ == 0) {
- isc_throw(isc::cryptolink::LibraryError, "EVP_MD_CTX_new");
+ isc_throw(isc::cryptolink::LibraryError,
+ "OpenSSL EVP_MD_CTX_new() failed");
}
EVP_DigestInit_ex(md_, algo, NULL);
-// Copyright (C) 2014-2016 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2014-2017 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
md_ = HMAC_CTX_new();
if (md_ == 0) {
- isc_throw(LibraryError, "HMAC_CTX_new");
+ isc_throw(LibraryError, "OpenSSL HMAC_CTX_new() failed");
}
if (!HMAC_Init_ex(md_, secret,
static_cast<int>(secret_len),
algo, NULL)) {
- isc_throw(LibraryError, "HMAC_Init_ex");
+ isc_throw(LibraryError, "OpenSSL HMAC_Init_ex() failed");
}
}
size_t getOutputLength() const {
int size = HMAC_size(md_);
if (size < 0) {
- isc_throw(LibraryError, "HMAC_size");
+ isc_throw(LibraryError, "OpenSSL HMAC_size() failed");
}
return (static_cast<size_t>(size));
}
if (!HMAC_Update(md_,
static_cast<const unsigned char*>(data),
len)) {
- isc_throw(LibraryError, "HMAC_Update");
+ isc_throw(LibraryError, "OpenSSLHMAC_Update() failed");
}
}
size_t size = getOutputLength();
ossl::SecBuf<unsigned char> digest(size);
if (!HMAC_Final(md_, &digest[0], NULL)) {
- isc_throw(LibraryError, "HMAC_Final");
+ isc_throw(LibraryError, "OpenSSL HMAC_Final() failed");
}
if (len > size) {
len = size;
size_t size = getOutputLength();
ossl::SecBuf<unsigned char> digest(size);
if (!HMAC_Final(md_, &digest[0], NULL)) {
- isc_throw(LibraryError, "HMAC_Final");
+ isc_throw(LibraryError, "OpenSSL HMAC_Final() failed");
}
if (len > size) {
len = size;
size_t size = getOutputLength();
ossl::SecBuf<unsigned char> digest(size);
if (!HMAC_Final(md_, &digest[0], NULL)) {
- isc_throw(LibraryError, "HMAC_Final");
+ isc_throw(LibraryError, "OpenSSL HMAC_Final() failed");
}
if (len < size) {
digest.resize(len);
// Get the digest from a copy of the context
HMAC_CTX* tmp = HMAC_CTX_new();
if (tmp == 0) {
- isc_throw(LibraryError, "HMAC_CTX_new");
+ isc_throw(LibraryError, "OpenSSL HMAC_CTX_new() failed");
}
if (!HMAC_CTX_copy(tmp, md_)) {
HMAC_CTX_free(tmp);
- isc_throw(LibraryError, "HMAC_CTX_copy");
+ isc_throw(LibraryError, "OpenSSL HMAC_CTX_copy() failed");
}
ossl::SecBuf<unsigned char> digest(size);
if (!HMAC_Final(tmp, &digest[0], NULL)) {
HMAC_CTX_free(tmp);
- isc_throw(LibraryError, "HMAC_Final");
+ isc_throw(LibraryError, "OpenSSL HMAC_Final() failed");
}
HMAC_CTX_free(tmp);
if (len > size) {