Skip to content

Commit 7759bb1

Browse files
antoinelochetAntoine Lochet
authored andcommitted
Applied CodeRabbit AI suggestions
1 parent 1e03bbc commit 7759bb1

File tree

4 files changed

+32
-0
lines changed

4 files changed

+32
-0
lines changed

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)