Skip to content

openssl ed25519 fix#134

Open
henrikalves wants to merge 3 commits intolbuchs:masterfrom
henrikalves:openssl-ed25519
Open

openssl ed25519 fix#134
henrikalves wants to merge 3 commits intolbuchs:masterfrom
henrikalves:openssl-ed25519

Conversation

@henrikalves
Copy link
Copy Markdown

PHP 8.4 added ed25519 support in OpenSSL:
https://www.php.net/manual/en/migration84.new-features.php#migration84.new-features.openssl

openssl_get_curve_names() does not return ed25519, so the previous curve-based check did not work.

I changed the detection to check if OPENSSL_KEYTYPE_ED25519 is defined instead.

There was also an issue in the verify logic: for Ed25519, openssl_verify() must use algorithm 0, not OPENSSL_ALGO_SHA256.

At the moment, I am using openssl_pkey_get_details() to determine the key type. I am not sure whether there is a better way to detect this without calling openssl_pkey_get_details(), but this works for now.

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.

1 participant