Reprogram-TEE-on-Qualcomm-devices icon indicating copy to clipboard operation
Reprogram-TEE-on-Qualcomm-devices copied to clipboard

Failed -66 RSA attestation failed

Open privacyguy123 opened this issue 11 months ago • 20 comments

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

privacyguy123 avatar Mar 20 '24 16:03 privacyguy123

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

VisionR1 avatar Mar 21 '24 15:03 VisionR1

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

privacyguy123 avatar Mar 24 '24 18:03 privacyguy123

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?

VisionR1 avatar Mar 24 '24 19:03 VisionR1

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.

privacyguy123 avatar Mar 25 '24 14:03 privacyguy123

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

VisionR1 avatar Mar 25 '24 14:03 VisionR1

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

privacyguy123 avatar Mar 25 '24 22:03 privacyguy123

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?

VisionR1 avatar Mar 25 '24 22:03 VisionR1

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.

privacyguy123 avatar Mar 26 '24 20:03 privacyguy123

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?

VisionR1 avatar Mar 26 '24 21:03 VisionR1

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 ...

privacyguy123 avatar Mar 26 '24 21:03 privacyguy123

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

VisionR1 avatar Mar 26 '24 21:03 VisionR1

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.

privacyguy123 avatar Mar 26 '24 21:03 privacyguy123

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 avatar Mar 26 '24 22:03 VisionR1

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

VisionR1 avatar Mar 26 '24 22:03 VisionR1

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 ...

privacyguy123 avatar Mar 26 '24 22:03 privacyguy123

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

VisionR1 avatar Mar 26 '24 22:03 VisionR1

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.

privacyguy123 avatar Mar 26 '24 22:03 privacyguy123

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

VisionR1 avatar Mar 26 '24 23:03 VisionR1

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

privacyguy123 avatar Mar 26 '24 23:03 privacyguy123

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

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

VisionR1 avatar Mar 27 '24 10:03 VisionR1