From aa59dc0e64da7e127261afb6af7b017e80b94240 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Fri, 11 Oct 2002 21:03:13 +0000 Subject: [PATCH] Fixed the usage of silc_pkcs_get_key_len function. --- apps/silcd/protocol.c | 3 ++- apps/silcd/server_query.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/silcd/protocol.c b/apps/silcd/protocol.c index 06922c36..8770fc0f 100644 --- a/apps/silcd/protocol.c +++ b/apps/silcd/protocol.c @@ -781,7 +781,8 @@ 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)); + *auth_data = silc_calloc((silc_pkcs_get_key_len(pkcs) / 8) + 1, + sizeof(**auth_data)); if (silc_pkcs_sign_with_hash(pkcs, ske->prop->hash, auth->data, auth->len, *auth_data, auth_data_len)) { silc_buffer_free(auth); diff --git a/apps/silcd/server_query.c b/apps/silcd/server_query.c index 9fdd184a..d086cac7 100644 --- a/apps/silcd/server_query.c +++ b/apps/silcd/server_query.c @@ -1628,7 +1628,7 @@ SilcBuffer silc_server_query_reply_attrs(SilcServer server, /* Finally compute the digital signature of all the data we provided as an indication that we provided rightfull information, and this also authenticates our public key. */ - if (silc_pkcs_get_key_len(server->pkcs) <= sizeof(sign) -1 && + if (silc_pkcs_get_key_len(server->pkcs) / 8 <= sizeof(sign) -1 && silc_pkcs_sign_with_hash(server->pkcs, server->sha1hash, buffer->data, buffer->len, sign, &sign_len)) { -- 2.43.0