blob: 3ab85a1a3d44a372c6103beeed86e3d1c541c495 [file] [edit]
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
load("@rules_cc//cc:cc_library.bzl", "cc_library")
load("@rules_cc//cc:cc_test.bzl", "cc_test")
package(default_visibility = ["//visibility:public"])
cc_library(
name = "cms_parser",
srcs = [
"ber_parser.cc",
"cms_parser.cc",
"oids.cc",
],
hdrs = [
"ber_parser.h",
"cms_error_code.h",
"cms_parser.h",
"oids.h",
],
deps = [
"@abseil-cpp//absl/strings",
"@boringssl//:crypto",
],
)
cc_test(
name = "cms_parser_test",
srcs = ["cms_parser_test.cc"],
data = glob([
"testdata/**",
]),
deps = [
":cms_parser",
":cms_test_helper",
"@abseil-cpp//absl/log:check",
"@abseil-cpp//absl/strings",
"@boringssl//:crypto",
"@googletest//:gtest_main",
],
)
cc_library(
name = "cms_test_helper",
testonly = True,
srcs = ["cms_test_helper.cc"],
hdrs = ["cms_test_helper.h"],
deps = [
":cms_parser",
"//testing:test_file_utils",
"@abseil-cpp//absl/log:check",
"@abseil-cpp//absl/strings",
"@boringssl//:crypto",
],
)
cc_library(
name = "verify_signature",
srcs = ["verify_signature.cc"],
hdrs = ["verify_signature.h"],
deps = [
":cms_parser",
"@abseil-cpp//absl/status",
"@abseil-cpp//absl/status:statusor",
"@abseil-cpp//absl/strings",
"@abseil-cpp//absl/strings:str_format",
"@boringssl//:crypto",
],
)
cc_test(
name = "ber_parser_test",
srcs = ["ber_parser_test.cc"],
deps = [
":cms_parser",
"@boringssl//:crypto",
"@googletest//:gtest_main",
],
)
cc_test(
name = "verify_signature_test",
srcs = ["verify_signature_test.cc"],
data = glob(["testdata/**"]),
deps = [
":certificates",
":cms_parser",
":cms_test_helper",
":verify_signature",
"@abseil-cpp//absl/log:check",
"@abseil-cpp//absl/status",
"@abseil-cpp//absl/status:status_matchers",
"@boringssl//:crypto",
"@googletest//:gtest_main",
],
)
cc_library(
name = "certificates",
srcs = ["certificates.cc"],
hdrs = ["certificates.h"],
deps = [
":cms_parser",
"@boringssl//:crypto",
],
)
cc_test(
name = "certificates_test",
srcs = ["certificates_test.cc"],
data = glob(["testdata/**"]),
deps = [
":certificates",
":cms_parser",
":cms_test_helper",
"@abseil-cpp//absl/log:check",
"@abseil-cpp//absl/log:die_if_null",
"@abseil-cpp//absl/strings",
"@boringssl//:crypto",
"@googletest//:gtest_main",
],
)