mission-improbable icon indicating copy to clipboard operation
mission-improbable copied to clipboard

update generate_verity_key for openssl 1.1

Open murinicanor opened this issue 7 years ago • 1 comments

when trying to compile generate_verity_key.c on debian stretch (which has libssl-dev 1.1.0c), i get

generate_verity_key.c:57:19: error: dereferencing pointer to incomplete type ‘RSA {aka struct rsa_st}’
     BN_copy(n, rsa->n);
                   ^~
Makefile:98: recipe for target 'generate_verity_key' failed
make: *** [generate_verity_key] Error 1

searching the web leads to https://wiki.openssl.org/index.php/1.1_API_Changes which states:

If you want to access rsa->n you now have to do something like:

const BIGNUM *n; RSA_get0_key(rsa, &n, NULL, NULL);

murinicanor avatar Feb 05 '17 13:02 murinicanor

Can you try changing BN_copy(n, rsa->n); to BN_copy(rsa, &n); and pkey->exponent = BN_get_word(rsa->e); to pkey->exponent = BN_get_word(rsa); in mission-improbable/helper-repos/android-simg2img/generate_verity_key.c file and running make again?

If it doesn't work, can you try getting the rsa.h file from https://packages.debian.org/jessie-backports/amd64/libssl-dev/download and putting it in mission-improbable/helper-repos/android-simg2img/include/openssl/ folder and changing #include <openssl/rsa.h> to #include "openssl/rsa.h" in mission-improbable/helper-repos/android-simg2img/generate_verity_key.c file and running make again?

Note: if you're running run-all.sh and not manually then you should do it before running run-all.sh, ie. git clone -b verity_tools3 https://github.com/mikeperry-tor/android-simg2img YOURsimg2imgFOLDER then edit stuff then ./run-all.sh

ghost avatar Dec 21 '17 15:12 ghost