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

Callback on keying completion, plus wolfSSH_GetText. #544

Conversation

falemagn
Copy link
Contributor

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.

@wolfSSL-Bot
Copy link

Can one of the admins verify this patch?

@falemagn falemagn force-pushed the pull-reqs/fc042f4_Callback_on_keying_completion branch from fffa1f2 to 52a932c Compare July 21, 2023 09:53
@JacobBarthelmeh JacobBarthelmeh self-assigned this Jul 21, 2023
@JacobBarthelmeh
Copy link
Contributor

ok to test

@JacobBarthelmeh
Copy link
Contributor

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.

@falemagn
Copy link
Contributor Author

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.

@JacobBarthelmeh
Copy link
Contributor

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

@falemagn falemagn force-pushed the pull-reqs/fc042f4_Callback_on_keying_completion branch from edac47e to 8abf3ca Compare October 20, 2023 07:43
@falemagn falemagn marked this pull request as draft October 20, 2023 07:48
@falemagn
Copy link
Contributor Author

@JacobBarthelmeh please, have a look at it now.

@falemagn falemagn marked this pull request as ready for review October 20, 2023 07:49
@ejohnstown
Copy link
Contributor

Superseded by PR #694.

@ejohnstown ejohnstown closed this May 29, 2024
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

Successfully merging this pull request may close these issues.

4 participants