Skip to content
This repository was archived by the owner on Jan 16, 2024. It is now read-only.

Commit 411fbfb

Browse files
committed
Bundle 0.10.5-1 (2023-06-27)
1 parent 941d6ac commit 411fbfb

File tree

153 files changed

+35440
-81
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

153 files changed

+35440
-81
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# libssh 0.10.5-1
2+
3+
- mingw-w64-i686-zlib-1.2.11-9100-any.pkg.tar.xz
4+
- mingw-w64-i686-openssl-1.1.1.m-9800-any.pkg.tar.xz
5+
- mingw-w64-i686-libssh-0.10.5-1-any.pkg.tar.xz
6+
- mingw-w64-x86_64-zlib-1.2.11-9100-any.pkg.tar.xz
7+
- mingw-w64-x86_64-openssl-1.1.1.m-9800-any.pkg.tar.xz
8+
- mingw-w64-x86_64-libssh-0.10.5-1-any.pkg.tar.xz
9+
- mingw-w64-ucrt-x86_64-zlib-1.2.11-9100-any.pkg.tar.xz
10+
- mingw-w64-ucrt-x86_64-openssl-1.1.1.m-9800-any.pkg.tar.xz
11+
- mingw-w64-ucrt-x86_64-libssh-0.10.5-1-any.pkg.tar.xz

include/libssh/callbacks.h

Lines changed: 42 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ typedef void (*ssh_callback_int) (int code, void *user);
5656
* @returns number of bytes processed by the callee. The remaining bytes will
5757
* be sent in the next callback message, when more data is available.
5858
*/
59-
typedef int (*ssh_callback_data) (const void *data, size_t len, void *user);
59+
typedef size_t (*ssh_callback_data) (const void *data, size_t len, void *user);
6060

6161
typedef void (*ssh_callback_int_int) (int code, int errno_code, void *user);
6262

