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

get-key-type test fails #12

Closed
filiplajszczak opened this issue Jul 6, 2019 · 10 comments
Closed

get-key-type test fails #12

filiplajszczak opened this issue Jul 6, 2019 · 10 comments
Assignees

Comments

@filiplajszczak
Copy link

While installing AUR package (on Arch with libssh-0.9.0-1 installed) get-key-type test fails.

Here is test-suite.log:

============================================
   Guile-SSH 0.11.3: tests/test-suite.log
============================================

# TOTAL: 11
# PASS:  10
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: key
=========

Backtrace:
           3 (primitive-load "/home/fjl/.cache/yay/guile-ssh/src/gui…")
In ice-9/eval.scm:
    619:8  2 (_ #(#(#(#<directory (guile-user) 56075d6cb140> #) #) #))
   293:34  1 (_ #(#(#(#<directory (guile-user) 56075d6cb140> #) #) #))
In unknown file:
           0 (public-key->string #<key ecdsa (public) 56075d859da0>)

ERROR: In procedure public-key->string:
Throw to key `guile-ssh-error' with args `("public-key->string" "Unable to convert the key to a string" #<key ecdsa (public) 56075d859da0> #f)'.
%%%% Starting test key  (Writing full log to "key.log")
tests/key.scm:90: FAIL get-key-type

and the test:

Test begin:
  test-name: "get-key-type"
  source-file: "tests/key.scm"
  source-line: 90
  source-form: (test-assert "get-key-type" (begin (set-log-userdata! "get-key-type") (and (eq? (quote rsa) (get-key-type *rsa-key*)) (eq? (quote ds
s) (get-key-type *dsa-key*)) (when-openssl (eq? (quote ecdsa) (get-key-type *ecdsa-key*))))))
Test end:
  result-kind: fail
  actual-value: #f

same content in key.log

@dongcarl
Copy link

dongcarl commented Jul 8, 2019

Same error here, here's the key.log:
https://pastebin.com/E65ehgSv

@artyom-poptsov artyom-poptsov self-assigned this Jul 8, 2019
@vagrantc
Copy link
Contributor

these tests also fail on Debian unstable and Debian testing using libssh 0.9.1-1, works with libssh 0.8.7-1.

@vagrantc
Copy link
Contributor

Correction, it works with guile-ssh 0.11.3 and libssh 0.8.7 on Debian when also adding two patches from upstream:

dac7ae6
tests/server.scm ("server-set!, valid values"): Add fix for libssh 0.8

01cafef
libguile-ssh: Fix building with libssh 0.8

@artyom-poptsov
Copy link
Owner

Hello! Currently I'm working on a new and (hopefully) better implementation of tests for Guile-SSH (see wip-new-tests branch). As soon as the updated test framework start working properly, I'll make a new Guile-SSH release with fixes.

Meanwhile, you should use patches from the upstream for now.

Thanks!

-- Artyom

@artyom-poptsov
Copy link
Owner

Hello!

Could you please check Guile-SSH from the master branch? I added some fixes for keys in
104d797.

Thanks!

-- Artyom

@lantw44
Copy link

lantw44 commented Sep 17, 2019

libguile-ssh/Makefile.am:48: error: HAVE_LIBSSH_0_8 does not appear in AM_CONDITIONAL

After manually fixing the error, the test passes.

@artyom-poptsov
Copy link
Owner

Thanks, @lantw44! I fixed that in a15543f. Does it work for you w/o modifying the code?

-- Artyom

lantw44 added a commit to lantw44/copr-rpm-spec that referenced this issue Sep 18, 2019
@lantw44
Copy link

lantw44 commented Sep 18, 2019

Applying both 104d797 and a15543f fixes the problem, but there is a problem on libssh < 0.9:

make[2]: Entering directory '/builddir/build/BUILD/guile-ssh-0.11.3/libguile-ssh'
  CC       libguile_ssh_la-key-type.lo
make[2]: Leaving directory '/builddir/build/BUILD/guile-ssh-0.11.3/libguile-ssh'
key-type.c:48:26: error: 'SSH_KEYTYPE_ECDSA_P256' undeclared here (not in a function); did you mean 'SSH_KEYTYPE_ECDSA'?
   { "ecdsa-p256",        SSH_KEYTYPE_ECDSA_P256        },
                          ^~~~~~~~~~~~~~~~~~~~~~
                          SSH_KEYTYPE_ECDSA
key-type.c:49:26: error: 'SSH_KEYTYPE_ECDSA_P384' undeclared here (not in a function); did you mean 'SSH_KEYTYPE_ECDSA'?
   { "ecdsa-p384",        SSH_KEYTYPE_ECDSA_P384        },
                          ^~~~~~~~~~~~~~~~~~~~~~
                          SSH_KEYTYPE_ECDSA
key-type.c:50:26: error: 'SSH_KEYTYPE_ECDSA_P521' undeclared here (not in a function); did you mean 'SSH_KEYTYPE_ECDSA'?
   { "ecdsa-p521",        SSH_KEYTYPE_ECDSA_P521        },
                          ^~~~~~~~~~~~~~~~~~~~~~
                          SSH_KEYTYPE_ECDSA
key-type.c:51:26: error: 'SSH_KEYTYPE_ECDSA_P256_CERT01' undeclared here (not in a function); did you mean 'SSH_KEYTYPE_RSA_CERT01'?
   { "ecdsa-p256-cert01", SSH_KEYTYPE_ECDSA_P256_CERT01 },
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                          SSH_KEYTYPE_RSA_CERT01
key-type.c:52:26: error: 'SSH_KEYTYPE_ECDSA_P384_CERT01' undeclared here (not in a function); did you mean 'SSH_KEYTYPE_RSA_CERT01'?
   { "ecdsa-p384-cert01", SSH_KEYTYPE_ECDSA_P384_CERT01 },
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                          SSH_KEYTYPE_RSA_CERT01
key-type.c:53:26: error: 'SSH_KEYTYPE_ECDSA_P521_CERT01' undeclared here (not in a function); did you mean 'SSH_KEYTYPE_RSA_CERT01'?
   { "ecdsa-p521-cert01", SSH_KEYTYPE_ECDSA_P521_CERT01 },
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                          SSH_KEYTYPE_RSA_CERT01
make[2]: *** [Makefile:638: libguile_ssh_la-key-type.lo] Error 1
make[2]: *** Waiting for unfinished jobs....

https://copr-be.cloud.fedoraproject.org/results/lantw44/guix/fedora-29-x86_64/01034705-guile-ssh/builder-live.log.gz

I think you meant #if HAVE_LIBSSH_0_9, not #ifdef HAVE_LIBSSH_0_9, right?

lantw44 added a commit to lantw44/AUR4-PKGBUILD that referenced this issue Sep 18, 2019
artyom-poptsov added a commit that referenced this issue Sep 19, 2019
Reported by lantw44 in
<#12>

* libguile-ssh/key-type.c: Use 'if' instead of 'ifdef' to check the presence
  of libssh 9.0.
@artyom-poptsov
Copy link
Owner

Sure thing, I meant to use #if directive here. Thanks for pointing this out! Should be fixed in 75cec44. Could you please check?

-- Artyom

@lantw44
Copy link

lantw44 commented Sep 20, 2019

Yes, I confirm that it is fixed 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

No branches or pull requests

5 participants