gecko/security/patches/bug-832942.patch
Camilo Viecco c1aaa2b5f9 Bug 832942: work around an ARMv6 code generation bug in gcc 4.6. r=wtc.
--HG--
extra : source : f37f4a6ba90b8add8792fa15812ba25d176b96b7
2013-03-18 19:49:38 -07:00

34 lines
1.2 KiB
Diff

diff --git a/lib/softoken/pkcs11.c b/lib/softoken/pkcs11.c
--- a/lib/softoken/pkcs11.c
+++ b/lib/softoken/pkcs11.c
@@ -1889,17 +1889,28 @@ sftk_mkPrivKey(SFTKObject *object, CK_KE
crv = sftk_Attribute2SSecItem(arena, &privKey->u.ec.publicValue,
object, CKA_NETSCAPE_DB);
if (crv != CKR_OK) break;
/* privKey was zero'd so public value is already set to NULL, 0
* if we don't set it explicitly */
}
rv = DER_SetUInteger(privKey->arena, &privKey->u.ec.version,
NSSLOWKEY_EC_PRIVATE_KEY_VERSION);
- if (rv != SECSuccess) crv = CKR_HOST_MEMORY;
+ if (rv != SECSuccess) {
+ crv = CKR_HOST_MEMORY;
+ /* The following ifdef is needed for Linux arm distros and
+ * Android as gcc 4.6 has a bug when targeting arm (but not
+ * thumb). The bug has been fixed in gcc 4.7.
+ * http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56561
+ */
+#if defined (__arm__) && !defined(__thumb__) && defined (__GNUC__)
+ *crvp = CKR_HOST_MEMORY;
+ break;
+#endif
+ }
break;
#endif /* NSS_ENABLE_ECC */
default:
crv = CKR_KEY_TYPE_INCONSISTENT;
break;
}
if (crv == CKR_OK && itemTemplateCount != 0) {