@@ -81,9 +81,9 @@ typedef void (*ssh_log_callback) (ssh_session session, int priority,
8181
*
8282
* @param priority Priority of the log, the smaller being the more important.
8383
*
84-
* @param function The function name calling the the logging fucntions.
84+
* @param function The function name calling the logging functions.
8585
*
86-
* @param message The actual message
86+
* @param buffer The actual message
8787
*
8888
* @param userdata Userdata to be passed to the callback function.
8989
*/
@@ -117,6 +117,8 @@ typedef void (*ssh_global_request_callback) (ssh_session session,
117117
* sends back an X11 connection attempt. This is a client-side API
118118
* @param session current session handler
119119
* @param userdata Userdata to be passed to the callback function.
120+
* @param originator_address IP address of the machine who sent the request
121+
* @param originator_port port number of the machine who sent the request
120122
* @returns a valid ssh_channel handle if the request is to be allowed
121123
* @returns NULL if the request should not be allowed
122124
* @warning The channel pointer returned by this callback must be closed by the application.
@@ -221,8 +223,8 @@ typedef int (*ssh_auth_gssapi_mic_callback) (ssh_session session, const char *us
221223
* @param user User that wants to authenticate
222224
* @param pubkey public key used for authentication
223225
* @param signature_state SSH_PUBLICKEY_STATE_NONE if the key is not signed (simple public key probe),
224-
* SSH_PUBLICKEY_STATE_VALID if the signature is valid. Others values should be
225-
* replied with a SSH_AUTH_DENIED.
226+
* SSH_PUBLICKEY_STATE_VALID if the signature is valid. Others values should be
227+
* replied with a SSH_AUTH_DENIED.
226228
* @param userdata Userdata to be passed to the callback function.
227229
* @returns SSH_AUTH_SUCCESS Authentication is accepted.
228230
* @returns SSH_AUTH_PARTIAL Partial authentication, more authentication means are needed.
@@ -268,11 +270,11 @@ typedef ssh_string (*ssh_gssapi_select_oid_callback) (ssh_session session, const
268270
int n_oid, ssh_string *oids, void *userdata);
269271

270272
/*
271-
* @brief handle the negociation of a security context, server side.
273+
* @brief handle the negotiation of a security context, server side.
272274
* @param session current session handler
273275
* @param[in] input_token input token provided by client
274276
* @param[out] output_token output of the gssapi accept_sec_context method,
275-
* NULL after completion.
277+
* NULL after completion.
276278
* @returns SSH_OK if the token was generated correctly or accept_sec_context
277279
* returned GSS_S_COMPLETE
278280
* @returns SSH_ERROR in case of error
@@ -354,6 +356,9 @@ typedef struct ssh_server_callbacks_struct *ssh_server_callbacks;
354356
* This functions sets the callback structure to use your own callback
355357
* functions for user authentication, new channels and requests.
356358
*
359+
* Note, that the structure is not copied to the session structure so it needs
360+
* to be valid for the whole session lifetime.
361+
*
357362
* @code
358363
* struct ssh_server_callbacks_struct cb = {
359364
* .userdata = data,
@@ -394,7 +399,7 @@ struct ssh_socket_callbacks_struct {
394399
*/
395400
ssh_callback_int_int exception;
396401
/** This function is called when the ssh_socket_connect was used on the socket
397-
* on nonblocking state, and the connection successed.
402+
* on nonblocking state, and the connection succeeded.
398403
*/
399404
ssh_callback_int_int connected;
400405
};
@@ -548,6 +553,9 @@ typedef struct ssh_packet_callbacks_struct *ssh_packet_callbacks;
548553
* This functions sets the callback structure to use your own callback
549554
* functions for auth, logging and status.
550555
*
556+
* Note, that the callback structure is not copied into the session so it needs
557+
* to be valid for the whole session lifetime.
558+
*
551559
* @code
552560
* struct ssh_callbacks_struct cb = {
553561
* .userdata = data,
@@ -619,6 +627,7 @@ typedef void (*ssh_channel_signal_callback) (ssh_session session,
619627
* @brief SSH channel exit status callback. Called when a channel has received an exit status
620628
* @param session Current session handler
621629
* @param channel the actual channel
630+
* @param exit_status Exit status of the ran command
622631
* @param userdata Userdata to be passed to the callback function.
623632
*/
624633
typedef void (*ssh_channel_exit_status_callback) (ssh_session session,
@@ -631,7 +640,7 @@ typedef void (*ssh_channel_exit_status_callback) (ssh_session session,
631640
* @param session Current session handler
632641
* @param channel the actual channel
633642
* @param signal the signal name (without the SIG prefix)
634-
* @param core a boolean telling wether a core has been dumped or not
643+
* @param core a boolean telling whether a core has been dumped or not
635644
* @param errmsg the description of the exception
636645
* @param lang the language of the description (format: RFC 3066)
637646
* @param userdata Userdata to be passed to the callback function.
@@ -646,12 +655,13 @@ typedef void (*ssh_channel_exit_signal_callback) (ssh_session session,
646655

647656
/**
648657
* @brief SSH channel PTY request from a client.
658+
* @param session the session
649659
* @param channel the channel
650660
* @param term The type of terminal emulation
651661
* @param width width of the terminal, in characters
652662
* @param height height of the terminal, in characters
653663
* @param pxwidth width of the terminal, in pixels
654-
* @param pxheight height of the terminal, in pixels
664+
* @param pwheight height of the terminal, in pixels
655665
* @param userdata Userdata to be passed to the callback function.
656666
* @returns 0 if the pty request is accepted
657667
* @returns -1 if the request is denied
@@ -665,6 +675,7 @@ typedef int (*ssh_channel_pty_request_callback) (ssh_session session,
665675

666676
/**
667677
* @brief SSH channel Shell request from a client.
678+
* @param session the session
668679
* @param channel the channel
669680
* @param userdata Userdata to be passed to the callback function.
670681
* @returns 0 if the shell request is accepted
@@ -677,6 +688,7 @@ typedef int (*ssh_channel_shell_request_callback) (ssh_session session,
677688
* @brief SSH auth-agent-request from the client. This request is
678689
* sent by a client when agent forwarding is available.
679690
* Server is free to ignore this callback, no answer is expected.
691+
* @param session the session
680692
* @param channel the channel
681693
* @param userdata Userdata to be passed to the callback function.
682694
*/
@@ -688,7 +700,12 @@ typedef void (*ssh_channel_auth_agent_req_callback) (ssh_session session,
688700
* @brief SSH X11 request from the client. This request is
689701
* sent by a client when X11 forwarding is requested(and available).
690702
* Server is free to ignore this callback, no answer is expected.
703+
* @param session the session
691704
* @param channel the channel
705+
* @param single_connection If true, only one channel should be forwarded
706+
* @param auth_protocol The X11 authentication method to be used
707+
* @param auth_cookie Authentication cookie encoded hexadecimal
708+
* @param screen_number Screen number
692709
* @param userdata Userdata to be passed to the callback function.
693710
*/
694711
typedef void (*ssh_channel_x11_req_callback) (ssh_session session,
@@ -700,11 +717,12 @@ typedef void (*ssh_channel_x11_req_callback) (ssh_session session,
700717
void *userdata);
701718
/**
702719
* @brief SSH channel PTY windows change (terminal size) from a client.
720+
* @param session the session
703721
* @param channel the channel
704722
* @param width width of the terminal, in characters
705723
* @param height height of the terminal, in characters
706724
* @param pxwidth width of the terminal, in pixels
707-
* @param pxheight height of the terminal, in pixels
725+
* @param pwheight height of the terminal, in pixels
708726
* @param userdata Userdata to be passed to the callback function.
709727
* @returns 0 if the pty request is accepted
710728
* @returns -1 if the request is denied
@@ -717,6 +735,7 @@ typedef int (*ssh_channel_pty_window_change_callback) (ssh_session session,
717735

718736
/**
719737
* @brief SSH channel Exec request from a client.
738+
* @param session the session
720739
* @param channel the channel
721740
* @param command the shell command to be executed
722741
* @param userdata Userdata to be passed to the callback function.
@@ -730,6 +749,7 @@ typedef int (*ssh_channel_exec_request_callback) (ssh_session session,
730749

731750
/**
732751
* @brief SSH channel environment request from a client.
752+
* @param session the session
733753
* @param channel the channel
734754
* @param env_name name of the environment value to be set
735755
* @param env_value value of the environment value to be set
@@ -746,6 +766,7 @@ typedef int (*ssh_channel_env_request_callback) (ssh_session session,
746766
void *userdata);
747767
/**
748768
* @brief SSH channel subsystem request from a client.
769+
* @param session the session
749770
* @param channel the channel
750771
* @param subsystem the subsystem required
751772
* @param userdata Userdata to be passed to the callback function.
@@ -760,6 +781,8 @@ typedef int (*ssh_channel_subsystem_request_callback) (ssh_session session,
760781
/**
761782
* @brief SSH channel write will not block (flow control).
762783
*
784+
* @param session the session
785+
*
763786
* @param channel the channel
764787
*
765788
* @param[in] bytes size of the remote window in bytes. Writing as much data
@@ -771,7 +794,7 @@ typedef int (*ssh_channel_subsystem_request_callback) (ssh_session session,
771794
*/
772795
typedef int (*ssh_channel_write_wontblock_callback) (ssh_session session,
773796
ssh_channel channel,
774-
size_t bytes,
797+
uint32_t bytes,
775798
void *userdata);
776799

777800
struct ssh_channel_callbacks_struct {
@@ -849,7 +872,11 @@ typedef struct ssh_channel_callbacks_struct *ssh_channel_callbacks;
849872
* @brief Set the channel callback functions.
850873
*
851874
* This functions sets the callback structure to use your own callback
852-
* functions for channel data and exceptions
875+
* functions for channel data and exceptions.
876+
*
877+
* Note, that the structure is not copied to the channel structure so it needs
878+
* to be valid as for the whole life of the channel or until it is removed with
879+
* ssh_remove_channel_callbacks().
853880
*
854881
* @code
855882
* struct ssh_channel_callbacks_struct cb = {
@@ -907,7 +934,7 @@ LIBSSH_API int ssh_remove_channel_callbacks(ssh_channel channel,
907934

908935
/** @} */
909936

910-
/** @group libssh_threads
937+
/** @addtogroup libssh_threads
911938
* @{
912939
*/
913940

@@ -979,7 +1006,7 @@ LIBSSH_API struct ssh_threads_callbacks_struct *ssh_threads_get_noop(void);
9791006
*
9801007
* @param[in] cb The callback to set.
9811008
*
982-
* @return 0 on success, < 0 on errror.
1009+
* @return 0 on success, < 0 on error.
9831010
*/
9841011
LIBSSH_API int ssh_set_log_callback(ssh_logging_callback cb);
9851012

include/libssh/legacy.h

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@
3131
typedef struct ssh_private_key_struct* ssh_private_key;
3232
typedef struct ssh_public_key_struct* ssh_public_key;
3333

34+
#ifdef __cplusplus
35+
extern "C" {
36+
#endif
37+
3438
LIBSSH_API int ssh_auth_list(ssh_session session);
3539
LIBSSH_API int ssh_userauth_offer_pubkey(ssh_session session, const char *username, int type, ssh_string publickey);
3640
LIBSSH_API int ssh_userauth_pubkey(ssh_session session, const char *username, ssh_string publickey, ssh_private_key privatekey);
@@ -88,19 +92,19 @@ SSH_DEPRECATED LIBSSH_API int channel_select(ssh_channel *readchans, ssh_channel
8892
SSH_DEPRECATED LIBSSH_API void channel_set_blocking(ssh_channel channel, int blocking);
8993
SSH_DEPRECATED LIBSSH_API int channel_write(ssh_channel channel, const void *data, uint32_t len);
9094

91-
LIBSSH_API void privatekey_free(ssh_private_key prv);
92-
LIBSSH_API ssh_private_key privatekey_from_file(ssh_session session, const char *filename,
95+
SSH_DEPRECATED LIBSSH_API void privatekey_free(ssh_private_key prv);
96+
SSH_DEPRECATED LIBSSH_API ssh_private_key privatekey_from_file(ssh_session session, const char *filename,
9397
int type, const char *passphrase);
94-
LIBSSH_API void publickey_free(ssh_public_key key);
95-
LIBSSH_API int ssh_publickey_to_file(ssh_session session, const char *file,
98+
SSH_DEPRECATED LIBSSH_API void publickey_free(ssh_public_key key);
99+
SSH_DEPRECATED LIBSSH_API int ssh_publickey_to_file(ssh_session session, const char *file,
96100
ssh_string pubkey, int type);
97-
LIBSSH_API ssh_string publickey_from_file(ssh_session session, const char *filename,
101+
SSH_DEPRECATED LIBSSH_API ssh_string publickey_from_file(ssh_session session, const char *filename,
98102
int *type);
99-
LIBSSH_API ssh_public_key publickey_from_privatekey(ssh_private_key prv);
100-
LIBSSH_API ssh_string publickey_to_string(ssh_public_key key);
101-
LIBSSH_API int ssh_try_publickey_from_file(ssh_session session, const char *keyfile,
103+
SSH_DEPRECATED LIBSSH_API ssh_public_key publickey_from_privatekey(ssh_private_key prv);
104+
SSH_DEPRECATED LIBSSH_API ssh_string publickey_to_string(ssh_public_key key);
105+
SSH_DEPRECATED LIBSSH_API int ssh_try_publickey_from_file(ssh_session session, const char *keyfile,
102106
ssh_string *publickey, int *type);
103-
LIBSSH_API enum ssh_keytypes_e ssh_privatekey_type(ssh_private_key privatekey);
107+
SSH_DEPRECATED LIBSSH_API enum ssh_keytypes_e ssh_privatekey_type(ssh_private_key privatekey);
104108

105109
LIBSSH_API ssh_string ssh_get_pubkey(ssh_session session);
106110

@@ -117,4 +121,8 @@ SSH_DEPRECATED LIBSSH_API size_t string_len(ssh_string str);
117121
SSH_DEPRECATED LIBSSH_API ssh_string string_new(size_t size);
118122
SSH_DEPRECATED LIBSSH_API char *string_to_char(ssh_string str);
119123

124+
#ifdef __cplusplus
125+
}
126+
#endif
127+
120128
#endif /* LEGACY_H_ */

0 commit comments

Comments
 (0)