lkml.org 
[lkml]   [2019]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v5 04/10] crypto: akcipher - new verify API for public key algorithms
Date
Vitaly Chikunov <vt@altlinux.org> wrote:

> + digest = kmemdup(sig->digest, sig->digest_size, GFP_KERNEL);
> + if (!digest)

You shouldn't need to copy the digest. It's being passed in to the crypto
algorithm, not extracted out.

> + if (memcmp(c, outbuf_enc, c_size)) {

Please use == 0 and != 0 with memcmp() and strcmp(). Their return values are
kind of inverted in sense if you treat them as boolean.

David

\
 
 \ /
  Last update: 2019-02-28 19:19    [W:0.168 / U:1.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site