Files
c45674a601 ssh: support raw string input for 'key' argument as documented (#2671)
* ssh: support raw string input for 'key' argument

Implement support for passing the actual private key as a string or bytes, as specified in the documentation. This prevents an AttributeError by converting the string to the appropriate Paramiko PKey object (RSA/ECDSA/Ed25519).

* update changelog

* Add tests for ssh connection using a key

* Cleanup docs

---------

Co-authored-by: Your Name <[email protected]>
Co-authored-by: Peace-Maker <[email protected]>
2026-03-24 13:01:25 +01:00
..

Testing in a Can

This is a Dockerfile which has all of the requirements for testing pwntools.

It's pretty simple, just run make. All of your changes will be copied into the docker container, and the doctest suite will be executed automatically.

$ make -C travis/docker ANDROID=yes
$ make -C travis/docker ANDROID=no TARGET=ssh.rst

You can get drop into a tmux session in the container to debug tests using the shell or bash targets.

$ make -C travis/docker shell

Options

Currently, the options TARGET and ANDROID are available.

ANDROID

Controls whether or not to run the Android test. The valid options are yes (the default) and no.

TARGET

This is appended to the sphinx command line, but generally is useful to select a specific rst file to parse (e.g. to only run those tests).

Known Issues

Currently, some tests are broken when executed in Docker.

  • process.leak() is broken, as it relies on /proc/<pid>/mem
  • srop tests are broken, since there are issues with SYS_sigreturn when running in Docker.