Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1437260

Re: [PATCH v8 6/6] crypto: AF_ALG - add support for key_id

From Tadeusz Struk <tadeusz.struk@intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH v8 6/6] crypto: AF_ALG - add support for key_id
Date 2016-07-05 22:30 +0200
Message-ID <rRF8K-7G3-25@gated-at.bofh.it> (permalink)
References <rNlLj-8gl-3@gated-at.bofh.it> <rNlLk-8gl-7@gated-at.bofh.it> <rPsIG-7IY-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Mat,
On 06/29/2016 11:43 AM, Mat Martineau wrote:
>> +    ret = verify_signature(key, &sig);
>> +    if (!ret) {
>> +        req->dst_len = sizeof(digest);
> 
> I think you fixed the BUG_ON() problem but there's still an issue with
> the handling of the digest. Check the use of sig->digest in
> public_key_verify_signature(), it's an input not an output. Right now it
> looks like 20 uninitialized bytes are compared with the computed digest
> within verify_signature, and then the unintialized bytes are copied to
> req->dst here.
> 
> With some modifications to public_key_verify_signature you could get the
> digest you need, but I'm not sure if verification with a hardware key
> (like a key in a TPM) can or can not provide the digest needed. Maybe
> this is why the verify_signature hook in struct asymmetric_key_subtype
> is optional.
> 
>> +        scatterwalk_map_and_copy(digest, req->dst, 0, req->dst_len, 1);
>> +    } 

So it looks like the only thing that we need to return to the user in
this case is the return code. Do you agree?
Thanks,
-- 
TS

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v8 6/6] crypto: AF_ALG - add support for key_id Tadeusz Struk <tadeusz.struk@intel.com> - 2016-06-24 01:00 +0200
  Re: [PATCH v8 6/6] crypto: AF_ALG - add support for key_id Mat Martineau <mathew.j.martineau@linux.intel.com> - 2016-06-29 20:50 +0200
    Re: [PATCH v8 6/6] crypto: AF_ALG - add support for key_id Tadeusz Struk <tadeusz.struk@intel.com> - 2016-07-05 22:30 +0200
      Re: [PATCH v8 6/6] crypto: AF_ALG - add support for key_id Mat Martineau <mathew.j.martineau@linux.intel.com> - 2016-07-06 21:40 +0200
        Re: [PATCH v8 6/6] crypto: AF_ALG - add support for key_id Tadeusz Struk <tadeusz.struk@intel.com> - 2016-07-08 17:30 +0200
          Re: [PATCH v8 6/6] crypto: AF_ALG - add support for key_id Mat Martineau <mathew.j.martineau@linux.intel.com> - 2016-07-08 18:50 +0200
            Re: [PATCH v8 6/6] crypto: AF_ALG - add support for key_id Tadeusz Struk <tadeusz.struk@intel.com> - 2016-07-08 19:30 +0200

csiph-web