aboutsummaryrefslogtreecommitdiff
path: root/crypto.c
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2023-06-13 17:10:13 +0000
committerOmar Polo <op@omarpolo.com>2023-06-13 17:10:13 +0000
commitb90faa1605c46f14747742a30cf10721515e0cac (patch)
tree9c408e4280ef1e10de4e8982d3566d03fc3b3fc6 /crypto.c
parentcf5cf697a89faf792c8e7214b6a6b148d6bfe7d8 (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.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/crypto.c b/crypto.c
index 37e5845..47530be 100644
--- a/crypto.c
+++ b/crypto.c
@@ -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;