From d03520e00613c0ab98c52039f496bbee42220690 Mon Sep 17 00:00:00 2001
From: Lloyd Hilaiel <lloyd@hilaiel.com>
Date: Tue, 24 Jan 2012 12:25:57 -0700
Subject: [PATCH] for IE8 during keygen on behalf of a primary, knock down
 keylength.  also, shorten cert duration globally (for now).  closes #956

---
 resources/static/shared/provisioning.js | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/resources/static/shared/provisioning.js b/resources/static/shared/provisioning.js
index 830fa8f9a..5c90de51a 100644
--- a/resources/static/shared/provisioning.js
+++ b/resources/static/shared/provisioning.js
@@ -64,14 +64,18 @@ BrowserID.Provisioning = (function() {
         // XXX: certificate duration should vary depending on a variety of factors:
         //   * user is on a device that is not her own
         //   * user is in an environment that can't handle the crypto
-        cert_duration_s: (24 * 60 * 60)
+        cert_duration_s: (6 * 60 * 60)
       };
     });
 
     chan.bind('genKeyPair', function(trans, s) {
       // this will take a little bit
-      // XXX: the key length should be controlled by higher level code.
-      keypair = jwk.KeyPair.generate("DS", 256);
+      // FIXME: refactor so code that makes this decision is shared.
+      var keysize = 256;
+      var ie_version = BrowserID.BrowserSupport.getInternetExplorerVersion();
+      if (ie_version > -1 && ie_version < 9)
+        keysize = 128;
+      keypair = jwk.KeyPair.generate("DS", keysize);
       return keypair.publicKey.toSimpleObject();
     });
 
-- 
GitLab