chiteroman / Reprogram-TEE-on-Qualcomm-devices

Guide to reprogram the TEE on Qualcomm devices to fix lost attestation keys
The Unlicense
301 stars 50 forks source link

Failed -66 RSA attestation failed #9

Open privacyguy123 opened 3 months ago

privacyguy123 commented 3 months ago

Using StrongBox version of the code snippet because my device uses StrongBox. Has anybody else seen this or knows what it means?

VisionR1 commented 3 months ago

Using StrongBox version of the code snippet because my device uses StrongBox. Has anybody else seen this or knows what it means?

Short IMG_20240321_175032

Full: https://developer.android.com/privacy-and-security/keystore

privacyguy123 commented 3 months ago

Doesn't really answer the question - the key box supplied is valid yet RSA portion of the command fails?

VisionR1 commented 3 months ago

Doesn't really answer the question - the key box supplied is valid yet RSA portion of the command fails?

Oh another error that, you mean the EC is valid but RSA fails?

privacyguy123 commented 3 months ago

Doesn't really answer the question - the key box supplied is valid yet RSA portion of the command fails?

Oh another error that, you mean the EC is valid but RSA fails?

Yes, error 66 from KmInstallKeybox.

The command without StrongBox worked fine.

VisionR1 commented 3 months ago

Doesn't really answer the question - the key box supplied is valid yet RSA portion of the command fails?

Oh another error that, you mean the EC is valid but RSA fails?

Yes, error 66 from KmInstallKeybox.

The command without StrongBox worked fine.

Have you try this

IMG_20240325_162013.jpg

privacyguy123 commented 3 months ago

Yes, false gives a different error saying the device expects props to be attested or something.

VisionR1 commented 3 months ago

Yes, false gives a different error saying the device expects props to be attested or something.

You insert the keybox.xml provided with this guide or try yours?

privacyguy123 commented 3 months ago

Yes, false gives a different error saying the device expects props to be attested or something.

You insert the keybox.xml provided with this guide or try yours?

I've tried 3 now all with this same error. I cannot overwrite StrongBox key.

VisionR1 commented 3 months ago

Yes, false gives a different error saying the device expects props to be attested or something.

You insert the keybox.xml provided with this guide or try yours?

I've tried 3 now all with this same error. I cannot overwrite StrongBox key.

Besides this 3, you have try and the keybox.xml provide with this guide right?

privacyguy123 commented 3 months ago

Yes, false gives a different error saying the device expects props to be attested or something.

You insert the keybox.xml provided with this guide or try yours?

I've tried 3 now all with this same error. I cannot overwrite StrongBox key.

Besides this 3, you have try and the keybox.xml provide with this guide right?

Yes, they all have the same error on StrongBox device ...

VisionR1 commented 3 months ago

Yes, false gives a different error saying the device expects props to be attested or something.

You insert the keybox.xml provided with this guide or try yours?

I've tried 3 now all with this same error. I cannot overwrite StrongBox key.

Besides this 3, you have try and the keybox.xml provide with this guide right?

Yes, they all have the same error on StrongBox device ...

This is strange, maybe your ROM have some wrong and cause this problem

privacyguy123 commented 3 months ago

Have you been able to run the StrongBox command and get a successful output? I am talking about the longer code snippet:

adb shell LD_LIBRARY_PATH=/vendor/lib64/hw KmInstallKeybox /data/nativetest64/qti_keymaster_tests/keybox.xml 0 true /data/nativetest64/qti_keymaster_tests/keybox.xml  0 true

What output do you get from that?

This shorter code snippet says "TEE fine successful" but this is not enough on a StrongBox because it only seems to be reprogramming "half" the key.

VisionR1 commented 3 months ago

Have you been able to run the StrongBox command and get a successful output? I am talking about the longer code snippet:

adb shell LD_LIBRARY_PATH=/vendor/lib64/hw KmInstallKeybox /data/nativetest64/qti_keymaster_tests/keybox.xml 0 true /data/nativetest64/qti_keymaster_tests/keybox.xml  0 true

What output do you get from that?

This shorter code snippet says "TEE fine successful" but this is not enough on a StrongBox because it only seems to be reprogramming "half" the key.

You mean this adb shell LD_LIBRARY_PATH=/vendor/lib64/hw KmInstallKeybox /data/nativetest64/qti_keymaster_tests/keybox.xml 0 true keybox.xml 0 true Because i think you write and some else in the end Don't have try this yet but i take the answer from another users what say like in XDA, and say my opinion.

And maybe is can't work in your device, because @chiteroman say have test this in his Xiaomi Poco X3 Pro. You have i guess, Samsung?

VisionR1 commented 3 months ago

And you can write here https://xdaforums.com/t/tee-hacking.4662185/

And if any users have the same problem and found a solution can tell you

privacyguy123 commented 3 months ago

You mean this adb shell LD_LIBRARY_PATH=/vendor/lib64/hw KmInstallKeybox /data/nativetest64/qti_keymaster_tests/keybox.xml 0 true keybox.xml 0 true Because i think you write and some else in the end

It is necessary to supply to the full path to the keybox twice ...

VisionR1 commented 3 months ago

You mean this adb shell LD_LIBRARY_PATH=/vendor/lib64/hw KmInstallKeybox /data/nativetest64/qti_keymaster_tests/keybox.xml 0 true keybox.xml 0 true Because i think you write and some else in the end

It is necessary to supply to the full path to the keybox twice ...

Really where say that? 🤔

Because i read this

IMG_20240327_004328.jpg

I think this with keybox twice mean this IMG_20240327_004653.jpg

Without twice for non StrongBox And with twice for StrongBox IMG_20240327_005028.jpg

privacyguy123 commented 3 months ago

If you don't understand why that is then I don't know if you're qualified to help me. :)

Writing keybox.xml (with no full path) attempts to read the file from the currently directory you're in - if you dont' supply a full path then KmInstallKeybox won't find the keybox file the 2nd time.

VisionR1 commented 3 months ago

If you don't understand why that is then I don't know if you're qualified to help me. :)

Writing keybox.xml (with no full path) attempts to read the file from the currently directory you're in - if you dont' supply a full path then KmInstallKeybox won't find the keybox file the 2nd time.

Yeah i know that, for that i say only my opinion and maybe some is useful.

Yeah i get your point, just i confused because i read the guide and can't find where say this specific part

privacyguy123 commented 3 months ago

Hes copy pasted the code wrong for StrongBox, it's simple as that

VisionR1 commented 3 months ago

Hes copy pasted the code wrong for StrongBox, it's simple as that

If so like this you say, then @chiteroman must change it