move auth to base64 from hex
All checks were successful
buildbot/WindowsBuilder Build finished.
buildbot/WindowsCMakeBuilder Build finished.

This commit is contained in:
Andrei Yankovich 2022-02-17 18:49:09 +03:00
parent 2beefa22ca
commit 9ff5f6664b
3 changed files with 4 additions and 3 deletions

View File

@ -36,7 +36,8 @@ bool AsyncKeysAuth::auth(int allowedTimeRangeSec, QString* userId) const {
if (result && userId) {
*userId = QCryptographicHash::hash(_publicKey,
QCryptographicHash::Sha256).toHex();
QCryptographicHash::Sha256).
toBase64(QByteArray::Base64UrlEncoding);
}
return result;

View File

@ -55,7 +55,7 @@ public:
/**
* @brief auth This method make authentication and return true if the authentication finished successful else false.
* @brief retLoginedUserId This is logined user id in hex
* @brief retLoginedUserId This is logined user id in Base64UrlEncoding
* @return true if the authentication finished successful else false.
*/
bool auth(int allowedTimeRangeSec, QString* retLoginedUserId) const;

View File

@ -50,7 +50,7 @@ void ECDSAAuthTest::test() {
// make user id
QString userIDOfPubKey = QCryptographicHash::hash(pub,
QCryptographicHash::Sha256).
toHex();
toBase64(QByteArray::Base64UrlEncoding);
// check createed keys. should be larget then 0.
QVERIFY(pub.length() && priv.length());