From: Fabio M. Di Nitto Date: Wed, 12 Jul 2017 06:58:40 +0000 (+0200) Subject: [crypto] set default case for key_type and avoid build warnings X-Git-Tag: v0.8~150 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=88274a866302f96bef89c1edbe54fcd75747eeb3;p=mirror_kronosnet.git [crypto] set default case for key_type and avoid build warnings when key_type is unknown, gcc complains that cipher can be used uninitialized. add default case to catch wrong callers and avoid build warning Signed-off-by: Fabio M. Di Nitto --- diff --git a/libknet/nsscrypto.c b/libknet/nsscrypto.c index 89ac4da..6b77c9b 100644 --- a/libknet/nsscrypto.c +++ b/libknet/nsscrypto.c @@ -185,6 +185,10 @@ static PK11SymKey *import_symmetric_key(knet_handle_t knet_h, enum sym_key_type cipher = hash_to_nss[instance->crypto_hash_type]; operation = CKA_SIGN; break; + default: + log_err(knet_h, KNET_SUB_NSSCRYPTO, "Import symmetric key failed. Unknown keyimport request"); + goto exit_res_key; + break; } slot = PK11_GetBestSlot(cipher, NULL);