security/manager/ssl/src/nsCryptoHash.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

     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/. */
     7 #ifndef _nsCryptoHash_h_
     8 #define _nsCryptoHash_h_
    10 #include "nsICryptoHash.h"
    11 #include "nsICryptoHMAC.h"
    12 #include "nsNSSShutDown.h"
    13 #include "hasht.h"
    14 #include "secmodt.h"
    16 class nsIInputStream;
    18 #define NS_CRYPTO_HASH_CID {0x36a1d3b3, 0xd886, 0x4317, {0x96, 0xff, 0x87, 0xb0, 0x00, 0x5c, 0xfe, 0xf7}}
    19 #define NS_CRYPTO_HMAC_CID {0xa496d0a2, 0xdff7, 0x4e23, {0xbd, 0x65, 0x1c, 0xa7, 0x42, 0xfa, 0x17, 0x8a}}
    21 class nsCryptoHash : public nsICryptoHash, public nsNSSShutDownObject
    22 {
    23 public:
    24   NS_DECL_ISUPPORTS
    25   NS_DECL_NSICRYPTOHASH
    27   nsCryptoHash();
    29 private:
    30   ~nsCryptoHash();
    32   HASHContext* mHashContext;
    33   bool mInitialized;
    35   virtual void virtualDestroyNSSReference();
    36   void destructorSafeDestroyNSSReference();
    37 };
    39 class nsCryptoHMAC : public nsICryptoHMAC, public nsNSSShutDownObject
    40 {
    41 public:
    42   NS_DECL_ISUPPORTS
    43   NS_DECL_NSICRYPTOHMAC
    45   nsCryptoHMAC();
    47 private:
    48   ~nsCryptoHMAC();
    49   PK11Context* mHMACContext;
    51   virtual void virtualDestroyNSSReference();
    52   void destructorSafeDestroyNSSReference();
    53 };
    55 #endif // _nsCryptoHash_h_

mercurial