mozglue/android/NSSBridge.h

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 2 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 4
michael@0 5 #ifndef NSSBridge_h
michael@0 6 #define NSSBridge_h
michael@0 7
michael@0 8 #include "nss.h"
michael@0 9 #include "pk11func.h"
michael@0 10 #include "pk11sdr.h"
michael@0 11 #include "seccomon.h"
michael@0 12 #include "secitem.h"
michael@0 13 #include "secmodt.h"
michael@0 14
michael@0 15 #include "prerror.h"
michael@0 16 #include "plstr.h"
michael@0 17 #include "prmem.h"
michael@0 18
michael@0 19 #include <jni.h>
michael@0 20
michael@0 21 int setup_nss_functions(void *nss_handle, void *nssutil_handle, void *plc_handle);
michael@0 22
michael@0 23 #define NSS_WRAPPER(name, return_type, args...) \
michael@0 24 typedef return_type (*name ## _t)(args); \
michael@0 25 extern name ## _t f_ ## name;
michael@0 26
michael@0 27 NSS_WRAPPER(NSS_Initialize, SECStatus, const char*, const char*, const char*, const char*, uint32_t)
michael@0 28 NSS_WRAPPER(NSS_Shutdown, void, void)
michael@0 29 NSS_WRAPPER(PK11SDR_Encrypt, SECStatus, SECItem *, SECItem *, SECItem *, void *)
michael@0 30 NSS_WRAPPER(PK11SDR_Decrypt, SECStatus, SECItem *, SECItem *, void *)
michael@0 31 NSS_WRAPPER(SECITEM_ZfreeItem, void, SECItem*, PRBool)
michael@0 32 NSS_WRAPPER(PR_ErrorToString, char *, PRErrorCode, PRLanguageCode)
michael@0 33 NSS_WRAPPER(PR_GetError, PRErrorCode, void)
michael@0 34 NSS_WRAPPER(PR_Free, PRErrorCode, char *)
michael@0 35 NSS_WRAPPER(PL_Base64Encode, char*, const char*, uint32_t, char*)
michael@0 36 NSS_WRAPPER(PL_Base64Decode, char*, const char*, uint32_t, char*)
michael@0 37 NSS_WRAPPER(PL_strfree, void, char*)
michael@0 38 NSS_WRAPPER(PK11_GetInternalKeySlot, PK11SlotInfo *, void)
michael@0 39 NSS_WRAPPER(PK11_NeedUserInit, PRBool, PK11SlotInfo *)
michael@0 40 NSS_WRAPPER(PK11_InitPin, SECStatus, PK11SlotInfo*, const char*, const char*)
michael@0 41
michael@0 42 bool setPassword(PK11SlotInfo *slot);
michael@0 43 SECStatus doCrypto(JNIEnv* jenv, const char *path, const char *value, char** result, bool doEncrypt);
michael@0 44 SECStatus encode(const unsigned char *data, int32_t dataLen, char **_retval);
michael@0 45 SECStatus decode(const char *data, unsigned char **result, int32_t * _retval);
michael@0 46 #endif /* NSS_h */

mercurial