diff --git a/src/auth.c b/src/auth.c index b9b32dfb..b8121aa9 100644 --- a/src/auth.c +++ b/src/auth.c @@ -58,7 +58,7 @@ /** * @internal * - * @brief Ask access to the ssh-userauth service. + * @brief Ask for access to the ssh-userauth service. * * @param[in] session The SSH session handle. * @@ -1873,7 +1873,7 @@ int ssh_userauth_kbdint_getnanswers(ssh_session session) { } /** - * @brief Get the answer for a question from a message block. + * @brief Get the answer to a question from a message block. * * @param[in] session The ssh session to use. * diff --git a/src/bind.c b/src/bind.c index 691a363f..54508391 100644 --- a/src/bind.c +++ b/src/bind.c @@ -339,7 +339,7 @@ static int ssh_bind_poll_callback(ssh_poll_handle sshpoll, } /** @internal - * @brief returns the current poll handle, or create it + * @brief returns the current poll handle, or creates it * @param sshbind the ssh_bind object * @returns a ssh_poll handle suitable for operation */ diff --git a/src/bind_config.c b/src/bind_config.c index 4c891c95..27c42c95 100644 --- a/src/bind_config.c +++ b/src/bind_config.c @@ -688,7 +688,7 @@ int ssh_bind_config_parse_string(ssh_bind bind, const char *input) line_start = c; c = strchr(line_start, '\n'); if (c == NULL) { - /* if there is no newline in the end of the string */ + /* if there is no newline at the end of the string */ c = strchr(line_start, '\0'); } if (c == NULL) { diff --git a/src/buffer.c b/src/buffer.c index 05a6aa12..432194e8 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -129,7 +129,7 @@ struct ssh_buffer_struct *ssh_buffer_new(void) /* * Always preallocate 64 bytes. * - * -1 for ralloc_buffer magic. + * -1 for realloc_buffer magic. */ rc = ssh_buffer_allocate_size(buf, 64 - 1); if (rc != 0) { @@ -693,7 +693,7 @@ uint32_t ssh_buffer_get_data(struct ssh_buffer_struct *buffer, void *data, uint3 /** * @internal * - * @brief Get a 8 bits unsigned int out of the buffer and adjusts the read + * @brief Get a 8 bits unsigned int out of the buffer and adjust the read * pointer. * * @param[in] buffer The buffer to read. @@ -757,7 +757,7 @@ int ssh_buffer_validate_length(struct ssh_buffer_struct *buffer, size_t len) /** * @internal * - * @brief Get a SSH String out of the buffer and adjusts the read pointer. + * @brief Get an SSH String out of the buffer and adjust the read pointer. * * @param[in] buffer The buffer to read. * diff --git a/src/chachapoly.c b/src/chachapoly.c index c4827fd8..2cd23854 100644 --- a/src/chachapoly.c +++ b/src/chachapoly.c @@ -65,7 +65,7 @@ static int chacha20_set_encrypt_key(struct ssh_cipher_struct *cipher, /** * @internal * - * @brief encrypts an outgoing packet with chacha20 and authenticate it + * @brief encrypts an outgoing packet with chacha20 and authenticates it * with poly1305. */ static void chacha20_poly1305_aead_encrypt(struct ssh_cipher_struct *cipher, diff --git a/src/channels.c b/src/channels.c index 0dc4260d..f19b3ce7 100644 --- a/src/channels.c +++ b/src/channels.c @@ -370,7 +370,7 @@ end: if (channel->state == SSH_CHANNEL_STATE_OPEN) { err = SSH_OK; } else if (err != SSH_AGAIN) { - /* Messages were handled correctly, but he channel state is invalid */ + /* Messages were handled correctly, but the channel state is invalid */ err = SSH_ERROR; } @@ -397,7 +397,7 @@ ssh_channel ssh_channel_from_local(ssh_session session, uint32_t id) { /** * @internal - * @brief grows the local window and send a packet to the other party + * @brief grows the local window and sends a packet to the other party * @param session SSH session * @param channel SSH channel * @param minimumsize The minimum acceptable size for the new window. @@ -1203,7 +1203,7 @@ void ssh_channel_free(ssh_channel channel) channel->flags |= SSH_CHANNEL_FLAG_FREED_LOCAL; /* The idea behind the flags is the following : it is well possible - * that a client closes a channel that stills exists on the server side. + * that a client closes a channel that still exists on the server side. * We definitively close the channel when we receive a close message *and* * the user closed it. */ @@ -1566,7 +1566,7 @@ error: /** * @brief Get the remote window size. * - * This is the maximum amounts of bytes the remote side expects us to send + * This is the maximum amount of bytes the remote side expects us to send * before growing the window again. * * @param[in] channel The channel to query. @@ -1826,7 +1826,7 @@ error: /** * @brief Request a pty with a specific type and size. * - * @param[in] channel The channel to sent the request. + * @param[in] channel The channel to send the request. * * @param[in] terminal The terminal type ("vt100, xterm,..."). * @@ -1918,8 +1918,8 @@ int ssh_channel_request_pty(ssh_channel channel) { * @return SSH_OK on success, SSH_ERROR if an error occurred. * * @warning Do not call it from a signal handler if you are not sure any other - * libssh function using the same channel/session is running at same - * time (not 100% threadsafe). + * libssh function using the same channel/session is running at the + * same time (not 100% threadsafe). */ int ssh_channel_change_pty_size(ssh_channel channel, int cols, int rows) { ssh_session session = channel->session; @@ -2062,7 +2062,7 @@ static char *generate_cookie(void) { * @brief Sends the "x11-req" channel request over an existing session channel. * * This will enable redirecting the display of the remote X11 applications to - * local X server over an secure tunnel. + * local X server over a secure tunnel. * * @param[in] channel An existing session channel where the remote X11 * applications are going to be executed. @@ -2858,7 +2858,7 @@ static int ssh_channel_read_termination(void *s){ return 0; } -/* TODO FIXME Fix the blocking behaviours */ +/* TODO: FIXME Fix the blocking behaviours */ /** * @brief Reads data from a channel. diff --git a/src/config.c b/src/config.c index 53e1b481..fb143983 100644 --- a/src/config.c +++ b/src/config.c @@ -1238,7 +1238,7 @@ int ssh_config_parse_string(ssh_session session, const char *input) line_start = c; c = strchr(line_start, '\n'); if (c == NULL) { - /* if there is no newline in the end of the string */ + /* if there is no newline at the end of the string */ c = strchr(line_start, '\0'); } if (c == NULL) { diff --git a/src/connect.c b/src/connect.c index ce4d58df..1d76b8b3 100644 --- a/src/connect.c +++ b/src/connect.c @@ -289,14 +289,14 @@ static int ssh_select_cb (socket_t fd, int revents, void *userdata) /** * @brief A wrapper for the select syscall * - * This functions acts more or less like the select(2) syscall.\n + * This function acts more or less like the select(2) syscall.\n * There is no support for writing or exceptions.\n * * @param[in] channels Arrays of channels pointers terminated by a NULL. * It is never rewritten. * - * @param[out] outchannels Arrays of same size that "channels", there is no need - * to initialize it. + * @param[out] outchannels Arrays of the same size as "channels", there is no + * need to initialize it. * * @param[in] maxfd Maximum +1 file descriptor from readfds. * diff --git a/src/connector.c b/src/connector.c index 4e96b200..82dfc481 100644 --- a/src/connector.c +++ b/src/connector.c @@ -216,7 +216,7 @@ static void ssh_connector_except_channel(ssh_connector connector, /** * @internal * - * @brief Reset the poll events to be followed for each file descriptors. + * @brief Reset the poll events to be followed for each file descriptor. */ static void ssh_connector_reset_pollevents(ssh_connector connector) { diff --git a/src/dh.c b/src/dh.c index 18b71734..2de85145 100644 --- a/src/dh.c +++ b/src/dh.c @@ -370,7 +370,7 @@ SSH_PACKET_CALLBACK(ssh_packet_client_dh_reply){ if (rc != 0) { goto error; } - + rc = ssh_dh_compute_shared_secret(session->next_crypto->dh_ctx, DH_CLIENT_KEYPAIR, DH_SERVER_KEYPAIR, &session->next_crypto->shared_secret); @@ -640,7 +640,7 @@ ssh_key ssh_dh_get_current_server_publickey(ssh_session session) return session->current_crypto->server_pubkey; } -/* Caller need to free the blob */ +/* Caller needs to free the blob */ int ssh_dh_get_current_server_publickey_blob(ssh_session session, ssh_string *pubkey_blob) { @@ -654,7 +654,7 @@ ssh_key ssh_dh_get_next_server_publickey(ssh_session session) return session->next_crypto->server_pubkey; } -/* Caller need to free the blob */ +/* Caller needs to free the blob */ int ssh_dh_get_next_server_publickey_blob(ssh_session session, ssh_string *pubkey_blob) { @@ -699,7 +699,7 @@ static char *ssh_get_b64_unpadded(const unsigned char *hash, size_t len) * @brief Get a hash as a human-readable hex- or base64-string. * * This gets an allocated fingerprint hash. If it is a SHA sum, it will - * return an unpadded base64 strings. If it is a MD5 sum, it will return hex + * return an unpadded base64 string. If it is a MD5 sum, it will return a hex * string. Either way, the output is prepended by the hash-type. * * @warning Do NOT use MD5 or SHA1! Those hash functions are being deprecated. diff --git a/src/error.c b/src/error.c index 22180407..8930d26a 100644 --- a/src/error.c +++ b/src/error.c @@ -142,7 +142,7 @@ const char *ssh_get_error(void *error) { * SSH_FATAL A fatal error occurred. This could be an unexpected * disconnection\n * - * Other error codes are internal but can be considered same than + * Other error codes are internal but can be considered the same as * SSH_FATAL. */ int ssh_get_error_code(void *error) { diff --git a/src/gssapi.c b/src/gssapi.c index 1d0fb6ae..2cbfba1a 100644 --- a/src/gssapi.c +++ b/src/gssapi.c @@ -581,7 +581,7 @@ ssh_gssapi_creds ssh_gssapi_get_creds(ssh_session session){ #endif /* SERVER */ /** - * @brief Set the forwadable ticket to be given to the server for authentication. + * @brief Set the forwardable ticket to be given to the server for authentication. * Unlike ssh_gssapi_get_creds() this is called on the client side of an ssh * connection. * diff --git a/src/init.c b/src/init.c index 2ebcedf6..7fdc14b7 100644 --- a/src/init.c +++ b/src/init.c @@ -104,7 +104,7 @@ _ret: /** * @brief Initialize global cryptographic data structures. * - * This functions is automatically called when the library is loaded. + * This function is automatically called when the library is loaded. * */ void libssh_constructor(void) @@ -127,7 +127,7 @@ void libssh_constructor(void) * The libssh library is implementing the SSH protocols and some of its * extensions. This group of functions is mostly used to implement an SSH * client. - * Some function are needed to implement an SSH server too. + * Some functions are needed to implement an SSH server too. * * @{ */ @@ -136,8 +136,8 @@ void libssh_constructor(void) * @brief Initialize global cryptographic data structures. * * Since version 0.8.0, when libssh is dynamically linked, it is not necessary - * to call this function on systems which are fully supported with regards to - * threading (that is, system with pthreads available). + * to call this function on systems that fully support threading (that is, + * systems with pthreads available). * * If libssh is statically linked, it is necessary to explicitly call ssh_init() * before calling any other provided API, and it is necessary to explicitly call @@ -189,7 +189,7 @@ _ret: } /** - * @brief Finalize and cleanup all libssh and cryptographic data structures. + * @brief Finalize and clean up all libssh and cryptographic data structures. * * This function is automatically called when the library is unloaded. * @@ -206,7 +206,7 @@ void libssh_destructor(void) } /** - * @brief Finalize and cleanup all libssh and cryptographic data structures. + * @brief Finalize and clean up all libssh and cryptographic data structures. * * Since version 0.8.0, when libssh is dynamically linked, it is not necessary * to call this function, since it is automatically called when the library is diff --git a/src/kdf.c b/src/kdf.c index 09644739..a88c92f8 100644 --- a/src/kdf.c +++ b/src/kdf.c @@ -39,7 +39,7 @@ /* The following implements the SSHKDF for crypto backend that - * do not have a native implementations */ + * do not have a native implementation */ struct ssh_mac_ctx_struct { enum ssh_kdf_digest digest_type; union { diff --git a/src/kex.c b/src/kex.c index 236d34a4..bd6d2664 100644 --- a/src/kex.c +++ b/src/kex.c @@ -965,13 +965,13 @@ char *ssh_keep_known_algos(enum ssh_kex_types_e algo, const char *list) /** * @internal * - * @brief Return a new allocated string containing only the FIPS allowed + * @brief Return a newly allocated string containing only the FIPS allowed * algorithms from the list. * * @param[in] algo The type of the methods to filter * @param[in] list The list to be filtered * - * @return A new allocated list containing only the FIPS allowed algorithms from + * @return A newly allocated list containing only the FIPS allowed algorithms from * the list; NULL in case of error. */ char *ssh_keep_fips_algos(enum ssh_kex_types_e algo, const char *list) diff --git a/src/known_hosts.c b/src/known_hosts.c index 3feab159..8103dac7 100644 --- a/src/known_hosts.c +++ b/src/known_hosts.c @@ -65,7 +65,7 @@ * @param[out] file A pointer to the known host file. Could be pointing to * NULL at start. * - * @param[in] filename The file name of the known host file. + * @param[in] filename The filename of the known host file. * * @param[out] found_type A pointer to a string to be set with the found key * type. diff --git a/src/knownhosts.c b/src/knownhosts.c index 67e6360a..07d1f277 100644 --- a/src/knownhosts.c +++ b/src/knownhosts.c @@ -600,7 +600,7 @@ char *ssh_known_hosts_get_algorithms_names(ssh_session session) /** * @brief Parse a line from a known_hosts entry into a structure * - * This parses an known_hosts entry into a structure with the key in a libssh + * This parses a known_hosts entry into a structure with the key in a libssh * consumeable form. You can use the PKI key function to further work with it. * * @param[in] hostname The hostname to match the line to @@ -608,7 +608,7 @@ char *ssh_known_hosts_get_algorithms_names(ssh_session session) * @param[in] line The line to compare and parse if we have a hostname * match. * - * @param[in] entry A pointer to store the the allocated known_hosts + * @param[in] entry A pointer to store the allocated known_hosts * entry structure. The user needs to free the memory * using SSH_KNOWNHOSTS_ENTRY_FREE(). * @@ -662,7 +662,7 @@ int ssh_known_hosts_parse_line(const char *hostname, if (q[0] == '[' && hostname[0] != '[') { /* Corner case: We have standard port so we do not have - * hostname in square braces. But the patern is enclosed + * hostname in square braces. But the pattern is enclosed * in braces with, possibly standard or wildcard, port. * We need to test against [host]:port pair here. */ @@ -775,12 +775,12 @@ out: } /** - * @brief Check if the set hostname and port matches an entry in known_hosts. + * @brief Check if the set hostname and port match an entry in known_hosts. * - * This check if the set hostname and port has an entry in the known_hosts file. + * This check if the set hostname and port have an entry in the known_hosts file. * You need to set at least the hostname using ssh_options_set(). * - * @param[in] session The session with with the values set to check. + * @param[in] session The session with the values set to check. * * @return A ssh_known_hosts_e return value. */ @@ -893,11 +893,11 @@ enum ssh_known_hosts_e ssh_session_has_known_hosts_entry(ssh_session session) * * @param[in] session The session with information to export. * - * @param[in] pentry_string A pointer to a string to store the alloocated + * @param[in] pentry_string A pointer to a string to store the allocated * line of the entry. The user must free it using * ssh_string_free_char(). * - * @return SSH_OK on succcess, SSH_ERROR otherwise. + * @return SSH_OK on success, SSH_ERROR otherwise. */ int ssh_session_export_known_hosts_entry(ssh_session session, char **pentry_string) @@ -962,7 +962,7 @@ int ssh_session_export_known_hosts_entry(ssh_session session, } /** - * @brief Add the current connected server to the user known_hosts file. + * @brief Adds the currently connected server to the user known_hosts file. * * This adds the currently connected server to the known_hosts file by * appending a new line at the end. The global known_hosts file is considered @@ -1113,7 +1113,7 @@ ssh_known_hosts_check_server_key(const char *hosts_entry, } /** - * @brief Get the known_hosts entry for the current connected session. + * @brief Get the known_hosts entry for the currently connected session. * * @param[in] session The session to validate. * @@ -1132,7 +1132,7 @@ ssh_known_hosts_check_server_key(const char *hosts_entry, * SSH_KNOWN_HOSTS_NOT_FOUND: The known host file does not exist. The * host is thus unknown. File will be * created if host key is accepted.\n - * SSH_KNOWN_HOSTS_ERROR: There had been an eror checking the host. + * SSH_KNOWN_HOSTS_ERROR: There had been an error checking the host. * * @see ssh_knownhosts_entry_free() */ diff --git a/src/legacy.c b/src/legacy.c index 8ae3d920..3d53fd9f 100644 --- a/src/legacy.c +++ b/src/legacy.c @@ -20,7 +20,7 @@ */ /** functions in that file are wrappers to the newly named functions. All - * of them are depreciated, but these wrapper will avoid breaking backward + * of them are depreciated, but these wrappers will avoid breaking backward * compatibility */ diff --git a/src/libgcrypt.c b/src/libgcrypt.c index 2383ffa0..a5d8c161 100644 --- a/src/libgcrypt.c +++ b/src/libgcrypt.c @@ -434,7 +434,7 @@ aes_gcm_encrypt(struct ssh_cipher_struct *cipher, err = gcry_cipher_setiv(cipher->key[0], cipher->last_iv, AES_GCM_IVLEN); - /* This actualy does not increment the packet counter for the + /* This actually does not increment the packet counter for the * current encryption operation, but for the next one. The first * operation needs to be completed with the derived IV. * diff --git a/src/messages.c b/src/messages.c index c09a841c..ff199f96 100644 --- a/src/messages.c +++ b/src/messages.c @@ -54,7 +54,7 @@ * This file contains the message parsing utilities for client and server * programs using libssh. * - * On the server the the main loop of the program will call + * On the server the main loop of the program will call * ssh_message_get(session) to get messages as they come. They are not 1-1 with * the protocol messages. Then, the user will know what kind of a message it is * and use the appropriate functions to handle it (or use the default handlers @@ -79,7 +79,7 @@ static ssh_message ssh_message_new(ssh_session session) #ifndef WITH_SERVER -/* Reduced version of the reply default that only reply with +/* Reduced version of the reply default that only replies with * SSH_MSG_UNIMPLEMENTED */ static int ssh_message_reply_default(ssh_message msg) { @@ -1169,7 +1169,7 @@ SSH_PACKET_CALLBACK(ssh_packet_channel_open){ ssh_set_error(session,SSH_FATAL, "Invalid state when receiving channel open request (must be authenticated)"); goto error; } - + if (strcmp(type_c,"session") == 0) { msg->channel_request_open.type = SSH_CHANNEL_SESSION; SAFE_FREE(type_c); @@ -1248,7 +1248,7 @@ end: * * @param[in] chan The channel the request is made on. * - * @returns SSH_OK on success, SSH_ERROR if an error occured. + * @returns SSH_OK on success, SSH_ERROR if an error occurred. */ int ssh_message_channel_request_open_reply_accept_channel(ssh_message msg, ssh_channel chan) { ssh_session session; @@ -1339,7 +1339,7 @@ ssh_channel ssh_message_channel_request_open_reply_accept(ssh_message msg) { * * @param[in] want_reply The want_reply field from the request. * - * @returns SSH_OK on success, SSH_ERROR if an error occured. + * @returns SSH_OK on success, SSH_ERROR if an error occurred. */ int ssh_message_handle_channel_request(ssh_session session, ssh_channel channel, ssh_buffer packet, const char *request, uint8_t want_reply) { diff --git a/src/misc.c b/src/misc.c index c7e3cfc9..b945a279 100644 --- a/src/misc.c +++ b/src/misc.c @@ -455,7 +455,7 @@ void ssh_print_hexa(const char *descr, const unsigned char *what, size_t len) { * " 00000000 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f ................" * * The value for each byte as corresponding ASCII character is printed at the - * end if the value is printable. Otherwise it is replace with '.'. + * end if the value is printable. Otherwise, it is replaced with '.'. * * @param[in] descr A description for the content to be logged * @param[in] what The buffer to be logged @@ -840,7 +840,7 @@ const void *_ssh_list_pop_head(struct ssh_list *list){ * * @return The dirname of path or NULL if we can't allocate memory. * If path does not contain a slash, c_dirname() returns - * the string ".". If path is the string "/", it returns + * the string ".". If path is a string "/", it returns * the string "/". If path is NULL or an empty string, * "." is returned. */ @@ -895,7 +895,7 @@ char *ssh_dirname (const char *path) { * @param[in] path The path to parse. * * @return The filename of path or NULL if we can't allocate - * memory. If path is a the string "/", basename returns + * memory. If path is the string "/", basename returns * the string "/". If path is NULL or an empty string, * "." is returned. */ @@ -1653,13 +1653,13 @@ int ssh_quote_file_name(const char *file_name, char *buf, size_t buf_len) *dst++ = '\\'; break; case SINGLE_QUOTE: - /* Close the current quoted string and replace '!' for unquoted + /* Close the currently quoted string and replace '!' for unquoted * "\!" */ *dst++ = '\''; *dst++ = '\\'; break; case DOUBLE_QUOTE: - /* Close current quoted string and replace "!" for unquoted + /* Close currently quoted string and replace "!" for unquoted * "\!" */ *dst++ = '"'; *dst++ = '\\'; @@ -1835,11 +1835,12 @@ err: /** * @internal * - * @brief Finds the first occurence of a patterm in a string and replaces it. + * @brief Finds the first occurrence of a pattern in a string and replaces it. * - * @param[in] src Source string containing the patern to be replaced. + * @param[in] src Source string containing the pattern to be replaced. * @param[in] pattern Pattern to be replaced in the source string. - * Note: this function replaces the first occurence of pattern only. + * Note: this function replaces the first occurrence of + * pattern only. * @param[in] replace String to be replaced is stored in replace. * * @returns src_replaced a pointer that points to the replaced string. diff --git a/src/options.c b/src/options.c index cdbec8e6..0dea536a 100644 --- a/src/options.c +++ b/src/options.c @@ -58,7 +58,7 @@ * @param dest A pointer to store the allocated session with duplicated * options. You have to free the memory. * - * @returns 0 on sucess, -1 on error with errno set. + * @returns 0 on success, -1 on error with errno set. * * @see ssh_session_connect() */ @@ -340,7 +340,7 @@ int ssh_options_set_algo(ssh_session session, * - SSH_LOG_NOLOG: No logging * - SSH_LOG_WARNING: Only warnings * - SSH_LOG_PROTOCOL: High level protocol information - * - SSH_LOG_PACKET: Lower level protocol infomations, packet level + * - SSH_LOG_PACKET: Lower level protocol information, packet level * - SSH_LOG_FUNCTIONS: Every function path * * - SSH_OPTIONS_LOG_VERBOSITY_STR: @@ -1070,7 +1070,7 @@ int ssh_options_get_port(ssh_session session, unsigned int* port_target) { /** * @brief This function can get ssh options, it does not support all options provided for * ssh options set, but mostly those which a user-space program may care about having - * trusted the ssh driver to infer these values from underlaying configuration files. + * trusted the ssh driver to infer these values from underlying configuration files. * It operates only on those SSH_OPTIONS_* which return char*. If you wish to receive * the port then please use ssh_options_get_port() which returns an unsigned int. * @@ -1175,10 +1175,10 @@ int ssh_options_get(ssh_session session, enum ssh_options_e type, char** value) * This is a helper for your application to generate the appropriate * options from the command line arguments.\n * The argv array and argc value are changed so that the parsed - * arguments wont appear anymore in them.\n + * arguments won't appear anymore in them.\n * The single arguments (without switches) are not parsed. thus, * myssh -l user localhost\n - * The command wont set the hostname value of options to localhost. + * The command won't set the hostname value of options to localhost. * * @param session The session to configure. * @@ -1555,7 +1555,7 @@ static int ssh_bind_set_algo(ssh_bind sshbind, * * - SSH_BIND_OPTIONS_HOSTKEY: * Set the path to an ssh host key, regardless - * of type. Only one key from per key type + * of type. Only one key from each key type * (RSA, DSA, ECDSA) is allowed in an ssh_bind * at a time, and later calls to this function * with this option for the same key type will @@ -1580,7 +1580,7 @@ static int ssh_bind_set_algo(ssh_bind sshbind, * - SSH_LOG_NOLOG: No logging * - SSH_LOG_WARNING: Only warnings * - SSH_LOG_PROTOCOL: High level protocol information - * - SSH_LOG_PACKET: Lower level protocol infomations, packet level + * - SSH_LOG_PACKET: Lower level protocol information, packet level * - SSH_LOG_FUNCTIONS: Every function path * * - SSH_BIND_OPTIONS_LOG_VERBOSITY_STR: @@ -1655,7 +1655,7 @@ static int ssh_bind_set_algo(ssh_bind sshbind, * possible algorithms is created from the list of keys * set and then filtered against this list. * (const char *, comma-separated list). - * + * * - SSH_BIND_OPTIONS_MODULI * Set the path to the moduli file. Defaults to * /etc/ssh/moduli if not specified (const char *). @@ -2132,7 +2132,7 @@ static char *ssh_bind_options_expand_escape(ssh_bind sshbind, const char *s) * @param sshbind SSH bind handle * * @param filename The options file to use; if NULL only the global - * configuration is parsed and applied (if it haven't been + * configuration is parsed and applied (if it hasn't been * processed before). * * @return 0 on success, < 0 on error. diff --git a/src/pcap.c b/src/pcap.c index c089854a..abac3cd0 100644 --- a/src/pcap.c +++ b/src/pcap.c @@ -103,7 +103,7 @@ struct ssh_pcap_context_struct { ssh_session session; ssh_pcap_file file; int connected; - /* All of these information are useful to generate + /* All of this information is useful to generate * the dummy IP and TCP packets */ uint32_t ipsource; @@ -198,7 +198,7 @@ error: } /** - * @brief opens a new pcap file and create header + * @brief opens a new pcap file and creates header */ int ssh_pcap_file_open(ssh_pcap_file pcap, const char *filename){ ssh_buffer header; @@ -506,7 +506,7 @@ error: /** @brief sets the pcap file used to trace the session * @param current session - * @param pcap an handler to a pcap file. A pcap file may be used in several + * @param pcap a handler to a pcap file. A pcap file may be used in several * sessions. * @returns SSH_ERROR in case of error, SSH_OK otherwise. */ diff --git a/src/pki.c b/src/pki.c index dc7992f6..5a23d163 100644 --- a/src/pki.c +++ b/src/pki.c @@ -764,7 +764,7 @@ void ssh_signature_free(ssh_signature sig) } /** - * @brief import a base64 formated key from a memory c-string + * @brief import a base64 formatted key from a memory c-string * * @param[in] b64_key The c-string holding the base64 encoded key * @@ -1557,7 +1557,7 @@ fail: } /** - * @brief Import a base64 formated public key from a memory c-string. + * @brief Import a base64 formatted public key from a memory c-string. * * @param[in] b64_key The base64 key to format. * @@ -1835,7 +1835,7 @@ int ssh_pki_import_pubkey_file(const char *filename, ssh_key *pkey) } /** - * @brief Import a base64 formated certificate from a memory c-string. + * @brief Import a base64 formatted certificate from a memory c-string. * * @param[in] b64_cert The base64 cert to format. * diff --git a/src/pki_crypto.c b/src/pki_crypto.c index 83bf4180..6f4f435c 100644 --- a/src/pki_crypto.c +++ b/src/pki_crypto.c @@ -2148,7 +2148,7 @@ error: /** * @internal * - * @brief Sign the given input data. The digest of to be signed is calculated + * @brief Sign the given input data. The digest to be signed is calculated * internally as necessary. * * @param[in] privkey The private key to be used for signing. diff --git a/src/poll.c b/src/poll.c index 82c9b18b..f9499b07 100644 --- a/src/poll.c +++ b/src/poll.c @@ -51,7 +51,7 @@ * * It's based on poll objects, each of which store a socket, its events and a * callback, which gets called whenever an event is set. The poll objects are - * attached to a poll context, which should be allocated on per thread basis. + * attached to a poll context, which should be allocated on a per thread basis. * * Polling the poll context will poll all the attached poll objects and call * their callbacks (handlers) if any of the socket events are set. This should @@ -210,8 +210,8 @@ static short bsd_socket_compute_revents(int fd, short events) * poll implementation. * * Keep in mind that select is terribly inefficient. The interface is simply not - * meant to be used with maximum descriptor value greater, say, 32 or so. With - * a value as high as 1024 on Linux you'll pay dearly in every single call. + * meant to be used with maximum descriptor value greater than, say, 32 or so. + * With a value as high as 1024 on Linux you'll pay dearly in every single call. * poll() will be orders of magnitude faster. */ static int bsd_poll(ssh_pollfd_t *fds, nfds_t nfds, int timeout) @@ -646,7 +646,7 @@ void ssh_poll_ctx_remove(ssh_poll_ctx ctx, ssh_poll_handle p) { * @brief Poll all the sockets associated through a poll object with a * poll context. If any of the events are set after the poll, the * call back function of the socket will be called. - * This function should be called once within the programs main loop. + * This function should be called once within the program's main loop. * * @param ctx Pointer to an already allocated poll context. * @param timeout An upper limit on the time for which ssh_poll_ctx() will @@ -655,7 +655,7 @@ void ssh_poll_ctx_remove(ssh_poll_ctx ctx, ssh_poll_handle p) { * the poll() function. * @returns SSH_OK No error. * SSH_ERROR Error happened during the poll. - * SSH_AGAIN Timeout occured + * SSH_AGAIN Timeout occurred */ int ssh_poll_ctx_dopoll(ssh_poll_ctx ctx, int timeout) @@ -752,7 +752,7 @@ struct ssh_event_struct { * ssh_session objects and socket fd which are going to be polled at the * same time as the event context. You would need a single event context * per thread. - * + * * @return The ssh_event object on success, NULL on failure. */ ssh_event ssh_event_new(void) { @@ -814,7 +814,7 @@ int ssh_event_add_fd(ssh_event event, socket_t fd, short events, ssh_event_callback cb, void *userdata) { ssh_poll_handle p; struct ssh_event_fd_wrapper *pw; - + if(event == NULL || event->ctx == NULL || cb == NULL || fd == SSH_INVALID_SOCKET) { return SSH_ERROR; @@ -870,7 +870,7 @@ void ssh_event_remove_poll(ssh_event event, ssh_poll_handle p) } /** - * @brief remove the poll handle from session and assign them to a event, + * @brief remove the poll handle from session and assign them to an event, * when used in blocking mode. * * @param event The ssh_event object diff --git a/src/scp.c b/src/scp.c index ab9c30b3..cbb301fd 100644 --- a/src/scp.c +++ b/src/scp.c @@ -325,7 +325,7 @@ void ssh_scp_free(ssh_scp scp) * @param[in] mode The UNIX permissions for the new directory, e.g. 0755. * * @returns SSH_OK if the directory has been created, SSH_ERROR if - * an error occured. + * an error occurred. * * @see ssh_scp_leave_directory() */ @@ -416,7 +416,7 @@ error: * @brief Leave a directory. * * @returns SSH_OK if the directory has been left, SSH_ERROR if an - * error occured. + * error occurred. * * @see ssh_scp_push_directory() */ @@ -465,7 +465,7 @@ int ssh_scp_leave_directory(ssh_scp scp) * @param[in] mode The UNIX permissions for the new file, e.g. 0644. * * @returns SSH_OK if the file is ready to be sent, SSH_ERROR if an - * error occured. + * error occurred. * * @see ssh_scp_push_file() */ @@ -570,7 +570,7 @@ error: * @param[in] mode The UNIX permissions for the new file, e.g. 0644. * * @returns SSH_OK if the file is ready to be sent, SSH_ERROR if an - * error occured. + * error occurred. */ int ssh_scp_push_file(ssh_scp scp, const char *filename, size_t size, int mode) { @@ -589,7 +589,7 @@ int ssh_scp_push_file(ssh_scp scp, const char *filename, size_t size, int mode) * @param[out] response A pointer where the response message must be copied if * any. This pointer must then be free'd. * - * @returns The return code, SSH_ERROR a error occured. + * @returns The return code, SSH_ERROR a error occurred. */ int ssh_scp_response(ssh_scp scp, char **response) { @@ -659,7 +659,7 @@ int ssh_scp_response(ssh_scp scp, char **response) * @param[in] len The number of bytes to write. * * @returns SSH_OK if the write was successful, SSH_ERROR an error - * occured while writing. + * occurred while writing. */ int ssh_scp_write(ssh_scp scp, const void *buffer, size_t len) { @@ -737,7 +737,7 @@ int ssh_scp_write(ssh_scp scp, const void *buffer, size_t len) * null-terminated. * * @returns SSH_OK if the string was read, SSH_ERROR if an error - * occured while reading. + * occurred while reading. */ int ssh_scp_read_string(ssh_scp scp, char *buffer, size_t len) { @@ -885,7 +885,7 @@ int ssh_scp_pull_request(ssh_scp scp) return SSH_ERROR; } - /* a parsing error occured */ + /* a parsing error occurred */ error: SAFE_FREE(name); SAFE_FREE(mode); @@ -992,7 +992,7 @@ int ssh_scp_accept_request(ssh_scp scp) * * @param[in] size The size of the buffer. * - * @returns The nNumber of bytes read, SSH_ERROR if an error occured + * @returns The nNumber of bytes read, SSH_ERROR if an error occurred * while reading. */ int ssh_scp_read(ssh_scp scp, void *buffer, size_t size) diff --git a/src/session.c b/src/session.c index 36339092..bb007e59 100644 --- a/src/session.c +++ b/src/session.c @@ -680,7 +680,7 @@ int ssh_handle_packets(ssh_session session, int timeout) { * @param[in] timeout Set an upper limit on the time for which this function * will block, in milliseconds. Specifying * SSH_TIMEOUT_INFINITE (-1) means an infinite timeout. - * Specifying SSH_TIMEOUT_USER means to use the timeout + * Specifying SSH_TIMEOUT_USER means using the timeout * specified in options. 0 means poll will return * immediately. * SSH_TIMEOUT_DEFAULT uses the session timeout if set or @@ -934,7 +934,7 @@ error: /** * @brief Set the session data counters. * - * This functions sets the counter structures to be used to calculate data + * This function sets the counter structures to be used to calculate data * which comes in and goes out through the session at different levels. * * @code @@ -1040,7 +1040,7 @@ int ssh_get_pubkey_hash(ssh_session session, unsigned char **hash) /** * @brief Deallocate the hash obtained by ssh_get_pubkey_hash. * - * This is required under Microsoft platform as this library might use a + * This is required under Microsoft platform as this library might use a * different C library than your software, hence a different heap. * * @param[in] hash The buffer to deallocate. @@ -1109,7 +1109,7 @@ int ssh_get_publickey(ssh_session session, ssh_key *key) * @return 0 on success, -1 if an error occurred. * * @warning It is very important that you verify at some moment that the hash - * matches a known server. If you don't do it, cryptography wont help + * matches a known server. If you don't do it, cryptography won't help * you at making things secure. * OpenSSH uses SHA256 to print public key digests. * diff --git a/src/sftp.c b/src/sftp.c index 1709ea68..d072f80e 100644 --- a/src/sftp.c +++ b/src/sftp.c @@ -866,7 +866,7 @@ static int sftp_enqueue(sftp_session sftp, sftp_message msg) { } /* - * Pulls of a message from the queue based on the ID. + * Pulls a message from the queue based on the ID. * Returns NULL if no message has been found. */ static sftp_message sftp_dequeue(sftp_session sftp, uint32_t id){ @@ -1102,7 +1102,7 @@ sftp_dir sftp_opendir(sftp_session sftp, const char *path) /* * Parse the attributes from a payload from some messages. It is coded on * baselines from the protocol version 4. - * This code is more or less dead but maybe we need it in future. + * This code is more or less dead but maybe we will need it in the future. */ static sftp_attributes sftp_parse_attr_4(sftp_session sftp, ssh_buffer buf, int expectnames) { diff --git a/src/socket.c b/src/socket.c index f80b63d9..1a12a43b 100644 --- a/src/socket.c +++ b/src/socket.c @@ -829,7 +829,7 @@ int ssh_socket_set_blocking(socket_t fd) /** * @internal * @brief Launches a socket connection - * If a the socket connected callback has been defined and + * If the socket connected callback has been defined and * a poll object exists, this call will be non blocking. * @param s socket to connect. * @param host hostname or ip address to connect to. @@ -846,7 +846,7 @@ int ssh_socket_connect(ssh_socket s, const char *bind_addr) { socket_t fd; - + if (s->state != SSH_SOCKET_NONE) { ssh_set_error(s->session, SSH_FATAL, "ssh_socket_connect called on socket not unconnected"); @@ -858,7 +858,7 @@ int ssh_socket_connect(ssh_socket s, return SSH_ERROR; } ssh_socket_set_fd(s,fd); - + return SSH_OK; } diff --git a/src/string.c b/src/string.c index acd3cf48..44403487 100644 --- a/src/string.c +++ b/src/string.c @@ -103,7 +103,7 @@ int ssh_string_fill(struct ssh_string_struct *s, const void *data, size_t len) { * @return The newly allocated string, NULL on error with errno * set. * - * @note The nul byte is not copied nor counted in the ouput string. + * @note The null byte is not copied nor counted in the output string. */ struct ssh_string_struct *ssh_string_from_char(const char *what) { struct ssh_string_struct *ptr; @@ -129,7 +129,7 @@ struct ssh_string_struct *ssh_string_from_char(const char *what) { /** * @brief Return the size of a SSH string. * - * @param[in] s The the input SSH string. + * @param[in] s The input SSH string. * * @return The size of the content of the string, 0 on error. */ @@ -149,7 +149,7 @@ size_t ssh_string_len(struct ssh_string_struct *s) { } /** - * @brief Get the the string as a C nul-terminated string. + * @brief Get the string as a C null-terminated string. * * This is only available as long as the SSH string exists. * @@ -168,7 +168,7 @@ const char *ssh_string_get_char(struct ssh_string_struct *s) } /** - * @brief Convert a SSH string to a C nul-terminated string. + * @brief Convert a SSH string to a C null-terminated string. * * @param[in] s The SSH input string. * diff --git a/src/wrapper.c b/src/wrapper.c index 0f65b1ae..5cdb21fd 100644 --- a/src/wrapper.c +++ b/src/wrapper.c @@ -25,7 +25,7 @@ * Why a wrapper? * * Let's say you want to port libssh from libcrypto of openssl to libfoo - * you are going to spend hours to remove every references to SHA1_Update() + * you are going to spend hours removing every reference to SHA1_Update() * to libfoo_sha1_update after the work is finished, you're going to have * only this file to modify it's not needed to say that your modifications * are welcome.