mirror of
https://github.com/ceph/ceph
synced 2025-02-20 17:37:29 +00:00
auth: move Crypto{None,AES} definitions to header
CephContext will need this. Signed-off-by: Sage Weil <sage@inktank.com>
This commit is contained in:
parent
ef80abed73
commit
9b7482fce9
@ -58,18 +58,6 @@ static int get_random_bytes(int len, bufferlist& bl)
|
||||
|
||||
// ---------------------------------------------------
|
||||
|
||||
class CryptoNone : public CryptoHandler {
|
||||
public:
|
||||
CryptoNone() { }
|
||||
~CryptoNone() {}
|
||||
int create(bufferptr& secret);
|
||||
int validate_secret(bufferptr& secret);
|
||||
void encrypt(const bufferptr& secret, const bufferlist& in,
|
||||
bufferlist& out, std::string &error) const;
|
||||
void decrypt(const bufferptr& secret, const bufferlist& in,
|
||||
bufferlist& out, std::string &error) const;
|
||||
};
|
||||
|
||||
int CryptoNone::
|
||||
create(bufferptr& secret)
|
||||
{
|
||||
@ -222,18 +210,6 @@ static void nss_aes_operation(CK_ATTRIBUTE_TYPE op, const bufferptr& secret,
|
||||
# error "No supported crypto implementation found."
|
||||
#endif
|
||||
|
||||
class CryptoAES : public CryptoHandler {
|
||||
public:
|
||||
CryptoAES() { }
|
||||
~CryptoAES() {}
|
||||
int create(bufferptr& secret);
|
||||
int validate_secret(bufferptr& secret);
|
||||
void encrypt(const bufferptr& secret, const bufferlist& in,
|
||||
bufferlist& out, std::string &error) const;
|
||||
void decrypt(const bufferptr& secret, const bufferlist& in,
|
||||
bufferlist& out, std::string &error) const;
|
||||
};
|
||||
|
||||
int CryptoAES::create(bufferptr& secret)
|
||||
{
|
||||
bufferlist bl;
|
||||
|
@ -115,4 +115,28 @@ extern CryptoHandler *get_crypto_handler(int type);
|
||||
extern int get_random_bytes(char *buf, int len);
|
||||
|
||||
|
||||
class CryptoNone : public CryptoHandler {
|
||||
public:
|
||||
CryptoNone() { }
|
||||
~CryptoNone() {}
|
||||
int create(bufferptr& secret);
|
||||
int validate_secret(bufferptr& secret);
|
||||
void encrypt(const bufferptr& secret, const bufferlist& in,
|
||||
bufferlist& out, std::string &error) const;
|
||||
void decrypt(const bufferptr& secret, const bufferlist& in,
|
||||
bufferlist& out, std::string &error) const;
|
||||
};
|
||||
|
||||
class CryptoAES : public CryptoHandler {
|
||||
public:
|
||||
CryptoAES() { }
|
||||
~CryptoAES() {}
|
||||
int create(bufferptr& secret);
|
||||
int validate_secret(bufferptr& secret);
|
||||
void encrypt(const bufferptr& secret, const bufferlist& in,
|
||||
bufferlist& out, std::string &error) const;
|
||||
void decrypt(const bufferptr& secret, const bufferlist& in,
|
||||
bufferlist& out, std::string &error) const;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user