SILC_STR_UI_XNSTRING(pk, pk_len),
SILC_STR_END);
- ret = silc_calloc(buf->len + 1, sizeof(*ret));
- memcpy(ret, buf->data, buf->len);
+ ret = silc_memdup(buf->data, buf->len);
if (ret_len)
*ret_len = buf->len;
case SILC_AUTH_PASSWORD:
/* Passphrase based authentication. The `pkcs', `hash', `id' and `type'
arguments are not needed. */
- if (!memcmp(payload->auth_data, auth_data, payload->auth_len)) {
+ if (!memcmp(payload->auth_data, auth_data, auth_data_len)) {
SILC_LOG_DEBUG(("Authentication successful"));
return TRUE;
}