Skip to content

Commit

Permalink
src: cleanup some obsolete includes in crypto_util
Browse files Browse the repository at this point in the history
  • Loading branch information
jasnell committed Mar 6, 2025
1 parent df29de0 commit defdb2f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 23 deletions.
1 change: 0 additions & 1 deletion deps/ncrypto/ncrypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ DataPointer DataPointer::Alloc(size_t len) {

DataPointer DataPointer::SecureAlloc(size_t len) {
#ifndef OPENSSL_IS_BORINGSSL
printf("... %zu\n", len);
auto ptr = OPENSSL_secure_zalloc(len);
if (ptr == nullptr) return {};
return DataPointer(ptr, len, true);
Expand Down
2 changes: 1 addition & 1 deletion src/crypto/crypto_hkdf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ bool HKDFTraits::DeriveBits(
params.length);
if (!dp) return false;

DCHECK(!data.isSecure());
DCHECK(!dp.isSecure());
*out = ByteSource::Allocated(dp.release());
return true;
}
Expand Down
23 changes: 2 additions & 21 deletions src/crypto/crypto_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,6 @@

#include "ncrypto.h"

#include <openssl/dsa.h>
#include <openssl/ec.h>
#include <openssl/err.h>
#include <openssl/evp.h>
#include <openssl/hmac.h>
#include <openssl/kdf.h>
#include <openssl/rsa.h>
#include <openssl/ssl.h>

// The FIPS-related functions are only available
// when the OpenSSL itself was compiled with FIPS support.
#if defined(OPENSSL_FIPS) && OPENSSL_VERSION_MAJOR < 3
# include <openssl/fips.h>
#endif // OPENSSL_FIPS

#include <algorithm>
#include <climits>
#include <cstdio>
Expand All @@ -37,9 +22,7 @@
#include <string>
#include <vector>

namespace node {

namespace crypto {
namespace node::crypto {
// Currently known sizes of commonly used OpenSSL struct sizes.
// OpenSSL considers it's various structs to be opaque and the
// sizes may change from one version of OpenSSL to another, so
Expand Down Expand Up @@ -665,9 +648,7 @@ namespace Util {
void Initialize(Environment* env, v8::Local<v8::Object> target);
void RegisterExternalReferences(ExternalReferenceRegistry* registry);
} // namespace Util

} // namespace crypto
} // namespace node
} // namespace node::crypto

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

0 comments on commit defdb2f

Please sign in to comment.