tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

TransportSecurityInfoUtils.h (1699B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 #ifndef mozilla_ipc_TransportSecurityInfoUtils_h
      6 #define mozilla_ipc_TransportSecurityInfoUtils_h
      7 
      8 #include "CertVerifier.h"
      9 #include "ipc/EnumSerializer.h"
     10 #include "mozilla/RefPtr.h"
     11 #include "nsITransportSecurityInfo.h"
     12 #include "nsIX509Cert.h"
     13 
     14 class MessageReader;
     15 class MessageWriter;
     16 
     17 namespace IPC {
     18 
     19 template <typename>
     20 struct ParamTraits;
     21 
     22 template <>
     23 struct ParamTraits<nsITransportSecurityInfo*> {
     24  static void Write(MessageWriter* aWriter, nsITransportSecurityInfo* aParam);
     25  static bool Read(MessageReader* aReader,
     26                   RefPtr<nsITransportSecurityInfo>* aResult);
     27 };
     28 
     29 template <>
     30 struct ParamTraits<nsIX509Cert*> {
     31  static void Write(MessageWriter* aWriter, nsIX509Cert* aCert);
     32  static bool Read(MessageReader* aReader, RefPtr<nsIX509Cert>* aResult);
     33 };
     34 
     35 template <>
     36 struct ParamTraits<nsITransportSecurityInfo::OverridableErrorCategory>
     37    : public ContiguousEnumSerializerInclusive<
     38          nsITransportSecurityInfo::OverridableErrorCategory,
     39          nsITransportSecurityInfo::OverridableErrorCategory::ERROR_UNSET,
     40          nsITransportSecurityInfo::OverridableErrorCategory::ERROR_TIME> {};
     41 
     42 template <>
     43 struct ParamTraits<mozilla::psm::EVStatus>
     44    : public ContiguousEnumSerializerInclusive<mozilla::psm::EVStatus,
     45                                               mozilla::psm::EVStatus::NotEV,
     46                                               mozilla::psm::EVStatus::EV> {};
     47 
     48 }  // namespace IPC
     49 
     50 #endif  // mozilla_ipc_TransportSecurityInfoUtils_h