aboutsummaryrefslogtreecommitdiff
path: root/src/session.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2018-08-27 09:08:28 +0200
committerAndreas Schneider <asn@cryptomilk.org>2018-08-27 09:30:24 +0200
commit73c9d60e5abf6bc20093e105dec112b071c83871 (patch)
tree2c08401a56a30337e83b744d50374f64ce93b865 /src/session.c
parentae3825dfb2c6364bc088353640d59b0546b8d6f6 (diff)
downloadlibssh-73c9d60e5abf6bc20093e105dec112b071c83871.tar.gz
libssh-73c9d60e5abf6bc20093e105dec112b071c83871.tar.xz
libssh-73c9d60e5abf6bc20093e105dec112b071c83871.zip
session: Group auth variables in a struct
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src/session.c')
-rw-r--r--src/session.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/session.c b/src/session.c
index c8c7414c..a1959d48 100644
--- a/src/session.c
+++ b/src/session.c
@@ -60,11 +60,10 @@ ssh_session ssh_new(void) {
char *id = NULL;
int rc;
- session = malloc(sizeof (struct ssh_session_struct));
+ session = calloc(1, sizeof (struct ssh_session_struct));
if (session == NULL) {
return NULL;
}
- ZERO_STRUCTP(session);
session->next_crypto = crypto_new();
if (session->next_crypto == NULL) {
@@ -87,7 +86,7 @@ ssh_session ssh_new(void) {
}
session->alive = 0;
- session->auth_methods = 0;
+ session->auth.supported_methods = 0;
ssh_set_blocking(session, 1);
session->maxchannel = FIRST_CHANNEL;
@@ -268,7 +267,7 @@ void ssh_free(ssh_session session) {
#endif
session->agent_state = NULL;
- SAFE_FREE(session->auth_auto_state);
+ SAFE_FREE(session->auth.auto_state);
SAFE_FREE(session->serverbanner);
SAFE_FREE(session->clientbanner);
SAFE_FREE(session->banner);