diff options
author | Maximilian Krambach <[email protected]> | 2018-08-16 09:25:50 +0000 |
---|---|---|
committer | Maximilian Krambach <[email protected]> | 2018-08-16 09:25:50 +0000 |
commit | 622db0d1de665dfd93c991cd2d517078b04b3a13 (patch) | |
tree | 4db9d960824730f53e613a42fe1ea792456fbe65 /lang/js/src | |
parent | js: make init export immutable (diff) | |
download | gpgme-622db0d1de665dfd93c991cd2d517078b04b3a13.tar.gz gpgme-622db0d1de665dfd93c991cd2d517078b04b3a13.zip |
js: consistently return uppercase fingerprint
--
* src/Key.js: the fingerprint returned by a Key is now always upper
case hex, even if the constructor had lower case input. This is to be
more consistent with gpgme and to be more readable and reliable in
comparisions.
Diffstat (limited to 'lang/js/src')
-rw-r--r-- | lang/js/src/Key.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lang/js/src/Key.js b/lang/js/src/Key.js index 88c49d3f..eeb27035 100644 --- a/lang/js/src/Key.js +++ b/lang/js/src/Key.js @@ -58,7 +58,7 @@ export class GPGME_Key { */ this.isAsync = async; - let _data = {fingerprint: fingerprint}; + let _data = {fingerprint: fingerprint.toUpperCase()}; this.getFingerprint = function(){ if (!_data.fingerprint || !isFingerprint(_data.fingerprint)){ return gpgme_error('KEY_INVALID'); @@ -88,7 +88,8 @@ export class GPGME_Key { if (typeof(data) !== 'object') { return gpgme_error('KEY_INVALID'); } - if (!data.fingerprint || data.fingerprint !== _data.fingerprint){ + if (!data.fingerprint || + data.fingerprint.toUpperCase() !== _data.fingerprint){ return gpgme_error('KEY_INVALID'); } let keys = Object.keys(data); |