X-Git-Url: http://git.silcnet.org/gitweb/?a=blobdiff_plain;f=lib%2Fsilccore%2Fsilcauth.c;h=3ee76ca41eccfcf3f2d789a16f0546e1e23c2274;hb=386c883d8774999c6e74d7c6c37e52e4163a4cb1;hp=36c51e93dd3494eebb5a453c99cbc9fcdee50583;hpb=4e64dd02ccecc9c497b8db8ecb09d017b9cef9a4;p=silc.git diff --git a/lib/silccore/silcauth.c b/lib/silccore/silcauth.c index 36c51e93..3ee76ca4 100644 --- a/lib/silccore/silcauth.c +++ b/lib/silccore/silcauth.c @@ -181,8 +181,7 @@ silc_auth_public_key_encode_data(SilcPublicKey public_key, 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; @@ -358,7 +357,7 @@ bool silc_auth_verify(SilcAuthPayload payload, SilcAuthMethod auth_method, 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; }