updates.
[silc.git] / lib / silccore / silcauth.c
index 36c51e93dd3494eebb5a453c99cbc9fcdee50583..3ee76ca41eccfcf3f2d789a16f0546e1e23c2274 100644 (file)
@@ -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;
     }