From e1c107c6dd0728b80ebd9f42f93b1c10c84838b2 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Wed, 13 Feb 2002 21:15:19 +0000 Subject: [PATCH] updates. --- CHANGES | 8 +++++++- apps/silcd/protocol.c | 12 +++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index 595b9068..b42eb884 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,10 @@ -Wed Feb 13 20:51:13 EET 2002 Johnny Mnemonic +Wed Feb 13 23:16:41 EET 2002 Pekka Riikonen + + * Fixed the public key authentication to allocate always the + destination signature buffer instead of using static buffer. + Affected file silcd/protocol.c. + +Wed Feb 13 20:51:13 EET 2002 Pekka Riikonen * Unified the serverconfig.[ch]'s helper function interface. Affected file silcd/serverconfig.[ch]. diff --git a/apps/silcd/protocol.c b/apps/silcd/protocol.c index 449a6886..afa0ad43 100644 --- a/apps/silcd/protocol.c +++ b/apps/silcd/protocol.c @@ -783,7 +783,7 @@ silc_server_public_key_authentication(SilcServer server, static int silc_server_get_public_key_auth(SilcServer server, - unsigned char *auth_data, + unsigned char **auth_data, uint32 *auth_data_len, SilcSKE ske) { @@ -804,12 +804,14 @@ silc_server_get_public_key_auth(SilcServer server, ske->start_payload_copy->len), SILC_STR_END); + *auth_data = silc_calloc(silc_pkcs_get_key_len(pkcs), sizeof(**auth_data)); if (silc_pkcs_sign_with_hash(pkcs, ske->prop->hash, auth->data, - auth->len, auth_data, auth_data_len)) { + auth->len, *auth_data, auth_data_len)) { silc_buffer_free(auth); return TRUE; } + silc_free(*auth_data); silc_buffer_free(auth); return FALSE; } @@ -1073,13 +1075,9 @@ SILC_TASK_CALLBACK(silc_server_protocol_connection_auth) case SILC_AUTH_PUBLIC_KEY: { - unsigned char sign[1024]; - /* Public key authentication */ - silc_server_get_public_key_auth(server, sign, &auth_data_len, + silc_server_get_public_key_auth(server, &auth_data, &auth_data_len, ctx->ske); - auth_data = silc_calloc(auth_data_len, sizeof(*auth_data)); - memcpy(auth_data, sign, auth_data_len); break; } } -- 2.24.0