/*
 * Copyright 2024 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
 *
 *      http://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.
 */

#include "fcp/client/attestation/extract_attestation_records.h"

#include <istream>
#include <sstream>
#include <string>
#include <vector>

#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "absl/log/log_entry.h"
#include "absl/log/log_sink.h"
#include "absl/log/log_sink_registry.h"
#include "fcp/client/attestation/log_attestation_records.h"
#include "fcp/client/attestation/test_values.h"
#include "fcp/protos/confidentialcompute/access_policy.pb.h"
#include "fcp/protos/confidentialcompute/verification_record.pb.h"
#include "fcp/protos/federatedcompute/confidential_aggregations.pb.h"
#include "fcp/testing/testing.h"
#include "proto/attestation/endorsement.pb.h"
#include "proto/attestation/evidence.pb.h"

namespace fcp::client::attestation {
namespace {
using ::fcp::client::attestation::test_values::GetKnownValidEncryptionConfig;
using ::testing::IsEmpty;
using ::testing::SizeIs;

// A test LogSink that captures all logs in text form into a stringstream buffer
// for later inspection.
class TestLogSink : public absl::LogSink {
 public:
  void Send(const absl::LogEntry& entry) override {
    stream_ << entry.text_message_with_prefix_and_newline();
  }

  // Returns the istream from which captured logs can be read.
  std::istream& stream() { return stream_; }

 private:
  std::stringstream stream_;
};

// Tests that the record extractor successfully handles the original output
// format, which previous incorrectly output more than 200 chars at a time when
// run on Android, and that it will continue to do so in the future.
TEST(ExtractAttestationRecordsTest, ExtractRecordWithFormatV1) {
  // Note that this log stream contains entries that:
  // a) are longer than 200 chars,
  // b) don't always end with a closing bracket,
  // c) have content that overlaps with the next line.
  std::stringstream hardcoded_record(R"text(
I0424 09:57:22.979757    9092 oak_rust_attestation_verifier.cc:207] fcp.attest: This device is contributing data via the confidential aggregation protocol. The attestation verification record follows.
I0424 09:57:22.979822    9092 oak_rust_attestation_verifier.cc:207] fcp.attest: <H4sIAAAAAAAAA+1We1QTVx7OTEIIA1GeorwMWh6C4CSTJ4JAAFetUuVlhFPtJBMwAlFCQALWSkB8oC5aUAR5BYRgoWqxCLsqghalKpSCoqGgBSnKw1ZB3tIm9bC69bh2z3Z79o/9nTN3zv3ud3/39/vmu+cMpDCGDkIkwDBfB8TNBB73ewP4B9u4GfjNmitq+LE7Pu9QycTAohFBW0vF38KD9vh+IvDzF1IDb8qn3pX7XMLlZ2Hukoxuua7BuhKfIXvdfVWp1ZwX/aMW2z6zwS16Unz/XMlJzD2l/QpSW7dy0e8u+r8USbOeZXyWp7zo8LHhsvvcFGLMyEDW4LTlrNT6rscpRV5Lfn5HzOj4tvzdegucL/HvQ1BU0u7gPvzdWw/3rmUfAC/U99pu/LTbft/d3Ds/QWLZkgdhsqozAx6+y3df9vQOX5uQNxZ4e1mgNnUmvz4LwGmed533vxZPELkbef2HBrkdXUez4Z+DnirssnGGTOeYEGfHKxNjksA882qVlfhR7P5NETGjO86/Lc9y5VUfSg4lUYndXE31XznaLu1omJtlnZ5nGXtxH2f3caOqjij9I0UrrioWu/zg7nDpz+zx//H2MAstAUAwQOGDqBRuGTY/lV+/IZPB0S3TARDelpAIUgBrHmVLb1wTacv2/aWHMaOwEfOckZ99PbcluhBUuKkYm+T0mgU8SvuXqe97fPfwp679q0BXk4hPFWnbizhHr5h0u/g3L7XkfGh4mwB9S0j2KgBsCwh+ntGyyEihVCIS+Hh5+3vSGMwNwNBJIM4epdEZCIKhKA3BOAwaIxRGMQFbwGdxWBwEZiEYEipk0GEUjLPnYyiGsEPZNCGfJsRQNQOjM9FQDo3BYfGZQj4Ch2JCGsZywf3Fez3vZZsXy9ljzl8Mlhxr3TJuc6yyH37R1faqTZtzXnv395pzTA6qUjwe3LsyVssAnlR3ROierxSf1FVEqtv0w5X3SJKO93jairiKcaZoV5Xx8aQft9Rc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
I0424 09:57:22.979853    9092 oak_rust_attestation_verifier.cc:207] fcp.attest: </LTbft/d3Ds/QWLZkgdhsqozAx6+y3df9vQOX5uQNxZ4e1mgNnUmvz4LwGmed533vxZPELkbef2HBrkdXUez4Z+DnirssnGGTOeYEGfHKxNjksA882qVlfhR7P5NETGjO86/Lc9y5VUfSg4lUYndXE31XznaLu1omJtlnZ5nGXtxH2f3caOqjij9I0UrrioWu/zg7nDpz+zx//H2MAstAUAwQOGDqBRuGTY/lV+/IZPB0S3TARDelpAIUgBrHmVLb1wTacv2/aWHMaOwEfOckZ99PbcluhBUuKkYm+T0mgU8SvuXqe97fPfwp679q0BXk4hPFWnbizhHr5h0u/g3L7XkfGh4mwB9S0j2KgBsCwh+ntGyyEihVCIS+Hh5+3vSGMwNwNBJIM4epdEZCIKhKA3BOAwaIxRGMQFbwGdxWBwEZiEYEipk0GEUjLPnYyiGsEPZNCGfJsRQNQOjM9FQDo3BYfGZQj4Ch2JCGsZywf3Fez3vZZsXy9ljzl8Mlhxr3TJuc6yyH37R1faqTZtzXnv395pzTA6qUjwe3LsyVssAnlR3ROierxSf1FVEqtv0w5X3SJKO93jairiKcaZoV5Xx8aQft9RcUx6MC7+iQ9IcxuNScJp3cIlm/KhAM4bzKH83zuVZ3eW12mY1Ja8ubTwD8J91nXKmoNrv8fM36u3x0tDQGbJjJi/yuFaxVl1G2w70UdO3YHxPVb7vj6VAMnOk3IB7TEOLiBRsFUdvjRC6SaUyf1gD8Wf2r/6GIicXC4junru/Ni55hL+140TBClfsEbM9mUionKjV0AQz5Hd5REPDZsj29FRP58Ty4IzwkWCKuIt461aUQ9qWg/QKx/iIwxfmzNPQhDPk9rKve2tqcGLHlIXKJWabbin68EcWutqeTQqquDBRR+3necyH7Ig3mkz05E7ym+Rom35MkB9PDhgGHKsBG2Y5Y+1UQJrp7DXp3ZtzVzWjYZsGwCDblPznezfJZ4splYV1dLPzWtA18O2+4j3W2Or3ekVtK2
I0424 09:57:22.979861    9092 oak_rust_attestation_verifier.cc:207] fcp.attest: <z+zx//H2MAstAUAwQOGDqBRuGTY/lV+/IZPB0S3TARDelpAIUgBrHmVLb1wTacv2/aWHMaOwEfOckZ99PbcluhBUuKkYm+T0mgU8SvuXqe97fPfwp679q0BXk4hPFWnbizhHr5h0u/g3L7XkfGh4mwB9S0j2KgBsCwh+ntGyyEihVCIS+Hh5+3vSGMwNwNBJIM4epdEZCIKhKA3BOAwaIxRGMQFbwGdxWBwEZiEYEipk0GEUjLPnYyiGsEPZNCGfJsRQNQOjM9FQDo3BYfGZQj4Ch2JCGsZywf3Fez3vZZsXy9ljzl8Mlhxr3TJuc6yyH37R1faqTZtzXnv395pzTA6qUjwe3LsyVssAnlR3ROierxSf1FVEqtv0w5X3SJKO93jairiKcaZoV5Xx8aQft9RcUx6MC7+iQ9IcxuNScJp3cIlm/KhAM4bzKH83zuVZ3eW12mY1Ja8ubTwD8J91nXKmoNrv8fM36u3x0tDQGbJjJi/yuFaxVl1G2w70UdO3YHxPVb7vj6VAMnOk3IB7TEOLiBRsFUdvjRC6SaUyf1gD8Wf2r/6GIicXC4junru/Ni55hL+140TBClfsEbM9mUionKjV0AQz5Hd5REPDZsj29FRP58Ty4IzwkWCKuIt461aUQ9qWg/QKx/iIwxfmzNPQhDPk9rKve2tqcGLHlIXKJWabbin68EcWutqeTQqquDBRR+3necyH7Ig3mkz05E7ym+Rom35MkB9PDhgGHKsBG2Y5Y+1UQJrp7DXp3ZtzVzWjYZsGwCDblPznezfJZ4splYV1dLPzWtA18O2+4j3W2Or3ekVtK2YoRuXwqSgDRTkwm4kx2RgD49MZHAZCxegoLGQgbD6bKnxpK+9iAAADtjZnmwWXkiI33273yaC25vewq6zwbCtCohaFoPbV1ReXwhzfmxR+UdH6tPgFBcYuz/XLXZyQsmci4GvV5CXZ66YJUWjG0BkB5ywruD6wMCZaaWZ9urqMxwuL6ZGuT3OOec7dUWPyoUOnhiZ6Sf
I0424 09:57:22.979871    9092 oak_rust_attestation_verifier.cc:207]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1qD2tptRuWOWiYP214fo6h0/KT1msvqDP1H9BMdYPj6SG3SHzT25poU2Tn1/KNEutkfzwYNnzINmwudvAs84vG+s/PpiMo7N45Pj8yYYAgCs5KcusmKx1yy0TLD3d6t4ivNtg7FdYu/Koeazl9emaQx98/1CbpUKQncNuRaXK93FxTTn3Fp8ropwwq7Dd/ZWP0pFEDRlKFHnnmJfJbLqXHu5Lkw06+ZKbPLKHv/J0PnW4VzZMKLCrEB3alLqxp2SKG5XSuMJbsc5csJnsuucqfTrd2IF6Yld77bzr6ce1tAyMFwRcK/IMvrJv+0LXyUKdXKaR+GGDW4zR3SPnp+s6k6vC/bh2NpymS80ezRQcpui4V+P6uZ6J2SxIzwyCSNFbI4UUKRr2C5kk3gSSDwAA>
I0424 09:57:22.979925    9092 oak_rust_attestation_verifier.cc:207] fcp.attest: <5P7zrJ794GmEyzegNvqtDvoMR0QmegcfDmZIoGytjrY8up/1qD2tptRuWOWiYP214fo6h0/KT1msvqDP1H9BMdYPj6SG3SHzT25poU2Tn1/KNEutkfzwYNnzINmwudvAs84vG+s/PpiMo7N45Pj8yYYAgCs5KcusmKx1yy0TLD3d6t4ivNtg7FdYu/Koeazl9emaQx98/1CbpUKQncNuRaXK93FxTTn3Fp8ropwwq7Dd/ZWP0pFEDRlKFHnnmJfJbLqXHu5Lkw06+ZKbPLKHv/J0PnW4VzZMKLCrEB3alLqxp2SKG5XSuMJbsc5csJnsuucqfTrd2IF6Yld77bzr6ce1tAyMFwRcK/IMvrJv+0LXyUKdXKaR+GGDW4zR3SPnp+s6k6vC/bh2NpymS80ezRQcpui4V+P6uZ6J2SxIzwyCSNFbI4UUKRr2C5kk3gSSDwAA>
I0424 09:57:22.979930    9092 oak_rust_attestation_verifier.cc:207] fcp.attest: </1CbpUKQncNuRaXK93FxTTn3Fp8ropwwq7Dd/ZWP0pFEDRlKFHnnmJfJbLqXHu5Lkw06+ZKbPLKHv/J0PnW4VzZMKLCrEB3alLqxp2SKG5XSuMJbsc5csJnsuucqfTrd2IF6Yld77bzr6ce1tAyMFwRcK/IMvrJv+0LXyUKdXKaR+GGDW4zR3SPnp+s6k6vC/bh2NpymS80ezRQcpui4V+P6uZ6J2SxIzwyCSNFbI4UUKRr2C5kk3gSSDwAA>
I0424 09:57:22.979934    9092 oak_rust_attestation_verifier.cc:207] fcp.attest: <S80ezRQcpui4V+P6uZ6J2SxIzwyCSNFbI4UUKRr2C5kk3gSSDwAA>
I0424 09:57:22.979937    9092 oak_rust_attestation_verifier.cc:207] fcp.attest: <>
  )text");

  // Extract the serialized log record from the stream.
  std::vector<Record> records;
  ExtractRecords(hardcoded_record,
                 [&](Record record) { records.push_back(record); });
  ASSERT_THAT(records, SizeIs(1));
  EXPECT_EQ(records[0].start_line, 3);
  EXPECT_EQ(records[0].end_line, 20);
}

