artyom-poptsov / guile-ssh

Guile-SSH is a library that provides access to the SSH protocol for GNU Guile programs.
https://memory-heap.org/~avp/projects/guile-ssh
GNU General Public License v3.0
65 stars 13 forks source link

Segfault when printing the server public key #41

Open graywolf opened 7 months ago

graywolf commented 7 months ago

Hello,

I found out that trying to print the public key of the server leads to a segfault:

$ guile -c '(use-modules (ssh session)) (define s (make-session #:host "terminal.shop")) (connect! s) (pk (get-server-public-key s))'

;;; ((segmentation fault

The workaround seems to be to also require (ssh key):

$ guile -c '(use-modules (ssh key) (ssh session)) (define s (make-session #:host "terminal.shop")) (connect! s) (pk (get-server-public-key s))'

;;; (#<key ed25519 (public) 7fd07cd60fc0>)

That does not seem to be documented, and, if the import is required, I believe it should happen automatically. The segfault is not great user experience.