lkml.org 
[lkml]   [2011]   [Aug]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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@namei.org>


\
 
 \ /
  Last update: 2011-08-16 03:03    [W:0.176 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site