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);
/* 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)) {