Hello curlers and Happy New Year :

    For many years now I have been building curl from sources myself and
I always ensure that the build is non-optimized and able to be walked
through with a debugger.  Nothing beats single stepping through libcurl
on a Sunday afternoon.  In any case I always run the testsuite and for
the most part I only ever look at the last lines of output and echo $? :

============================================================================
Testsuite summary for curl -
============================================================================
# TOTAL: 2
# PASS:  2
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
.
.
.
alpha$ echo $?
0
alpha$

So that looks fine.

However when I scroll through the full test report output I see plenty
of little things that make me wonder what is happening :


********* System characteristics ********
* curl 7.81.0 (sparc64-sun-solaris2.10)
* libcurl/7.81.0 OpenSSL/1.1.1m zlib/1.2.11 libidn2/2.3.2 libssh2/1.10.0
* Features: alt-svc AsynchDNS HSTS HTTPS-proxy IDN IPv6 Largefile libz NTLM NTLM_WB SSL TLS-SRP UnixSockets
* Disabled:
* Host: alpha
* System: SunOS alpha 5.10 Generic_150400-65 sun4u sparc SUNW,SPARC-Enterprise
* OS: solaris
* Servers: HTTP-IPv6 HTTP-unix FTP-IPv6
* Env:
* Seed: 260697
*****************************************
test 0001...OK (1 out of 1448, remaining: 28:59, took 1.202s, duration: 00:01) test 0002...OK (2 out of 1448, remaining: 16:26, took 0.161s, duration: 00:01)
.
.
.
test 0029...Warning: server logs lock timeout (2 seconds) expired
OK (29  out of 1448, remaining: 08:35, took 4.114s, duration: 00:10)
.
.
.

    Here I have to guess that the timeout is what was desired given
    that I see "OK" there.

.
.
.
test 0111...Killed
OK (111 out of 1448, remaining: 07:32, took 0.122s, duration: 00:37)
.
.
.

    Again I see "OK" but the output "Killed" has me wondering if that
    is really what was desired?  Same for test 0117, 0118 and 0119
    and a pile of others.

    Other tests resort to the strange output :

.
.
.
test 0285...Warning: server logs lock timeout (2 seconds) expired
OK (285 out of 1448, remaining: 07:36, took 2.111s, duration: 01:51)
test 0286...Warning: server logs lock timeout (2 seconds) expired
OK (286 out of 1448, remaining: 07:54, took 5.002s, duration: 01:56)
.
.
.

    Now here is where really strange things begin :

sshd configuration file curl_sshd_config failed verification
=== Start of file /opt/bw/build/curl-7.81.0_sunos5.10_sparcv9.001/tests/log/ssh_server.log Could not load host key: /opt/bw/build/curl-7.81.0_sunos5.10_sparcv9.001/tests/curl_host_rsa_key
Disabling protocol version 2. Could not load hostkey or GSS-API mechanisms
sshd: no hostkeys available -- exiting.
=== End of file /opt/bw/build/curl-7.81.0_sunos5.10_sparcv9.001/tests/log/ssh_server.log
=== Start of file curl_sshd_config
# This is a generated file.  Do not edit.
# SunSSH 1.1.9 sshd configuration file for curl testing
#

.
.
.

    What is going on here?  I have OpenSSH_8.6p1 installed and in the
    PATH but here I see ye ancient old SunSSH ? There are pages and
    pages of output where all manner of things go wrong and then I see
    this :

.
.
.
=== End of file curl_sshd_config
RUN: failed to start the SSH server on 22654
RUN: couldn't start SSH. Tried these ports:RUN: 20360, 20545, 20864, 21237, 21575, 22027, 22415, 22565, 22591, 22654test 0584...OK (482 out of 1448, remaining: 11:38, took 0.229s, duration: 05:48)
.
.
.

    Here I must ask, do I need to run the testsuite as root user and
    also provide some more information via env vars or magic incantation
    such that curl knows where to find OpenSSH ?

    To continue there are many many tests where there are gaps and leaps
    from one test to another with numbers skipped :

