commit b90faa1605c46f14747742a30cf10721515e0cac from: Omar Polo date: Tue Jun 13 17:10:13 2023 UTC simplify check brought to my attention by gcc who isn't smart enough to figure out that `ret' is always set. commit - cf5cf697a89faf792c8e7214b6a6b148d6bfe7d8 commit + b90faa1605c46f14747742a30cf10721515e0cac blob - 37e5845724a737c5d2e2853591e9cc9119047889 blob + 47530be393646535ab46547e4520126e9e20da87 --- crypto.c +++ crypto.c @@ -145,16 +145,12 @@ crypto_dispatch_server(int fd, struct privsep_proc *p, 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;