Re: [PATCH] selftests/sgx: fix EINIT failure dueto SGX_INVALID_SIGNATURE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 3/2/21 1:54 PM, Andy Lutomirski wrote:
On Mon, Mar 1, 2021 at 9:06 PM Tianjia Zhang
<tianjia.zhang@xxxxxxxxxxxxxxxxx> wrote:



On 3/1/21 5:54 PM, Jarkko Sakkinen wrote:
On Mon, Mar 01, 2021 at 01:18:36PM +0800, Tianjia Zhang wrote:
q2 is not always 384-byte length. Sometimes it only has 383-byte.

What does determine this?

In this case, the valid portion of q2 is reordered reversely for
little endian order, and the remaining portion is filled with zero.

I'm presuming that you want to say "In this case, q2 needs to be reversed because...".

I'm lacking these details:

1. Why the length of Q2 can vary?
2. Why reversing the bytes is the correct measure to counter-measure
     this variation?

/Jarkko


When use openssl to generate a key instead of using the built-in
sign_key.pem, there is a probability that will encounter this problem.

Here is a problematic key I encountered. The calculated q1 and q2 of
this key are both 383 bytes, If the length is not processed, the
hardware signature will fail.

Presumably the issue is that some keys have parameters that have
enough leading 0 bits to be effectively shorter.  The openssl API
(and, sadly, a bunch  of the ASN.1 stuff) treats these parameters as
variable-size integers.


I agree with your opinion.

Thanks,
Tianjia



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux