-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Async keys auth #54
Async keys auth #54
Conversation
auto free = [eckey, ecgroup] () { | ||
if (*ecgroup) | ||
EC_GROUP_free(*ecgroup); | ||
|
||
if (*eckey) | ||
EC_KEY_free(*eckey); | ||
}; | ||
|
||
*eckey = EC_KEY_new(); | ||
if (!*eckey) { | ||
printlastOpenSSlError(); | ||
free(); | ||
return false; | ||
} | ||
|
||
*ecgroup = EC_GROUP_new_by_curve_name(NID_secp256k1); | ||
|
||
if (!*ecgroup) { | ||
printlastOpenSSlError(); | ||
free(); | ||
return false; | ||
} | ||
|
||
if (!EC_KEY_set_group(*eckey, *ecgroup)) { | ||
printlastOpenSSlError(); | ||
free(); | ||
return false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a little unclear what's going on here.
QVERIFY(QH::AuthECDSA::makeKeys(pub, priv)); | ||
|
||
// check createed keys. should be larget then 0. | ||
QVERIFY(pub.length() && priv.length()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this test redundant by any chance?
// create test auth object using ecdsa algorithm | ||
ECDSA edsa(pub, priv); | ||
|
||
// The terst object should be invalid because it is not prepared. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// The terst object should be invalid because it is not prepared. | |
// The test object should be invalid because it is not prepared. |
data.insert(0, reinterpret_cast<const char*>(&_unixTime), | ||
sizeof(_unixTime)); | ||
|
||
return checkSign(data, _signature, _publicKey); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where does this method come from, I don’t see either from which it is connected.
Added support of ecdsa encryption for async authentication interface.