// Tests that the record extractor successfully handles the current output
// format (and will continue to do so in the future).
TEST(ExtractAttestationRecordsTest, ExtractRecordSuccessfully) {
  // Create a verification record with a good amount of data in it.
  confidentialcompute::AttestationVerificationRecord record;
  auto encryption_config = GetKnownValidEncryptionConfig();
  *record.mutable_attestation_evidence() =
      encryption_config.attestation_evidence();
  *record.mutable_attestation_endorsements() =
      encryption_config.attestation_endorsements();
  *record.mutable_data_access_policy()
       ->add_transforms()
       ->mutable_application()
       ->mutable_tag() = "some tag";

  // Call the LogSerializedVerificationRecord function and gather the log
  // records it emits.
  TestLogSink log_sink;
  absl::AddLogSink(&log_sink);
  LogSerializedVerificationRecord(record);
  absl::RemoveLogSink(&log_sink);

  // Extract the serialized log record from the stream.
  std::vector<Record> records;
  int num_records = ExtractRecords(
      log_sink.stream(), [&](Record record) { records.push_back(record); });
  EXPECT_EQ(num_records, 1);
  ASSERT_THAT(records, SizeIs(1));

  // Verify that the extracted record matches the original record.
  fcp::confidentialcompute::AttestationVerificationRecord parsed_record;
  ASSERT_TRUE(parsed_record.ParseFromString(records[0].decompressed_record));
  EXPECT_THAT(parsed_record, EqualsProto(record));

  // Now also compare the original record to the hardcoded serialized record
  // below. It should match. If this test starts failing this indicates that the
  // serialization format may have changed, and in that case this hardcoded
  // record should be moved into its own test (like `ExtractRecordsWithFormatV1`
  // above), and a new hardcoded record should be generated and added below.
  //
  // This will help ensure that the record extraction utility continues to
  // properly parse both records in previously used formats as well as records
  // in whatever new format we may come up with.
  std::stringstream hardcoded_record(R"text(
I0811 09:51:20.138945    6115 oak_rust_attestation_verifier.cc:207] foo: Some prefix text.
I0811 09:51:20.138945    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: This device is contributing data via the confidential aggregation protocol. The attestation verification record follows.
I0811 09:51:20.139018    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <H4sIAAAAAAAAA+19B3wc1bW+JRds2QYjTHOwIwSmuWh6MRjQaot2pV1p22yhmDszd3ZXW7W7qg4ETOgdHCCUAIZQAoHAn5DQQgn9hWIIL48SIIT2QigBQksI/+/KAdMCJMH84LEGW9Jq5s6dW8495Tvfmbdxy6x5LS3Ta+UibauTTOuxNzVHLlrRMueI8Hy6j+xtOn7m>
I0811 09:51:20.139024    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <guI1b7qual29ouXWnVrOmTu9qfXGjVa2tLW1r6iPVWj7srb2bL1eqS3r6MiVltTL9fLSXLkjWid1WqSlescw376YXV2pUjtn4dPYR+6qVMsD1KovKZP80kyunh0yWQP4qaNe7aAlu1ytfbil2pDJbsCT90LDbW2sM+xPe4kUJ/qDe1dUaa1ezVl1aq/I02qJFlbUcsVK>
I0811 09:51:20.139033    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <ga7IlVfkSrn6iqq9YqRKKhVaXWHmShN9nGjEzmVwK5p5r1l8VssSQVZY01QSBMeWiKSZDscrsikpxLZtauucyCm2YquKQjiVykSwLJ04Ok8VScQfVXEcotjt/3jM/hNf2b/7fHh03n9we65WG6J2X4k9VuAEeQmnLeHEGCcsE8RlvLhUE0WO49L/6Hn7MCnk7Fx97AM9>
I0811 09:51:20.139039    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <by+V6y7qlKsTo/LZbbAhLNc7nTqtvn8Dzy/h+I8/dF331w1au1UguWINt6ybj/UzggY/ukb+McNWudjxgYmfmG6zUDY7iiRX6rDLVo3N/kTDHaKiSsrS4vqxe2+uPjBDX8BjZEER1Q3/GF3QRf1LeIyma8IHHzMxY/vg3/1b9m+Z99CsliOmrWrq5QSsIU7jRF7WbEFT>
I0811 09:51:20.139043    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <KXUck9oCp+iczFPOpJRwki4IlOMUqkmC6WiiJuO3uiUIqsmJsi3ogigKPHdk006WTXi2LXTB0hUqiqaqObykORzROdOhmoamNEGzT2zaU6SqJaq8JmuOYNq6xYmCpkuKLpm2bJqSpouOIHGiRTXCmZajihanEkekjkJEmfDyaU0HNhFV5E3NxvMVXbBNylEimKaFjhOF>
I0811 09:51:20.139048    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <U1VTEQRRUBWVSqZgExM7UtDRhKk5eLAq6Y6mOkS3Vdxsa6oqUZsXJJ23eduyeUu1NV5UOPSSWoJETLybTgTN4m2Tp1TVLG4N64Mi27jEkTjK6xLROMVRTZkJBkolR9HQDyLZisg7Mr4TZIniek7QOMcmtqxzAhUtVVRNydRFTecxalSyBUWwVLRhqrai27ZuWwQzJYmy>
I0811 09:51:20.139052    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <oBP2kqKuKLaIGTD1HzftRzSNF9gw4U2oSCRMou2IeBtbJ8RSCQZR1k0e34sy1WXcSDlbsUTewpwrNsaIFwVJdHiOchaeL2uE6CJPNMtSBV6Vr2ja07JVxxZlHW9rWY5laha70ZFFRZBUXrAlGS/kWBSvKvOqoFLBIrLNiaot8rYjqNc0abYI0SioGm9SSEOqKCbHc5JN>
I0811 09:51:20.139056    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <ZMExBV2nGuusTSxT0BxFcRT0F4vDUlY178ebMnqisoHDYKqazRGV51TbZMtWRKc5WZXwxqaFN+YdycIcWDy1VVniLCJifdgK0SWJFzlNwOKQOEXEnHGaLDuiQ5zWQ7AXutEd9j/nqNgHlqnrisWhfVyl6Jqj4ZGOKls2J4gmxQqVJR1DKFuSaQqqqGk2mhU4XuWxD2wO>
I0811 09:51:20.139060    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <bRC8gy6qskNNGQsf08NplGrYMBA1isRmEPtAYi2iW5xNFAVniOhI2BQW4SWiUmxMjLylsx810VIkqomKbWp4AU4yFYdY/MQ+wJlDdUXDrDlElnCVZRIITUmWLROLz1SwfWVcTAlGAtvNlkWeYtxFzeaJThXMra0J2G/UpI4sEYsoJq/jyMJSFkwOx5uMRSabGrYXNi7m>
I0811 09:51:20.139064    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <CVucMwlHOBurnu0DqmAjOjblZFnmHF3iJIo9bQq8hU2NBegIGhWIY2K5YPNh52FjY2YUgVjYW5SaxOFkQcCg42VlSySyyJmmYmELqrZuOhZkkSapbPvb2NSQK7ou6zx2kUgsXI99gAHAyKpMkJs6JkZyBCworEtJsbAPTMXELHC2aRIFoykK6L/pOPgqYTtytqVapqxL>
I0811 09:51:20.139067    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <skqwLUSBqiJEmS1Y2BfYX1gQ2AcacWzsQ5PtNiYrNE1XMDSQHZA4psqeTih2qy45lu4oFsQiFo1pyhAEGuYR+8BUeMghbEcZG4cXbV3lCRMnOlEtTpI5nUoy+mfLgqSoDocmVCoKnIp9YGODY0mYEhU5TCS2nyzbvOxwuAnKhYoFTyEHBUeC5MJo67JDTAw3dpJOmGyx>
I0811 09:51:20.139073    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <FI3HsuVkhaPoiCJhL0qOA/GuYW1Z87qwILHaTQsrA5uUE/CyGu/oECi2aUOh4RWHUhtPZw8nODF0HTqOzEHdMdnCthWptQcqoo/zNLetULKV6948Y/oxL+x8/JEL/mv2Lds89EC0/Ub+94npBzYdGss0bzvp+y8fcvRcrb3n3vSJl5958qKzf7wnv6u5w36b7vLY0MpJ>
I0811 09:51:20.139076    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <obfJvLWbrWzH+FOd13D+WLICISqbimraCtUhICBn8WsIBp23TOxc3VJVx1IIxbaCABMxqzgdNM0RCSUQpibeqX3ZynazbENVaqdjgazlKyTSycA4SehD/oFyLtgljfQOeHK9XYEqSch59plVNKqmGMj7cyM5S3QVUmN+BffmU8lI1j9QUf3FbNYSMrm+Ui2XSoyWcG3F>
I0811 09:51:20.139112    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <9mXrE/cK2WxwIC6we+2it2Yn4rm+XGAgPWAMhBKhYnogXQzG/Fzah7/FFBdyZ4tBwS8EY+GxYCLFpweyueC4K58a98uhmJFNJ1JiX8xbDA2EuWDCM5JOBMdC7oycToQK/hKvo994F3sIfeOtIp7F+iToQ7bPGLK7/Io/z3uNeCgQGciMpeJZd19XvcfmCoPpmGuEcIXh>
I0811 09:51:20.139116    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <dLIgBjnDHyvKcSNZCIbjfCFSyLqjcW8X8Y1Gzby3Eol7a+l8yEfygUjIU6jaBVfS8tQls1BJW0W91/J4Q0Z3pBIt8q54vs6FYt6CzQX6ewTe2x/11/zF9LBV5LMT/Sll+KA7z8Z7xE4EaiQR6k0n85/Q79FYsDsSjI973fGCkY8WIpVwwZsw4pVQnDdCaT44YhQq+L2L>
I0811 09:51:20.139120    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <i3mDI1E+YiRKgXzQmxo3eKMc8/lHLU+lYCZ0MR5z+eIF2zA9o7lg0tWTTvDDNh/wRgqBdNAbiCYGXL5IIThudduJYKEsxLg4b+d5j5FPpwmfDuD6ki0YiUShkDW8gUpqINRjeQOiKVaSZiEdZj9TX8gTKcrRSFGXMc4h6pHj4Xw2Gkxk/Uap0hXx6MlosY6fQ4rh48tG>
I0811 09:51:20.139124    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <IZ008gaenxpP4fd2vDZqenQSFyODsZirhwgRI1bwGmZexlSER6Lc++PhM3z1SJo3fEY+FI8kRj3RuMFFCvY/xsvFhaGQ9UcDupPk9fbF7blSnWaqMMbsWI7ZTDjkcepAaMiL2wvljN+NrWFxkII4N20cNroqOrosQ3kyiQDViHC8o0m8BBUJpz7OBUmSoY1Ijq5B8mKv>
I0811 09:51:20.139130    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <cryNx7CmSjYdbV8m4riURE3hFrcP02rOYZZgrgzbZiX6YhWGavihv1ouO+wTK0utfKWMTqIbVZovV5fWcplaHYbMUpsOty1p43GwchCVsg6ppsiKzCl7l6DsySL7aO/S0CDfl4A+wS8y6Fje0FOjQ4FwLy11DqZSWsjn7fcE1NHCUErNlZfvXdq79OSBq9s+4UEjIb9O>
I0811 09:51:20.139134    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <BlyezpzLY2Y6/f2VcrArnClHRobz+UBFiPWPjqRTDhns67YHRoZHBnM9Q9WwP0P9ZDDp0iPJeCU+5BkphQaHEq5+m0tk8pFUtOD29MS67GFSsyJBPB4DlSW1LIUFtVe7YkKTgPjnbVsSZHbAyja0Uc2GPOYpFE8oGQJUKxykmqpDI4BMxNHDhoBAp9LQmIXTUZRslTch>
I0811 09:51:20.139138    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <KQnEPBoUeRwukNUSjkhIcSqpOFEF3AgFBUeESaH3QXuCfiaJaEIimHMTqim1ZE2xsTgIzkgoYVCKcODgYLc4RcP5JKnok+BAfcPgWziNJI63eIImqGNCFXAkiUlpTBe0QFykEEWQcbBK0Kihv0LplCkhCtQfKKY6+qHYHI439BhNqDhlZcuRsc6gwEAfwrkK3Ysdhhq+>
I0811 09:51:20.139143    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <QFFXoGhbFMcVJ2ABwkjgOFgHOL2gpzlsBUJhgDpgQzuUYJjgdIUyZkMr10zTERysHGj+AmtAopIFtUoTRB52vKSLE+8L30U7dG4o1KrDQ1tRMQf46kgiz0PTtSlmQeahYqimZhLYBVARFRgYElRjQRbRX0VFE7D8CdQWqLM4PqEiUKgisIPwhYcmBXUI24WTVImHFohR>
I0811 09:51:20.139146    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <hTIOw0DEptPgPRB4E02YosKLRBUkzKrOKTgAMX6YRQsnvE51U4Pmj7ZwMsNKYS4IE41CVcdzbJybHBsLaA2YEbwl1HUCnQbGGBQsnOu2IysiDCFCcZjjFbG/beifEsZD0djIodc2RRNQrAR2kFIF+popcbIEZ4iqQ3bAhIJ6ZWIWoffYPOwtaCMUo4+5IbBioF5iSbJe>
I0811 09:51:20.139152    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <YNwgCNhFGuZZRQdwnivQ2TCCMHqglymShYUEXV52HEWCGo2jHCsMSg50SzQB882RNVmlPIf+y9DVYdk5Fm+yCVawUURoVbge9oJABN3EwNiWBh2G8jLP6QLrBRYwlhW8N0zVIY5DCZRNBSovNDcV3SOw/DiLTQhl+oYswVrVofFAI8SMsyagkEJpxMISJcuSMG28Q6FK>
I0811 09:51:20.139161    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <wzCA+oH1Ch1alzTsHnygwQ7CQMGcg64E5UmmqtC+zwcF5HvCS1vcDjFY74ZAgPAzCcQvlaHs6ATDKeNdCRRUtp8x4xI0TqJy2MZQqDFjGlacBKPcgl9Kh6khsH1Yr1IazY1DyL8vH/df3A55WqK2p1SvjrEToFYnxQqeF/TEu/zeqikUqVpSR/lu4im4XRHbsMZdcd5T>
I0811 09:51:20.139165    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <7agbhASq/MAgcSJKPd6Z83Qu8qfHBuNKNSr2+MWxkZSWSLiH9Kwn5SHdYxYmyBdMy5F4V6gYXt6+//77t7Q+962WgzaCkvjotK+3H/E9/6FVtFcUciUKp2MGh93ndCVqMtwrPDyFWO6wRWEkw9yGCwNWu8SrkslZGnODYBNALFMYibA5sd5tE5Jc0ET5C3MlSkuhxv+H>
I0811 09:51:20.139169    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <rsSPtvGZrsT1N3yZrkRJFf8PuRJxGkkfciV+2Me3YN/BoRytt1VIKWctX8K3Mb/3cnjpc/W2pbts/76dtu2k00595twzfrbwrJcOnfLsced2xX+86bPHPs3Ff9S7Zu4ru7iO2K65bdbTMx7f480nTipvt9c9d9w5Zh38p84zf+pPDi2P/33xz/eZccW81XM/bqdJHCxc>
I0811 09:51:20.139173    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <QXF40+FVeDY0uBckC54luKlg9sIZBs0RNrpAcYDYIrx/8AlqMg4inOsQ118JO80vpYRIPhjrHEvH7Hyf25sNjQeZPZMNCqEB2GFZ2GliOhEeDQ1ki33uUCE9ECikYiF8ns2FxjMjfey+mAU7jt1vF1PjdvFfsdPi8VDWjOtZUpSDRmJ0qGes3h3O64W4TxuJFdKjxJMd>
I0811 09:51:20.139177    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <IiXDsPl01sjzw8QbkaNCvTeaL4jRhO2J8UZPUCwPh9yRnlgpHQgm0/00ztdCRp6Ld4ciiYGAGOfT5aDhSiS66sGYL5IPC4HA18ZOK0Z8xOuKReKGGDOMvjjsqXgBY1ZyhVPjAQjZQDKRtAumL6TEEnJXKC+XLG/FMPh0f9xI91iGfyxRysZpMduf9tVJUAiPEDGbJrGC>
I0811 09:51:20.139181    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <OxULJIgQMqKxUDpoVLxGcZTEEqEh2G8hM5aVjJgrES4G3LY3hKdnpVTMG4Vx5I8MRApmMjy+oew0fQPbaWh/A9tpCqftXYoFs9lFY95Qb6g/7gkWh2q9EaPc5+uI58Left7fmR9IZUfG3L0pgfscdpoXdlpPb7k/ny67JKcIFb5zQOv3dBY704FeuExKZa3Sx6ddmVyq>
I0811 09:51:20.139185    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <e7wv7M929ib60v3FcC09Olypl4ojya6QtyPTO1irR2y9WvHElEipUPQFBjvkj9hpPPRUXWA+Z6b0ibAJcIRaMHNhCEDT5RVRgktQgMMKLlsBZ7kA5Z2Hvsmb8EUqTJmGSQ47hyLKYEKdhUWHJhAxERBicGAbwaUNLz4Ub3jreRW6MUHr8HTCvY9ggqpJrAloyTbUBB02>
I0811 09:51:20.139189    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <HZyBKnQJOCihxsLtBQsR8hYfwJ8PUx6WmwgDSYdRpRHJIrB/JnpBECeBPw2xS3ifHViDqswzI8s0YQwR6IwS9He44RE8gA8WyjmzQWApIFgGg4djFlLD1GuYeg1T71809RCg/JCpByNSgwmJgAnCfxYzF3kODndqwh8iw1ynTEqwEI0MnwmitizoieAKky2mgqDQJ5h6>
I0811 09:51:20.139193    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <ELGfZuqluvzhLsdfNsP9naEety6MFaPuRCaThaQy/D41Fx+krpLLTbqz3f5MPgN5GUx0uau18ohQrHfnUj3SqHssGC6Q0KIoV4l3jhXHar2aPOTpi+v6hKk377F5LddOg6l31dfA1CtX4XgEaoTA0fh5jTgFKquJmANhsSBRgQjXEQRGYA1uJF5DJNySZIROiUiJJqg6>
I0811 09:51:20.139199    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <IiqCg/ASi/CK0ITpF2bEAQ/Cqf+hEffRNj7TiFt/w5dpxH1JQA0ABAT5SwBqfBQP8iEjrjWAzePl3M1t1Vue+cPLV3z78OvPjjyRrHlvX8N15Iu3XhXM//Cpi2/b8eXpzW3Rbf/w1sOKcdzhl41sfNObNwiX/vysNdeROf/70lhi7A/b737uJ8fSHPhCNYQbLcSX4b6E>
I0811 09:51:20.139203    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <O1YwIW7gRgc+ATFAFb5lwDx4BDE54iAY6aiqSOCjE0xETrWvhI0WyAUTXthdYSE4gChKLJ3ri+Xlvlghm/ZFcqGBuBR0+0dTRc8o4mp82t0pB30pxMsi2ZDgLQbdoXzIbYnBmAvtxHENYmvjHu7z2miwzwJRz6g3lDTCthgq93AFIRUPxEKedJkWAuPpRCEUHi+MpYqh>
I0811 09:51:20.139207    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <ZLAQSSL+x0fFdHc0p7sQyEEMKxJIG518sFghhlDmSDKdt8ftrh5uRKLJwFg6gVhZKVuOxBHDKxqJtDvOUcODeCSL6XxdYmnpbssTykfGjXRqwIW4p2Ek8pW4YVTkWCxUpYVKIhaLRE2fNm64AyRa8JYsHx+KiFlvKiEboURgKJbX02a8UksYQTnutQeNZLpgxHk57XYl>
I0811 09:51:20.139211    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <golAIjwQyEd8o92IvZUjHtmf7vbmg4nIsOHjeMJ7k5ECrjcqqZg7AGtNN/oMu9/wVDZYLE3YsDaaLG5wGw0gj71Lg30JtRIJBauLCmIngs5ZpTIa0TuLhZ5FgrfeK+V9HdXxAX+f0mF9DhsNsbTOTGF0MK93koyHjBsj3V2phODKeqoe76jcm+iISrZV16sDnfao0+nP>
I0811 09:51:20.139215    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <+H2Fcu+iGOnoivDxjKNUPLmRoBnP8CPVZCEqDy0aKqXM0ijfUcx/LJZGHIQgAPiBaoZQC2Bj+A/BFhuBHTjubQS8gBSC3NMhyYDekhGkRPQEkCWAUhATgUol2hCGAvBrOOQBT1FhPgGog8AOkEEyJKSoAvDJI0AGXJFFgV2RBeA/ECYBKkGE8YcmHOBlEBm1YD8JiIk4>
I0811 09:51:20.139218    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <iAA4vKLhYbhbAkoF2hyxEKYB+AUgKwByEGIAtIJTLAkSmQV/GgZWw8BqGFj/ooGFcPKHDCyiIZCGkDiPeB1BqE5F5AyGkwigHqB9gDLgxwndXWGoLwchEQRrEV2GhQV0msNilx+PpQmfaWCF9LAsVoz6SEV1qtGovyCR7qLb3aFVuoVSYHBRppry183iooCPGVihgc6K>
I0811 09:51:20.139222    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <wWXHwpV4R8DfK3r89d6OvOAdFLoDXWNRLT9kDifHSy45lpwwsCIvbtky57nQb+c6Z3a1nL/JkXRBOj659aEtW/57y5Y/T4bu+KfJX+0YW5VWChNpAQihUTsD5PnnDJ8BkQzsh25CQMtA3+uA9vKAAwItKwsIgxL4v2QEb4HoZKhchNwR9rcA5LR0gJJVzvqPLC91CafG>
I0811 09:51:20.139227    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <eG2ZyC8DmBtYzH/D8vq0Nj7R8uKWcPLHH7rO8voHrhsxnenrsHczTz3s0dMXX7tm7Wu7Hso/c2Tg7v41fzKuf/l3J1urjv/vxe/MBPbuza2nbv7w7My9s7bZ7ZxJf161JnTfwreWbn7Zxcmeve69f5Mnzph34idg7yzEbRxNkYFmRuweQW/E+XngHYAqRdAdOCAV0EbE>
I0811 09:51:20.139231    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <biQAQoBolm3sWuAHGJpWBT6EfDXsBWDoPOMpAXZDLJKHHZAP+oJi2hccTw3kudRAYQDfyelYaCA4YHGhon8s6M5wQSE+2heLZNn3qXH8jXVKfe4s7I2wnErEP7e9wLB34aSRJu6CnMqPBu1EfiRd8IjEV/GbiULVyssGsF3jRsk/bo+HSKJYKVmeSDLm7RyJeRj2zlMN>
I0811 09:51:20.139235    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <F+u+SDEyHCuUpT4P4g3dhXLYcHWHBb0a4r096WKdjxQ9Vatge21fQOmLF8IhT0X8+tgL9iBxpwegvw+linwfxiSV9vAk6huNx5OVvnAh5LO8djRYqPiNgYAPmC6X1R2Imb5RKVXI+oAhjEdK9kDCG1Digpw3vIW6EfPmIkkXn8inQ8DuDZHudNT0BHB9fNQWIojpuIB3>
I0811 09:51:20.139239    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <zIwaQPoRI+QPx7wJ2BO1dDxSC3nDo6bbiNLiaNcXH9OB4BJ5Ef7ADYK9EwBzAvRI3ZDYO14SgewHnGzvUlATsibt9oxLlf5IrtCZSNYGSqI/kewPd1lJ2yMsGjWSXR0F2vt5Yjo+BjHhF6XEcXfNced6VEnu85XFoVRPcmQQvtHIoqIQKXsVOl6BsKnl4dN0G3HgdTw1>
I0811 09:51:20.139243    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <FkbKBTUuMqAExntjtWSq3jGmkzESjohhiYY9mVDn8o/aDIDPA6GFuApSKDRgqSDTALOfgIQrMo4Nk7MR92DgaNVCboyMFA1VQRwIGgRPgceDlqABam8CnIc0GKCUZIwKAjBAEzkwRYCbtIHUEQEIB2Yc0HlNRJ4OgkDAEsHRazI8EZpQcQUQVaKInABF4WwAsBGEkQlg>
I0811 09:51:20.139253    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <z8jcQGoHj+MP+QPoC9JlAKtT4SCGjOWQHgKkM8P9CDqiQg6g5QoF2AnSGOoNgkEi0jwAIdE0TbQpMiVkIK4owN7IaBEFpH1IiCMhfMWx0JDJ8FVAACLNB44hQA1lC5LdBP4JcSmW8cLa5TkZeGuYUDCHgDxHygDMIQT7JWcCPAegP/JGYOBguIATRNQI+CqA79B9GUhS>
I0811 09:51:20.139257    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <ZI4gsAVgFXAwwBgCogU0l4bRB5QRxhYbTsS7AJfSEfFCqAowR4bxZoB84D4BEoOHHFkQSAkASpAdREB9CThxkBvCEIq2SdhwSsDQ2DiEgGlzoOgB1ciwgADp4RGER4gLCSvwz8JgA8YOpznAbwrHA0IF2xFhLoaIxAEHJRBRNoAAZfhxoX1ISMIBkkHCcQgEIwclQAXe>
I0811 09:51:20.139263    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <C05YIL4oEGGA4xENj+FsRAbRBHCZGAfiIN1Hhz1qacBDABqnMd+xhbkzYe1hyimP5QZwvaIDAAjbEchJpJ0gEIAm8D6AecJgRJ/xrrIGKxN4S8yFjWllXmVAhSygKNhYS8ilAigfbeM9LdnhefYi7A1EvDvc08htUkzkFjmAz1OsZOQWsBWLNYMABNBHis4j+IeljGQI>
I0811 09:51:20.139268    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <CUkBPJJL2NJCigP2hM4ioFCROZaXxXyDFrJOEHaUBIDvkPgDzJ2DpUeRtoNcEgATYVxzaGcCgPzFgufekz4fBs+JwP0hYQGoPxjSyN/B1lKwK+DaVIFixKAIzD+PZSwgJUUFLhEoWAAMLcGhMgCmH46ovC/gPk3hZ+C5zHiM70x48mVfJtFb6olkez29rgFiDBfGbSMr>
I0811 09:51:20.139271    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <dCkd8eiYxyWnA0yyVXuC6mC6U6ZRxe2JjQTH/Fy9YiVdfsWniuXcMK1UjUV96fJgNbMOPBc45Nstcx4LzI7v98fgbRevnfFCve/AP7a+vKDlhQUth8+Ewn/KVzw5F1DDDOX+lZxbpBEi+QR5QIrEYftiU+jAOirI5gK2U4ffGjlVqgUkr2lCPgA3DRwnL8iAHyMKg2D8>
I0811 09:51:20.139275    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <f6TpfzDnVloK6NK/oel/WhufqOl/MOd2/UO/zBgLzzbFhg9+fEmhHMhpUdvwb/Ox1N4P4/H+d3JLBhvUQiIX8vyQA8YDCQ9gBxyKCP4ikQuHAhBxkNfAYgAercIHiDw+WFSCaQkWMCYA6nOmzgHvCzch/IoaMskglHGGUeB/gQy2kRghwwDGg6ZMPAiNApSCRkx4LuGh>
I0811 09:51:20.139279    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <BBzchPMRgHokcODI5hzArG1AVXA+QM8A8JwBPhhkH6ltUGxsirMbSaqIO6O7QJvAzkMWqYocYVyhcHjQnIkH4VRXFOZP1XAKoXVJYE+FxoDNiMNSQcoCVBU4PqFKIMCkArQMdAnkLLwwLEVBZ9msOJlYwh6PTsANCiUL4FcY7artsAftOfEgQP0FZPYBD4P0BKgwQLIg>
I0811 09:51:20.139283    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <c0HC0YrME6gdsD+RcIiMOgSrkBqI1GIB6ghe0cZhTiHmkWeMHEskpwJWjbYtjZeBdqG6huGFN6iV5cDp0GqgKgEDToGlRmYkXpkHJJcD9AaZZQDTILUXEBweCoiCAaEyclsRMATWHkqKQNfnwKWWbfW4uN8L392msL9yxnDmwZNqbz988bdnX+pkdn1gbWZLDXb487/s>
I0811 09:51:20.139287    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <f7G+ya5n3/vWmed1rh1deNNV36tdsO2m/uwIDZR2tr/ziXY46wpAPiydTWE5hDiKkYuDVG4oWjjdYZ0jkRYKCPRygYfiAS2P5XYCEG8jRxnh+a9EDlyxz4f8N7c1lhoIjwaLcakvER5LuxlOMj8eKgZFxOvGkecmI0cKsbrIQNqdF1PF8Dgy5kZSQlgKuYOjoVgnn45l>
I0811 09:51:20.139290    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <i6FYXIZNzn/euN1EDlyxJkQ4ZMwWCv3BqO6PiBk5VnJJyPmSDT4y0CsiPzCZkWKlQD1RlPv7DFcUWMGB0Do7XAiNG5GQAHi7RxMi3s4qsJTVOKxG2NoDkfFAOerRh6JGwBctev1p32jMjEVGEvns18cOz/P+tEdOBAeQGOeNdNEEi50ZaTOZ7UZOWjUYr40nioUcsJWi>
I0811 09:51:20.139294    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <gRw5YhjwVfCIq8m8kUcmUJwfDA94ScJTMVL5tDfIF+p9BnwfxdHBOJct2wkj2dddgN1tjRgeO4L2DeL15oiQrQCrGY3g52A8RIJxeSSOHEnEAf3Ep8eDnvKGwlZKGzhup21IO3xdjgfyzpEDp2ZGOKujw9WX6Ee83pMecaW5oJIddpdtu4OIi1wx5M1ExxKm53PE7Sbs>
I0811 09:51:20.139298    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <8FIplc1lOvtH06Qz053PLIoK/JAnkekOlruLQxkxlRvqq+iVZE/Jz7BFlcHCWHiso788EBHEUCw9FHJHqzGPwvtcViYMgO34YNHnG6oZw+GP2eGwxGB9QFixfHLYSyx7GSciDEOYh8hlRqIUDihmveA/JPsjb0sxkW6GLHKAGRVm6SBvAuAcHDwI7klUhbUK6xTHrgXX>
I0811 09:51:20.139302    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <Pg5gJIXj9JVh9eL8RF4zDBqkXiB/hx0dMgx6NNEIvDUCb43A278YeEM22oeT2ExTE+H0YtsPrBAgfGGEFCx7FKQUug3KEQaKZr42pO4rpuogMxEuKljtpsB4S7APPxp4g4D7DDs83CVHQvlSUipbap97vNhjRWpJvpihtFLsy8XFQFe/O28vcnkyJQsZu0jhGotyZqHL>
I0811 09:51:20.139306    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <yOZGu+NjI64ePdqX0QaHE4n+sDetd1iuRK4/5s9r6+xw1+MtLXPSrfdt0n22a/sbXjtl7+FE13Gtd7W03N7CrZraxa1qfuPsyc1Nzc1Nk7jOaTN2ObT70DdmNzW1cNLZm3Czp83Y79DuJjp5SnPz1EnnbMPNW3/F9I/8dg1a4biV/Fyuddrk+JSZs2Z6ShkkmyGLGnnz>
I0811 09:51:20.139310    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <M7kZ7NNpmzXHo+9dstGsmVFSqpO2rgKpkvcumT6ruauT/zY3n13fMmuLTiQglyxqtwVzVrXc5qbDOYvW+FZuDrtg8qwZUY+xJJgrkBK3YMvZ0KF5qOXQvGUpveVsxETX/8iNf1md25TbZF3nprPOGV2eHm4Y/d0Io3vP8uamaVMXHTRlUvtkc9KUX5x17a3vzLxr78FL>
I0811 09:51:20.139314    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <D3pk0p2HbnHaiadss3aevfnMZwuvHjx199yNr/z46BP/p/koa8Hgzu+U7v1e7RBh/0OM3Xrt+Ko/iWef1/TH2tEvnt/79A2b3f7W87vvWz1gizkdb+63ValZTb/uPdj+8TvnrmraklvVtBmePmPRtKYpTWeMNjVNwVRN4rZc/0nzlJYtpk+M4RIXx206reW9SydPXDvl>
I0811 09:51:20.139318    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <Qx81r7v9g1dN+fhHUz/+0bSPf7TRxz+azD7aCotofSemT8H6m/QIF1zf4ylT9jxnGbnmyennvfGXxy887NGr33W2WV70XvSHV0uXbbXXSYevnHH/wq6ZTyxcdsnofVfv2XfDtX+Q/rbdnb/7EVl48Q7PZvYXz9v9J1/Acp+8CgN54H6PcMfd5nHakk+snXrlA7F5f9ls>
I0811 09:51:20.139324    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <5cLTfz1HP3bKdR3XqFdsNXOkvtt5kwd3zf/Pi9nOLvrdE+bMe7XrMulb7z7/qj5zi789lV2x8OFzb1rR0/rU+a/7x9e+GLkjeuVPtrhyk1n37p54PX3elVvdu2j51Zf/Xr/mttHbd3qx765fzd76sDPvOfbU5BaR7Y947bZX5++a+nPb/K1Pfj6/6rXkdX+7vvflpmcv>
I0811 09:51:20.139328    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <vnzfGy4sz7r57tE9p++Qjn7/wHdeeaN3h3um5mNLFnoPv37t5WNvbHztfUv2FJ888oBTxY075jw86by0d2zuqdPPuO8oWbv52OdOP+7+YzdrcYlPj8UDj66a82abe9Xvlix86fH8vTdfbW1hXmGpV5PFc66Vt/71Bb43QzMPuyP0h2Zu7mNH3qgce+2eO7rv3GThCc3T>
I0811 09:51:20.139332    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <N19w9ovSyr2PXnL5qWu27H75F5KxbGTXY67ZdMtLnjxmp23+tvqVJ7ns+K8vTtwwafUrF/RluLFFVx5+0CPX76xfMlW9P7rpyLsHx17nW5ftcMRmMGBWHvWwtvMzP3nt7Gnf1a+bOXrf6iuTT+uH/ezkPVZPvSR2wcW33XSX6xcvz008WSs+JW5c3eXVvxZXv/z3X1e3>
I0811 09:51:20.139336    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <Vzd/6aaLXvnlSf0Pvtgx55LHvrNQazKOCtxwwu17Vju+U9K7zxj91YtDT/7lnXP/dM/tB5658qLvtK2o/eDmq5tfP2N0/kunH91On5/jP/nqy2aorRvPnj/LvOXZG3bdt+PV5W9dcdPc47cZeabl4LOb5t23ZcvdW7Y0QAzfKBDDBHlQA8DwaeRBDQDDV548qAFg+KLI>
I0811 09:51:20.139340    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <gxoAhgaAoQFgaAAYGgCG/wMAhta39m1/cF5LIyG0kRA6wbf+9WHu/mokhDaSQT+LWLWRDPqVt40ayaBflG30D2LVRjJoIxm0QazaIFZtEKv+M2LVb0AyaOvj32ppcKo2OFXT6xDv+3855Zm+SZyqE7m1Db7UT6tr0eBL/crXtWjwpX7hdS0afKkNvtQGX2qjNEajNMaG>
I0811 09:51:20.139343    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <Ko3xjeBLbf8Mzv6W63ZqaVTfbVTfnSge/OWYd43qu/9GyWIkk35K9d1GdcRGdcRGdcRGdcRGdcRGdcRGdcRGdcRGdcRGdcT3qyO2PzSr5QiUo+9FVXj8Qblv1KBHoW0VRUgd0K6AF1rnZB61A5GnzqGEJ5jgOJZOK5hgdGG16jkdVCpgBgEfHmNUEUHRhpL0jAsL9czB>
I0811 09:51:20.139347    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: </gXKEgpOJVZCXQJlCOhdQMemoUI9SpJqNthPwNmF1HiUk0RxNvCnsKo/KDYJclxwzaEIIbhaHPDBgPyNVUFnVVctRgEmUlabHTRu8kRJepWVqAT5iqiAyM5EXUPUFTBBsIZC5RxKDilgKgBPjEqR5AtmGBTwFFBdmKIeHB6sSjp445CRj3rnKNDKyqtTcMWBO8zmke7P>
I0811 09:51:20.139351    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <W2BNAx8U6i2pFEVkQfIC2m6CukmgtmMkL6h3ykrSE7BB4RIwfIHcGySwIPRFwj8rGU7B2gbKNtQSl1gtTZCZsmp0yE0GExpqwYM5APQ2HAhmwNWGSqsgMtUYAYFIGcWagCql+AxVOEE2CwICgpmSRJSJBb0ZAbGYAmI+zICpoyQ9QVFlgQ0T3oSKBNwC4BUEfx9uJODE>
I0811 09:51:20.139355    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <A5M4ZSnO+F6UUTsVN1IQ/FkgdWOEg6wMPViuUCUXhHzIkwbPjAaOPhHcOKgViVoMMkrSg/7AAf2djrdFvVew51nsRjAYKIKE+nsgo8MLOUiyRuFVXgXTnWCBE4EDQ5vIoyivipL0Nri1UPoXhahAd6egjDAI/8CCR2QB9WhQSRXV40GIjlKpAnK3FUdhBeVl1IQCHQ9v>
I0811 09:51:20.139359    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <oiowKPEwcBhMVUOpVpXnQL/Hlq2ITnOoY8XKZIFniPAgHMQcWDxFpXoJFVJRUpe54nUJZF5wn2JxoNi0yMphgjjRER3itB6CvdCN7rD/QaGIfWAxMlkw+OG92HLXQO2moiAWSv6CFs+kWKEyCPXwfCSQmwKYnzRQI2GOUNkW+8AGgSBWKzLIRVUGwbOMhY/pQYl50Iih>
I0811 09:51:20.139363    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <gj1jSWQziH0AuiPchtrENmgYwRgB2iBsCouAl0Kl2JiMeEJnP4JCXkHRYlThATkFqB4lE3QSFj+xD1CLl+qKhlkDex6IZkCSR1B3FjV9UHQYNXNRKRZcQxgSEP2BXAn0xaAYwriLGiiQUFoMc4vaudhvjL4HFHooKws6PQU8i6YsmCgXqoNlUGMkRabJ6ALBOqgLHOMJ>
I0811 09:51:20.139367    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <RMq9LrF9QEGEiHq7oEaUwT0PBjwJBIio5IsMe0XHAnQEMB2Cww/LBZsPOw8bGzMDgibwKEPMmCDVQO43Bh0vKyNTH2WGUTPMwhZUbR2FpCGLQCnFtr+NTQ25gqqlIKYCPT54pSwR+wADgJFVGd8XaJpAeo+yj+D2cEDJh3JoEAeoYQbiRPBzg2YSIgv9Nx0HX1GGGZ+D>
I0811 09:51:20.139371    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <1MiUdVS+ZTycYCNEoWdG0m1hX2B/YUFgH6CKL4ooiybbbUxWaBoYOEHKpKIOGwrlsqeDmh9kk+Di10ErBbGIRQOGRAgCsEJb2AesHjNqIvMEbE/YeKBVAhcixImO0tMcaguD7JHRYIJgC+QFDocm1Ilq1IxoCxscSwLsIWA6tBVsP9BS8zIYmXRIPFYMGTSdjCATpb1F>
I0811 09:51:20.139375    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <jDaYrVB3G+0TtM5kC5izUM0T2wWcU+iIgsJy4NB0IN5BdUeteYyWCqsdparB1qmikBBeVgPfNQQK2PHAgwkKE0ptPJ09HPUDUDoW1ZxB34XxYQsbVcVbLt+59akFLQ2KwAZF4FgFFaHb2rP1eqW2rKPj3/BxNSgC/41B+3SKwHWOwQZl3KdlPjco477q6P4GZdwXDS9p>
I0811 09:51:20.139379    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <UMY1KOOgDkLT1PAFVjDjiQWZK9jowdjKLHCOg+kN1RBGEOqmg/FcRZFQqJ3gvIbVD9UVlg4KoKDWH+r+OigIALMahOYwQahkwWYB+TnPWFJ1cKHDxJmgbhd0WKuoVwVTAJXmaQPc0QB3bDBwxzeBMq69QQD9jSGAbtAAbkCOwgYN4OQGDWCDBvAbQgP4g83bV09uXdXc>
I0811 09:51:20.139385    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <Mi06UTqk9Y2mFp2xRizNlMuZAiWVXG2pVS52lEl+KanXUcKd1HPl0tJhfum6O4KU1IaqtEhL9Vrr1U0tbb33ta2afb41bY/OQ+6ae8Fzk+/+zhnndO9mP6c88r1pU656+6bWtt2/o26VfOX6MybvtDrX8+C13Se9suduz5193Ru7bXTZ7q+fm958Xpvz7NW3r/EfnH/r>
I0811 09:51:20.139389    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <B4G/inO22mJvz2/f3v3CHU9u7rjwN/dbd+7e3rY82vvs6uPbD7/puIMvOmmTnx6xcu3lB74xb+2SlzrqD+zZt62wS9tp73ROf+Aa48ilTYfustuVhwbmHHDrHs/uOuOUQ15YVLLmXbqfMNsql2rlAl1er4OetvXoppZ2vOWKKitTn7NY0cQ8rZZoYcUHa9e3Oi27fs7x>
I0811 09:51:20.139393    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <6aysq76I4eolY7TqJnXSumPLdic2tS2dscXpj8QfmnHiCSe89bvIboHv/mz2E3NWX7jv9a/fduqdPz9sVuukeSdObf1t8/e6zmna4Zwpkc7aWLFIWbc8Xe5opyArybd+1DS6k41KD3CWm5rOahJRG5EeBcEnGeaGxcsI2Jm8Dbe80IxLUZMIYTUUa5J51HaCTWIjVoHg>
I0811 09:51:20.139397    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <AGfZsEsQjqCI7Zhk2SSfO5F0LgC7buy+rX7+4Dvhfbq3+82UlfvdLbVf8rznmsk7TDmoua1p22Rbpn35f23aHNxk6d5/31bcPXXRZSte2MP1/bEZTaL2g1vyU9rak22n/WZF4KXm6YNnDTyx3QPTv7f9vb98JbbjyUsXf2sse5T7kD/vwh6WdLVNYl8L57B/88m2ZSdf>
I0811 09:51:20.139401    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <NEp/9SOte5/nDjlgweZFLbr0ldCB/uNe+PtrR3f9dNotyT0PvHCk66DBXX579ZrbTzs9P/eao1svUg7oeuWZ/W+/6u9/+c2tm+ZnPnfzcaGNTrjcWfnomWptRei4l5fnNx484YKFI09OuunaWsvPPm1kf/svjiyCCzqiGQhWIajKwiqIOiCqh3ijjkLuLJgrijLKWK0b>
I0811 09:51:20.139405    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <Wff5TU3NsduOeGjsrrfPEq454rnvP3Cya/vJYnJgsrZgykFT26ZgaCfNcd980k4v/v7li/beeN8j3l7R8WT7EReUh43Tflnd4gBPufBvjtv0s1fUvxU6Vf3tfv/VPXuT8gVXnPfC79PZo+fRA6aND196R/RI6u4//6xrR+a/dnd+YLfYzgvPf3LzLe6+o/3R/747Ez0F>
I0811 09:51:20.139409    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: </MUPN7d89qJEAA4lvsBGbYoOiocqKFuJyBoLzKImGoqDIFaHgbFktig/5/r94KK8//zMX4948q0XOpXJQ3MKm8+/dv4LN69flPT6K5oOO+O1mbsfmT3srscOvXHWD769+Klr93n8mcOmGr+6a/q+WJQvOjtoy3eUd7vp3kvrPzxpi61+dEZu99RThRdu2fi0tn2vfut3>
I0811 09:51:20.139413    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <nzi4O1z41Mrh1C2nzLvDue3wx/jE4vvuOPIY3zG3rr7wmMMe167bLrnnHec8efqzxy1fs6t+9TPz313ed/vU4gMvbjz1xdYpR5z5kz9H22bccMvp5575xN9e23zkxd2u+vnYQYE96BTvfTv4rtx1zeOP/2h+yzEt89Ztuzrxvtyzx0PT3PVLXg291OfZ4yL71vVv+MRe>
I0811 09:51:20.139417    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <KKXxw5PuOHzNAbM0PzV/GZxXueDbk68NLJn/6LvCGcvwhvu/fdzzJ+6/Nv7q+NCSh07de5u1G08ufn/sqQuOHf/rT8/73mOntJ49Y/Kk9/6s/+79j/7JN034fMrE77Z6ZOFHrnlo5OlnV+aPdl+8zyNzd1VntD0dajv+weVHzg3OyF06/d3HHvonTb7/MVc4cfPayrMf>
I0811 09:51:20.139421    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <7r11bZ7udcaZzjtb3j/rGl/7dYvF07818/jz56/9++g2J7w9vuDlhz1rt94n8lntbejf76Xs/nj70dcUDtr+vlMiz//vdlN2/OEy4jmq5fYHrUv+32XJ4ruf8ee9cdy6iY3qx//8p0TR77U/X22axP6+9/PHn/TV/OTQHXv3GH/6rY2GOkaWz7jn+0/eSK//4y+OW9jt>
I0811 09:51:20.139425    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <e9W58ag5mzx4+oLN5Z8cuOjxuX+bN+3cy2cJ/+wt7J9stvV+zwyHEucsP3KRc9jR6Xs2vsL/6r5/+nMgvNodu+KSlY/cf8sFuyx+95KrHjvzzrNu7P1n7TQ+/3JHYHrT/wcAik2zPqsAAA==>
I0811 09:51:20.139429    6115 oak_rust_attestation_verifier.cc:207] fcp.attest: <>
I0811 09:51:20.139433    4815 oak_rust_attestation_verifier.cc:207] foo: Some suffix text.
  )text");

  // Extract the serialized log record from the hardcoded logs above.
  records.clear();
  num_records = ExtractRecords(
      hardcoded_record, [&](Record record) { records.push_back(record); });
  EXPECT_EQ(num_records, 1);
  ASSERT_THAT(records, SizeIs(1));
  EXPECT_EQ(records[0].start_line, 4);
  EXPECT_EQ(records[0].end_line, 91);

  // Verify that the extracted record from the hardcoded logs above still
  // matches the original record at the top of this test.
  ASSERT_TRUE(parsed_record.ParseFromString(records[0].decompressed_record));
  EXPECT_THAT(parsed_record, EqualsProto(record));
}