.
.
.
test 0829...OK (625 out of 1448, remaining: 08:39, took 0.167s, duration: 06:34) test 0830...OK (626 out of 1448, remaining: 08:38, took 0.117s, duration: 06:34) ld.so.1: sh: fatal: /opt/bw/build/curl-7.81.0_sunos5.10_sparcv9.001/tests/libtest/.libs/libhostname.so: wrong ELF class: ELFCLASS64 test 0833...OK (629 out of 1448, remaining: 08:34, took 0.318s, duration: 06:35) ld.so.1: sh: fatal: /opt/bw/build/curl-7.81.0_sunos5.10_sparcv9.001/tests/libtest/.libs/libhostname.so: wrong ELF class: ELFCLASS64 test 0837...OK (632 out of 1448, remaining: 08:30, took 0.318s, duration: 06:35)
.
.
.

    I don't know what to make of that. Also there is no reason that we
    should be doing anything with 32-bit libs or 32-bit binaries on
    this machine. It supports 32-bit and 64-bit just fine but nothing
    in the libCurl or Curl build process ever results in a 32-bit object
    ever.  So I should never ever see "wrong ELF class: ELFCLASS64" as
    output from a test.

    Later on in the testsuite I see something that makes no sense to me
    whatsoever. I see the testsuite trying to use the blake2s and also
    blake2b message digest algorithms but fails to simply call into the
    linked OpenSSL libs :

.
.
.
test 1450...OK (1207 out of 1448, remaining: 01:53, took 1.120s, duration: 09:28)
ERROR:root:code for hash blake2b was not found.
Traceback (most recent call last):
  File "/opt/bw/lib/python3.7/hashlib.py", line 244, in <module>
    globals()[__func_name] = __get_hash(__func_name)
File "/opt/bw/lib/python3.7/hashlib.py", line 119, in __get_openssl_constructor
    return __get_builtin_constructor(name)
File "/opt/bw/lib/python3.7/hashlib.py", line 113, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type blake2b
ERROR:root:code for hash blake2s was not found.
Traceback (most recent call last):
  File "/opt/bw/lib/python3.7/hashlib.py", line 244, in <module>
    globals()[__func_name] = __get_hash(__func_name)
File "/opt/bw/lib/python3.7/hashlib.py", line 119, in __get_openssl_constructor
    return __get_builtin_constructor(name)
File "/opt/bw/lib/python3.7/hashlib.py", line 113, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type blake2s
Python package impacket needs to be installed!
Use pip or your package manager to install it.
== Contents of files in the log/ dir after test 1451
ERROR:root:code for hash blake2b was not found.
Traceback (most recent call last):
  File "/opt/bw/lib/python3.7/hashlib.py", line 244, in <module>
    globals()[__func_name] = __get_hash(__func_name)
File "/opt/bw/lib/python3.7/hashlib.py", line 119, in __get_openssl_constructor
    return __get_builtin_constructor(name)
File "/opt/bw/lib/python3.7/hashlib.py", line 113, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type blake2b
ERROR:root:code for hash blake2s was not found.
Traceback (most recent call last):
  File "/opt/bw/lib/python3.7/hashlib.py", line 244, in <module>
    globals()[__func_name] = __get_hash(__func_name)
File "/opt/bw/lib/python3.7/hashlib.py", line 119, in __get_openssl_constructor
    return __get_builtin_constructor(name)
File "/opt/bw/lib/python3.7/hashlib.py", line 113, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type blake2s
Python package impacket needs to be installed!
Use pip or your package manager to install it.
== Contents of files in the log/ dir after test 1451
ERROR:root:code for hash blake2b was not found.
Traceback (most recent call last):
  File "/opt/bw/lib/python3.7/hashlib.py", line 244, in <module>
    globals()[__func_name] = __get_hash(__func_name)
File "/opt/bw/lib/python3.7/hashlib.py", line 119, in __get_openssl_constructor
    return __get_builtin_constructor(name)
File "/opt/bw/lib/python3.7/hashlib.py", line 113, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type blake2b
ERROR:root:code for hash blake2s was not found.
Traceback (most recent call last):
  File "/opt/bw/lib/python3.7/hashlib.py", line 244, in <module>
    globals()[__func_name] = __get_hash(__func_name)
File "/opt/bw/lib/python3.7/hashlib.py", line 119, in __get_openssl_constructor
    return __get_builtin_constructor(name)
File "/opt/bw/lib/python3.7/hashlib.py", line 113, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type blake2s
Python package impacket needs to be installed!
Use pip or your package manager to install it.
== Contents of files in the log/ dir after test 1451
ERROR:root:code for hash blake2b was not found.
Traceback (most recent call last):
  File "/opt/bw/lib/python3.7/hashlib.py", line 244, in <module>
    globals()[__func_name] = __get_hash(__func_name)
File "/opt/bw/lib/python3.7/hashlib.py", line 119, in __get_openssl_constructor
    return __get_builtin_constructor(name)
File "/opt/bw/lib/python3.7/hashlib.py", line 113, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type blake2b
ERROR:root:code for hash blake2s was not found.
Traceback (most recent call last):
  File "/opt/bw/lib/python3.7/hashlib.py", line 244, in <module>
    globals()[__func_name] = __get_hash(__func_name)
