Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c4abbe64 authored by Matthew Maurer's avatar Matthew Maurer
Browse files

trusty: keymaster-hal: Reconnect on failed VERSION

Trusty Keymaster will currently disconnect the client on an invalid
message. This includes the newly introduced GET_VERSION2 message.

While in the future we could change this behavior, this is a backcompat
path and so we can't assume a changed Trusty. Reconnect on failed
GET_VERSION2 before attempting version negotiation.

Bug: 177843218
Test: Set PIN on device using older Trusty
Change-Id: Ie60e4aaafa43e375797e6288b97834cac42413f4
parent da0f466d
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -37,6 +37,12 @@ int TrustyKeymaster::Initialize() {
    if (versionRsp.error != KM_ERROR_OK) {
        ALOGW("TA appears not to support GetVersion2, falling back (err = %d)", versionRsp.error);

        err = trusty_keymaster_connect();
        if (err) {
            ALOGE("Failed to connect to trusty keymaster %d", err);
            return err;
        }

        GetVersionRequest versionReq;
        GetVersionResponse versionRsp;
        GetVersion(versionReq, &versionRsp);