Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 42181d4b authored by J. Bruce Fields's avatar J. Bruce Fields Committed by Trond Myklebust
Browse files

SUNRPC: Make spkm3 report unsupported encryption types



 Print messages when an unsupported encrytion algorthm is requested or
 there is an error locating a supported algorthm.

 Signed-off-by: default avatarKevin Coffman <kwc@citi.umich.edu>
 Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
 Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 9eed129b
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -111,15 +111,19 @@ get_key(const void *p, const void *end, struct crypto_tfm **res, int *resalg)
			setkey = 0;
			break;
		default:
			dprintk("RPC: SPKM3 get_key: unsupported algorithm %d", *resalg);
			dprintk("gss_spkm3_mech: unsupported algorithm %d\n", *resalg);
			goto out_err_free_key;
	}
	if (!(*res = crypto_alloc_tfm(alg_name, alg_mode)))
	if (!(*res = crypto_alloc_tfm(alg_name, alg_mode))) {
		printk("gss_spkm3_mech: unable to initialize crypto algorthm %s\n", alg_name);
		goto out_err_free_key;
	}
	if (setkey) {
		if (crypto_cipher_setkey(*res, key.data, key.len))
		if (crypto_cipher_setkey(*res, key.data, key.len)) {
			printk("gss_spkm3_mech: error setting key for crypto algorthm %s\n", alg_name);
			goto out_err_free_tfm;
		}
	}

	if(key.len > 0)
		kfree(key.data);