VerifySSLServerCertParent.h (2254B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set sw=2 ts=8 et tw=80 : */ 3 4 /* This Source Code Form is subject to the terms of the Mozilla Public 5 * License, v. 2.0. If a copy of the MPL was not distributed with this 6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 7 8 #ifndef mozilla_psm_VerifySSLServerCertParent_h__ 9 #define mozilla_psm_VerifySSLServerCertParent_h__ 10 11 #include "mozilla/psm/PVerifySSLServerCertParent.h" 12 #include "mozpkix/Time.h" 13 #include "ScopedNSSTypes.h" 14 #include "SharedCertVerifier.h" 15 16 namespace mozilla { 17 namespace psm { 18 19 // This class implements the main process side of the server certificate 20 // verification for socket process. 21 // SSLServerCertVerificationJob::Dispatch is called in 22 // VerifySSLServerCertParent::Dispatch with IPCServerCertVerificationResult and 23 // the result of the certificate verification will be sent to the socket process 24 // via IPC. 25 class VerifySSLServerCertParent : public PVerifySSLServerCertParent { 26 public: 27 NS_INLINE_DECL_THREADSAFE_REFCOUNTING(VerifySSLServerCertParent, override) 28 29 VerifySSLServerCertParent(); 30 31 bool Dispatch(nsTArray<ByteArray>&& aPeerCertChain, 32 const nsACString& aHostName, const int32_t& aPort, 33 const OriginAttributes& aOriginAttributes, 34 const Maybe<ByteArray>& aStapledOCSPResponse, 35 const Maybe<ByteArray>& aSctsFromTLSExtension, 36 const Maybe<DelegatedCredentialInfoArg>& aDcInfo, 37 const uint32_t& aProviderFlags, 38 const uint32_t& aCertVerifierFlags); 39 40 void OnVerifiedSSLServerCert( 41 const nsTArray<ByteArray>& aBuiltCertChain, 42 uint16_t aCertificateTransparencyStatus, EVStatus aEVStatus, 43 bool aSucceeded, PRErrorCode aFinalError, 44 nsITransportSecurityInfo::OverridableErrorCategory 45 aOverridableErrorCategory, 46 bool aIsBuiltCertChainRootBuiltInRoot, bool aMadeOCSPRequests); 47 48 private: 49 virtual ~VerifySSLServerCertParent(); 50 51 // PVerifySSLServerCertParent 52 void ActorDestroy(ActorDestroyReason aWhy) override; 53 54 nsCOMPtr<nsISerialEventTarget> mBackgroundThread; 55 }; 56 57 } // namespace psm 58 } // namespace mozilla 59 60 #endif // mozilla_psm_VerifySSLServerCertParent_h__