Repository navigation
Make OS/400 implementation work again - #953
Merged
Merged
Conversation
This enables the possibility to compile libssh2 even if the ascii runtime development files are not installed system-wide.
A temporary variable matching the parameter type is used before copying to the real target and checking for overflow (that should not occur!).
A bug added by a previous code style cleaning is fixed. _libssh2_random() now checks and return the success status.
They were wrongly set to the key size.
In particular, os400qc3 limits the maximum group size to 2048-bits. Move definitions of these parameters to crypto backend header files.
Member
|
Thanks @monnerat! |
Contributor
Author
|
Thanks to you for merging, @vszakats :-) |
agreppin
pushed a commit
to agreppin/libssh2
that referenced
this pull request
Jul 14, 2024
* os400: support QADRT development files in a non-standard directory This enables the possibility to compile libssh2 even if the ascii runtime development files are not installed system-wide. * userauth_kbd_packet: fix a pointer target type mismatch. A temporary variable matching the parameter type is used before copying to the real target and checking for overflow (that should not occur!). * os400qc3: move and fix big number procedures A bug added by a previous code style cleaning is fixed. _libssh2_random() now checks and return the success status. * os400qc3: fix cipher definition block lengths They were wrongly set to the key size. * Diffie-Hellman min/max modulus sizes are dependent of crypto-backend In particular, os400qc3 limits the maximum group size to 2048-bits. Move definitions of these parameters to crypto backend header files. * kex: return an error if Diffie-Hellman key pair generation fails * os400: add an ascii assert.h header file * os400qc3: implement RSA SHA2 256/512
vszakats
added a commit
to vszakats/libssh2
that referenced
this pull request
Apr 10, 2026
[16/136] Building C object src/CMakeFiles/libssh2_static.dir/userauth_kbd_packet.c.o
src/userauth_kbd_packet.c:102:44: warning: an assignment within an 'if' condition is bug-prone [bugprone-assignment-in-if-condition]
102 | (session->userauth_kybd_num_prompts = tmp_u32) != tmp_u32) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
src/userauth_kbd_packet.c:102:44: note: if it should be an assignment, move it out of the 'if' condition
src/userauth_kbd_packet.c:102:44: note: if it is meant to be an equality check, change '=' to '=='
Follow-up to 6dc42e9 libssh2#953
vszakats
added a commit
to vszakats/libssh2
that referenced
this pull request
Apr 10, 2026
[16/136] Building C object src/CMakeFiles/libssh2_static.dir/userauth_kbd_packet.c.o
src/userauth_kbd_packet.c:102:44: warning: an assignment within an 'if' condition is bug-prone [bugprone-assignment-in-if-condition]
102 | (session->userauth_kybd_num_prompts = tmp_u32) != tmp_u32) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
src/userauth_kbd_packet.c:102:44: note: if it should be an assignment, move it out of the 'if' condition
src/userauth_kbd_packet.c:102:44: note: if it is meant to be an equality check, change '=' to '=='
Follow-up to 6dc42e9 libssh2#953
vszakats
added a commit
to vszakats/libssh2
that referenced
this pull request
Apr 10, 2026
[16/136] Building C object src/CMakeFiles/libssh2_static.dir/userauth_kbd_packet.c.o
src/userauth_kbd_packet.c:102:44: warning: an assignment within an 'if' condition is bug-prone [bugprone-assignment-in-if-condition]
102 | (session->userauth_kybd_num_prompts = tmp_u32) != tmp_u32) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
src/userauth_kbd_packet.c:102:44: note: if it should be an assignment, move it out of the 'if' condition
src/userauth_kbd_packet.c:102:44: note: if it is meant to be an equality check, change '=' to '=='
Follow-up to 6dc42e9 libssh2#953
vszakats
added a commit
to vszakats/libssh2
that referenced
this pull request
Apr 10, 2026
[16/136] Building C object src/CMakeFiles/libssh2_static.dir/userauth_kbd_packet.c.o
src/userauth_kbd_packet.c:102:44: warning: an assignment within an 'if' condition is bug-prone [bugprone-assignment-in-if-condition]
102 | (session->userauth_kybd_num_prompts = tmp_u32) != tmp_u32) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
src/userauth_kbd_packet.c:102:44: note: if it should be an assignment, move it out of the 'if' condition
src/userauth_kbd_packet.c:102:44: note: if it is meant to be an equality check, change '=' to '=='
Follow-up to 6dc42e9 libssh2#953
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After more than 6 years without an IBM i, I have been able to do some work on libssh2 for it thanks to pub400.com.
During this time, some "injuries" were done to this implementation. The commits in this PR contribute all together to fix them:
Thanks for considering this.