File "/opt/bw/lib/python3.7/hashlib.py", line 119, in __get_openssl_constructor
    return __get_builtin_constructor(name)
File "/opt/bw/lib/python3.7/hashlib.py", line 113, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type blake2s
Python package impacket needs to be installed!
Use pip or your package manager to install it.
== Contents of files in the log/ dir after test 1451
ERROR:root:code for hash blake2b was not found.
Traceback (most recent call last):
  File "/opt/bw/lib/python3.7/hashlib.py", line 244, in <module>
    globals()[__func_name] = __get_hash(__func_name)
File "/opt/bw/lib/python3.7/hashlib.py", line 119, in __get_openssl_constructor
    return __get_builtin_constructor(name)
File "/opt/bw/lib/python3.7/hashlib.py", line 113, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type blake2b
ERROR:root:code for hash blake2s was not found.
Traceback (most recent call last):
  File "/opt/bw/lib/python3.7/hashlib.py", line 244, in <module>
    globals()[__func_name] = __get_hash(__func_name)
File "/opt/bw/lib/python3.7/hashlib.py", line 119, in __get_openssl_constructor
    return __get_builtin_constructor(name)
File "/opt/bw/lib/python3.7/hashlib.py", line 113, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type blake2s
Python package impacket needs to be installed!
Use pip or your package manager to install it.
== Contents of files in the log/ dir after test 1451
ERROR:root:code for hash blake2b was not found.
Traceback (most recent call last):
  File "/opt/bw/lib/python3.7/hashlib.py", line 244, in <module>
    globals()[__func_name] = __get_hash(__func_name)
File "/opt/bw/lib/python3.7/hashlib.py", line 119, in __get_openssl_constructor
    return __get_builtin_constructor(name)
File "/opt/bw/lib/python3.7/hashlib.py", line 113, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type blake2b
ERROR:root:code for hash blake2s was not found.
Traceback (most recent call last):
  File "/opt/bw/lib/python3.7/hashlib.py", line 244, in <module>
    globals()[__func_name] = __get_hash(__func_name)
File "/opt/bw/lib/python3.7/hashlib.py", line 119, in __get_openssl_constructor
    return __get_builtin_constructor(name)
File "/opt/bw/lib/python3.7/hashlib.py", line 113, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type blake2s
Python package impacket needs to be installed!
Use pip or your package manager to install it.
== Contents of files in the log/ dir after test 1451
ERROR:root:code for hash blake2b was not found.
Traceback (most recent call last):
  File "/opt/bw/lib/python3.7/hashlib.py", line 244, in <module>
    globals()[__func_name] = __get_hash(__func_name)
File "/opt/bw/lib/python3.7/hashlib.py", line 119, in __get_openssl_constructor
    return __get_builtin_constructor(name)
File "/opt/bw/lib/python3.7/hashlib.py", line 113, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type blake2b
ERROR:root:code for hash blake2s was not found.
Traceback (most recent call last):
  File "/opt/bw/lib/python3.7/hashlib.py", line 244, in <module>
    globals()[__func_name] = __get_hash(__func_name)
File "/opt/bw/lib/python3.7/hashlib.py", line 119, in __get_openssl_constructor
    return __get_builtin_constructor(name)
File "/opt/bw/lib/python3.7/hashlib.py", line 113, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type blake2s
Python package impacket needs to be installed!
Use pip or your package manager to install it.
== Contents of files in the log/ dir after test 1451
ERROR:root:code for hash blake2b was not found.
Traceback (most recent call last):
  File "/opt/bw/lib/python3.7/hashlib.py", line 244, in <module>
    globals()[__func_name] = __get_hash(__func_name)
File "/opt/bw/lib/python3.7/hashlib.py", line 119, in __get_openssl_constructor
    return __get_builtin_constructor(name)
File "/opt/bw/lib/python3.7/hashlib.py", line 113, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type blake2b
ERROR:root:code for hash blake2s was not found.
Traceback (most recent call last):
  File "/opt/bw/lib/python3.7/hashlib.py", line 244, in <module>
    globals()[__func_name] = __get_hash(__func_name)
File "/opt/bw/lib/python3.7/hashlib.py", line 119, in __get_openssl_constructor
    return __get_builtin_constructor(name)
File "/opt/bw/lib/python3.7/hashlib.py", line 113, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type blake2s
Python package impacket needs to be installed!
Use pip or your package manager to install it.
== Contents of files in the log/ dir after test 1451
ERROR:root:code for hash blake2b was not found.
Traceback (most recent call last):
  File "/opt/bw/lib/python3.7/hashlib.py", line 244, in <module>
    globals()[__func_name] = __get_hash(__func_name)
