OSSCA Chromium

기여 목록 / 8382616

components/certificate_transparency: Migrate to new crypto/hash APIs

SecurityrefactorMerged

components/certificate_transparency 디렉토리 내 crypto/sha2.h 를 crypto/hash.h 로 마이그레이션했습니다.

문제 설명

  • components/certificate_transparency 디렉토리 내 crypto/sha2.h 를 crypto/hash.h 로 교체

해결 내용

  1. components/certificate_transparency/chrome_ct_policy_enforcer.cc 수정
- #include "crypto/sha2.h"
+ #include "crypto/hash.h"
std::optionalbase::Time ChromeCTPolicyEnforcer::GetLogDisqualificationTime(
std::string_view log_id) const {
- CHECK_EQ(log_id.size(), crypto::kSHA256Length);
+ CHECK_EQ(log_id.size(), crypto::hash::kSha256Size);
  1. components/certificate_transparency/chrome_require_ct_delegate.cc 수정
- #include "crypto/sha2.h"
  1. components/certificate_transparency/ct_known_logs.cc 수정
- #include "crypto/sha2.h"
+ #include "crypto/hash.h"
std::optionalbase::Time ChromeCTPolicyEnforcer::GetLogDisqualificationTime(
std::string_view log_id) const {
- CHECK_EQ(log_id.size(), crypto::kSHA256Length);
+ CHECK_EQ(log_id.size(), crypto::hash::kSha256Size);
  1. components/certificate_transparency/ct_known_logs_unittest.cc 수정
- #include "crypto/sha2.h"

테스트 방법

  • autoninja -C out/Default chrome 통과
  • autoninja -C out/Default components_unittests ./out/Default/components_unittests --gtest_filter='CTKnownLogsTest.*' 통과

배운 점

  • unittests 를 해볼 수 있었습니다.

참고 자료