From 89964416a9324385aa44903894c12e0014273af1 Mon Sep 17 00:00:00 2001 From: Przemyslaw Ciezkowski Date: Tue, 16 Jun 2015 12:21:51 +0200 Subject: [PATCH] [KeyManager] Prevent calling constructor as function [Verification] All of these calls should throw exception "Constructor cannot be called as function" tizen.Key(); tizen.Data(); tizen.Certificate(); Fixes tct: Key_exist Change-Id: Id5f2898f405c82e0b1f02f9099edc6de18ad2957 Signed-off-by: Przemyslaw Ciezkowski --- src/keymanager/keymanager_api.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/keymanager/keymanager_api.js b/src/keymanager/keymanager_api.js index 233b91d5..281c4691 100755 --- a/src/keymanager/keymanager_api.js +++ b/src/keymanager/keymanager_api.js @@ -714,14 +714,17 @@ KeyManager.prototype.verifySignature = function() { // expose only basic constructors tizen.Key = function(name, password, extractable) { + xwalk.utils.validator.isConstructorCall(this, tizen.Key); Key.call(this, name, password, extractable, KeyType.KEY_NONE, ""); }; tizen.Key.prototype = Object.create(Key.prototype); tizen.Certificate = function(name, password, extractable) { + xwalk.utils.validator.isConstructorCall(this, tizen.Certificate); Certificate.call(this, name, password, extractable, ""); }; tizen.Certificate.prototype = Object.create(Certificate.prototype); tizen.Data = function(name, password, extractable) { + xwalk.utils.validator.isConstructorCall(this, tizen.Data); Data.call(this, name, password, extractable, ""); }; tizen.Data.prototype = Object.create(Data.prototype); -- 2.34.1