1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set sw=2 ts=8 et tw=80 : */
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/. */
8 #ifndef mozilla_psm_VerifySSLServerCertParent_h__
9 #define mozilla_psm_VerifySSLServerCertParent_h__
11 #include "mozilla/psm/PVerifySSLServerCertParent.h"
12 #include "mozpkix/Time.h"
13 #include "ScopedNSSTypes.h"
14 #include "SharedCertVerifier.h"
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
25 class VerifySSLServerCertParent
: public PVerifySSLServerCertParent
{
27 NS_INLINE_DECL_THREADSAFE_REFCOUNTING(VerifySSLServerCertParent
, override
)
29 VerifySSLServerCertParent();
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
);
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
);
49 virtual ~VerifySSLServerCertParent();
51 // PVerifySSLServerCertParent
52 void ActorDestroy(ActorDestroyReason aWhy
) override
;
54 nsCOMPtr
<nsISerialEventTarget
> mBackgroundThread
;
58 } // namespace mozilla
60 #endif // mozilla_psm_VerifySSLServerCertParent_h__