Allow lookup only by key ids with at least 16 chars

This commit is contained in:
Tankred Hase
2016-06-07 16:22:17 +02:00
parent f54b86f79a
commit bdde8e44d5
4 changed files with 32 additions and 21 deletions

View File

@@ -42,7 +42,7 @@ exports.isTrue = function(data) {
};
/**
* Checks for a valid key id which is between 8 and 40 hex chars.
* Checks for a valid key id which is between 16 and 40 hex chars.
* @param {string} data The key id
* @return {boolean} If the key id if valid
*/
@@ -50,7 +50,7 @@ exports.validateKeyId = function(data) {
if (!this.isString(data)) {
return false;
}
return /^[a-fA-F0-9]{8,40}$/.test(data);
return /^[a-fA-F0-9]{16,40}$/.test(data);
};
/**