File "/opt/bw/lib/python3.7/hashlib.py", line 119, in __get_openssl_constructor
    return __get_builtin_constructor(name)
File "/opt/bw/lib/python3.7/hashlib.py", line 113, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type blake2b
ERROR:root:code for hash blake2s was not found.
Traceback (most recent call last):
  File "/opt/bw/lib/python3.7/hashlib.py", line 244, in <module>
    globals()[__func_name] = __get_hash(__func_name)
File "/opt/bw/lib/python3.7/hashlib.py", line 119, in __get_openssl_constructor
    return __get_builtin_constructor(name)
File "/opt/bw/lib/python3.7/hashlib.py", line 113, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type blake2s
Python package impacket needs to be installed!
Use pip or your package manager to install it.
== Contents of files in the log/ dir after test 1451
ERROR:root:code for hash blake2b was not found.
Traceback (most recent call last):
  File "/opt/bw/lib/python3.7/hashlib.py", line 244, in <module>
    globals()[__func_name] = __get_hash(__func_name)
File "/opt/bw/lib/python3.7/hashlib.py", line 119, in __get_openssl_constructor
    return __get_builtin_constructor(name)
File "/opt/bw/lib/python3.7/hashlib.py", line 113, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type blake2b
ERROR:root:code for hash blake2s was not found.
Traceback (most recent call last):
  File "/opt/bw/lib/python3.7/hashlib.py", line 244, in <module>
    globals()[__func_name] = __get_hash(__func_name)
File "/opt/bw/lib/python3.7/hashlib.py", line 119, in __get_openssl_constructor
    return __get_builtin_constructor(name)
File "/opt/bw/lib/python3.7/hashlib.py", line 113, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type blake2s
.
.
.

    All of that has to be wrong given that the provided OpenSSL
    libs supply the digests we need :

alpha $ openssl version
OpenSSL 1.1.1m  14 Dec 2021
alpha $ openssl list --digest-commands
blake2b512        blake2s256        gost              md4
md5               mdc2              rmd160            sha1
sha224            sha256            sha3-224          sha3-256
sha3-384          sha3-512          sha384            sha512
sha512-224        sha512-256        shake128          shake256
sm3

alpha $

Perhaps this is all just a problem with Python ?

Regardless I am confused by the testsuite output which seems to complain about a missing message digest algorithm as well as many other concerns like 32-bit libs being needed or even great huge missing gaps in the
tests :

.
.
.

test 2002...OK (1350 out of 1448, remaining: 00:49, took 0.216s, duration: 11:17) test 2003...OK (1351 out of 1448, remaining: 00:48, took 0.288s, duration: 11:17) ld.so.1: sh: fatal: /opt/bw/build/curl-7.81.0_sunos5.10_sparcv9.001/tests/libtest/.libs/libhostname.so: wrong ELF class: ELFCLASS64 ld.so.1: sh: fatal: /opt/bw/build/curl-7.81.0_sunos5.10_sparcv9.001/tests/libtest/.libs/libhostname.so: wrong ELF class: ELFCLASS64 ld.so.1: sh: fatal: /opt/bw/build/curl-7.81.0_sunos5.10_sparcv9.001/tests/libtest/.libs/libhostname.so: wrong ELF class: ELFCLASS64 ld.so.1: sh: fatal: /opt/bw/build/curl-7.81.0_sunos5.10_sparcv9.001/tests/libtest/.libs/libhostname.so: wrong ELF class: ELFCLASS64 ld.so.1: sh: fatal: /opt/bw/build/curl-7.81.0_sunos5.10_sparcv9.001/tests/libtest/.libs/libhostname.so: wrong ELF class: ELFCLASS64 ld.so.1: sh: fatal: /opt/bw/build/curl-7.81.0_sunos5.10_sparcv9.001/tests/libtest/.libs/libhostname.so: wrong ELF class: ELFCLASS64 ld.so.1: sh: fatal: /opt/bw/build/curl-7.81.0_sunos5.10_sparcv9.001/tests/libtest/.libs/libhostname.so: wrong ELF class: ELFCLASS64 ld.so.1: sh: fatal: /opt/bw/build/curl-7.81.0_sunos5.10_sparcv9.001/tests/libtest/.libs/libhostname.so: wrong ELF class: ELFCLASS64 ld.so.1: sh: fatal: /opt/bw/build/curl-7.81.0_sunos5.10_sparcv9.001/tests/libtest/.libs/libhostname.so: wrong ELF class: ELFCLASS64 ld.so.1: sh: fatal: /opt/bw/build/curl-7.81.0_sunos5.10_sparcv9.001/tests/libtest/.libs/libhostname.so: wrong ELF class: ELFCLASS64 test 2036...OK (1366 out of 1448, remaining: 00:40, took 0.100s, duration: 11:18) test 2039...OK (1369 out of 1448, remaining: 00:39, took 0.191s, duration: 11:18)
.
.
.

