Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions public_include/libcert_crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,4 @@ std::string encrypt(const std::string& plainData, const std::string& passphrase)
*/
std::string decrypt(const std::string& encryptedData, const std::string& passphrase);

/**
* Check pass phraseFormat
* @param phassphrase
* @return True if the passphrase is Ok, otherwise false.
*/
bool checkPassphraseFormat(const std::string& passphrase);

/**
* Get passphrase format
* @param phassphrase
* @return The passphrase format
*/
std::string getPassphraseFormat();

} // namespace fty
15 changes: 0 additions & 15 deletions src/libcert_crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@

#include "libcert_openssl_wrapper.h"
#include <iostream>
#include <memory>
#include <regex>
#include <sstream>

namespace fty {
static constexpr const char* PASS_PHRASE_FORMAT_REGEX = ".{8,}";
Expand Down Expand Up @@ -78,16 +75,4 @@ std::string decrypt(const std::string& encryptedData, const std::string& passphr
return bytesToStr(plainBinary);
}

bool checkPassphraseFormat(const std::string& passphrase)
{
std::regex reg(PASS_PHRASE_FORMAT_REGEX);

return !passphrase.empty() && std::regex_search(passphrase, reg);
}

std::string getPassphraseFormat()
{
return std::string(PASS_PHRASE_FORMAT_REGEX);
}

} // namespace fty