Skip to content

Commit 24a8aae

Browse files
author
Antoine Lochet
committed
Applied CodeRabbit AI suggestions
1 parent aa10f0a commit 24a8aae

6 files changed

Lines changed: 35 additions & 40 deletions

File tree

m4/acx_botan_mldsa.m4

Lines changed: 0 additions & 33 deletions
This file was deleted.

m4/acx_crypto_backend.m4

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -185,13 +185,9 @@ AC_DEFUN([ACX_CRYPTO_BACKEND],[
185185
detect-*) enable_eddsa="${have_lib_botan_eddsa_support}";;
186186
esac
187187
188-
case "${enable_mldsa}" in
189-
yes|detect) ACX_BOTAN_MLDSA;;
190-
esac
191-
case "${enable_mldsa}-${have_lib_botan_mldsa_support}" in
192-
yes-no) AC_MSG_ERROR([Botan library has no ML-DSA support]);;
193-
detect-*) enable_mldsa="${have_lib_botan_mldsa_support}";;
194-
esac
188+
if test "x${enable_mldsa}" = "xyes"; then
189+
AC_MSG_ERROR([Botan does not support ML-DSA])
190+
fi
195191
196192
case "${enable_gost}" in
197193
yes|detect) ACX_BOTAN_GOST;;

src/lib/crypto/OSSLMLDSAPublicKey.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,27 @@ OSSLMLDSAPublicKey::~OSSLMLDSAPublicKey()
3737
}
3838
}
3939

40+
OSSLMLDSAPublicKey::OSSLMLDSAPublicKey(OSSLMLDSAPublicKey&& other) noexcept
41+
: MLDSAPublicKey(std::move(other)), pkey(other.pkey)
42+
{
43+
other.pkey = NULL;
44+
}
45+
46+
OSSLMLDSAPublicKey& OSSLMLDSAPublicKey::operator=(OSSLMLDSAPublicKey&& other) noexcept
47+
{
48+
if (this != &other)
49+
{
50+
// move base
51+
MLDSAPublicKey::operator=(std::move(other));
52+
// release current
53+
if (pkey) { EVP_PKEY_free(pkey); }
54+
// steal
55+
pkey = other.pkey;
56+
other.pkey = NULL;
57+
}
58+
return *this;
59+
}
60+
4061
// The type
4162
/*static*/ const char* OSSLMLDSAPublicKey::type = "OpenSSL ML-DSA Public Key";
4263

src/lib/crypto/OSSLMLDSAPublicKey.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ class OSSLMLDSAPublicKey : public MLDSAPublicKey
2323
// Destructor
2424
virtual ~OSSLMLDSAPublicKey();
2525

26+
// Non-copyable (raw ownership of EVP_PKEY)
27+
OSSLMLDSAPublicKey(const OSSLMLDSAPublicKey&) = delete;
28+
OSSLMLDSAPublicKey& operator=(const OSSLMLDSAPublicKey&) = delete;
29+
30+
// Movable
31+
OSSLMLDSAPublicKey(OSSLMLDSAPublicKey&&) noexcept;
32+
OSSLMLDSAPublicKey& operator=(OSSLMLDSAPublicKey&&) noexcept;
33+
2634
// The type
2735
static const char* type;
2836

src/lib/crypto/OSSLUtil.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@
3434
#include "log.h"
3535
#include "DerUtil.h"
3636
#include "OSSLUtil.h"
37+
#ifdef WITH_ML_DSA
3738
#include "MLDSAParameters.h"
3839
#include <map>
40+
#endif
3941
#include <openssl/asn1.h>
4042
#include <openssl/evp.h>
4143
#include <openssl/err.h>

src/lib/object_store/DBObject.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,7 @@ static AttributeKind attributeKind(CK_ATTRIBUTE_TYPE type)
520520
case CKA_OS_USERPIN: return akBinary;
521521

522522
case CKA_PARAMETER_SET: return akInteger;
523+
case CKA_SEED: return akBinary;
523524

524525
default: return akUnknown;
525526
}

0 commit comments

Comments
 (0)