Skip to content

Commit defdb2f

Browse files
committed
src: cleanup some obsolete includes in crypto_util
1 parent df29de0 commit defdb2f

File tree

3 files changed

+3
-23
lines changed

3 files changed

+3
-23
lines changed

deps/ncrypto/ncrypto.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ DataPointer DataPointer::Alloc(size_t len) {
113113

114114
DataPointer DataPointer::SecureAlloc(size_t len) {
115115
#ifndef OPENSSL_IS_BORINGSSL
116-
printf("... %zu\n", len);
117116
auto ptr = OPENSSL_secure_zalloc(len);
118117
if (ptr == nullptr) return {};
119118
return DataPointer(ptr, len, true);

src/crypto/crypto_hkdf.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ bool HKDFTraits::DeriveBits(
117117
params.length);
118118
if (!dp) return false;
119119

120-
DCHECK(!data.isSecure());
120+
DCHECK(!dp.isSecure());
121121
*out = ByteSource::Allocated(dp.release());
122122
return true;
123123
}

src/crypto/crypto_util.h

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,6 @@
1414

1515
#include "ncrypto.h"
1616

17-
#include <openssl/dsa.h>
18-
#include <openssl/ec.h>
19-
#include <openssl/err.h>
20-
#include <openssl/evp.h>
21-
#include <openssl/hmac.h>
22-
#include <openssl/kdf.h>
23-
#include <openssl/rsa.h>
24-
#include <openssl/ssl.h>
25-
26-
// The FIPS-related functions are only available
27-
// when the OpenSSL itself was compiled with FIPS support.
28-
#if defined(OPENSSL_FIPS) && OPENSSL_VERSION_MAJOR < 3
29-
# include <openssl/fips.h>
30-
#endif // OPENSSL_FIPS
31-
3217
#include <algorithm>
3318
#include <climits>
3419
#include <cstdio>
@@ -37,9 +22,7 @@
3722
#include <string>
3823
#include <vector>
3924

40-
namespace node {
41-
42-
namespace crypto {
25+
namespace node::crypto {
4326
// Currently known sizes of commonly used OpenSSL struct sizes.
4427
// OpenSSL considers it's various structs to be opaque and the
4528
// sizes may change from one version of OpenSSL to another, so
@@ -665,9 +648,7 @@ namespace Util {
665648
void Initialize(Environment* env, v8::Local<v8::Object> target);
666649
void RegisterExternalReferences(ExternalReferenceRegistry* registry);
667650
} // namespace Util
668-
669-
} // namespace crypto
670-
} // namespace node
651+
} // namespace node::crypto
671652

672653
#endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS
673654
#endif // SRC_CRYPTO_CRYPTO_UTIL_H_

0 commit comments

Comments
 (0)