Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #ifndef __NS_CMS_H__ |
michael@0 | 7 | #define __NS_CMS_H__ |
michael@0 | 8 | |
michael@0 | 9 | #include "nsISupports.h" |
michael@0 | 10 | #include "nsCOMPtr.h" |
michael@0 | 11 | #include "nsXPIDLString.h" |
michael@0 | 12 | #include "nsIInterfaceRequestor.h" |
michael@0 | 13 | #include "nsICMSMessage.h" |
michael@0 | 14 | #include "nsICMSMessage2.h" |
michael@0 | 15 | #include "nsIX509Cert3.h" |
michael@0 | 16 | #include "nsVerificationJob.h" |
michael@0 | 17 | #include "nsICMSEncoder.h" |
michael@0 | 18 | #include "nsICMSDecoder.h" |
michael@0 | 19 | #include "sechash.h" |
michael@0 | 20 | #include "cms.h" |
michael@0 | 21 | #include "nsNSSShutDown.h" |
michael@0 | 22 | |
michael@0 | 23 | #define NS_CMSMESSAGE_CID \ |
michael@0 | 24 | { 0xa4557478, 0xae16, 0x11d5, { 0xba,0x4b,0x00,0x10,0x83,0x03,0xb1,0x17 } } |
michael@0 | 25 | |
michael@0 | 26 | class nsCMSMessage : public nsICMSMessage, |
michael@0 | 27 | public nsICMSMessage2, |
michael@0 | 28 | public nsNSSShutDownObject |
michael@0 | 29 | { |
michael@0 | 30 | public: |
michael@0 | 31 | NS_DECL_THREADSAFE_ISUPPORTS |
michael@0 | 32 | NS_DECL_NSICMSMESSAGE |
michael@0 | 33 | NS_DECL_NSICMSMESSAGE2 |
michael@0 | 34 | |
michael@0 | 35 | nsCMSMessage(); |
michael@0 | 36 | nsCMSMessage(NSSCMSMessage* aCMSMsg); |
michael@0 | 37 | virtual ~nsCMSMessage(); |
michael@0 | 38 | |
michael@0 | 39 | void referenceContext(nsIInterfaceRequestor* aContext) {m_ctx = aContext;} |
michael@0 | 40 | NSSCMSMessage* getCMS() {return m_cmsMsg;} |
michael@0 | 41 | private: |
michael@0 | 42 | nsCOMPtr<nsIInterfaceRequestor> m_ctx; |
michael@0 | 43 | NSSCMSMessage * m_cmsMsg; |
michael@0 | 44 | NSSCMSSignerInfo* GetTopLevelSignerInfo(); |
michael@0 | 45 | nsresult CommonVerifySignature(unsigned char* aDigestData, uint32_t aDigestDataLen); |
michael@0 | 46 | |
michael@0 | 47 | nsresult CommonAsyncVerifySignature(nsISMimeVerificationListener *aListener, |
michael@0 | 48 | unsigned char* aDigestData, uint32_t aDigestDataLen); |
michael@0 | 49 | |
michael@0 | 50 | virtual void virtualDestroyNSSReference(); |
michael@0 | 51 | void destructorSafeDestroyNSSReference(); |
michael@0 | 52 | |
michael@0 | 53 | friend class nsSMimeVerificationJob; |
michael@0 | 54 | }; |
michael@0 | 55 | |
michael@0 | 56 | // =============================================== |
michael@0 | 57 | // nsCMSDecoder - implementation of nsICMSDecoder |
michael@0 | 58 | // =============================================== |
michael@0 | 59 | |
michael@0 | 60 | #define NS_CMSDECODER_CID \ |
michael@0 | 61 | { 0x9dcef3a4, 0xa3bc, 0x11d5, { 0xba, 0x47, 0x00, 0x10, 0x83, 0x03, 0xb1, 0x17 } } |
michael@0 | 62 | |
michael@0 | 63 | class nsCMSDecoder : public nsICMSDecoder, |
michael@0 | 64 | public nsNSSShutDownObject |
michael@0 | 65 | { |
michael@0 | 66 | public: |
michael@0 | 67 | NS_DECL_THREADSAFE_ISUPPORTS |
michael@0 | 68 | NS_DECL_NSICMSDECODER |
michael@0 | 69 | |
michael@0 | 70 | nsCMSDecoder(); |
michael@0 | 71 | virtual ~nsCMSDecoder(); |
michael@0 | 72 | |
michael@0 | 73 | private: |
michael@0 | 74 | nsCOMPtr<nsIInterfaceRequestor> m_ctx; |
michael@0 | 75 | NSSCMSDecoderContext *m_dcx; |
michael@0 | 76 | virtual void virtualDestroyNSSReference(); |
michael@0 | 77 | void destructorSafeDestroyNSSReference(); |
michael@0 | 78 | }; |
michael@0 | 79 | |
michael@0 | 80 | // =============================================== |
michael@0 | 81 | // nsCMSEncoder - implementation of nsICMSEncoder |
michael@0 | 82 | // =============================================== |
michael@0 | 83 | |
michael@0 | 84 | #define NS_CMSENCODER_CID \ |
michael@0 | 85 | { 0xa15789aa, 0x8903, 0x462b, { 0x81, 0xe9, 0x4a, 0xa2, 0xcf, 0xf4, 0xd5, 0xcb } } |
michael@0 | 86 | class nsCMSEncoder : public nsICMSEncoder, |
michael@0 | 87 | public nsNSSShutDownObject |
michael@0 | 88 | { |
michael@0 | 89 | public: |
michael@0 | 90 | NS_DECL_THREADSAFE_ISUPPORTS |
michael@0 | 91 | NS_DECL_NSICMSENCODER |
michael@0 | 92 | |
michael@0 | 93 | nsCMSEncoder(); |
michael@0 | 94 | virtual ~nsCMSEncoder(); |
michael@0 | 95 | |
michael@0 | 96 | private: |
michael@0 | 97 | nsCOMPtr<nsIInterfaceRequestor> m_ctx; |
michael@0 | 98 | NSSCMSEncoderContext *m_ecx; |
michael@0 | 99 | virtual void virtualDestroyNSSReference(); |
michael@0 | 100 | void destructorSafeDestroyNSSReference(); |
michael@0 | 101 | }; |
michael@0 | 102 | |
michael@0 | 103 | #endif |