Skip to content

practical verification of MRSIGNER #1359

Answered by dimakuv
nmwael asked this question in Q&A
Discussion options

You must be logged in to vote

@nmwael This was indeed pretty hard. I spent an hour figuring this out, and here's the final command:

openssl rsa -in enclave-key.pem -inform PEM -noout -modulus | cut -d= -f2- | fold -w2 | tac | tr --delete '\n' | xxd -r -p | sha256sum

So what happens here is:

  1. We need to get the modulus (not the public key itself).
  2. OpenSSL prints the modulus as Modulus=F290..., so we remove the Modulus= prefix using cut.
  3. OpenSSL prints the modulus as a hex string but in big-endian format, however Intel SGX requires the modulus to be hashed in little-endian format, so we do the trick of fold | tac, which swaps the bytes in hex representation.
  4. Then we delete the newline character using tr.
  5. Then we decode…

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@nmwael
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@dimakuv
Comment options

@nmwael
Comment options

Answer selected by nmwael
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants