Added var to properly declare local variables so that they don't pollute the global namespace and risk multi-threading conflicts.
diff --git a/js/Key.js b/js/Key.js
index 9d86f1e..35b0428 100644
--- a/js/Key.js
+++ b/js/Key.js
@@ -50,7 +50,7 @@
if (decoder.peekStartElement(CCNProtocolDTags.Key)) {
try {
- encodedKey = decoder.readBinaryElement(CCNProtocolDTags.Key);
+ var encodedKey = decoder.readBinaryElement(CCNProtocolDTags.Key);
// This is a DER-encoded SubjectPublicKeyInfo.
//TODO FIX THIS, This should create a Key Object instead of keeping bytes
@@ -73,7 +73,7 @@
} else if ( decoder.peekStartElement(CCNProtocolDTags.Certificate)) {
try {
- encodedCert = decoder.readBinaryElement(CCNProtocolDTags.Certificate);
+ var encodedCert = decoder.readBinaryElement(CCNProtocolDTags.Certificate);
/*
* Certificates not yet working