cleanup: use ssh_ prefix in the kex (non-static) functions
Having "ssh_" prefix in the functions' name will avoid possible clashes when compiling libssh statically. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Этот коммит содержится в:
родитель
c487f5db5b
Коммит
1102ea4c55
@ -38,10 +38,10 @@ SSH_PACKET_CALLBACK(ssh_packet_publickey1);
|
||||
|
||||
int ssh_send_kex(ssh_session session, int server_kex);
|
||||
void ssh_list_kex(struct ssh_kex_struct *kex);
|
||||
int set_client_kex(ssh_session session);
|
||||
int ssh_set_client_kex(ssh_session session);
|
||||
int ssh_kex_select_methods(ssh_session session);
|
||||
int verify_existing_algo(int algo, const char *name);
|
||||
char **space_tokenize(const char *chain);
|
||||
int ssh_verify_existing_algo(int algo, const char *name);
|
||||
char **ssh_space_tokenize(const char *chain);
|
||||
int ssh_get_kex1(ssh_session session);
|
||||
char *ssh_find_matching(const char *in_d, const char *what_d);
|
||||
const char *ssh_kex_get_supported_method(uint32_t algo);
|
||||
|
@ -399,7 +399,7 @@ static void ssh_client_connection_callback(ssh_session session){
|
||||
case SSH_SESSION_STATE_KEXINIT_RECEIVED:
|
||||
set_status(session,0.6f);
|
||||
ssh_list_kex(&session->next_crypto->server_kex);
|
||||
if (set_client_kex(session) < 0) {
|
||||
if (ssh_set_client_kex(session) < 0) {
|
||||
goto error;
|
||||
}
|
||||
if (ssh_kex_select_methods(session) == SSH_ERROR)
|
||||
|
@ -172,7 +172,7 @@ static char **tokenize(const char *chain){
|
||||
|
||||
/* same as tokenize(), but with spaces instead of ',' */
|
||||
/* TODO FIXME rewrite me! */
|
||||
char **space_tokenize(const char *chain){
|
||||
char **ssh_space_tokenize(const char *chain){
|
||||
char **tokens;
|
||||
int n=1;
|
||||
int i=0;
|
||||
@ -512,7 +512,7 @@ static char *ssh_client_select_hostkeys(ssh_session session){
|
||||
for (i=0;preferred_hostkeys[i] != NULL; ++i){
|
||||
for (j=0; methods[j] != NULL; ++j){
|
||||
if(strcmp(preferred_hostkeys[i], methods[j]) == 0){
|
||||
if (verify_existing_algo(SSH_HOSTKEYS, methods[j])){
|
||||
if (ssh_verify_existing_algo(SSH_HOSTKEYS, methods[j])){
|
||||
if(needcoma)
|
||||
strncat(methods_buffer,",",sizeof(methods_buffer)-strlen(methods_buffer)-1);
|
||||
strncat(methods_buffer, methods[j], sizeof(methods_buffer)-strlen(methods_buffer)-1);
|
||||
@ -539,7 +539,7 @@ static char *ssh_client_select_hostkeys(ssh_session session){
|
||||
* @brief sets the key exchange parameters to be sent to the server,
|
||||
* in function of the options and available methods.
|
||||
*/
|
||||
int set_client_kex(ssh_session session){
|
||||
int ssh_set_client_kex(ssh_session session){
|
||||
struct ssh_kex_struct *client= &session->next_crypto->client_kex;
|
||||
const char *wanted;
|
||||
int i;
|
||||
@ -656,7 +656,7 @@ error:
|
||||
}
|
||||
|
||||
/* returns 1 if at least one of the name algos is in the default algorithms table */
|
||||
int verify_existing_algo(int algo, const char *name){
|
||||
int ssh_verify_existing_algo(int algo, const char *name){
|
||||
char *ptr;
|
||||
if(algo>9 || algo <0)
|
||||
return -1;
|
||||
|
@ -134,7 +134,7 @@ static char **ssh_get_knownhost_line(FILE **file, const char *filename,
|
||||
continue; /* skip empty lines */
|
||||
}
|
||||
|
||||
tokens = space_tokenize(buffer);
|
||||
tokens = ssh_space_tokenize(buffer);
|
||||
if (tokens == NULL) {
|
||||
fclose(*file);
|
||||
*file = NULL;
|
||||
|
@ -164,7 +164,7 @@ int ssh_options_copy(ssh_session src, ssh_session *dest) {
|
||||
|
||||
int ssh_options_set_algo(ssh_session session, int algo,
|
||||
const char *list) {
|
||||
if (!verify_existing_algo(algo, list)) {
|
||||
if (!ssh_verify_existing_algo(algo, list)) {
|
||||
ssh_set_error(session, SSH_REQUEST_DENIED,
|
||||
"Setting method: no algorithm for method \"%s\" (%s)\n",
|
||||
ssh_kex_get_description(algo), list);
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user