From: bdemsky Date: Sun, 24 Jul 2016 07:44:49 +0000 (-0700) Subject: edits X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=659f46fc71f04dd20253eb3e53ae185bc870be71;p=iotcloud.git edits --- diff --git a/src/java/iotcloud/CloudComm.java b/src/java/iotcloud/CloudComm.java index 85f6b08..85c95bb 100644 --- a/src/java/iotcloud/CloudComm.java +++ b/src/java/iotcloud/CloudComm.java @@ -30,8 +30,8 @@ class CloudComm { SecureRandom random = new SecureRandom(); random.nextBytes(salt); PBEKeySpec keyspec = new PBEKeySpec(password.toCharArray(), salt, 65536, 128); - SecretKey key = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA256").generateSecret(keyspec); - key = new SecretKeySpec(key.getEncoded(), "AES"); + SecretKey tmpkey = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA256").generateSecret(keyspec); + this.key = new SecretKeySpec(tmpkey.getEncoded(), "AES"); } catch (Exception e) { e.printStackTrace(); throw new Error("Failed generating key.");