1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/security/manager/ssl/src/nsNSSHelper.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,56 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- 1.5 + * 1.6 + * This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#ifndef NSS_HELPER_ 1.11 +#define NSS_HELPER_ 1.12 + 1.13 +#include "nsIInterfaceRequestor.h" 1.14 +#include "nsIInterfaceRequestorUtils.h" 1.15 +#include "pk11func.h" 1.16 + 1.17 +// 1.18 +// Implementation of an nsIInterfaceRequestor for use 1.19 +// as context for NSS calls 1.20 +// 1.21 +class PipUIContext : public nsIInterfaceRequestor 1.22 +{ 1.23 +public: 1.24 + NS_DECL_THREADSAFE_ISUPPORTS 1.25 + NS_DECL_NSIINTERFACEREQUESTOR 1.26 + 1.27 + PipUIContext(); 1.28 + virtual ~PipUIContext(); 1.29 + 1.30 +}; 1.31 + 1.32 +// 1.33 +// Function to get the implementor for a certain set of NSS 1.34 +// specific dialogs. 1.35 +// 1.36 + 1.37 +nsresult 1.38 +getNSSDialogs(void **_result, REFNSIID aIID, const char *contract); 1.39 + 1.40 +extern "C" { 1.41 +// a "fake" unicode conversion function 1.42 +PRBool 1.43 +pip_ucs2_ascii_conversion_fn(PRBool toUnicode, 1.44 + unsigned char *inBuf, 1.45 + unsigned int inBufLen, 1.46 + unsigned char *outBuf, 1.47 + unsigned int maxOutBufLen, 1.48 + unsigned int *outBufLen, 1.49 + PRBool swapBytes); 1.50 +} 1.51 + 1.52 +// 1.53 +// A function that sets the password on an unitialized slot. 1.54 +// 1.55 +nsresult 1.56 +setPassword(PK11SlotInfo *slot, nsIInterfaceRequestor *ctx); 1.57 + 1.58 +#endif 1.59 +