public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in dev-lang/pike/files: nettle-2.1.patch
@ 2012-05-10  0:20 Luis F. Araujo (araujo)
  0 siblings, 0 replies; 2+ messages in thread
From: Luis F. Araujo (araujo) @ 2012-05-10  0:20 UTC (permalink / raw
  To: gentoo-commits

araujo      12/05/10 00:20:10

  Added:                nettle-2.1.patch
  Log:
  Revision bump. Fix bug #414995
  
  (Portage version: 2.1.10.57/cvs/Linux x86_64)

Revision  Changes    Path
1.1                  dev-lang/pike/files/nettle-2.1.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/pike/files/nettle-2.1.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-lang/pike/files/nettle-2.1.patch?rev=1.1&content-type=text/plain

Index: nettle-2.1.patch
===================================================================
--- a/src/post_modules/Nettle/cipher.cmod
+++ b/src/post_modules/Nettle/cipher.cmod
@@ -572,23 +572,11 @@ pike_des_set_key(void *c,
 
   if (!des_set_key(ctx, (const uint8_t *)key))
   {
-    switch (ctx->status)
-    {
-    case DES_WEAK_KEY:
       if (force)
 	/* Use key anyway */
-	ctx->status = DES_OK;
+	;
       else
 	Pike_error("DES_INFO: Key is weak.\n");
-      break;
-      
-    case DES_BAD_PARITY:
-      /* FIXME: I don't think this should be visible in the user
-       * interface, the parity bits should just be ignored. */
-      Pike_error("DES_INFO: Key has bad parity.\n");
-    default:
-      Pike_error("DES_INFO: Unexpected error, please send a bug report.\n");
-    }
   }
 }
 
@@ -742,28 +730,15 @@ pike_des3_set_key(void *c,
     break;
   }
 
-  /* The hack of resetting ctx->status to use a weak key doesn't
-   * currently work with nettle's des3_set_key function. So we set the
-   * individual keys by ourself. */
-  for (i = 0; i<3; i++, key += DES_KEY_SIZE)
-    if (!des_set_key(&ctx->des[i], (const uint8_t *)key))
-      switch (ctx->des[i].status)
-      {
-      case DES_WEAK_KEY:
+  /* Since Nettle 2.1 has removed the status field and simply returns
+     zero if the key is weak, we can simply call des3_set_key */
+  if (!des3_set_key(ctx, (const uint8_t *)key)) {
 	if (force)
 	  /* Use key anyway */
-	  ctx->des[i].status = DES_OK;
+	  ;
 	else
 	  Pike_error("DES3_INFO: Key is weak.\n");
-	break;
-      
-      case DES_BAD_PARITY:
-	/* FIXME: I don't think this should be visible in the user
-	 * interface, the parity bits should just be ignored. */
-	Pike_error("DES3_INFO: Key has bad parity.\n");
-      default:
-	Pike_error("DES3_INFO: Unexpected error, please send a bug report.\n");
-    }
+  }
 }
 #define pike_des3_set_encrypt_key pike_des3_set_key
 #define pike_des3_set_decrypt_key pike_des3_set_key
--- a/src/post_modules/Nettle/cipher.c
+++ b/src/post_modules/Nettle/cipher.c
@@ -1093,23 +1093,11 @@ pike_des_set_key(void *c,
 
   if (!des_set_key(ctx, (const uint8_t *)key))
   {
-    switch (ctx->status)
-    {
-    case DES_WEAK_KEY:
       if (force)
 	/* Use key anyway */
-	ctx->status = DES_OK;
+	;
       else
 	Pike_error("DES_INFO: Key is weak.\n");
-      break;
-      
-    case DES_BAD_PARITY:
-      /* FIXME: I don't think this should be visible in the user
-       * interface, the parity bits should just be ignored. */
-      Pike_error("DES_INFO: Key has bad parity.\n");
-    default:
-      Pike_error("DES_INFO: Unexpected error, please send a bug report.\n");
-    }
   }
 }
 
@@ -1355,28 +1343,15 @@ pike_des3_set_key(void *c,
     break;
   }
 
-  /* The hack of resetting ctx->status to use a weak key doesn't
-   * currently work with nettle's des3_set_key function. So we set the
-   * individual keys by ourself. */
-  for (i = 0; i<3; i++, key += DES_KEY_SIZE)
-    if (!des_set_key(&ctx->des[i], (const uint8_t *)key))
-      switch (ctx->des[i].status)
-      {
-      case DES_WEAK_KEY:
+  /* Since Nettle 2.1 has removed the status field and simply returns
+     zero if the key is weak, we can simply call des3_set_key */
+  if (!des3_set_key(ctx, (const uint8_t *)key)) {
 	if (force)
 	  /* Use key anyway */
-	  ctx->des[i].status = DES_OK;
+	  ;
 	else
 	  Pike_error("DES3_INFO: Key is weak.\n");
-	break;
-      
-      case DES_BAD_PARITY:
-	/* FIXME: I don't think this should be visible in the user
-	 * interface, the parity bits should just be ignored. */
-	Pike_error("DES3_INFO: Key has bad parity.\n");
-      default:
-	Pike_error("DES3_INFO: Unexpected error, please send a bug report.\n");
-    }
+  }
 }
 #define pike_des3_set_encrypt_key pike_des3_set_key
 #define pike_des3_set_decrypt_key pike_des3_set_key






^ permalink raw reply	[flat|nested] 2+ messages in thread

* [gentoo-commits] gentoo-x86 commit in dev-lang/pike/files: nettle-2.1.patch
@ 2015-04-26 12:55 Pacho Ramos (pacho)
  0 siblings, 0 replies; 2+ messages in thread
From: Pacho Ramos (pacho) @ 2015-04-26 12:55 UTC (permalink / raw
  To: gentoo-commits

pacho       15/04/26 12:55:01

  Removed:              nettle-2.1.patch
  Log:
  Remove masked for removal package


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-04-26 12:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-26 12:55 [gentoo-commits] gentoo-x86 commit in dev-lang/pike/files: nettle-2.1.patch Pacho Ramos (pacho)
  -- strict thread matches above, loose matches on Subject: below --
2012-05-10  0:20 Luis F. Araujo (araujo)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox