|
15 | 15 | #include <openssl/hkdf.h> |
16 | 16 | #endif |
17 | 17 |
|
18 | | -#if OPENSSL_VERSION_NUMBER >= 0x30200000L |
19 | | -#include <openssl/thread.h> |
20 | | -#endif |
21 | | - |
22 | 18 | #include <algorithm> |
23 | 19 | #include <array> |
24 | 20 | #include <cstring> |
25 | | -<<<<<<< nodejs/ncrypto:src/ncrypto.cpp |
26 | 21 | #include <string_view> |
27 | 22 | #include <vector> |
28 | | -||||||| nodejs/node:deps/ncrypto/ncrypto.cc@84aaed75978e |
29 | | -======= |
30 | | -#include <string_view> |
31 | | ->>>>>>> nodejs/node:deps/ncrypto/ncrypto.cc@8385efc01343 |
32 | 23 | #if OPENSSL_VERSION_MAJOR >= 3 |
33 | 24 | #include <openssl/core_names.h> |
34 | 25 | #include <openssl/params.h> |
@@ -3258,20 +3249,13 @@ const Cipher Cipher::AES_256_GCM = Cipher::FromNid(NID_aes_256_gcm); |
3258 | 3249 | const Cipher Cipher::AES_128_KW = Cipher::FromNid(NID_id_aes128_wrap); |
3259 | 3250 | const Cipher Cipher::AES_192_KW = Cipher::FromNid(NID_id_aes192_wrap); |
3260 | 3251 | const Cipher Cipher::AES_256_KW = Cipher::FromNid(NID_id_aes256_wrap); |
3261 | | -<<<<<<< nodejs/ncrypto:src/ncrypto.cpp |
3262 | 3252 |
|
3263 | 3253 | #ifndef OPENSSL_IS_BORINGSSL |
3264 | 3254 | const Cipher Cipher::AES_128_OCB = Cipher::FromNid(NID_aes_128_ocb); |
3265 | 3255 | const Cipher Cipher::AES_192_OCB = Cipher::FromNid(NID_aes_192_ocb); |
3266 | 3256 | const Cipher Cipher::AES_256_OCB = Cipher::FromNid(NID_aes_256_ocb); |
3267 | 3257 | #endif |
3268 | 3258 |
|
3269 | | -||||||| nodejs/node:deps/ncrypto/ncrypto.cc@84aaed75978e |
3270 | | -======= |
3271 | | -const Cipher Cipher::AES_128_OCB = Cipher::FromNid(NID_aes_128_ocb); |
3272 | | -const Cipher Cipher::AES_192_OCB = Cipher::FromNid(NID_aes_192_ocb); |
3273 | | -const Cipher Cipher::AES_256_OCB = Cipher::FromNid(NID_aes_256_ocb); |
3274 | | ->>>>>>> nodejs/node:deps/ncrypto/ncrypto.cc@8385efc01343 |
3275 | 3259 | const Cipher Cipher::CHACHA20_POLY1305 = Cipher::FromNid(NID_chacha20_poly1305); |
3276 | 3260 |
|
3277 | 3261 | bool Cipher::isGcmMode() const { |
@@ -4552,57 +4536,6 @@ std::optional<EVP_PKEY_CTX*> EVPMDCtxPointer::verifyInit( |
4552 | 4536 | return ctx; |
4553 | 4537 | } |
4554 | 4538 |
|
4555 | | -<<<<<<< nodejs/ncrypto:src/ncrypto.cpp |
4556 | | -std::optional<EVP_PKEY_CTX*> EVPMDCtxPointer::signInitWithContext( |
4557 | | - const EVPKeyPointer& key, |
4558 | | - const Digest& digest, |
4559 | | - const Buffer<const unsigned char>& context_string) { |
4560 | | -#ifdef OSSL_SIGNATURE_PARAM_CONTEXT_STRING |
4561 | | - EVP_PKEY_CTX* ctx = nullptr; |
4562 | | - |
4563 | | - const OSSL_PARAM params[] = { |
4564 | | - OSSL_PARAM_construct_octet_string( |
4565 | | - OSSL_SIGNATURE_PARAM_CONTEXT_STRING, |
4566 | | - const_cast<unsigned char*>(context_string.data), |
4567 | | - context_string.len), |
4568 | | - OSSL_PARAM_END}; |
4569 | | - |
4570 | | - if (!EVP_DigestSignInit_ex( |
4571 | | - ctx_.get(), &ctx, nullptr, nullptr, nullptr, key.get(), params)) { |
4572 | | - return std::nullopt; |
4573 | | - } |
4574 | | - return ctx; |
4575 | | -#else |
4576 | | - return std::nullopt; |
4577 | | -#endif |
4578 | | -} |
4579 | | - |
4580 | | -std::optional<EVP_PKEY_CTX*> EVPMDCtxPointer::verifyInitWithContext( |
4581 | | - const EVPKeyPointer& key, |
4582 | | - const Digest& digest, |
4583 | | - const Buffer<const unsigned char>& context_string) { |
4584 | | -#ifdef OSSL_SIGNATURE_PARAM_CONTEXT_STRING |
4585 | | - EVP_PKEY_CTX* ctx = nullptr; |
4586 | | - |
4587 | | - const OSSL_PARAM params[] = { |
4588 | | - OSSL_PARAM_construct_octet_string( |
4589 | | - OSSL_SIGNATURE_PARAM_CONTEXT_STRING, |
4590 | | - const_cast<unsigned char*>(context_string.data), |
4591 | | - context_string.len), |
4592 | | - OSSL_PARAM_END}; |
4593 | | - |
4594 | | - if (!EVP_DigestVerifyInit_ex( |
4595 | | - ctx_.get(), &ctx, nullptr, nullptr, nullptr, key.get(), params)) { |
4596 | | - return std::nullopt; |
4597 | | - } |
4598 | | - return ctx; |
4599 | | -#else |
4600 | | - return std::nullopt; |
4601 | | -#endif |
4602 | | -} |
4603 | | - |
4604 | | -||||||| nodejs/node:deps/ncrypto/ncrypto.cc@84aaed75978e |
4605 | | -======= |
4606 | 4539 | std::optional<EVP_PKEY_CTX*> EVPMDCtxPointer::signInitWithContext( |
4607 | 4540 | const EVPKeyPointer& key, |
4608 | 4541 | const Digest& digest, |
@@ -4693,7 +4626,6 @@ std::optional<EVP_PKEY_CTX*> EVPMDCtxPointer::verifyInitWithContext( |
4693 | 4626 | #endif |
4694 | 4627 | } |
4695 | 4628 |
|
4696 | | ->>>>>>> nodejs/node:deps/ncrypto/ncrypto.cc@8385efc01343 |
4697 | 4629 | DataPointer EVPMDCtxPointer::signOneShot( |
4698 | 4630 | const Buffer<const unsigned char>& buf) const { |
4699 | 4631 | if (!ctx_) return {}; |
|
0 commit comments