nsSSLStatus.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2. *
  3. * This Source Code Form is subject to the terms of the Mozilla Public
  4. * License, v. 2.0. If a copy of the MPL was not distributed with this
  5. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  6. #ifndef _NSSSLSTATUS_H
  7. #define _NSSSLSTATUS_H
  8. #include "CertVerifier.h" // For CertificateTransparencyInfo
  9. #include "nsISSLStatus.h"
  10. #include "nsCOMPtr.h"
  11. #include "nsXPIDLString.h"
  12. #include "nsIX509Cert.h"
  13. #include "nsISerializable.h"
  14. #include "nsIClassInfo.h"
  15. class nsNSSCertificate;
  16. enum class EVStatus {
  17. NotEV = 0,
  18. EV = 1,
  19. };
  20. class nsSSLStatus final
  21. : public nsISSLStatus
  22. , public nsISerializable
  23. , public nsIClassInfo
  24. {
  25. protected:
  26. virtual ~nsSSLStatus();
  27. public:
  28. NS_DECL_THREADSAFE_ISUPPORTS
  29. NS_DECL_NSISSLSTATUS
  30. NS_DECL_NSISERIALIZABLE
  31. NS_DECL_NSICLASSINFO
  32. nsSSLStatus();
  33. void SetServerCert(nsNSSCertificate* aServerCert, EVStatus aEVStatus);
  34. bool HasServerCert() {
  35. return mServerCert != nullptr;
  36. }
  37. void SetCertificateTransparencyInfo(
  38. const mozilla::psm::CertificateTransparencyInfo& info);
  39. /* public for initilization in this file */
  40. uint16_t mCipherSuite;
  41. uint16_t mProtocolVersion;
  42. uint16_t mCertificateTransparencyStatus;
  43. nsCString mKeaGroup;
  44. nsCString mSignatureSchemeName;
  45. bool mIsDomainMismatch;
  46. bool mIsNotValidAtThisTime;
  47. bool mIsUntrusted;
  48. bool mIsEV;
  49. bool mHasIsEVStatus;
  50. bool mHaveCipherSuiteAndProtocol;
  51. /* mHaveCertErrrorBits is relied on to determine whether or not a SPDY
  52. connection is eligible for joining in nsNSSSocketInfo::JoinConnection() */
  53. bool mHaveCertErrorBits;
  54. private:
  55. nsCOMPtr<nsIX509Cert> mServerCert;
  56. };
  57. // 600cd77a-e45c-4184-bfc5-55c87dbc4511
  58. #define NS_SSLSTATUS_CID \
  59. { 0x600cd77a, 0xe45c, 0x4184, \
  60. { 0xbf, 0xc5, 0x55, 0xc8, 0x7d, 0xbc, 0x45, 0x11 } }
  61. #endif