summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCamilo Viecco <cviecco@mozilla.com>2013-10-22 20:57:20 +0200
committerCamilo Viecco <cviecco@mozilla.com>2013-10-22 20:57:20 +0200
commit5448cacd46a040534135b66685b5aa003369bc68 (patch)
treeb044cf3cbdf07c5e67c1f4c6e3490515a268faae
parent83e48fe57e2c373020d4f58847053401d131227e (diff)
downloadnss-hg-5448cacd46a040534135b66685b5aa003369bc68.tar.gz
Bug 832942: work around an ARMv6 code generation bug in gcc 4.6. r=wtc
-rw-r--r--security/nss/lib/softoken/pkcs11.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/security/nss/lib/softoken/pkcs11.c b/security/nss/lib/softoken/pkcs11.c
index f91d15a3d..f7205889c 100644
--- a/security/nss/lib/softoken/pkcs11.c
+++ b/security/nss/lib/softoken/pkcs11.c
@@ -1894,7 +1894,18 @@ sftk_mkPrivKey(SFTKObject *object, CK_KEY_TYPE key_type, CK_RV *crvp)
}
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 */