chiark
/
gitweb
/
~mdw
/
catacomb
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
35b1eba
)
key/key-misc.c (key_bytag): Don't give up because a by-id search fails.
author
Mark Wooding
<mdw@distorted.org.uk>
Sat, 26 Oct 2019 14:38:25 +0000
(15:38 +0100)
committer
Mark Wooding
<mdw@distorted.org.uk>
Mon, 16 Dec 2019 16:25:17 +0000
(16:25 +0000)
This came to my attention when searching for a key of type `ec' didn't
work because it looks like a hex number. This obviously sucks.
key/key-misc.c
patch
|
blob
|
blame
|
history
diff --git
a/key/key-misc.c
b/key/key-misc.c
index c3442f281cd86020c78c7c17a1c999a0d234fb70..0d969a8788072260ae5358659322b97d0d54f988 100644
(file)
--- a/
key/key-misc.c
+++ b/
key/key-misc.c
@@
-160,12
+160,12
@@
key *key_bytag(key_file *f, const char *tag)
char *p;
uint32 id;
key_ref *kr = sym_find(&f->bytag, tag, -1, 0, 0);
+ key *k;
if (kr && !(KEY_EXPIRED(t, kr->k->exp) && KEY_EXPIRED(t, kr->k->del)))
return (kr->k);
id = strtoul(tag, &p, 16);
- if (!*p)
- return (key_byid(f, id));
+ if (!*p && (k = key_byid(f, id)) != 0) return (k);
return (key_bytype(f, tag));
}