From 25079451c70cf8e3334f09efd83a4ca29f4de5fc Mon Sep 17 00:00:00 2001 From: Zale Young Date: Tue, 23 Jan 2024 15:34:47 -0800 Subject: [PATCH] clang-format some files related to fizz Certificates Summary: Some files from a previous commit were not formatted correctly. Run clang-format on them to correct. Reviewed By: mingtaoy Differential Revision: D52814984 fbshipit-source-id: cbc80de90ee539a895e7cb8e95918124d94223bf --- fizz/protocol/OpenSSLPeerCertImpl.h | 4 ++-- fizz/protocol/OpenSSLSelfCertImpl-inl.h | 2 +- fizz/protocol/OpenSSLSelfCertImpl.h | 14 +++++++------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/fizz/protocol/OpenSSLPeerCertImpl.h b/fizz/protocol/OpenSSLPeerCertImpl.h index 4354db28d74..387a2a6fa4e 100644 --- a/fizz/protocol/OpenSSLPeerCertImpl.h +++ b/fizz/protocol/OpenSSLPeerCertImpl.h @@ -21,7 +21,7 @@ class OpenSSLPeerCertImpl : public PeerCert { ~OpenSSLPeerCertImpl() override = default; - std::string getIdentity() const override; + [[nodiscard]] std::string getIdentity() const override; void verify( SignatureScheme scheme, @@ -29,7 +29,7 @@ class OpenSSLPeerCertImpl : public PeerCert { folly::ByteRange toBeSigned, folly::ByteRange signature) const override; - folly::ssl::X509UniquePtr getX509() const override; + [[nodiscard]] folly::ssl::X509UniquePtr getX509() const override; protected: OpenSSLSignature signature_; diff --git a/fizz/protocol/OpenSSLSelfCertImpl-inl.h b/fizz/protocol/OpenSSLSelfCertImpl-inl.h index 4cc700c5291..60731ea72b8 100644 --- a/fizz/protocol/OpenSSLSelfCertImpl-inl.h +++ b/fizz/protocol/OpenSSLSelfCertImpl-inl.h @@ -30,7 +30,7 @@ OpenSSLSelfCertImpl::OpenSSLSelfCertImpl( std::vector certs, const std::vector>& compressors) { - if (certs.size() == 0) { + if (certs.empty()) { throw std::runtime_error("Must supply at least 1 cert"); } if (X509_check_private_key(certs[0].get(), pkey.get()) != 1) { diff --git a/fizz/protocol/OpenSSLSelfCertImpl.h b/fizz/protocol/OpenSSLSelfCertImpl.h index 4aac521a7f6..e5741d0d0bd 100644 --- a/fizz/protocol/OpenSSLSelfCertImpl.h +++ b/fizz/protocol/OpenSSLSelfCertImpl.h @@ -30,24 +30,24 @@ class OpenSSLSelfCertImpl : public SelfCert { ~OpenSSLSelfCertImpl() override = default; - std::string getIdentity() const override; + [[nodiscard]] std::string getIdentity() const override; - std::vector getAltIdentities() const override; + [[nodiscard]] std::vector getAltIdentities() const override; - std::vector getSigSchemes() const override; + [[nodiscard]] std::vector getSigSchemes() const override; - CertificateMsg getCertMessage( + [[nodiscard]] CertificateMsg getCertMessage( Buf certificateRequestContext = nullptr) const override; - CompressedCertificate getCompressedCert( + [[nodiscard]] CompressedCertificate getCompressedCert( CertificateCompressionAlgorithm algo) const override; - Buf sign( + [[nodiscard]] Buf sign( SignatureScheme scheme, CertificateVerifyContext context, folly::ByteRange toBeSigned) const override; - folly::ssl::X509UniquePtr getX509() const override; + [[nodiscard]] folly::ssl::X509UniquePtr getX509() const override; protected: // Allows derived classes to handle init