mozglue/android/NSSBridge.h
author B2G Bumper Bot <release+b2gbumper@mozilla.com>
Thu, 03 Jul 2014 01:25:25 -0700
changeset 205896 8c6d2ef269cd87cb34d6a46ca2fd9490712a8033
parent 115417 a45fac177fc87ca8eed1bf403e4ccb28d4f8d8ff
permissions -rw-r--r--
Bumping gaia.json for 4 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/f98cc089db06 Author: Jose M. Cantera <jmcanterafonseca@gmail.com> Desc: Merge pull request #20613 from jmcanterafonseca/contacts_Data Bug 989929 - [Contacts][Refactor] Create Contacts indexed DB library to ... ======== https://hg.mozilla.org/integration/gaia-central/rev/5e71e90bb54f Author: José Manuel Cantera <jmcanterafonseca@gmail.com> Desc: Bug 989929 - [Contacts][Refactor] Create Contacts indexed DB library to support synchronization from the Global Contacts Datastore ======== https://hg.mozilla.org/integration/gaia-central/rev/7fb5ac42a379 Author: Greg Weng <snowmantw@gmail.com> Desc: Merge pull request #21317 from snowmantw/issue1033135 Bug 1033135 - [System] Hide SIM pin dialog if the screen unlock into Cam... ======== https://hg.mozilla.org/integration/gaia-central/rev/487e7faa8395 Author: Greg Weng <snowmantw@gmail.com> Desc: Bug 1033135 - [System] Hide SIM pin dialog if the screen unlock into Camera app

/* 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 NSSBridge_h
#define NSSBridge_h

#include "nss.h"
#include "pk11func.h"
#include "pk11sdr.h"
#include "seccomon.h"
#include "secitem.h"
#include "secmodt.h"

#include "prerror.h"
#include "plstr.h"
#include "prmem.h"

#include <jni.h>

int setup_nss_functions(void *nss_handle, void *nssutil_handle, void *plc_handle);

#define NSS_WRAPPER(name, return_type, args...) \
typedef return_type (*name ## _t)(args);  \
extern name ## _t f_ ## name;

NSS_WRAPPER(NSS_Initialize, SECStatus, const char*, const char*, const char*, const char*, uint32_t)
NSS_WRAPPER(NSS_Shutdown, void, void)
NSS_WRAPPER(PK11SDR_Encrypt, SECStatus, SECItem *, SECItem *, SECItem *, void *)
NSS_WRAPPER(PK11SDR_Decrypt, SECStatus, SECItem *, SECItem *, void *)
NSS_WRAPPER(SECITEM_ZfreeItem, void, SECItem*, PRBool)
NSS_WRAPPER(PR_ErrorToString, char *, PRErrorCode, PRLanguageCode)
NSS_WRAPPER(PR_GetError, PRErrorCode, void)
NSS_WRAPPER(PR_Free, PRErrorCode, char *)
NSS_WRAPPER(PL_Base64Encode, char*, const char*, uint32_t, char*)
NSS_WRAPPER(PL_Base64Decode, char*, const char*, uint32_t, char*)
NSS_WRAPPER(PL_strfree, void, char*)
NSS_WRAPPER(PK11_GetInternalKeySlot, PK11SlotInfo *, void)
NSS_WRAPPER(PK11_NeedUserInit, PRBool, PK11SlotInfo *)
NSS_WRAPPER(PK11_InitPin, SECStatus, PK11SlotInfo*, const char*, const char*)

bool setPassword(PK11SlotInfo *slot);
SECStatus doCrypto(JNIEnv* jenv, const char *path, const char *value, char** result, bool doEncrypt);
SECStatus encode(const unsigned char *data, int32_t dataLen, char **_retval);
SECStatus decode(const char *data, unsigned char **result, int32_t * _retval);
#endif /* NSS_h */