[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LRH.2.00.1108161059260.7706@tundra.namei.org>
Date:	Tue, 16 Aug 2011 11:00:39 +1000 (EST)
From:	James Morris <jmorris@...ei.org>
To:	Dmitry Kasatkin <dmitry.kasatkin@...el.com>
cc:	linux-security-module@...r.kernel.org,
	linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org,
	zohar@...ux.vnet.ibm.com
Subject: Re: [RFC v1.1 2/5] crypto: ksign - digital signature verification
 support
On Thu, 11 Aug 2011, Dmitry Kasatkin wrote:
> +static int ksign_verify_rsa(struct key *key,
> +		    const char *sig, int siglen,
> +		       const char *h, int hlen)
> +{
> +	int err = -ENOMEM;
> +	unsigned long len;
> +	unsigned long mlen, mblen;
> +	unsigned nret, l;
> +	int valid, head, i;
> +	unsigned char *out1 = NULL, *out2 = NULL;
> +	MPI in = NULL, res = NULL, pkey[2];
> +	uint8_t *p, *datap, *endp;
> +	struct user_key_payload *ukp;
> +	struct pubkey_hdr *pkh;
> +
> +	down_read(&key->sem);
> +	ukp = key->payload.data;
> +	pkh = (struct pubkey_hdr *)ukp->data;
> +
> +	if (pkh->version != 1)
> +		return -EINVAL;
> +
> +	if (pkh->algo != PUBKEY_ALGO_RSA)
> +		return -EINVAL;
Are you supposed to be still holding key->sem here?
-- 
James Morris
<jmorris@...ei.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Powered by blists - more mailing lists
 
