security/manager/ssl/src/nsVerificationJob.h

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
michael@0 2 *
michael@0 3 * This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 6
michael@0 7 #ifndef _INC_NSVERIFICATIONJOB_H
michael@0 8 #define _INC_NSVERIFICATIONJOB_H
michael@0 9
michael@0 10 #include "nspr.h"
michael@0 11
michael@0 12 #include "nsIX509Cert.h"
michael@0 13 #include "nsIX509Cert3.h"
michael@0 14 #include "nsICMSMessage.h"
michael@0 15 #include "nsICMSMessage2.h"
michael@0 16 #include "nsProxyRelease.h"
michael@0 17
michael@0 18 class nsBaseVerificationJob
michael@0 19 {
michael@0 20 public:
michael@0 21 virtual ~nsBaseVerificationJob() {}
michael@0 22 virtual void Run() = 0;
michael@0 23 };
michael@0 24
michael@0 25 class nsCertVerificationJob : public nsBaseVerificationJob
michael@0 26 {
michael@0 27 public:
michael@0 28 nsCOMPtr<nsIX509Cert> mCert;
michael@0 29 nsMainThreadPtrHandle<nsICertVerificationListener> mListener;
michael@0 30
michael@0 31 void Run();
michael@0 32 };
michael@0 33
michael@0 34 class nsCertVerificationResult : public nsICertVerificationResult
michael@0 35 {
michael@0 36 public:
michael@0 37 nsCertVerificationResult();
michael@0 38 virtual ~nsCertVerificationResult();
michael@0 39
michael@0 40 NS_DECL_THREADSAFE_ISUPPORTS
michael@0 41 NS_DECL_NSICERTVERIFICATIONRESULT
michael@0 42
michael@0 43 private:
michael@0 44 nsresult mRV;
michael@0 45 uint32_t mVerified;
michael@0 46 uint32_t mCount;
michael@0 47 char16_t **mUsages;
michael@0 48
michael@0 49 friend class nsCertVerificationJob;
michael@0 50 };
michael@0 51
michael@0 52 class nsSMimeVerificationJob : public nsBaseVerificationJob
michael@0 53 {
michael@0 54 public:
michael@0 55 nsSMimeVerificationJob() { digest_data = nullptr; digest_len = 0; }
michael@0 56 ~nsSMimeVerificationJob() { delete [] digest_data; }
michael@0 57
michael@0 58 nsCOMPtr<nsICMSMessage> mMessage;
michael@0 59 nsCOMPtr<nsISMimeVerificationListener> mListener;
michael@0 60
michael@0 61 unsigned char *digest_data;
michael@0 62 uint32_t digest_len;
michael@0 63
michael@0 64 void Run();
michael@0 65 };
michael@0 66
michael@0 67
michael@0 68
michael@0 69 #endif

mercurial