Skip to content

Commit 14ed05f

Browse files
authored
crypto: fix BoringSSL RSA-PSS macro redefinitions
Signed-off-by: Filip Skokan <panva.ip@gmail.com> PR-URL: #66900 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
1 parent 28b50fb commit 14ed05f

2 files changed

Lines changed: 13 additions & 12 deletions

File tree

‎src/node_constants.cc‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838

3939
#if HAVE_OPENSSL
4040
#include <openssl/ec.h>
41+
#include <openssl/rsa.h>
4142
#include <openssl/ssl.h>
4243
#if !defined(RSA_PKCS1_PADDING)
4344
#define RSA_PKCS1_PADDING 1
@@ -57,6 +58,18 @@
5758
#if !defined(RSA_PKCS1_PSS_PADDING)
5859
#define RSA_PKCS1_PSS_PADDING 6
5960
#endif
61+
#ifndef RSA_PSS_SALTLEN_DIGEST
62+
#define RSA_PSS_SALTLEN_DIGEST -1
63+
#endif
64+
65+
#ifndef RSA_PSS_SALTLEN_MAX_SIGN
66+
#define RSA_PSS_SALTLEN_MAX_SIGN -2
67+
#endif
68+
69+
#ifndef RSA_PSS_SALTLEN_AUTO
70+
#define RSA_PSS_SALTLEN_AUTO -2
71+
#endif
72+
6073
#if !defined(OPENSSL_IS_BORINGSSL) && OPENSSL_VERSION_MAJOR >= 3
6174
// OpenSSL hides these deprecated DH check constants under
6275
// OPENSSL_NO_DEPRECATED, but the numeric verifyError values remain public API.

‎src/node_constants.h‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,6 @@
3232

3333
#if HAVE_OPENSSL
3434

35-
#ifndef RSA_PSS_SALTLEN_DIGEST
36-
#define RSA_PSS_SALTLEN_DIGEST -1
37-
#endif
38-
39-
#ifndef RSA_PSS_SALTLEN_MAX_SIGN
40-
#define RSA_PSS_SALTLEN_MAX_SIGN -2
41-
#endif
42-
43-
#ifndef RSA_PSS_SALTLEN_AUTO
44-
#define RSA_PSS_SALTLEN_AUTO -2
45-
#endif
46-
4735
#if defined(NODE_OPENSSL_DEFAULT_CIPHER_LIST)
4836
#define DEFAULT_CIPHER_LIST_CORE NODE_OPENSSL_DEFAULT_CIPHER_LIST
4937
#else

0 commit comments

Comments
 (0)