Repository navigation
Conversation
|
Tests are failing, but I got the same failures when I run I think that paramiko automated tests should be migrated to GitHub Actions first. Let me know if you need help with the GitHub Actions migration. |
|
Any updates? Because we are trying to install paramiko with ARM64 chip but encountered issue with |
|
@ash-cryptocom you can try to the patch and see if it works for you. |
|
@ash-cryptocom / @adiroiban I can confirm success w/ this patch. In addition to the patch I needed to get You can confirm you're having the same issue with the following: To fix the issue run the following: Verify the native-extension architecture (it should be I hope this helps. |
|
Probably I'm misunderstanding something but I think the minimum version of |
Inspired by: paramiko#1806
|
This doesn't use |
|
(... more accurately: this uses Raw serialization, not openssh format serialization, from cryptography, so cryptography version 2.6 should be sufficient) |
Ed25519 support arrived in 2.2 (paramiko#325 via paramiko#972) backed by PyNaCl, because Cryptography had no Ed25519 primitive at the time; it landed in Cryptography 2.6, roughly two years later. Our floor is already 3.3, so the primitive has been available across the entire supported range, and Ed25519Key was the last remaining user of PyNaCl. Beyond dropping a C-extension dependency, this puts Ed25519 under the same OpenSSL configuration that already governs every other key type, cipher and KEX we use -- including any algorithm policy the host OpenSSL enforces, which a separately bundled libsodium cannot participate in. Compare KexCurve25519.is_available(), which already defers to Cryptography for exactly that reason. Implementation notes: * Uses public_bytes(Encoding.Raw, PublicFormat.Raw) rather than the tidier public_bytes_raw(), which only exists as of Cryptography 40. The older spelling works across our whole supported range, including the 3.3.2 and 39.0.0 cells in CI. * Ed25519Key._fields now holds the key's raw bytes rather than the key object itself. Cryptography's key objects compare by identity on older versions (3.3.2, 39.0.0) and are unhashable on newer ones, so neither is safe for the equality and hashing contract PKey relies on here; raw bytes are exact on every version. test_ed25519_compare gains a hash() assertion so it covers both failure modes. * Cryptography's verify() takes (signature, data), the reverse of PyNaCl's verify(smessage, signature). Wire format is unchanged. Ed25519 is deterministic, so the new test_sign_and_verify_ed25519 pins the exact signature bytes the PyNaCl implementation produced for the existing test key. The one user-visible change is Ed25519Key.verifying_key, which now returns an Ed25519PublicKey rather than a nacl.signing.VerifyKey. Refs paramiko#1419, paramiko#2527. Builds on the earlier attempts by @adiroiban in paramiko#1806 and @boyxuper in paramiko#2103.
Ed25519 support arrived in 2.2 (paramiko#325 via paramiko#972) backed by PyNaCl, because Cryptography had no Ed25519 primitive at the time; it landed in Cryptography 2.6, roughly two years later. Our floor is already 3.3, so the primitive has been available across the entire supported range, and Ed25519Key was the last remaining user of PyNaCl. Beyond dropping a C-extension dependency, this puts Ed25519 under the same OpenSSL configuration that already governs every other key type, cipher and KEX we use -- including any algorithm policy the host OpenSSL enforces, which a separately bundled libsodium cannot participate in. Compare KexCurve25519.is_available(), which already defers to Cryptography for exactly that reason. Implementation notes: * Uses public_bytes(Encoding.Raw, PublicFormat.Raw) rather than the tidier public_bytes_raw(), which only exists as of Cryptography 40. The older spelling works across our whole supported range, including the 3.3.2 and 39.0.0 cells in CI. * Ed25519Key._fields now holds the key's raw bytes rather than the key object itself. Cryptography's key objects compare by identity on older versions (3.3.2, 39.0.0) and are unhashable on newer ones, so neither is safe for the equality and hashing contract PKey relies on here; raw bytes are exact on every version. test_ed25519_compare gains a hash() assertion so it covers both failure modes. * Cryptography's verify() takes (signature, data), the reverse of PyNaCl's verify(smessage, signature). Wire format is unchanged. Ed25519 is deterministic, so the new test_sign_and_verify_ed25519 pins the exact signature bytes the PyNaCl implementation produced for the existing test key. The one user-visible change is Ed25519Key.verifying_key, which now returns an Ed25519PublicKey rather than a nacl.signing.VerifyKey. Refs paramiko#1419, paramiko#2527. Builds on the earlier attempts by @adiroiban in paramiko#1806 and @boyxuper in paramiko#2103.
Ed25519Key was the last thing using PyNaCl, and only did so because Cryptography had no Ed25519 primitive back when 2.2 shipped; it grew one in 2.6 and our floor is already 3.3. Wire format is unchanged. _fields now holds the key's raw bytes rather than the key object, since Cryptography's key objects compare by identity on older versions and are unhashable on newer ones. verifying_key returns an Ed25519PublicKey rather than a nacl.signing.VerifyKey, which is the one API change. Refs paramiko#1419, paramiko#2527. Same approach as paramiko#1806 and paramiko#2103.
Ed25519Key was the last thing using PyNaCl, and only did so because Cryptography had no Ed25519 primitive back when 2.2 shipped; it grew one in 2.6 and our floor is already 3.3. Wire format is unchanged. _fields now holds the key's raw bytes rather than the key object, since Cryptography's key objects compare by identity on older versions and are unhashable on newer ones. verifying_key returns an Ed25519PublicKey rather than a nacl.signing.VerifyKey, which is the one API change. Refs paramiko#1419, paramiko#2527. Same approach as paramiko#1806 and paramiko#2103.
Scope
The pynacl is only used for ED keys.
cryptography starting with 2.6 supports ED signing.
I think that by removing the pynacl and libsodium deps, it will be much easier to deploy paramiko.
I saw a few issues about failing to use paramiko due to the pynacl deps.
Changes
Update requirements from cryptography 2.5 to 2.6 for ED support.
I think that bcrypt will remain a main deps as it is used in the new OpenSSH v1 private key format.
I kept the ed25519 extra requirement for backward compatibility.
Use cryptography to sign and validate SSH data.
Update the automated tests to include a quick sign / verify test.
Update the www docs to remove
paramiko[ed25519]or pynacl deps.Update bcrypt to informa that it's used for OpenSSH v1 private key format.
Follow up
As a followup it would be nice to refactor and remove
Ed25519Key._parse_signing_key_dataand instead try to usePKey._read_private_key_openssh`How to test
In the dev environment install cryptography 2.6 and make sure pynacl is removed and run the tests
Check extra requirement still works for backward compatibility: