[Commits] [SCM] claws branch, master, updated. 3.14.0-12-gf5fdc11

ticho at claws-mail.org ticho at claws-mail.org
Thu Aug 18 16:12:52 CEST 2016


The branch, master has been updated
       via  f5fdc11d409425988a1041c3c5ef5c4b0ff72c2b (commit)
      from  7e344914c711eb277022e9965d1834229d6b13e9 (commit)

Summary of changes:
 src/common/pkcs5_pbkdf2.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)


- Log -----------------------------------------------------------------
commit f5fdc11d409425988a1041c3c5ef5c4b0ff72c2b
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Thu Aug 18 16:11:41 2016 +0200

    Avoid usage of deprecated bcopy/bzero in pbkdf2 routine.

diff --git a/src/common/pkcs5_pbkdf2.c b/src/common/pkcs5_pbkdf2.c
index f9ca702..5abbf01 100644
--- a/src/common/pkcs5_pbkdf2.c
+++ b/src/common/pkcs5_pbkdf2.c
@@ -51,8 +51,8 @@ hmac_sha1(const guchar *text, size_t text_len, const guchar *key,
 		key_len = digestlen;
 	}
 
-	bzero(k_pad, sizeof k_pad);
-	bcopy(key, k_pad, key_len);
+	memset(k_pad, 0, sizeof k_pad);
+	memcpy(k_pad, key, key_len);
 	for (i = 0; i < CHECKSUM_BLOCKLEN; i++)
 		k_pad[i] ^= 0x36;
 
@@ -63,8 +63,8 @@ hmac_sha1(const guchar *text, size_t text_len, const guchar *key,
 	g_checksum_get_digest(cksum, digest, &outlen);
 	g_checksum_free(cksum);
 
-	bzero(k_pad, sizeof k_pad);
-	bcopy(key, k_pad, key_len);
+	memset(k_pad, 0, sizeof k_pad);
+	memcpy(k_pad, key, key_len);
 	for (i = 0; i < CHECKSUM_BLOCKLEN; i++)
 		k_pad[i] ^= 0x5c;
 
@@ -122,11 +122,11 @@ pkcs5_pbkdf2(const gchar *pass, size_t pass_len, const guchar *salt,
 		key += r;
 		key_len -= r;
 	};
-	bzero(asalt, salt_len + 4);
+	memset(asalt, 0, salt_len + 4);
 	free(asalt);
-	bzero(d1, sizeof(d1));
-	bzero(d2, sizeof(d2));
-	bzero(obuf, sizeof(obuf));
+	memset(d1, 0, sizeof(d1));
+	memset(d2, 0, sizeof(d2));
+	memset(obuf, 0, sizeof(obuf));
 
 	return 0;
 }

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list