mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-07-31 00:03:07 +03:00
unsorted formatting cleanup
Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
@ -523,7 +523,8 @@ int ssh_userauth_try_publickey(ssh_session session,
|
|||||||
"Invalid key type (unknown)");
|
"Invalid key type (unknown)");
|
||||||
return SSH_AUTH_DENIED;
|
return SSH_AUTH_DENIED;
|
||||||
}
|
}
|
||||||
if (!ssh_key_algorithm_allowed(session, sig_type_c)) {
|
rc = ssh_key_algorithm_allowed(session, sig_type_c);
|
||||||
|
if (!rc) {
|
||||||
ssh_set_error(session, SSH_REQUEST_DENIED,
|
ssh_set_error(session, SSH_REQUEST_DENIED,
|
||||||
"The key algorithm '%s' is not allowed to be used by"
|
"The key algorithm '%s' is not allowed to be used by"
|
||||||
" PUBLICKEY_ACCEPTED_TYPES configuration option",
|
" PUBLICKEY_ACCEPTED_TYPES configuration option",
|
||||||
@ -647,7 +648,8 @@ int ssh_userauth_publickey(ssh_session session,
|
|||||||
"Invalid key type (unknown)");
|
"Invalid key type (unknown)");
|
||||||
return SSH_AUTH_DENIED;
|
return SSH_AUTH_DENIED;
|
||||||
}
|
}
|
||||||
if (!ssh_key_algorithm_allowed(session, sig_type_c)) {
|
rc = ssh_key_algorithm_allowed(session, sig_type_c);
|
||||||
|
if (!rc) {
|
||||||
ssh_set_error(session, SSH_REQUEST_DENIED,
|
ssh_set_error(session, SSH_REQUEST_DENIED,
|
||||||
"The key algorithm '%s' is not allowed to be used by"
|
"The key algorithm '%s' is not allowed to be used by"
|
||||||
" PUBLICKEY_ACCEPTED_TYPES configuration option",
|
" PUBLICKEY_ACCEPTED_TYPES configuration option",
|
||||||
@ -765,7 +767,8 @@ static int ssh_userauth_agent_publickey(ssh_session session,
|
|||||||
SSH_STRING_FREE(pubkey_s);
|
SSH_STRING_FREE(pubkey_s);
|
||||||
return SSH_AUTH_DENIED;
|
return SSH_AUTH_DENIED;
|
||||||
}
|
}
|
||||||
if (!ssh_key_algorithm_allowed(session, sig_type_c)) {
|
rc = ssh_key_algorithm_allowed(session, sig_type_c);
|
||||||
|
if (!rc) {
|
||||||
ssh_set_error(session, SSH_REQUEST_DENIED,
|
ssh_set_error(session, SSH_REQUEST_DENIED,
|
||||||
"The key algorithm '%s' is not allowed to be used by"
|
"The key algorithm '%s' is not allowed to be used by"
|
||||||
" PUBLICKEY_ACCEPTED_TYPES configuration option",
|
" PUBLICKEY_ACCEPTED_TYPES configuration option",
|
||||||
|
@ -906,7 +906,6 @@ int ssh_options_set(ssh_session session, enum ssh_options_e type,
|
|||||||
|
|
||||||
session->opts.StrictHostKeyChecking = (*x & 0xff) > 0 ? 1 : 0;
|
session->opts.StrictHostKeyChecking = (*x & 0xff) > 0 ? 1 : 0;
|
||||||
}
|
}
|
||||||
session->opts.StrictHostKeyChecking = *(int*)value;
|
|
||||||
break;
|
break;
|
||||||
case SSH_OPTIONS_PROXYCOMMAND:
|
case SSH_OPTIONS_PROXYCOMMAND:
|
||||||
v = value;
|
v = value;
|
||||||
|
@ -2687,7 +2687,7 @@ ssh_string ssh_srv_pki_do_sign_sessionid(ssh_session session,
|
|||||||
session->current_crypto;
|
session->current_crypto;
|
||||||
|
|
||||||
if (crypto->secret_hash == NULL){
|
if (crypto->secret_hash == NULL){
|
||||||
ssh_set_error(session,SSH_FATAL,"Missing secret_hash");
|
ssh_set_error(session, SSH_FATAL, "Missing secret_hash");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* pki_ed25519 .c - PKI infrastructure using ed25519
|
* pki_ed25519.c - PKI infrastructure using ed25519
|
||||||
*
|
*
|
||||||
* This file is part of the SSH Library
|
* This file is part of the SSH Library
|
||||||
*
|
*
|
||||||
|
@ -558,7 +558,7 @@ static void torture_auth_agent(void **state) {
|
|||||||
assert_true(rc & SSH_AUTH_METHOD_PUBLICKEY);
|
assert_true(rc & SSH_AUTH_METHOD_PUBLICKEY);
|
||||||
|
|
||||||
rc = ssh_userauth_agent(session, NULL);
|
rc = ssh_userauth_agent(session, NULL);
|
||||||
assert_int_equal(rc, SSH_AUTH_SUCCESS);
|
assert_ssh_return_code(session, rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void torture_auth_agent_nonblocking(void **state) {
|
static void torture_auth_agent_nonblocking(void **state) {
|
||||||
@ -589,7 +589,7 @@ static void torture_auth_agent_nonblocking(void **state) {
|
|||||||
do {
|
do {
|
||||||
rc = ssh_userauth_agent(session, NULL);
|
rc = ssh_userauth_agent(session, NULL);
|
||||||
} while (rc == SSH_AUTH_AGAIN);
|
} while (rc == SSH_AUTH_AGAIN);
|
||||||
assert_int_equal(rc, SSH_AUTH_SUCCESS);
|
assert_ssh_return_code(session, rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void torture_auth_cert(void **state) {
|
static void torture_auth_cert(void **state) {
|
||||||
@ -631,7 +631,7 @@ static void torture_auth_cert(void **state) {
|
|||||||
assert_int_equal(rc, SSH_OK);
|
assert_int_equal(rc, SSH_OK);
|
||||||
|
|
||||||
rc = ssh_userauth_try_publickey(session, NULL, cert);
|
rc = ssh_userauth_try_publickey(session, NULL, cert);
|
||||||
assert_int_equal(rc, SSH_AUTH_SUCCESS);
|
assert_ssh_return_code(session, rc);
|
||||||
|
|
||||||
rc = ssh_userauth_publickey(session, NULL, privkey);
|
rc = ssh_userauth_publickey(session, NULL, privkey);
|
||||||
assert_int_equal(rc, SSH_AUTH_SUCCESS);
|
assert_int_equal(rc, SSH_AUTH_SUCCESS);
|
||||||
|
Reference in New Issue
Block a user