xref: /aosp_15_r20/external/libsrtp2/Android.bp (revision 90e502c7aef8d77d0622bb67d75435c6190cfc1a)
1package {
2    default_applicable_licenses: ["external_libsrtp2_license"],
3}
4
5// Added automatically by a large-scale-change that took the approach of
6// 'apply every license found to every target'. While this makes sure we respect
7// every license restriction, it may not be entirely correct.
8//
9// e.g. GPL in an MIT project might only apply to the contrib/ directory.
10//
11// Please consider splitting the single license below into multiple licenses,
12// taking care not to lose any license_kind information, and overriding the
13// default license using the 'licenses: [...]' property on targets as needed.
14//
15// For unused files, consider creating a 'fileGroup' with "//visibility:private"
16// to attach the license to, and including a comment whether the files may be
17// used in the current project.
18// See: http://go/android-license-faq
19license {
20    name: "external_libsrtp2_license",
21    visibility: [":__subpackages__"],
22    license_kinds: [
23        "SPDX-license-identifier-BSD",
24        "SPDX-license-identifier-MIT",
25        "legacy_unencumbered",
26    ],
27    license_text: [
28        "LICENSE",
29    ],
30}
31
32cc_library_static {
33    host_supported: true,
34    // vendor needed for libpreprocessing effects.
35    vendor: true,
36    name: "libsrtp2",
37    srcs: [
38        "crypto/cipher/aes.c",
39        "crypto/cipher/aes_icm.c",
40        "crypto/cipher/cipher.c",
41        "crypto/cipher/null_cipher.c",
42        "crypto/hash/auth.c",
43        "crypto/hash/hmac.c",
44        "crypto/hash/null_auth.c",
45        "crypto/hash/sha1.c",
46        "crypto/kernel/alloc.c",
47        "crypto/kernel/crypto_kernel.c",
48        "crypto/kernel/err.c",
49        "crypto/kernel/key.c",
50        "crypto/math/datatypes.c",
51        "crypto/math/stat.c",
52        "crypto/replay/rdb.c",
53        "crypto/replay/rdbx.c",
54        "crypto/replay/ut_sim.c",
55        "srtp/ekt.c",
56        "srtp/srtp.c",
57    ],
58    local_include_dirs: [
59        "crypto/include",
60        "include",
61    ],
62    cflags: [
63        "-Wno-unused-parameter",
64        "-DHAVE_CONFIG_H",
65    ],
66    export_include_dirs: [
67        "crypto/include",
68        "include",
69        "exported_include",
70    ],
71    visibility: [
72        "//external/webrtc:__subpackages__",
73        "//device/google/cuttlefish/host/frontend/webrtc:__subpackages__",
74    ],
75}
76
77cc_fuzz {
78    name: "libsrtp2-fuzzer",
79    host_supported: true,
80    vendor: true,
81    static_libs: ["libsrtp2"],
82    cflags: [
83        "-Wno-unused-parameter",
84    ],
85    srcs: [
86        "fuzzer/fuzzer.c",
87        "fuzzer/mt19937.cpp",
88        "fuzzer/testmem.c",
89    ],
90    // There are so many corpus files that when all are used it
91    // exceeds the posix_spawn limit. So, only some of the files
92    // are used.
93    corpus: ["fuzzer/corpus/0*"],
94    fuzzing_frameworks: {
95        afl: false,
96    },
97    fuzz_config: {
98        componentid: 87896,
99    },
100}
101