Skip to content

Commit 64c5e9a

Browse files
committed
Fix formatting
1 parent 914f887 commit 64c5e9a

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

lib/uid2encryption.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ DecryptTokenV3(const std::vector<std::uint8_t>& encryptedId, const KeyContainer&
143143
return DecryptionResult::MakeError(DecryptionStatus::INVALID_IDENTITY_SCOPE);
144144
}
145145

146-
/*const auto version = */reader.ReadByte();
146+
/*const auto version = */ reader.ReadByte();
147147

148148
const std::int32_t masterKeyId = reader.ReadInt32();
149149
const auto* const masterKey = keys.Get(masterKeyId);
@@ -152,20 +152,20 @@ DecryptTokenV3(const std::vector<std::uint8_t>& encryptedId, const KeyContainer&
152152
}
153153

154154
std::uint8_t masterPayload[256];
155-
if (reader.GetRemainingSize() > static_cast<int>(sizeof(masterPayload))){
155+
if (reader.GetRemainingSize() > static_cast<int>(sizeof(masterPayload))) {
156156
return DecryptionResult::MakeError(DecryptionStatus::INVALID_PAYLOAD);
157157
}
158158
const int masterPayloadLen = DecryptGCM(reader.GetCurrentData(), reader.GetRemainingSize(), masterKey->secret_.data(), masterPayload);
159159

160160
BigEndianByteReader masterPayloadReader(masterPayload, masterPayloadLen);
161161

162162
const Timestamp expires = Timestamp::FromEpochMilli(masterPayloadReader.ReadInt64());
163-
/*const Timestamp created = */Timestamp::FromEpochMilli(masterPayloadReader.ReadInt64());
163+
/*const Timestamp created = */ Timestamp::FromEpochMilli(masterPayloadReader.ReadInt64());
164164

165-
/*const auto operatorSiteId = */masterPayloadReader.ReadInt32();
166-
/*const auto operatorType = */masterPayloadReader.ReadByte();
167-
/*const auto operatorVersion = */masterPayloadReader.ReadInt32();
168-
/*const auto operatorClientKeyId = */masterPayloadReader.ReadInt32();
165+
/*const auto operatorSiteId = */ masterPayloadReader.ReadInt32();
166+
/*const auto operatorType = */ masterPayloadReader.ReadByte();
167+
/*const auto operatorVersion = */ masterPayloadReader.ReadInt32();
168+
/*const auto operatorClientKeyId = */ masterPayloadReader.ReadInt32();
169169

170170
const auto siteKeyId = masterPayloadReader.ReadInt32();
171171
const auto* const siteKey = keys.Get(siteKeyId);
@@ -182,12 +182,12 @@ DecryptTokenV3(const std::vector<std::uint8_t>& encryptedId, const KeyContainer&
182182
BigEndianByteReader sitePayloadReader(sitePayload, sitePayloadLen);
183183

184184
const auto siteId = sitePayloadReader.ReadInt32();
185-
/*const auto publisherId = */sitePayloadReader.ReadInt64();
186-
/*const auto publisherKeyId = */sitePayloadReader.ReadInt32();
185+
/*const auto publisherId = */ sitePayloadReader.ReadInt64();
186+
/*const auto publisherKeyId = */ sitePayloadReader.ReadInt32();
187187

188-
/*const auto privacyBits = */sitePayloadReader.ReadInt32();
188+
/*const auto privacyBits = */ sitePayloadReader.ReadInt32();
189189
const Timestamp established = Timestamp::FromEpochMilli(sitePayloadReader.ReadInt64());
190-
/*const Timestamp refreshed = */Timestamp::FromEpochMilli(sitePayloadReader.ReadInt64());
190+
/*const Timestamp refreshed = */ Timestamp::FromEpochMilli(sitePayloadReader.ReadInt64());
191191

192192
if (checkValidity && expires < now) {
193193
return DecryptionResult::MakeError(DecryptionStatus::EXPIRED_TOKEN, established, siteId, siteKey->siteId_);
@@ -314,7 +314,7 @@ static DecryptionDataResult DecryptDataV2(const std::vector<std::uint8_t>& encry
314314
}
315315

316316
const auto encryptedAt = Timestamp::FromEpochMilli(reader.ReadInt64());
317-
/*const int siteId = */reader.ReadInt32();
317+
/*const int siteId = */ reader.ReadInt32();
318318
const std::int64_t keyId = reader.ReadInt32();
319319
const auto* const key = keys.Get(keyId);
320320
if (key == nullptr) {
@@ -351,7 +351,7 @@ static DecryptionDataResult DecryptDataV3(const std::vector<std::uint8_t>& encry
351351

352352
BigEndianByteReader payloadReader(payload.data(), payloadLen);
353353
const auto encryptedAt = Timestamp::FromEpochMilli(payloadReader.ReadInt64());
354-
/*const int siteId = */payloadReader.ReadInt32();
354+
/*const int siteId = */ payloadReader.ReadInt32();
355355

356356
return DecryptionDataResult::MakeSuccess({payloadReader.GetCurrentData(), payloadReader.GetCurrentData() + payloadReader.GetRemainingSize()}, encryptedAt);
357357
}

0 commit comments

Comments
 (0)