GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — crypto: use EVP_PKEY_CTX_set_dsa_paramgen_q_bits when available · nodejs/node@e0fbba0

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src/crypto
    • crypto_dsa.cc
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/crypto/crypto_dsa.cc‎

Copy file name to clipboardExpand all lines: src/crypto/crypto_dsa.cc
+13-7Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@
1212

1313
#include <cstdio>
1414

15+
// EVP_PKEY_CTX_set_dsa_paramgen_q_bits was added in OpenSSL 1.1.1e.
16+
#if OPENSSL_VERSION_NUMBER < 0x1010105fL
17+
#define EVP_PKEY_CTX_set_dsa_paramgen_q_bits(ctx, qbits) \
18+
EVP_PKEY_CTX_ctrl((ctx), \
19+
EVP_PKEY_DSA, \
20+
EVP_PKEY_OP_PARAMGEN, \
21+
EVP_PKEY_CTRL_DSA_PARAMGEN_Q_BITS, \
22+
(qbits), \
23+
nullptr)
24+
#endif
25+
1526
namespace node {
1627

1728
using v8::FunctionCallbackInfo;
@@ -39,13 +50,8 @@ EVPKeyCtxPointer DsaKeyGenTraits::Setup(DsaKeyPairGenConfig* params) {
3950
}
4051

4152
if (params->params.divisor_bits != -1) {
42-
if (EVP_PKEY_CTX_ctrl(
43-
param_ctx.get(),
44-
EVP_PKEY_DSA,
45-
EVP_PKEY_OP_PARAMGEN,
46-
EVP_PKEY_CTRL_DSA_PARAMGEN_Q_BITS,
47-
params->params.divisor_bits,
48-
nullptr) <= 0) {
53+
if (EVP_PKEY_CTX_set_dsa_paramgen_q_bits(
54+
param_ctx.get(), params->params.divisor_bits) <= 0) {
4955
return EVPKeyCtxPointer();
5056
}
5157
}

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.