Support more query types
- long - short - 0xlong - 0xshort - fingerprint Signed-off-by: Georg Pfuetzenreuter <georg.pfuetzenreuter@suse.com>
This commit is contained in:
parent
cd62e63cc2
commit
53aa292b7e
@ -97,7 +97,7 @@ class HKP {
|
||||
if (!util.isString(id)) {
|
||||
return false;
|
||||
}
|
||||
return /^0x[a-fA-F0-9]{16,40}$/.test(id);
|
||||
return /^(?:0x)?[a-fA-F0-9]{8,40}$/.test(id);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -261,8 +261,12 @@ class PublicKey {
|
||||
}
|
||||
// query by key id (to prevent key id collision)
|
||||
if (keyId) {
|
||||
keyId = keyId.toLowerCase();
|
||||
if (keyId.length === 8) {
|
||||
keyId = new RegExp('[a-fA-F0-9]{8}' + keyId);
|
||||
}
|
||||
queries.push({
|
||||
keyId: keyId.toLowerCase(),
|
||||
keyId: keyId,
|
||||
'userIds.verified': true
|
||||
});
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ exports.isKeyId = function(data) {
|
||||
if (!this.isString(data)) {
|
||||
return false;
|
||||
}
|
||||
return /^[a-fA-F0-9]{16}$/.test(data);
|
||||
return /^[a-fA-F0-9]{8,16}$/.test(data);
|
||||
};
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user