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

Commit 9c4c5a6e authored by Sami Tolvanen's avatar Sami Tolvanen Committed by Gerrit Code Review
Browse files

Merge "Verify token length before adb signs it"

parents a034362b 7b9c20d3
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -395,6 +395,11 @@ int adb_auth_sign(void *node, void *token, size_t token_size, void *sig)
    unsigned int len;
    struct adb_private_key *key = node_to_item(node, struct adb_private_key, node);

    if (token_size != TOKEN_SIZE) {
        D("Unexpected token size %zd\n", token_size);
        return 0;
    }

    if (!RSA_sign(NID_sha1, token, token_size, sig, &len, key->rsa)) {
        return 0;
    }