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

Commit 5501207c authored by Robert Shih's avatar Robert Shih Committed by android-build-merger
Browse files

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

am: 9c1b2468

* commit '9c1b2468':
  HLS: left zero fill 128 bit AES IV

Change-Id: I90f07f91c8a2f956f25691c8c44d9f91bb991c26
parents e662bd5c 9c1b2468
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]);