wolfssh icon indicating copy to clipboard operation
wolfssh copied to clipboard

Callback on keying completion, plus wolfSSH_GetText.

Open falemagn opened this issue 2 years ago • 6 comments

A callback is optionally invoked on keying completion. From within this callback it's possible to invoke wolfSSH_GetText() to get a textual representation of a few internal variables, identified by the WS_Text enum.

falemagn avatar Jul 21 '23 07:07 falemagn

Can one of the admins verify this patch?

wolfSSL-Bot avatar Jul 21 '23 07:07 wolfSSL-Bot

ok to test

JacobBarthelmeh avatar Jul 27 '23 22:07 JacobBarthelmeh

Might be dependent on another PR? This is the report from Jenkins:

  CC       src/libwolfssh_la-io.lo
src/ssh.c:2212:13: error: 14 enumeration values not handled in switch: 'WC_HASH_TYPE_NONE', 'WC_HASH_TYPE_MD2', 'WC_HASH_TYPE_MD4'... [-Werror,-Wswitch]
    switch (HashForId(id)) {
            ^~~~~~~~~~~~~
src/ssh.c:2212:13: note: add missing switch cases
    switch (HashForId(id)) {
            ^
src/ssh.c:2242:14: error: use of undeclared identifier 'ECC_X25519'; did you mean 'CTC_ED25519'?
        case ECC_X25519:
             ^~~~~~~~~~
             CTC_ED25519
/usr/local/include/wolfssl/wolfcrypt/asn_public.h:214:5: note: 'CTC_ED25519' declared here
    CTC_ED25519      = 256,
    ^
2 errors generated.

JacobBarthelmeh avatar Jul 28 '23 14:07 JacobBarthelmeh

Might be dependent on another PR? This is the report from Jenkins:

  CC       src/libwolfssh_la-io.lo
src/ssh.c:2212:13: error: 14 enumeration values not handled in switch: 'WC_HASH_TYPE_NONE', 'WC_HASH_TYPE_MD2', 'WC_HASH_TYPE_MD4'... [-Werror,-Wswitch]
    switch (HashForId(id)) {
            ^~~~~~~~~~~~~
src/ssh.c:2212:13: note: add missing switch cases
    switch (HashForId(id)) {
            ^

The patch only cares about a subset of the wc_HashType enum, how do you suggest we deal with that?

src/ssh.c:2242:14: error: use of undeclared identifier 'ECC_X25519'; did you mean 'CTC_ED25519'? case ECC_X25519: ^~~~~~~~~~

This has been fixed with the proper #ifdef.

falemagn avatar Aug 21 '23 12:08 falemagn

If not handling all cases for the hash enums in the switch statement, then either

  1. not using a switch statement triggering the error of missing enums and matching the small subset of enums with if statements
  2. making a public getter function for the hash type string in wolfSSL wolfcrypt/src/hash.c similar to the GetHashTypeStr function in wolfcrypt/src/cryptocb.c

JacobBarthelmeh avatar Sep 15 '23 21:09 JacobBarthelmeh

@JacobBarthelmeh please, have a look at it now.

falemagn avatar Oct 20 '23 07:10 falemagn

Superseded by PR #694.

ejohnstown avatar May 29 '24 20:05 ejohnstown