diff options
author | Omar Polo <op@omarpolo.com> | 2023-06-13 17:10:13 +0000 |
---|---|---|
committer | Omar Polo <op@omarpolo.com> | 2023-06-13 17:10:13 +0000 |
commit | b90faa1605c46f14747742a30cf10721515e0cac (patch) | |
tree | 9c408e4280ef1e10de4e8982d3566d03fc3b3fc6 /crypto.c | |
parent | cf5cf697a89faf792c8e7214b6a6b148d6bfe7d8 (diff) |
simplify check
brought to my attention by gcc who isn't smart enough to figure out
that `ret' is always set.
Diffstat (limited to 'crypto.c')
-rw-r--r-- | crypto.c | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -145,16 +145,12 @@ crypto_dispatch_server(int fd, struct privsep_proc *p, struct imsg *imsg) if ((to = calloc(1, req.tlen)) == NULL) fatal("calloc"); - switch (imsg->hdr.type) { - case IMSG_CRYPTO_RSA_PRIVENC: + if (imsg->hdr.type == IMSG_CRYPTO_RSA_PRIVENC) ret = RSA_private_encrypt(req.flen, from, to, rsa, req.padding); - break; - case IMSG_CRYPTO_RSA_PRIVDEC: + else ret = RSA_private_decrypt(req.flen, from, to, rsa, req.padding); - break; - } memset(&res, 0, sizeof(res)); res.id = req.id; |