Skip to content
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

Merged
merged 10 commits into from
Feb 14, 2022
Merged

Async keys auth #54

merged 10 commits into from
Feb 14, 2022

Conversation

EndrII
Copy link
Member

@EndrII EndrII commented Feb 13, 2022

Added support of ecdsa encryption for async authentication interface.

@EndrII EndrII added the enhancement New feature or request label Feb 13, 2022
@EndrII EndrII self-assigned this Feb 13, 2022
Comment on lines +209 to +236
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;
}
Copy link
Member

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());
Copy link
Member

@IgorekLoschinin IgorekLoschinin Feb 14, 2022

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// 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);
Copy link
Member

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.

@EndrII EndrII merged commit 2beefa2 into main Feb 14, 2022
@EndrII EndrII deleted the AsyncKeysAuth branch May 30, 2023 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants