diff --git a/egg/egg-symkey.c b/egg/egg-symkey.c
index c3af43b..a0b08a3 100644
--- a/egg/egg-symkey.c
+++ b/egg/egg-symkey.c
@@ -295,8 +295,6 @@ egg_symkey_generate_pbe (int cipher_algo, int hash_algo, const gchar *password,
 	return TRUE;
 }
 
-#define MAX_PASS_LEN 128
-
 static gboolean
 generate_pkcs12 (int hash_algo, int type, const gchar *utf8_password,
                  gssize n_password, const guchar *salt, gsize n_salt,
@@ -308,7 +306,7 @@ generate_pkcs12 (int hash_algo, int type, const gchar *utf8_password,
 	gcry_md_hd_t mdh;
 	const gchar *p2;
 	guchar *p;
-	gsize n_hash, i, p_size, i_size;
+	gsize n_hash, i;
 	gunichar unich;
 	gcry_error_t gcry;
 	gsize length;
@@ -320,15 +318,11 @@ generate_pkcs12 (int hash_algo, int type, const gchar *utf8_password,
 
 	if (!utf8_password)
 		n_password = 0;
-	if (n_password == -1) {
-		n_password = strlen (utf8_password);
-		end_password = utf8_password + n_password;
-	}
+	if (n_password == -1)
+		end_password = utf8_password + strlen (utf8_password);
 	else
 		end_password = utf8_password + n_password;
 
-	g_return_val_if_fail (n_password <= MAX_PASS_LEN, FALSE);
-
 	gcry = gcry_md_open (&mdh, hash_algo, 0);
 	if (gcry) {
 		g_warning ("couldn't create '%s' hash context: %s",
@@ -338,13 +332,11 @@ generate_pkcs12 (int hash_algo, int type, const gchar *utf8_password,
 
 	/* Reqisition me a buffer */
 	hash = egg_secure_alloc (n_hash);
-	buf_i = egg_secure_alloc (MAX_PASS_LEN * 2 + 64);
+	buf_i = egg_secure_alloc (128);
 	buf_b = egg_secure_alloc (64);
 	g_return_val_if_fail (hash && buf_i && buf_b, FALSE);
 
 	/* Bring in the salt */
-	p_size = ((n_password / 64) * 64) + 64;
-
 	p = buf_i;
 	if (salt) {
 		for (i = 0; i < 64; ++i)
@@ -357,7 +349,7 @@ generate_pkcs12 (int hash_algo, int type, const gchar *utf8_password,
 	/* Bring in the password, as 16bits per character BMP string, ie: UCS2 */
 	if (utf8_password) {
 		p2 = utf8_password;
-		for (i = 0; i < p_size; i += 2) {
+		for (i = 0; i < 64; i += 2) {
 
 			/* Get a character from the string */
 			if (p2 < end_password) {
@@ -375,11 +367,10 @@ generate_pkcs12 (int hash_algo, int type, const gchar *utf8_password,
 			*(p++) = (unich & 0xFF);
 		}
 	} else {
-		memset (p, 0, p_size);
+		memset (p, 0, 64);
 	}
 
 	/* Hash and bash */
-	i_size = 64 + p_size;
 	for (;;) {
 		gcry_md_reset (mdh);
 
@@ -388,7 +379,7 @@ generate_pkcs12 (int hash_algo, int type, const gchar *utf8_password,
 			gcry_md_putc (mdh, type);
 
 		/* Bring in the password */
-		gcry_md_write (mdh, buf_i, utf8_password ? i_size : 64);
+		gcry_md_write (mdh, buf_i, utf8_password ? 128 : 64);
 
 		/* First iteration done */
 		memcpy (hash, gcry_md_read (mdh, hash_algo), n_hash);
