diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /comm/mailnews/mime/cthandlers/pgpmime/nsPgpMimeProxy.h | |
parent | Initial commit. (diff) | |
download | thunderbird-upstream.tar.xz thunderbird-upstream.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'comm/mailnews/mime/cthandlers/pgpmime/nsPgpMimeProxy.h')
-rw-r--r-- | comm/mailnews/mime/cthandlers/pgpmime/nsPgpMimeProxy.h | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/comm/mailnews/mime/cthandlers/pgpmime/nsPgpMimeProxy.h b/comm/mailnews/mime/cthandlers/pgpmime/nsPgpMimeProxy.h new file mode 100644 index 0000000000..e115be2ddd --- /dev/null +++ b/comm/mailnews/mime/cthandlers/pgpmime/nsPgpMimeProxy.h @@ -0,0 +1,73 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef _nsPgpmimeDecrypt_h_ +#define _nsPgpmimeDecrypt_h_ + +#include "mimecth.h" +#include "nsIPgpMimeProxy.h" +#include "nsCOMPtr.h" +#include "nsIStreamListener.h" +#include "nsIInputStream.h" +#include "nsILoadGroup.h" + +#define PGPMIME_JS_DECRYPTOR_CONTRACTID \ + "@mozilla.org/mime/pgp-mime-js-decrypt;1" + +typedef struct MimeEncryptedPgpClass MimeEncryptedPgpClass; +typedef struct MimeEncryptedPgp MimeEncryptedPgp; + +struct MimeEncryptedPgpClass { + MimeEncryptedClass encrypted; +}; + +struct MimeEncryptedPgp { + MimeEncrypted encrypted; +}; + +class nsPgpMimeProxy : public nsIPgpMimeProxy, + public nsIRequest, + public nsIInputStream { + public: + NS_DECL_THREADSAFE_ISUPPORTS + NS_DECL_NSIPGPMIMEPROXY + NS_DECL_NSIREQUESTOBSERVER + NS_DECL_NSISTREAMLISTENER + NS_DECL_NSIREQUEST + NS_DECL_NSIINPUTSTREAM + + nsPgpMimeProxy(); + + // Define a Create method to be used with a factory: + static nsresult Create(nsISupports* aOuter, REFNSIID aIID, void** aResult); + + protected: + virtual ~nsPgpMimeProxy(); + bool mInitialized; + nsCOMPtr<nsIStreamListener> mDecryptor; + +#ifdef DEBUG + PRBool mOutputWasRemoved; +#endif + MimeDecodeCallbackFun mOutputFun; + void* mOutputClosure; + + nsCOMPtr<nsILoadGroup> mLoadGroup; + nsLoadFlags mLoadFlags; + nsresult mCancelStatus; + + uint32_t mStreamOffset; + nsCString mByteBuf; + nsCString mContentType; + nsCString mMimePart; + bool mAllowNestedDecrypt; + + nsCOMPtr<nsIURI> mMessageURI; + nsresult Finalize(); +}; + +#define MimeEncryptedPgpClassInitializer(ITYPE, CSUPER) \ + { MimeEncryptedClassInitializer(ITYPE, CSUPER) } + +#endif |