// Tests that the record extractor can successfully extract multiple sequential
// records.
TEST(ExtractAttestationRecordsTest, ExtractRecordMultipleSuccessfully) {
  // Create a verification record with a good amount of data in it.
  confidentialcompute::AttestationVerificationRecord record1;
  auto encryption_config = GetKnownValidEncryptionConfig();
  *record1.mutable_attestation_evidence() =
      encryption_config.attestation_evidence();
  *record1.mutable_attestation_endorsements() =
      encryption_config.attestation_endorsements();
  *record1.mutable_data_access_policy()
       ->add_transforms()
       ->mutable_application()
       ->mutable_tag() = "some tag";

  confidentialcompute::AttestationVerificationRecord record2 = record1;
  *record2.mutable_data_access_policy()
       ->add_transforms()
       ->mutable_application()
       ->mutable_tag() = "another tag";

  // Call the LogSerializedVerificationRecord function twice and gather the log
  // records it emits.
  TestLogSink log_sink;
  absl::AddLogSink(&log_sink);
  LogSerializedVerificationRecord(record1);
  LogSerializedVerificationRecord(record2);
  absl::RemoveLogSink(&log_sink);

  // Extract the serialized log records from the stream. There should be two.
  std::vector<Record> records;
  int num_records = ExtractRecords(
      log_sink.stream(), [&](Record record) { records.push_back(record); });
  EXPECT_EQ(num_records, 2);
  ASSERT_THAT(records, SizeIs(2));
  EXPECT_NE(records[0].decompressed_record, records[1].decompressed_record);

  // Verify that the extracted records match the original records.
  fcp::confidentialcompute::AttestationVerificationRecord parsed_record;
  ASSERT_TRUE(parsed_record.ParseFromString(records[0].decompressed_record));
  EXPECT_THAT(parsed_record, EqualsProto(record1));
  ASSERT_TRUE(parsed_record.ParseFromString(records[1].decompressed_record));
  EXPECT_THAT(parsed_record, EqualsProto(record2));
}