Perhaps we can takes these one at a time and at least address the strange message digest issue.



--
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken
GreyBeard and suspenders optional



ps: I did check the OpenSSL libs for the message digest algorithms
    requested :


#include <stdio.h>
#include <string.h>
#include <openssl/evp.h>
#include <stdlib.h>

int main(int argc, char **argv)
{
    EVP_MD_CTX *mdctx;
    const   EVP_MD *md;

    /* please see the reference test vector discussion at
     * https://datatracker.ietf.org/doc/html/rfc7693#appendix-A
     *
     * Here we see the input "abc" should produce the output
     * for BLAKE2b-512 algorithm :
     *
     *
     *  BA 80 A5 3F 98 1C 4D 0D 6A 27 97 B6 9F 12 F6 E9
     *  4C 21 2F 14 68 5A C4 B7 4B 12 BB 6F DB FF A2 D1
     *  7D 87 C5 39 2A AB 79 2D C2 52 D5 DE 45 33 CC 95
     *  18 D3 8A A8 DB F1 92 5A B9 23 86 ED D4 00 99 23
     *
     */
    char    mess0[] = "abc";

/* we don't need these at the moment
    char    mess1[] = "Test Message\n";
    char    mess2[] = "Hello World\n";
*/

    unsigned char   md_value[EVP_MAX_MD_SIZE];
    unsigned int    md_len, i;

    if (argv[1] == NULL) {
        fprintf(stderr,"Usage: %s digest_algorithm_name\n", argv[0]);
        return EXIT_FAILURE;
    }

    md = EVP_get_digestbyname(argv[1]);
    if (md == NULL) {
        /*
         * Please see OpenSSL manual for EVP_DigestInit
         * and also see EVP_MD_meth_new.
         *
         * Digest algorithms may be listed thus :
         *
         * $ openssl list --digest-commands
         * blake2b512       blake2s256       gost             md4
         * md5              mdc2             rmd160           sha1
         * sha224           sha256           sha3-224         sha3-256
         * sha3-384         sha3-512         sha384           sha512
         * sha512-224       sha512-256       shake128         shake256
         * sm3
         *
         */
        fprintf(stderr,"FAIL : Unknown message digest %s\n", argv[1]);

        fprintf(stderr,"    : Please use one of the following :\n");
        fprintf(stderr,"    :   md4, md5, mdc2, rmd160, gost, sha1,\n");
        fprintf(stderr,"    :   sm3, shake128, shake256, sha224,\n");
        fprintf(stderr,"    :   sha256, sha384, sha512,\n");
        fprintf(stderr,"    :   sha512-224, sha512-256, sha3-224,\n");
        fprintf(stderr,"    :   sha3-256, sha3-384, sha3-512,\n");
        fprintf(stderr,"    :   blake2s256, blake2b512.\n");

        return EXIT_FAILURE;
    }

    mdctx = EVP_MD_CTX_new();
    EVP_DigestInit_ex(mdctx, md, NULL);
    EVP_DigestUpdate(mdctx, mess0, strlen(mess0));
/*
    EVP_DigestUpdate(mdctx, mess1, strlen(mess1));
    EVP_DigestUpdate(mdctx, mess2, strlen(mess2));
*/
    EVP_DigestFinal_ex(mdctx, md_value, &md_len);
    EVP_MD_CTX_free(mdctx);

    printf("Digest is: ");
    for (i = 0; i < md_len; i++) {
        printf("%02X ", md_value[i]);
    }
    printf("\n");

    return EXIT_SUCCESS;

}


alpha $
alpha $ ./dgst_test blake2b512
Digest is: BA 80 A5 3F 98 1C 4D 0D 6A 27 97 B6 9F 12 F6 E9 4C 21 2F 14 68 5A C4 B7 4B 12 BB 6F DB FF A2 D1 7D 87 C5 39 2A AB 79 2D C2 52 D5 DE 45 33 CC 95 18 D3 8A A8 DB F1 92 5A B9 23 86 ED D4 00 99 23
alpha $

--
Unsubscribe: https://lists.haxx.se/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html

Reply via email to