Skip to content

Commit

Permalink
clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
bifurcation committed Aug 26, 2023
1 parent a449211 commit 840a39f
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
4 changes: 3 additions & 1 deletion include/mls/credential.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,9 @@ namespace tls {

TLS_VARIANT_MAP(mls::CredentialType, mls::BasicCredential, basic)
TLS_VARIANT_MAP(mls::CredentialType, mls::X509Credential, x509)
TLS_VARIANT_MAP(mls::CredentialType, mls::UserInfoVCCredential, userinfo_vc_draft_00)
TLS_VARIANT_MAP(mls::CredentialType,
mls::UserInfoVCCredential,
userinfo_vc_draft_00)
TLS_VARIANT_MAP(mls::CredentialType, mls::MultiCredential, multi_draft_00)

} // namespace tls
3 changes: 2 additions & 1 deletion lib/hpke/src/rsa.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ struct RSASignature : public Signature
const std::string& json_str) const override;
std::unique_ptr<Signature::PublicKey> import_jwk(
const std::string& json_str) const override;
std::string export_jwk_private(const Signature::PrivateKey& sk) const override;
std::string export_jwk_private(
const Signature::PrivateKey& sk) const override;
std::string export_jwk(const Signature::PublicKey& pk) const override;

private:
Expand Down
2 changes: 1 addition & 1 deletion lib/hpke/src/signature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ struct GroupSignature : public Signature
const auto jwk_json = validate_jwk_json(json_str, true);

const auto d = from_base64url(jwk_json["d"]);
auto gsk = group.deserialize_private(d);
auto gsk = group.deserialize_private(d);

return std::make_unique<PrivateKey>(gsk.release());
}
Expand Down
6 changes: 4 additions & 2 deletions lib/hpke/test/signature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ TEST_CASE("Signature Key JWK Round-Trip")
Signature::ID::Ed448,
};


for (const auto& id : ids) {
if (fips() && fips_disable(id)) {
continue;
Expand Down Expand Up @@ -282,6 +281,8 @@ TEST_CASE("Signature Key JWK Known-Answer")
std::string jwk_pub;
};

// XXX(RLB) clang-format wants to indent this really far to the right.
// clang-format off
const std::vector<KnownAnswerTest> cases{
{
Signature::ID::P256_SHA256,
Expand Down Expand Up @@ -358,8 +359,9 @@ TEST_CASE("Signature Key JWK Known-Answer")
"kty": "OKP",
"x":"0P_035gQbBr8mHe_4uLu8wUI22JiSBYWq9Yzb3Tr3C4ksfv85Xo5OIRrWzE-L0QFRez78nrNA4wA"
})",
}
},
};
// clang-format on

for (const auto& tc : cases) {
const auto& sig = select_signature(tc.id);
Expand Down
5 changes: 3 additions & 2 deletions src/credential.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,9 @@ operator==(const X509Credential& lhs, const X509Credential& rhs)
/// UserInfoVCCredential
///
UserInfoVCCredential::UserInfoVCCredential(bytes userinfo_vc_jwt)
: userinfo_vc_jwt(std::move(userinfo_vc_jwt))
{}
: userinfo_vc_jwt(std::move(userinfo_vc_jwt))
{
}

bool
UserInfoVCCredential::valid_for(const SignaturePublicKey& /* pub */) const
Expand Down
4 changes: 2 additions & 2 deletions test/crypto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ TEST_CASE("Signature Key JWK Import/Export")
const auto pub = priv.public_key;

const auto encoded_priv = priv.to_jwk(suite);
const auto decoded_priv = SignaturePrivateKey::from_jwk(suite, encoded_priv);
const auto decoded_priv =
SignaturePrivateKey::from_jwk(suite, encoded_priv);
REQUIRE(decoded_priv == priv);


const auto encoded_pub = pub.to_jwk(suite);
const auto decoded_pub = SignaturePublicKey::from_jwk(suite, encoded_pub);
REQUIRE(decoded_pub == pub);
Expand Down

0 comments on commit 840a39f

Please sign in to comment.