| # 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 = "validation_status_util", |
| hdrs = ["validation_status_util.h"], |
| deps = [ |
| "//constants:status_codes", |
| "//proto:validation_status_cc_proto", |
| "@abseil-cpp//absl/strings", |
| ], |
| ) |
| |
| cc_library( |
| name = "sig_structure", |
| srcs = ["sig_structure.cc"], |
| hdrs = ["sig_structure.h"], |
| deps = [ |
| "//cbor", |
| "//cbor:parse", |
| "//crypto:algorithms", |
| "@abseil-cpp//absl/log", |
| "@abseil-cpp//absl/log:absl_log", |
| "@abseil-cpp//absl/status", |
| "@abseil-cpp//absl/status:status_macros", |
| "@abseil-cpp//absl/status:statusor", |
| "@abseil-cpp//absl/strings", |
| "@abseil-cpp//absl/strings:string_view", |
| "@libcppbor", |
| ], |
| ) |
| |
| cc_test( |
| name = "sig_structure_test", |
| srcs = ["sig_structure_test.cc"], |
| deps = [ |
| ":sig_structure", |
| "//cbor", |
| "//cbor:parse", |
| "//crypto:algorithms", |
| "//testing:cbor_utils", |
| "@abseil-cpp//absl/log:check", |
| "@abseil-cpp//absl/status", |
| "@abseil-cpp//absl/status:status_macros", |
| "@abseil-cpp//absl/status:status_matchers", |
| "@abseil-cpp//absl/status:statusor", |
| "@abseil-cpp//absl/strings", |
| "@googletest//:gtest_main", |
| ], |
| ) |
| |
| cc_library( |
| name = "ocsp_verifier", |
| srcs = ["ocsp_verifier.cc"], |
| hdrs = ["ocsp_verifier.h"], |
| deps = [ |
| ":validation_status_util", |
| "//constants:labels", |
| "//constants:status_codes", |
| "//crypto:crypto_read_handler", |
| "//proto:validation_status_cc_proto", |
| "@abseil-cpp//absl/base:nullability", |
| "@abseil-cpp//absl/status", |
| "@abseil-cpp//absl/strings", |
| "@abseil-cpp//absl/time", |
| "@abseil-cpp//absl/types:span", |
| ], |
| ) |
| |
| cc_test( |
| name = "ocsp_verifier_test", |
| srcs = ["ocsp_verifier_test.cc"], |
| deps = [ |
| ":ocsp_verifier", |
| "//constants:status_codes", |
| "//crypto/default:pem", |
| "//proto:validation_status_cc_proto", |
| "//testing:pem", |
| "//tsp:verified_timestamp", |
| "@abseil-cpp//absl/status", |
| "@abseil-cpp//absl/status:status_matchers", |
| "@abseil-cpp//absl/status:statusor", |
| "@abseil-cpp//absl/strings", |
| "@abseil-cpp//absl/time", |
| "@abseil-cpp//absl/types:span", |
| "@boringssl//:crypto", |
| "@googletest//:gtest_main", |
| ], |
| ) |
| |
| cc_library( |
| name = "cose_sign1", |
| srcs = ["cose_sign1.cc"], |
| hdrs = ["cose_sign1.h"], |
| deps = [ |
| ":ocsp_verifier", |
| ":sig_structure", |
| ":validation_status_util", |
| "//constants:labels", |
| "//constants:status_codes", |
| "//crypto:crypto_read_handler", |
| "//crypto:hash", |
| "//proto:assurance_level_cc_proto", |
| "//proto:signature_info_cc_proto", |
| "//proto:validation_status_cc_proto", |
| "//tsp:timestamp_parsing", |
| "//tsp:verified_timestamp", |
| "@abseil-cpp//absl/base:nullability", |
| "@abseil-cpp//absl/log", |
| "@abseil-cpp//absl/log:check", |
| "@abseil-cpp//absl/memory", |
| "@abseil-cpp//absl/status", |
| "@abseil-cpp//absl/status:status_macros", |
| "@abseil-cpp//absl/status:statusor", |
| "@abseil-cpp//absl/strings", |
| "@abseil-cpp//absl/strings:string_view", |
| "@abseil-cpp//absl/time", |
| "@abseil-cpp//absl/time:clock_interface", |
| "@abseil-cpp//absl/types:span", |
| "@boringssl//:crypto", |
| "@protobuf//:timestamp_cc_proto", |
| ], |
| ) |
| |
| cc_library( |
| name = "verifier", |
| srcs = ["verifier.cc"], |
| hdrs = ["verifier.h"], |
| deps = [ |
| ":cose_sign1", |
| ":sig_structure", |
| ":validation_status_util", |
| "//constants:labels", |
| "//constants:status_codes", |
| "//crypto:crypto_read_handler", |
| "//crypto:hash", |
| "//crypto/default:hasher", |
| "//proto:cose_verification_result_cc_proto", |
| "//proto:signature_info_cc_proto", |
| "//proto:validation_status_cc_proto", |
| "@abseil-cpp//absl/base:nullability", |
| "@abseil-cpp//absl/log", |
| "@abseil-cpp//absl/log:check", |
| "@abseil-cpp//absl/status", |
| "@abseil-cpp//absl/status:statusor", |
| "@abseil-cpp//absl/strings", |
| "@abseil-cpp//absl/time:clock_interface", |
| "@protobuf//:timestamp_cc_proto", |
| ], |
| ) |
| |
| cc_library( |
| name = "simple_cms_parser", |
| srcs = ["simple_cms_parser.cc"], |
| hdrs = ["simple_cms_parser.h"], |
| deps = [ |
| "//crypto:algorithms", |
| "//crypto/default/cms:certificates", |
| "//crypto/default/cms:cms_parser", |
| "//crypto/default/cms:verify_signature", |
| "//tsp:cms_parser", |
| "//tsp:constants", |
| "//tsp:parsed_timestamp_token", |
| "@abseil-cpp//absl/algorithm:container", |
| "@abseil-cpp//absl/memory", |
| "@abseil-cpp//absl/status", |
| "@abseil-cpp//absl/status:status_macros", |
| "@abseil-cpp//absl/status:statusor", |
| "@abseil-cpp//absl/strings", |
| "@abseil-cpp//absl/strings:str_format", |
| "@abseil-cpp//absl/strings:string_view", |
| "@boringssl//:crypto", |
| ], |
| ) |
| |
| cc_test( |
| name = "simple_cms_parser_test", |
| srcs = ["simple_cms_parser_test.cc"], |
| deps = [ |
| ":simple_cms_parser", |
| "//crypto:algorithms", |
| "//tsp:parsed_timestamp_token", |
| "@abseil-cpp//absl/status", |
| "@abseil-cpp//absl/status:status_matchers", |
| "@abseil-cpp//absl/strings", |
| "@abseil-cpp//absl/strings:string_view", |
| "@googletest//:gtest_main", |
| ], |
| ) |