1 /* 2 * Copyright (c) 2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 17 #ifndef DRM_MEDIAKEYSESSIONNDK_FUZZER_H 18 #define DRM_MEDIAKEYSESSIONNDK_FUZZER_H 19 20 #include "native_drm_common.h" 21 #include "native_drm_base.h" 22 #include "native_drm_object.h" 23 #include "native_mediakeysession.h" 24 #define FUZZ_PROJECT_NAME "mediakeydecryptndk_fuzzer" 25 26 namespace OHOS { 27 namespace DrmStandard { 28 class MediadecryptNdkFuzzer : public NoCopyable { 29 private: 30 bool wisePlay = false; 31 32 public: 33 MediadecryptNdkFuzzer(); 34 ~MediadecryptNdkFuzzer(); 35 bool FuzzTestMediaKeyDecryptNdk(uint8_t *rawData, size_t size); 36 void GetUuid(); 37 void Init(); 38 void Deinitialize(); 39 void IsWisePlay(); 40 void GenerateDeviceCertificate(); 41 void GenerateLicense(); 42 MediaKeySystem *mediaKeySystem = nullptr; 43 MediaKeySession *mediaKeySession = nullptr; 44 std::string uuid; 45 std::string mimeType; 46 DRM_ContentProtectionLevel ContentProtectionLevel = CONTENT_PROTECTION_LEVEL_SW_CRYPTO; 47 }; 48 } // namespace DrmStandard 49 bool FuzzMediaKeysessionNdk(uint8_t *data, size_t size); 50 } // namesapce OHOS 51 52 #endif // DRM_MEDIAKEYSESSIONNDK_FUZZER_H