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

fix EVP_PKEY #55

Merged
merged 3 commits into from
Nov 4, 2024
Merged

fix EVP_PKEY #55

merged 3 commits into from
Nov 4, 2024

Conversation

nogolang
Copy link
Contributor

@nogolang nogolang commented Nov 4, 2024

fix EVP_PKEY and old version still work

if not pcall(function () return C.EVP_PKEY_size(pkey) end) then
size = C.EVP_PKEY_get_size(pkey)
else
size=C.EVP_PKEY_size(pkey)
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
size=C.EVP_PKEY_size(pkey)
size = C.EVP_PKEY_size(pkey)

local size = C.EVP_PKEY_size(pkey)
--local size = C.EVP_PKEY_size(pkey)
local size
if not pcall(function () return C.EVP_PKEY_size(pkey) end) then
Copy link
Owner

Choose a reason for hiding this comment

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

Let's use pcall like

if not pcall(function () return C.EVP_MD_CTX_create end) then
, so we only need to call once when loading the module.

@@ -388,7 +389,13 @@ function _M.new(_, opts)
end
end

local size = C.EVP_PKEY_size(pkey)
--local size = C.EVP_PKEY_size(pkey)
Copy link
Owner

Choose a reason for hiding this comment

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

We can remove it now

@@ -388,7 +396,8 @@ function _M.new(_, opts)
end
end

local size = C.EVP_PKEY_size(pkey)
local size=evp_pkey_size(pkey)
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
local size=evp_pkey_size(pkey)
local size = evp_pkey_size(pkey)

@nogolang
Copy link
Contributor Author

nogolang commented Nov 4, 2024

thank you, actually this is my first pull request

@spacewander
Copy link
Owner

thank you, actually this is my first pull request

I hope you're having fun!

@spacewander spacewander merged commit 2f1f13c into spacewander:master Nov 4, 2024
@spacewander
Copy link
Owner

@nogolang
Merged. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants