Fixed the usage of silc_pkcs_get_key_len function.
authorPekka Riikonen <priikone@silcnet.org>
Fri, 11 Oct 2002 21:03:13 +0000 (21:03 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Fri, 11 Oct 2002 21:03:13 +0000 (21:03 +0000)
apps/silcd/protocol.c
apps/silcd/server_query.c

index 06922c364641772e407a40a789f9266e8789e940..8770fc0ff0abcdd05aa1a82b2ec737ae4887f0b6 100644 (file)
@@ -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);
index 9fdd184a2de6266efd13a30203b114d80a744461..d086cac778d40ed33ac3a83028a3ca079cd2db3c 100644 (file)
@@ -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)) {