// Tests that the utility ignores truncated records and continues extracting any
// other valid records that may still exist in the stream.
TEST(ExtractAttestationRecordsTest,
     IgnoreTruncatedRecordsAndInterleavedTextAndContinueExtracting) {
  std::stringstream hardcoded_record(R"text(
--- THIS IS A TRUNCATED RECORD (WE'VE REMOVED SOME OF ITS LINES), AND SHOULD BE IGNORED.
I0424 09:51:46.084833    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: This device is contributing data via the confidential aggregation protocol. The attestation verification record follows.
I0424 09:51:46.084886    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <H4sIAAAAAAAAA+1We1QTVx7OTEIIA1GeorwMWh6C4CSTJ4JAAFetUuVlhFPtJBMwAlFCQALWSkB8oC5aUAR5BYRgoWqxCLsqghalKpSCoqGgBSnKw1ZB3tIm9bC69bh2z3Z79o/9nTN3zv3ud3/39/vmu+cMpDCGDkIkwDBfB8TNBB73ewP4B9u4GfjNmitq+LE7Pu9Q>
I0424 09:51:46.084895    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <ycTAohFBW0vF38KD9vh+IvDzF1IDb8qn3pX7XMLlZ2Hukoxuua7BuhKfIXvdfVWp1ZwX/aMW2z6zwS16Unz/XMlJzD2l/QpSW7dy0e8u+r8USbOeZXyWp7zo8LHhsvvcFGLMyEDW4LTlrNT6rscpRV5Lfn5HzOj4tvzdegucL/HvQ1BU0u7gPvzdWw/3rmUfAC/U99pu>
I0424 09:51:46.084900    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: </LTbft/d3Ds/QWLZkgdhsqozAx6+y3df9vQOX5uQNxZ4e1mgNnUmvz4LwGmed533vxZPELkbef2HBrkdXUez4Z+DnirssnGGTOeYEGfHKxNjksA882qVlfhR7P5NETGjO86/Lc9y5VUfSg4lUYndXE31XznaLu1omJtlnZ5nGXtxH2f3caOqjij9I0UrrioWu/zg7nDp>
< SNIP! >
I0424 09:51:46.084950    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <>
--- THIS IS A VALID RECORD WHICH SHOULD STILL BE EXTRACTED.
I0424 09:51:46.084833    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: This device is contributing data via the confidential aggregation protocol. The attestation verification record follows.
I0424 09:51:46.084886    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <H4sIAAAAAAAAA+1We1QTVx7OTEIIA1GeorwMWh6C4CSTJ4JAAFetUuVlhFPtJBMwAlFCQALWSkB8oC5aUAR5BYRgoWqxCLsqghalKpSCoqGgBSnKw1ZB3tIm9bC69bh2z3Z79o/9nTN3zv3ud3/39/vmu+cMpDCGDkIkwDBfB8TNBB73ewP4B9u4GfjNmitq+LE7Pu9Q>
I0424 09:51:46.084895    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <ycTAohFBW0vF38KD9vh+IvDzF1IDb8qn3pX7XMLlZ2Hukoxuua7BuhKfIXvdfVWp1ZwX/aMW2z6zwS16Unz/XMlJzD2l/QpSW7dy0e8u+r8USbOeZXyWp7zo8LHhsvvcFGLMyEDW4LTlrNT6rscpRV5Lfn5HzOj4tvzdegucL/HvQ1BU0u7gPvzdWw/3rmUfAC/U99pu>
I0424 09:51:46.084900    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: </LTbft/d3Ds/QWLZkgdhsqozAx6+y3df9vQOX5uQNxZ4e1mgNnUmvz4LwGmed533vxZPELkbef2HBrkdXUez4Z+DnirssnGGTOeYEGfHKxNjksA882qVlfhR7P5NETGjO86/Lc9y5VUfSg4lUYndXE31XznaLu1omJtlnZ5nGXtxH2f3caOqjij9I0UrrioWu/zg7nDp>
I0424 09:51:46.084903    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <z+zx//H2MAstAUAwQOGDqBRuGTY/lV+/IZPB0S3TARDelpAIUgBrHmVLb1wTacv2/aWHMaOwEfOckZ99PbcluhBUuKkYm+T0mgU8SvuXqe97fPfwp679q0BXk4hPFWnbizhHr5h0u/g3L7XkfGh4mwB9S0j2KgBsCwh+ntGyyEihVCIS+Hh5+3vSGMwNwNBJIM4epdEZ>
I0424 09:51:46.084906    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <CIKhKA3BOAwaIxRGMQFbwGdxWBwEZiEYEipk0GEUjLPnYyiGsEPZNCGfJsRQNQOjM9FQDo3BYfGZQj4Ch2JCGsZywf3Fez3vZZsXy9ljzl8Mlhxr3TJuc6yyH37R1faqTZtzXnv395pzTA6qUjwe3LsyVssAnlR3ROierxSf1FVEqtv0w5X3SJKO93jairiKcaZoV5Xx>
I0424 09:51:46.084912    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <8aQft9RcUx6MC7+iQ9IcxuNScJp3cIlm/KhAM4bzKH83zuVZ3eW12mY1Ja8ubTwD8J91nXKmoNrv8fM36u3x0tDQGbJjJi/yuFaxVl1G2w70UdO3YHxPVb7vj6VAMnOk3IB7TEOLiBRsFUdvjRC6SaUyf1gD8Wf2r/6GIicXC4junru/Ni55hL+140TBClfsEbM9mUio>
I0424 09:51:46.084915    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <nKjV0AQz5Hd5REPDZsj29FRP58Ty4IzwkWCKuIt461aUQ9qWg/QKx/iIwxfmzNPQhDPk9rKve2tqcGLHlIXKJWabbin68EcWutqeTQqquDBRR+3necyH7Ig3mkz05E7ym+Rom35MkB9PDhgGHKsBG2Y5Y+1UQJrp7DXp3ZtzVzWjYZsGwCDblPznezfJZ4splYV1dLPz>
I0424 09:51:46.084918    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <WtA18O2+4j3W2Or3ekVtK2YoRuXwqSgDRTkwm4kx2RgD49MZHAZCxegoLGQgbD6bKnxpK+9iAAADtjZnmwWXkiI33273yaC25vewq6zwbCtCohaFoPbV1ReXwhzfmxR+UdH6tPgFBcYuz/XLXZyQsmci4GvV5CXZ66YJUWjG0BkB5ywruD6wMCZaaWZ9urqMxwuL6ZGu>
I0424 09:51:46.084921    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <T3OOec7dUWPyoUOnhiZ6SfZQi9mo3+TU1zevz9pZ6IN2f0MXg2MWseM5O5bAUkulVWPxotNncHezVrV7RQkOZCch8xat5I7daKd6DFpGBGwvaDTs+xdKbgB0/00paSgHRRAalcNC6RyYI6CFhmIYnc9Ro3QqzOYIBRiCslDq6zfUIQuxPlaUdmLJi9bqLLr+voGWkoLX>
I0424 09:51:46.084923    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <buj0Y9bTpHO6UTZ1ueuIhqnn6qYSKz1UvZ0JbbvymL3Z6hs67nyWd0q2ItxtOG5u0BcdUqbLMsppVUnM91Nn00yn+gf/MLGd7jgpJWCrxIdwefTI7cz1JuselGRXW+yE1+KT8hi12f0T8ccsxRnaEQYiuWnEXIVKvprr4fQdO1N5+nuhjradoQqC2iCoFYKaIViutQaW>
I0424 09:51:46.084926    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <g1P5eFAtAoCDlxN1HFJWpIySAQCCOfmzYTJR56OUFYAQTwBBLVyBBWz2ikH6zapCnQUuVA8AnEA1hg2J+ECCrp6ujzhMJBYKJSJxGFUX1tGgRCMw0H+Goq2n64+KpSjFKwKVoDMUkh7o5UmdD1tqJpDeHE8sFhULhBhljUgg2UrxFsaKBMJoqiGsryHg9XT8fYKc1ogi>
I0424 09:51:46.084930    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <UDFsZUqm0WEERqgcOp3BDDYlI9TXpnD8n1WcATz7ZXEkTXFBXj7vw7HqerXVAja6gQBRyzGRgFuA5+MI3rm0ss6QI432uSjxfmu8kh2L8GIejzRGfTP5SBogGOrf1mIO7V52uLNGnCUMOOxUAHYImFVzTw0oS1qrRpbrhtQPuYWPz6uvzC+85t1kIdjItjPtzq7Y+sGd>
I0424 09:51:46.084933    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <4LQhmfveQjlgCssBI/XpOo5EgACciAMAAl7zyU1fISABmkP6VUMnLgwbEKGZBfyvXPw/QeDL7a9DhDchrTch4puQ9psQXgNpPsIriERQ2wzXDK95VTGB4PGf/kn/UZ7Hy9UthNQ1rLpnzQzdOV9V5aUFrdUFDu5rnwRP0nhCn4nyzwMO3e5cLJFuIh25eRzJlu4SzHLf>
I0424 09:51:46.084936    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <CcR91ay9DRkxCJmYP/aEGzrBIrP4SCQ2XLthD0e2gLy8p+1O/br7ZRvKXRJXSosTGnKcfV2rM0XNgf2Z40uT9NK7bpROzOtYvEEhPp+ckOCxiBRvb1F24PHmsoIM0tINOclK5tB2o0NWI7TU+qTeSNKqi+N5pWzV3Bbvo+kHnvpO6vGZvd9eLu+vXI/uMP60cKW13GLU>
I0424 09:51:46.084939    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <5P7zrJ794GmEyzegNvqtDvoMR0QmegcfDmZIoGytjrY8up/1qD2tptRuWOWiYP214fo6h0/KT1msvqDP1H9BMdYPj6SG3SHzT25poU2Tn1/KNEutkfzwYNnzINmwudvAs84vG+s/PpiMo7N45Pj8yYYAgCs5KcusmKx1yy0TLD3d6t4ivNtg7FdYu/Koeazl9emaQx98>
I0424 09:51:46.084941    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: </1CbpUKQncNuRaXK93FxTTn3Fp8ropwwq7Dd/ZWP0pFEDRlKFHnnmJfJbLqXHu5Lkw06+ZKbPLKHv/J0PnW4VzZMKLCrEB3alLqxp2SKG5XSuMJbsc5csJnsuucqfTrd2IF6Yld77bzr6ce1tAyMFwRcK/IMvrJv+0LXyUKdXKaR+GGDW4zR3SPnp+s6k6vC/bh2Npym>
I0424 09:51:46.084947    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <S80ezRQcpui4V+P6uZ6J2SxIzwyCSNFbI4UUKRr2C5kk3gSSDwAA>
I0424 09:51:46.084950    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <>
  )text");

  // Extract the serialized log record from the hardcoded logs above.
  std::vector<Record> records;
  int num_records = ExtractRecords(
      hardcoded_record, [&](Record record) { records.push_back(record); });
  EXPECT_EQ(num_records, 1);
  ASSERT_THAT(records, SizeIs(1));
  EXPECT_EQ(records[0].start_line, 11);
  EXPECT_EQ(records[0].end_line, 28);
}

// Tests that the utility ignores records with non-base64 data and continues
// extracting any other valid records that may still exist in the stream.
TEST(ExtractAttestationRecordsTest,
     IgnoreInvalidBase64RecordsAndInterleavedTextAndContinueExtracting) {
  std::stringstream hardcoded_record(R"text(
--- THIS IS A RECORD WITH NON-BASE64 CONTENT (IT HAS '%' CHARS), AND SHOULD BE IGNORED.
I0424 09:51:46.084833    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: This device is contributing data via the confidential aggregation protocol. The attestation verification record follows.
I0424 09:51:46.084886    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <%%%%%%%%AAAAA+1We1QTVx7OTEIIA1GeorwMWh6C4CSTJ4JAAFetUuVlhFPtJBMwAlFCQALWSkB8oC5aUAR5BYRgoWqxCLsqghalKpSCoqGgBSnKw1ZB3tIm9bC69bh2z3Z79o/9nTN3zv3ud3/39/vmu+cMpDCGDkIkwDBfB8TNBB73ewP4B9u4GfjNmitq+LE7Pu9Q>
I0424 09:51:46.084950    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <>
--- THIS IS A VALID RECORD WHICH SHOULD STILL BE EXTRACTED.
I0424 09:51:46.084833    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: This device is contributing data via the confidential aggregation protocol. The attestation verification record follows.
I0424 09:51:46.084886    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <H4sIAAAAAAAAA+1We1QTVx7OTEIIA1GeorwMWh6C4CSTJ4JAAFetUuVlhFPtJBMwAlFCQALWSkB8oC5aUAR5BYRgoWqxCLsqghalKpSCoqGgBSnKw1ZB3tIm9bC69bh2z3Z79o/9nTN3zv3ud3/39/vmu+cMpDCGDkIkwDBfB8TNBB73ewP4B9u4GfjNmitq+LE7Pu9Q>
I0424 09:51:46.084895    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <ycTAohFBW0vF38KD9vh+IvDzF1IDb8qn3pX7XMLlZ2Hukoxuua7BuhKfIXvdfVWp1ZwX/aMW2z6zwS16Unz/XMlJzD2l/QpSW7dy0e8u+r8USbOeZXyWp7zo8LHhsvvcFGLMyEDW4LTlrNT6rscpRV5Lfn5HzOj4tvzdegucL/HvQ1BU0u7gPvzdWw/3rmUfAC/U99pu>
I0424 09:51:46.084900    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: </LTbft/d3Ds/QWLZkgdhsqozAx6+y3df9vQOX5uQNxZ4e1mgNnUmvz4LwGmed533vxZPELkbef2HBrkdXUez4Z+DnirssnGGTOeYEGfHKxNjksA882qVlfhR7P5NETGjO86/Lc9y5VUfSg4lUYndXE31XznaLu1omJtlnZ5nGXtxH2f3caOqjij9I0UrrioWu/zg7nDp>
I0424 09:51:46.084903    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <z+zx//H2MAstAUAwQOGDqBRuGTY/lV+/IZPB0S3TARDelpAIUgBrHmVLb1wTacv2/aWHMaOwEfOckZ99PbcluhBUuKkYm+T0mgU8SvuXqe97fPfwp679q0BXk4hPFWnbizhHr5h0u/g3L7XkfGh4mwB9S0j2KgBsCwh+ntGyyEihVCIS+Hh5+3vSGMwNwNBJIM4epdEZ>
I0424 09:51:46.084906    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <CIKhKA3BOAwaIxRGMQFbwGdxWBwEZiEYEipk0GEUjLPnYyiGsEPZNCGfJsRQNQOjM9FQDo3BYfGZQj4Ch2JCGsZywf3Fez3vZZsXy9ljzl8Mlhxr3TJuc6yyH37R1faqTZtzXnv395pzTA6qUjwe3LsyVssAnlR3ROierxSf1FVEqtv0w5X3SJKO93jairiKcaZoV5Xx>
I0424 09:51:46.084912    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <8aQft9RcUx6MC7+iQ9IcxuNScJp3cIlm/KhAM4bzKH83zuVZ3eW12mY1Ja8ubTwD8J91nXKmoNrv8fM36u3x0tDQGbJjJi/yuFaxVl1G2w70UdO3YHxPVb7vj6VAMnOk3IB7TEOLiBRsFUdvjRC6SaUyf1gD8Wf2r/6GIicXC4junru/Ni55hL+140TBClfsEbM9mUio>
I0424 09:51:46.084915    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <nKjV0AQz5Hd5REPDZsj29FRP58Ty4IzwkWCKuIt461aUQ9qWg/QKx/iIwxfmzNPQhDPk9rKve2tqcGLHlIXKJWabbin68EcWutqeTQqquDBRR+3necyH7Ig3mkz05E7ym+Rom35MkB9PDhgGHKsBG2Y5Y+1UQJrp7DXp3ZtzVzWjYZsGwCDblPznezfJZ4splYV1dLPz>
I0424 09:51:46.084918    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <WtA18O2+4j3W2Or3ekVtK2YoRuXwqSgDRTkwm4kx2RgD49MZHAZCxegoLGQgbD6bKnxpK+9iAAADtjZnmwWXkiI33273yaC25vewq6zwbCtCohaFoPbV1ReXwhzfmxR+UdH6tPgFBcYuz/XLXZyQsmci4GvV5CXZ66YJUWjG0BkB5ywruD6wMCZaaWZ9urqMxwuL6ZGu>
I0424 09:51:46.084921    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <T3OOec7dUWPyoUOnhiZ6SfZQi9mo3+TU1zevz9pZ6IN2f0MXg2MWseM5O5bAUkulVWPxotNncHezVrV7RQkOZCch8xat5I7daKd6DFpGBGwvaDTs+xdKbgB0/00paSgHRRAalcNC6RyYI6CFhmIYnc9Ro3QqzOYIBRiCslDq6zfUIQuxPlaUdmLJi9bqLLr+voGWkoLX>
I0424 09:51:46.084923    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <buj0Y9bTpHO6UTZ1ueuIhqnn6qYSKz1UvZ0JbbvymL3Z6hs67nyWd0q2ItxtOG5u0BcdUqbLMsppVUnM91Nn00yn+gf/MLGd7jgpJWCrxIdwefTI7cz1JuselGRXW+yE1+KT8hi12f0T8ccsxRnaEQYiuWnEXIVKvprr4fQdO1N5+nuhjradoQqC2iCoFYKaIViutQaW>
I0424 09:51:46.084926    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <g1P5eFAtAoCDlxN1HFJWpIySAQCCOfmzYTJR56OUFYAQTwBBLVyBBWz2ikH6zapCnQUuVA8AnEA1hg2J+ECCrp6ujzhMJBYKJSJxGFUX1tGgRCMw0H+Goq2n64+KpSjFKwKVoDMUkh7o5UmdD1tqJpDeHE8sFhULhBhljUgg2UrxFsaKBMJoqiGsryHg9XT8fYKc1ogi>
I0424 09:51:46.084930    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <UDFsZUqm0WEERqgcOp3BDDYlI9TXpnD8n1WcATz7ZXEkTXFBXj7vw7HqerXVAja6gQBRyzGRgFuA5+MI3rm0ss6QI432uSjxfmu8kh2L8GIejzRGfTP5SBogGOrf1mIO7V52uLNGnCUMOOxUAHYImFVzTw0oS1qrRpbrhtQPuYWPz6uvzC+85t1kIdjItjPtzq7Y+sGd>
I0424 09:51:46.084933    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <4LQhmfveQjlgCssBI/XpOo5EgACciAMAAl7zyU1fISABmkP6VUMnLgwbEKGZBfyvXPw/QeDL7a9DhDchrTch4puQ9psQXgNpPsIriERQ2wzXDK95VTGB4PGf/kn/UZ7Hy9UthNQ1rLpnzQzdOV9V5aUFrdUFDu5rnwRP0nhCn4nyzwMO3e5cLJFuIh25eRzJlu4SzHLf>
I0424 09:51:46.084936    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <CcR91ay9DRkxCJmYP/aEGzrBIrP4SCQ2XLthD0e2gLy8p+1O/br7ZRvKXRJXSosTGnKcfV2rM0XNgf2Z40uT9NK7bpROzOtYvEEhPp+ckOCxiBRvb1F24PHmsoIM0tINOclK5tB2o0NWI7TU+qTeSNKqi+N5pWzV3Bbvo+kHnvpO6vGZvd9eLu+vXI/uMP60cKW13GLU>
I0424 09:51:46.084939    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <5P7zrJ794GmEyzegNvqtDvoMR0QmegcfDmZIoGytjrY8up/1qD2tptRuWOWiYP214fo6h0/KT1msvqDP1H9BMdYPj6SG3SHzT25poU2Tn1/KNEutkfzwYNnzINmwudvAs84vG+s/PpiMo7N45Pj8yYYAgCs5KcusmKx1yy0TLD3d6t4ivNtg7FdYu/Koeazl9emaQx98>
I0424 09:51:46.084941    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: </1CbpUKQncNuRaXK93FxTTn3Fp8ropwwq7Dd/ZWP0pFEDRlKFHnnmJfJbLqXHu5Lkw06+ZKbPLKHv/J0PnW4VzZMKLCrEB3alLqxp2SKG5XSuMJbsc5csJnsuucqfTrd2IF6Yld77bzr6ce1tAyMFwRcK/IMvrJv+0LXyUKdXKaR+GGDW4zR3SPnp+s6k6vC/bh2Npym>
I0424 09:51:46.084947    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <S80ezRQcpui4V+P6uZ6J2SxIzwyCSNFbI4UUKRr2C5kk3gSSDwAA>
I0424 09:51:46.084950    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <>
  )text");

  // Extract the serialized log record from the hardcoded logs above.
  std::vector<Record> records;
  int num_records = ExtractRecords(
      hardcoded_record, [&](Record record) { records.push_back(record); });
  EXPECT_EQ(num_records, 1);
  ASSERT_THAT(records, SizeIs(1));
  EXPECT_EQ(records[0].start_line, 8);
  EXPECT_EQ(records[0].end_line, 25);
}

// Tests that the utility ignores records with invalid compressed data (validly
// base64, but not validly gzipped data after base64 decoding) and continues
// extracting any other valid records that may still exist in the stream.
TEST(ExtractAttestationRecordsTest,
     IgnoreInvalidGzippedRecordsAndInterleavedTextAndContinueExtracting) {
  std::stringstream hardcoded_record(R"text(
--- THIS IS A RECORD WITH INVALID GZIPPED DATA (WE'VE REMOVED THE FIRST ENCODED CHARACTERS), AND SHOULD BE IGNORED.
I0424 09:51:46.084833    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: This device is contributing data via the confidential aggregation protocol. The attestation verification record follows.
I0424 09:51:46.084886    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <1We1QTVx7OTEIIA1GeorwMWh6C4CSTJ4JAAFetUuVlhFPtJBMwAlFCQALWSkB8oC5aUAR5BYRgoWqxCL>
I0424 09:51:46.084950    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <>
--- THIS IS A VALID RECORD WHICH SHOULD STILL BE EXTRACTED.
I0424 09:51:46.084833    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: This device is contributing data via the confidential aggregation protocol. The attestation verification record follows.
I0424 09:51:46.084886    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <H4sIAAAAAAAAA+1We1QTVx7OTEIIA1GeorwMWh6C4CSTJ4JAAFetUuVlhFPtJBMwAlFCQALWSkB8oC5aUAR5BYRgoWqxCLsqghalKpSCoqGgBSnKw1ZB3tIm9bC69bh2z3Z79o/9nTN3zv3ud3/39/vmu+cMpDCGDkIkwDBfB8TNBB73ewP4B9u4GfjNmitq+LE7Pu9Q>
I0424 09:51:46.084895    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <ycTAohFBW0vF38KD9vh+IvDzF1IDb8qn3pX7XMLlZ2Hukoxuua7BuhKfIXvdfVWp1ZwX/aMW2z6zwS16Unz/XMlJzD2l/QpSW7dy0e8u+r8USbOeZXyWp7zo8LHhsvvcFGLMyEDW4LTlrNT6rscpRV5Lfn5HzOj4tvzdegucL/HvQ1BU0u7gPvzdWw/3rmUfAC/U99pu>
I0424 09:51:46.084900    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: </LTbft/d3Ds/QWLZkgdhsqozAx6+y3df9vQOX5uQNxZ4e1mgNnUmvz4LwGmed533vxZPELkbef2HBrkdXUez4Z+DnirssnGGTOeYEGfHKxNjksA882qVlfhR7P5NETGjO86/Lc9y5VUfSg4lUYndXE31XznaLu1omJtlnZ5nGXtxH2f3caOqjij9I0UrrioWu/zg7nDp>
I0424 09:51:46.084903    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <z+zx//H2MAstAUAwQOGDqBRuGTY/lV+/IZPB0S3TARDelpAIUgBrHmVLb1wTacv2/aWHMaOwEfOckZ99PbcluhBUuKkYm+T0mgU8SvuXqe97fPfwp679q0BXk4hPFWnbizhHr5h0u/g3L7XkfGh4mwB9S0j2KgBsCwh+ntGyyEihVCIS+Hh5+3vSGMwNwNBJIM4epdEZ>
I0424 09:51:46.084906    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <CIKhKA3BOAwaIxRGMQFbwGdxWBwEZiEYEipk0GEUjLPnYyiGsEPZNCGfJsRQNQOjM9FQDo3BYfGZQj4Ch2JCGsZywf3Fez3vZZsXy9ljzl8Mlhxr3TJuc6yyH37R1faqTZtzXnv395pzTA6qUjwe3LsyVssAnlR3ROierxSf1FVEqtv0w5X3SJKO93jairiKcaZoV5Xx>
I0424 09:51:46.084912    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <8aQft9RcUx6MC7+iQ9IcxuNScJp3cIlm/KhAM4bzKH83zuVZ3eW12mY1Ja8ubTwD8J91nXKmoNrv8fM36u3x0tDQGbJjJi/yuFaxVl1G2w70UdO3YHxPVb7vj6VAMnOk3IB7TEOLiBRsFUdvjRC6SaUyf1gD8Wf2r/6GIicXC4junru/Ni55hL+140TBClfsEbM9mUio>
I0424 09:51:46.084915    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <nKjV0AQz5Hd5REPDZsj29FRP58Ty4IzwkWCKuIt461aUQ9qWg/QKx/iIwxfmzNPQhDPk9rKve2tqcGLHlIXKJWabbin68EcWutqeTQqquDBRR+3necyH7Ig3mkz05E7ym+Rom35MkB9PDhgGHKsBG2Y5Y+1UQJrp7DXp3ZtzVzWjYZsGwCDblPznezfJZ4splYV1dLPz>
I0424 09:51:46.084918    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <WtA18O2+4j3W2Or3ekVtK2YoRuXwqSgDRTkwm4kx2RgD49MZHAZCxegoLGQgbD6bKnxpK+9iAAADtjZnmwWXkiI33273yaC25vewq6zwbCtCohaFoPbV1ReXwhzfmxR+UdH6tPgFBcYuz/XLXZyQsmci4GvV5CXZ66YJUWjG0BkB5ywruD6wMCZaaWZ9urqMxwuL6ZGu>
I0424 09:51:46.084921    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <T3OOec7dUWPyoUOnhiZ6SfZQi9mo3+TU1zevz9pZ6IN2f0MXg2MWseM5O5bAUkulVWPxotNncHezVrV7RQkOZCch8xat5I7daKd6DFpGBGwvaDTs+xdKbgB0/00paSgHRRAalcNC6RyYI6CFhmIYnc9Ro3QqzOYIBRiCslDq6zfUIQuxPlaUdmLJi9bqLLr+voGWkoLX>
I0424 09:51:46.084923    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <buj0Y9bTpHO6UTZ1ueuIhqnn6qYSKz1UvZ0JbbvymL3Z6hs67nyWd0q2ItxtOG5u0BcdUqbLMsppVUnM91Nn00yn+gf/MLGd7jgpJWCrxIdwefTI7cz1JuselGRXW+yE1+KT8hi12f0T8ccsxRnaEQYiuWnEXIVKvprr4fQdO1N5+nuhjradoQqC2iCoFYKaIViutQaW>
I0424 09:51:46.084926    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <g1P5eFAtAoCDlxN1HFJWpIySAQCCOfmzYTJR56OUFYAQTwBBLVyBBWz2ikH6zapCnQUuVA8AnEA1hg2J+ECCrp6ujzhMJBYKJSJxGFUX1tGgRCMw0H+Goq2n64+KpSjFKwKVoDMUkh7o5UmdD1tqJpDeHE8sFhULhBhljUgg2UrxFsaKBMJoqiGsryHg9XT8fYKc1ogi>
I0424 09:51:46.084930    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <UDFsZUqm0WEERqgcOp3BDDYlI9TXpnD8n1WcATz7ZXEkTXFBXj7vw7HqerXVAja6gQBRyzGRgFuA5+MI3rm0ss6QI432uSjxfmu8kh2L8GIejzRGfTP5SBogGOrf1mIO7V52uLNGnCUMOOxUAHYImFVzTw0oS1qrRpbrhtQPuYWPz6uvzC+85t1kIdjItjPtzq7Y+sGd>
I0424 09:51:46.084933    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <4LQhmfveQjlgCssBI/XpOo5EgACciAMAAl7zyU1fISABmkP6VUMnLgwbEKGZBfyvXPw/QeDL7a9DhDchrTch4puQ9psQXgNpPsIriERQ2wzXDK95VTGB4PGf/kn/UZ7Hy9UthNQ1rLpnzQzdOV9V5aUFrdUFDu5rnwRP0nhCn4nyzwMO3e5cLJFuIh25eRzJlu4SzHLf>
I0424 09:51:46.084936    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <CcR91ay9DRkxCJmYP/aEGzrBIrP4SCQ2XLthD0e2gLy8p+1O/br7ZRvKXRJXSosTGnKcfV2rM0XNgf2Z40uT9NK7bpROzOtYvEEhPp+ckOCxiBRvb1F24PHmsoIM0tINOclK5tB2o0NWI7TU+qTeSNKqi+N5pWzV3Bbvo+kHnvpO6vGZvd9eLu+vXI/uMP60cKW13GLU>
I0424 09:51:46.084939    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <5P7zrJ794GmEyzegNvqtDvoMR0QmegcfDmZIoGytjrY8up/1qD2tptRuWOWiYP214fo6h0/KT1msvqDP1H9BMdYPj6SG3SHzT25poU2Tn1/KNEutkfzwYNnzINmwudvAs84vG+s/PpiMo7N45Pj8yYYAgCs5KcusmKx1yy0TLD3d6t4ivNtg7FdYu/Koeazl9emaQx98>
I0424 09:51:46.084941    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: </1CbpUKQncNuRaXK93FxTTn3Fp8ropwwq7Dd/ZWP0pFEDRlKFHnnmJfJbLqXHu5Lkw06+ZKbPLKHv/J0PnW4VzZMKLCrEB3alLqxp2SKG5XSuMJbsc5csJnsuucqfTrd2IF6Yld77bzr6ce1tAyMFwRcK/IMvrJv+0LXyUKdXKaR+GGDW4zR3SPnp+s6k6vC/bh2Npym>
I0424 09:51:46.084947    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <S80ezRQcpui4V+P6uZ6J2SxIzwyCSNFbI4UUKRr2C5kk3gSSDwAA>
I0424 09:51:46.084950    4815 oak_rust_attestation_verifier.cc:207] fcp.attest: <>
  )text");

  // Extract the serialized log record from the hardcoded logs above.
  std::vector<Record> records;
  int num_records = ExtractRecords(
      hardcoded_record, [&](Record record) { records.push_back(record); });
  EXPECT_EQ(num_records, 1);
  ASSERT_THAT(records, SizeIs(1));
  EXPECT_EQ(records[0].start_line, 8);
  EXPECT_EQ(records[0].end_line, 25);
}

// Tests that the utility ignores records that don't start with "fcp.attest",
// even if they otherwise contain valid record data.
TEST(ExtractAttestationRecordsTest, IgnoreDataNotTaggedWithFcpAttest) {
  std::stringstream hardcoded_record(R"text(
I0424 09:51:46.084833    4815 oak_rust_attestation_verifier.cc:207] fcp.foobar: This device is contributing data via the confidential aggregation protocol. The attestation verification record follows.
I0424 09:51:46.084886    4815 oak_rust_attestation_verifier.cc:207] fcp.foobar: <H4sIAAAAAAAAA+1We1QTVx7OTEIIA1GeorwMWh6C4CSTJ4JAAFetUuVlhFPtJBMwAlFCQALWSkB8oC5aUAR5BYRgoWqxCLsqghalKpSCoqGgBSnKw1ZB3tIm9bC69bh2z3Z79o/9nTN3zv3ud3/39/vmu+cMpDCGDkIkwDBfB8TNBB73ewP4B9u4GfjNmitq+LE7Pu9Q>
I0424 09:51:46.084895    4815 oak_rust_attestation_verifier.cc:207] fcp.foobar: <ycTAohFBW0vF38KD9vh+IvDzF1IDb8qn3pX7XMLlZ2Hukoxuua7BuhKfIXvdfVWp1ZwX/aMW2z6zwS16Unz/XMlJzD2l/QpSW7dy0e8u+r8USbOeZXyWp7zo8LHhsvvcFGLMyEDW4LTlrNT6rscpRV5Lfn5HzOj4tvzdegucL/HvQ1BU0u7gPvzdWw/3rmUfAC/U99pu>
I0424 09:51:46.084900    4815 oak_rust_attestation_verifier.cc:207] fcp.foobar: </LTbft/d3Ds/QWLZkgdhsqozAx6+y3df9vQOX5uQNxZ4e1mgNnUmvz4LwGmed533vxZPELkbef2HBrkdXUez4Z+DnirssnGGTOeYEGfHKxNjksA882qVlfhR7P5NETGjO86/Lc9y5VUfSg4lUYndXE31XznaLu1omJtlnZ5nGXtxH2f3caOqjij9I0UrrioWu/zg7nDp>
I0424 09:51:46.084903    4815 oak_rust_attestation_verifier.cc:207] fcp.foobar: <z+zx//H2MAstAUAwQOGDqBRuGTY/lV+/IZPB0S3TARDelpAIUgBrHmVLb1wTacv2/aWHMaOwEfOckZ99PbcluhBUuKkYm+T0mgU8SvuXqe97fPfwp679q0BXk4hPFWnbizhHr5h0u/g3L7XkfGh4mwB9S0j2KgBsCwh+ntGyyEihVCIS+Hh5+3vSGMwNwNBJIM4epdEZ>
I0424 09:51:46.084906    4815 oak_rust_attestation_verifier.cc:207] fcp.foobar: <CIKhKA3BOAwaIxRGMQFbwGdxWBwEZiEYEipk0GEUjLPnYyiGsEPZNCGfJsRQNQOjM9FQDo3BYfGZQj4Ch2JCGsZywf3Fez3vZZsXy9ljzl8Mlhxr3TJuc6yyH37R1faqTZtzXnv395pzTA6qUjwe3LsyVssAnlR3ROierxSf1FVEqtv0w5X3SJKO93jairiKcaZoV5Xx>
I0424 09:51:46.084912    4815 oak_rust_attestation_verifier.cc:207] fcp.foobar: <8aQft9RcUx6MC7+iQ9IcxuNScJp3cIlm/KhAM4bzKH83zuVZ3eW12mY1Ja8ubTwD8J91nXKmoNrv8fM36u3x0tDQGbJjJi/yuFaxVl1G2w70UdO3YHxPVb7vj6VAMnOk3IB7TEOLiBRsFUdvjRC6SaUyf1gD8Wf2r/6GIicXC4junru/Ni55hL+140TBClfsEbM9mUio>
I0424 09:51:46.084915    4815 oak_rust_attestation_verifier.cc:207] fcp.foobar: <nKjV0AQz5Hd5REPDZsj29FRP58Ty4IzwkWCKuIt461aUQ9qWg/QKx/iIwxfmzNPQhDPk9rKve2tqcGLHlIXKJWabbin68EcWutqeTQqquDBRR+3necyH7Ig3mkz05E7ym+Rom35MkB9PDhgGHKsBG2Y5Y+1UQJrp7DXp3ZtzVzWjYZsGwCDblPznezfJZ4splYV1dLPz>
I0424 09:51:46.084918    4815 oak_rust_attestation_verifier.cc:207] fcp.foobar: <WtA18O2+4j3W2Or3ekVtK2YoRuXwqSgDRTkwm4kx2RgD49MZHAZCxegoLGQgbD6bKnxpK+9iAAADtjZnmwWXkiI33273yaC25vewq6zwbCtCohaFoPbV1ReXwhzfmxR+UdH6tPgFBcYuz/XLXZyQsmci4GvV5CXZ66YJUWjG0BkB5ywruD6wMCZaaWZ9urqMxwuL6ZGu>
I0424 09:51:46.084921    4815 oak_rust_attestation_verifier.cc:207] fcp.foobar: <T3OOec7dUWPyoUOnhiZ6SfZQi9mo3+TU1zevz9pZ6IN2f0MXg2MWseM5O5bAUkulVWPxotNncHezVrV7RQkOZCch8xat5I7daKd6DFpGBGwvaDTs+xdKbgB0/00paSgHRRAalcNC6RyYI6CFhmIYnc9Ro3QqzOYIBRiCslDq6zfUIQuxPlaUdmLJi9bqLLr+voGWkoLX>
I0424 09:51:46.084923    4815 oak_rust_attestation_verifier.cc:207] fcp.foobar: <buj0Y9bTpHO6UTZ1ueuIhqnn6qYSKz1UvZ0JbbvymL3Z6hs67nyWd0q2ItxtOG5u0BcdUqbLMsppVUnM91Nn00yn+gf/MLGd7jgpJWCrxIdwefTI7cz1JuselGRXW+yE1+KT8hi12f0T8ccsxRnaEQYiuWnEXIVKvprr4fQdO1N5+nuhjradoQqC2iCoFYKaIViutQaW>
I0424 09:51:46.084926    4815 oak_rust_attestation_verifier.cc:207] fcp.foobar: <g1P5eFAtAoCDlxN1HFJWpIySAQCCOfmzYTJR56OUFYAQTwBBLVyBBWz2ikH6zapCnQUuVA8AnEA1hg2J+ECCrp6ujzhMJBYKJSJxGFUX1tGgRCMw0H+Goq2n64+KpSjFKwKVoDMUkh7o5UmdD1tqJpDeHE8sFhULhBhljUgg2UrxFsaKBMJoqiGsryHg9XT8fYKc1ogi>
I0424 09:51:46.084930    4815 oak_rust_attestation_verifier.cc:207] fcp.foobar: <UDFsZUqm0WEERqgcOp3BDDYlI9TXpnD8n1WcATz7ZXEkTXFBXj7vw7HqerXVAja6gQBRyzGRgFuA5+MI3rm0ss6QI432uSjxfmu8kh2L8GIejzRGfTP5SBogGOrf1mIO7V52uLNGnCUMOOxUAHYImFVzTw0oS1qrRpbrhtQPuYWPz6uvzC+85t1kIdjItjPtzq7Y+sGd>
I0424 09:51:46.084933    4815 oak_rust_attestation_verifier.cc:207] fcp.foobar: <4LQhmfveQjlgCssBI/XpOo5EgACciAMAAl7zyU1fISABmkP6VUMnLgwbEKGZBfyvXPw/QeDL7a9DhDchrTch4puQ9psQXgNpPsIriERQ2wzXDK95VTGB4PGf/kn/UZ7Hy9UthNQ1rLpnzQzdOV9V5aUFrdUFDu5rnwRP0nhCn4nyzwMO3e5cLJFuIh25eRzJlu4SzHLf>
I0424 09:51:46.084936    4815 oak_rust_attestation_verifier.cc:207] fcp.foobar: <CcR91ay9DRkxCJmYP/aEGzrBIrP4SCQ2XLthD0e2gLy8p+1O/br7ZRvKXRJXSosTGnKcfV2rM0XNgf2Z40uT9NK7bpROzOtYvEEhPp+ckOCxiBRvb1F24PHmsoIM0tINOclK5tB2o0NWI7TU+qTeSNKqi+N5pWzV3Bbvo+kHnvpO6vGZvd9eLu+vXI/uMP60cKW13GLU>
I0424 09:51:46.084939    4815 oak_rust_attestation_verifier.cc:207] fcp.foobar: <5P7zrJ794GmEyzegNvqtDvoMR0QmegcfDmZIoGytjrY8up/1qD2tptRuWOWiYP214fo6h0/KT1msvqDP1H9BMdYPj6SG3SHzT25poU2Tn1/KNEutkfzwYNnzINmwudvAs84vG+s/PpiMo7N45Pj8yYYAgCs5KcusmKx1yy0TLD3d6t4ivNtg7FdYu/Koeazl9emaQx98>
I0424 09:51:46.084941    4815 oak_rust_attestation_verifier.cc:207] fcp.foobar: </1CbpUKQncNuRaXK93FxTTn3Fp8ropwwq7Dd/ZWP0pFEDRlKFHnnmJfJbLqXHu5Lkw06+ZKbPLKHv/J0PnW4VzZMKLCrEB3alLqxp2SKG5XSuMJbsc5csJnsuucqfTrd2IF6Yld77bzr6ce1tAyMFwRcK/IMvrJv+0LXyUKdXKaR+GGDW4zR3SPnp+s6k6vC/bh2Npym>
I0424 09:51:46.084947    4815 oak_rust_attestation_verifier.cc:207] fcp.foobar: <S80ezRQcpui4V+P6uZ6J2SxIzwyCSNFbI4UUKRr2C5kk3gSSDwAA>
I0424 09:51:46.084950    4815 oak_rust_attestation_verifier.cc:207] fcp.foobar: <>
  )text");

  // Extract the serialized log record from the hardcoded logs above.
  std::vector<Record> records;
  int num_records = ExtractRecords(
      hardcoded_record, [&](Record record) { records.push_back(record); });
  EXPECT_EQ(num_records, 0);
  EXPECT_THAT(records, IsEmpty());
}

}  // namespace

}  // namespace fcp::client::attestation
