File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change 28
28
#include < openssl/fips.h>
29
29
#endif // OPENSSL_FIPS
30
30
31
- # if OPENSSL_VERSION_MAJOR >= 3
32
- #define OSSL3_CONST const
33
- #if OPENSSL_VERSION_MINOR >= 5
31
+ // Define OPENSSL_WITH_PQC for post-quantum cryptography support
32
+ #if OPENSSL_VERSION_NUMBER >= 0x30500000L
33
+ #define OPENSSL_WITH_PQC 1
34
34
#include < openssl/core_names.h>
35
35
#endif
36
+
37
+ #if OPENSSL_VERSION_MAJOR >= 3
38
+ #define OSSL3_CONST const
36
39
#else
37
40
#define OSSL3_CONST
38
41
#endif
@@ -715,7 +718,7 @@ class EVPKeyPointer final {
715
718
const Buffer<const unsigned char >& data);
716
719
static EVPKeyPointer NewRawPrivate (int id,
717
720
const Buffer<const unsigned char >& data);
718
- #if OPENSSL_VERSION_MAJOR >= 3 && OPENSSL_VERSION_MINOR >= 5
721
+ #if OPENSSL_WITH_PQC
719
722
static EVPKeyPointer NewRawSeed (int id,
720
723
const Buffer<const unsigned char >& data);
721
724
#endif
@@ -812,7 +815,7 @@ class EVPKeyPointer final {
812
815
DataPointer rawPrivateKey () const ;
813
816
BIOPointer derPublicKey () const ;
814
817
815
- #if OPENSSL_VERSION_MAJOR >= 3 && OPENSSL_VERSION_MINOR >= 5
818
+ #if OPENSSL_WITH_PQC
816
819
DataPointer rawSeed () const ;
817
820
#endif
818
821
Original file line number Diff line number Diff line change @@ -1983,7 +1983,7 @@ EVPKeyPointer EVPKeyPointer::NewRawPrivate(
1983
1983
EVP_PKEY_new_raw_private_key (id, nullptr , data.data , data.len ));
1984
1984
}
1985
1985
1986
- #if OPENSSL_VERSION_MAJOR >= 3 && OPENSSL_VERSION_MINOR >= 5
1986
+ #if OPENSSL_WITH_PQC
1987
1987
EVPKeyPointer EVPKeyPointer::NewRawSeed (
1988
1988
int id, const Buffer<const unsigned char >& data) {
1989
1989
if (id == 0 ) return {};
@@ -2066,7 +2066,7 @@ EVP_PKEY* EVPKeyPointer::release() {
2066
2066
int EVPKeyPointer::id (const EVP_PKEY* key) {
2067
2067
if (key == nullptr ) return 0 ;
2068
2068
int type = EVP_PKEY_id (key);
2069
- #if OPENSSL_VERSION_MAJOR >= 3 && OPENSSL_VERSION_MINOR >= 5
2069
+ #if OPENSSL_WITH_PQC
2070
2070
// https://github.com/openssl/openssl/issues/27738#issuecomment-3013215870
2071
2071
if (type == -1 ) {
2072
2072
if (EVP_PKEY_is_a (key, " ML-DSA-44" )) return EVP_PKEY_ML_DSA_44;
@@ -2130,7 +2130,7 @@ DataPointer EVPKeyPointer::rawPublicKey() const {
2130
2130
return {};
2131
2131
}
2132
2132
2133
- #if OPENSSL_VERSION_MAJOR >= 3 && OPENSSL_VERSION_MINOR >= 5
2133
+ #if OPENSSL_WITH_PQC
2134
2134
DataPointer EVPKeyPointer::rawSeed () const {
2135
2135
if (!pkey_) return {};
2136
2136
switch (id ()) {
@@ -2608,7 +2608,7 @@ bool EVPKeyPointer::isOneShotVariant() const {
2608
2608
switch (type) {
2609
2609
case EVP_PKEY_ED25519:
2610
2610
case EVP_PKEY_ED448:
2611
- #if OPENSSL_VERSION_MAJOR >= 3 && OPENSSL_VERSION_MINOR >= 5
2611
+ #if OPENSSL_WITH_PQC
2612
2612
case EVP_PKEY_ML_DSA_44:
2613
2613
case EVP_PKEY_ML_DSA_65:
2614
2614
case EVP_PKEY_ML_DSA_87:
You can’t perform that action at this time.
0 commit comments