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

Remove libsodium #86

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

sgessa
Copy link
Contributor

@sgessa sgessa commented May 24, 2024

This PR removes libsalty library because outdated and no longer maintained.
libsalty was used for XChaCha20Poly1305 and Ed25519 crypto functions that are now implemented using Erlang native crypto functions.
I also fixed an issue where V2.sign/3 expected a keypair (a binary composed with private + public key) with 64 bytes length to work. Only the secret key is needed for signing and must be 32 bytes.

@sgessa sgessa marked this pull request as draft May 24, 2024 12:02
Copy link
Contributor Author

@sgessa sgessa left a comment

Choose a reason for hiding this comment

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

@Ianleeclark can you take a look? What do you think?

PS: should I bump the Elixir version too?

iex> Paseto.V2.sign("Test Message", sk)
"v2.public.VGVzdAJxQsXSrgYBkcwiOnWamiattqhhhNN_1jsY-LR_YbsoYpZ18-ogVSxWv7d8DlqzLSz9csqNtSzDk4y0JV5xaAE"
"""
@spec sign(String.t(), String.t(), String.t()) :: String.t() | {:error, String.t()}
def sign(data, secret_key, footer \\ "") when byte_size(secret_key) == 64 do
def sign(data, secret_key, footer \\ "") when byte_size(secret_key) == 32 do
Copy link
Contributor Author

Choose a reason for hiding this comment

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

each key in Ed25519 is 32 bytes

@@ -3,17 +3,15 @@
vector: "v2-S-1",
token:
"v2.public.eyJkYXRhIjoidGhpcyBpcyBhIHNpZ25lZCBtZXNzYWdlIiwiZXhwIjoiMjAxOS0wMS0wMVQwMDowMDowMCswMDowMCJ9HQr8URrGntTu7Dz9J2IF23d1M7-9lH9xiqdGyJNvzp4angPW5Esc7C5huy_M8I8_DjJK2ZXC2SUYuOFM-Q_5Cw",
private_key:
"b4cbfb43 df4ce210 727d953e 4a713307 fa19bb7d 9f850414 38d9e11b 942a3774 1eb9dbbb bc047c03 fd70604e 0071f098 7e16b28b 757225c1 1f00415d 0e20b1a2",
private_key: "b4cbfb43 df4ce210 727d953e 4a713307 fa19bb7d 9f850414 38d9e11b 942a3774",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

removing the public key since it's not needed

public_key: "1eb9dbbb bc047c03 fd70604e 0071f098 7e16b28b 757225c1 1f00415d 0e20b1a2",
payload: ~s({"data":"this is a signed message","exp":"2019-01-01T00:00:00+00:00"})
],
[
vector: "v2-S-2",
token:
"v2.public.eyJkYXRhIjoidGhpcyBpcyBhIHNpZ25lZCBtZXNzYWdlIiwiZXhwIjoiMjAxOS0wMS0wMVQwMDowMDowMCswMDowMCJ9flsZsx_gYCR0N_Ec2QxJFFpvQAs7h9HtKwbVK2n1MJ3Rz-hwe8KUqjnd8FAnIJZ601tp7lGkguU63oGbomhoBw.eyJraWQiOiJ6VmhNaVBCUDlmUmYyc25FY1Q3Z0ZUaW9lQTlDT2NOeTlEZmdMMVc2MGhhTiJ9",
private_key:
"b4cbfb43 df4ce210 727d953e 4a713307 fa19bb7d 9f850414 38d9e11b 942a3774 1eb9dbbb bc047c03 fd70604e 0071f098 7e16b28b 757225c1 1f00415d 0e20b1a2",
private_key: "b4cbfb43 df4ce210 727d953e 4a713307 fa19bb7d 9f850414 38d9e11b 942a3774",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

removing the public key since it's not needed

@sgessa sgessa marked this pull request as ready for review May 24, 2024 19:56
@Ianleeclark
Copy link
Owner

Ianleeclark commented Jun 12, 2024 via email

@Ianleeclark
Copy link
Owner

Unfortunately I'm going to have to reject this as it increases the maintenance burden and quite frankly I'm stuffed to the gills at the moment.

Should things ease up, I'll leave this open and reassure

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