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

Commit 9c1b2468 authored by Robert Shih's avatar Robert Shih Committed by Android (Google) Code Review
Browse files

Merge "HLS: left zero fill 128 bit AES IV" into nyc-dev

parents 10486e55 4a3108a4
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -368,11 +368,15 @@ status_t PlaylistFetcher::decryptBuffer(
        AString iv;
        if (itemMeta->findString("cipher-iv", &iv)) {
            if ((!iv.startsWith("0x") && !iv.startsWith("0X"))
                    || iv.size() != 16 * 2 + 2) {
                    || iv.size() > 16 * 2 + 2) {
                ALOGE("malformed cipher IV '%s'.", iv.c_str());
                return ERROR_MALFORMED;
            }

            while (iv.size() < 16 * 2 + 2) {
                iv.insert("0", 1, 2);
            }

            memset(mAESInitVec, 0, sizeof(mAESInitVec));
            for (size_t i = 0; i < 16; ++i) {
                char c1 = tolower(iv.c_str()[2 + 2 * i]);