adds logging control at java level.
parent
32616adf5d
commit
73311405fd
|
@ -79,6 +79,7 @@
|
|||
<class name="com.wolfssl.wolfcrypt.NativeStruct" />
|
||||
<class name="com.wolfssl.wolfcrypt.Aes" />
|
||||
<class name="com.wolfssl.wolfcrypt.Des3" />
|
||||
<class name="com.wolfssl.wolfcrypt.Logging" />
|
||||
<class name="com.wolfssl.wolfcrypt.Md5" />
|
||||
<class name="com.wolfssl.wolfcrypt.Sha" />
|
||||
<class name="com.wolfssl.wolfcrypt.Sha256" />
|
||||
|
|
|
@ -28,7 +28,8 @@ LOCAL_SRC_FILES := jni_fips.c \
|
|||
jni_rsa.c \
|
||||
jni_dh.c \
|
||||
jni_ecc.c \
|
||||
jni_asn.c
|
||||
jni_asn.c \
|
||||
jni_logging.c
|
||||
|
||||
LOCAL_CFLAGS := -DHAVE_CONFIG_H -Wall -Wno-unused
|
||||
LOCAL_LDLIBS := -llog
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
/* DO NOT EDIT THIS FILE - it is machine generated */
|
||||
#include <jni.h>
|
||||
/* Header for class com_wolfssl_wolfcrypt_Logging */
|
||||
|
||||
#ifndef _Included_com_wolfssl_wolfcrypt_Logging
|
||||
#define _Included_com_wolfssl_wolfcrypt_Logging
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/*
|
||||
* Class: com_wolfssl_wolfcrypt_Logging
|
||||
* Method: wolfSSL_Debugging_ON
|
||||
* Signature: ()I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_com_wolfssl_wolfcrypt_Logging_wolfSSL_1Debugging_1ON
|
||||
(JNIEnv *, jclass);
|
||||
|
||||
/*
|
||||
* Class: com_wolfssl_wolfcrypt_Logging
|
||||
* Method: wolfSSL_Debugging_OFF
|
||||
* Signature: ()V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_com_wolfssl_wolfcrypt_Logging_wolfSSL_1Debugging_1OFF
|
||||
(JNIEnv *, jclass);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
|
@ -0,0 +1,42 @@
|
|||
/* jni_logging.c
|
||||
*
|
||||
* Copyright (C) 2006-2016 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||
*
|
||||
* wolfSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* wolfSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <com_wolfssl_wolfcrypt_Logging.h>
|
||||
|
||||
#ifndef __ANDROID__
|
||||
#include <wolfssl/options.h>
|
||||
#endif
|
||||
|
||||
#include <wolfssl/wolfcrypt/logging.h>
|
||||
int wolfSSL_Debugging_ON(void);
|
||||
void wolfSSL_Debugging_OFF(void);
|
||||
|
||||
JNIEXPORT jint JNICALL Java_com_wolfssl_wolfcrypt_Logging_wolfSSL_1Debugging_1ON
|
||||
(JNIEnv* env, jclass class)
|
||||
{
|
||||
return wolfSSL_Debugging_ON();
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_com_wolfssl_wolfcrypt_Logging_wolfSSL_1Debugging_1OFF
|
||||
(JNIEnv* env, jclass class)
|
||||
{
|
||||
wolfSSL_Debugging_OFF();
|
||||
}
|
2
makefile
2
makefile
|
@ -4,7 +4,7 @@ INC_PATH = $(SRC_PATH)/include
|
|||
|
||||
OBJ_LIST = jni_fips.o jni_native_struct.o jni_aes.o jni_des3.o jni_md5.o \
|
||||
jni_sha.o jni_hmac.o jni_rng.o jni_rsa.o jni_dh.o jni_ecc.o \
|
||||
jni_error.o jni_asn.o
|
||||
jni_error.o jni_asn.o jni_logging.o
|
||||
OBJS = $(patsubst %,$(OUT_PATH)/%,$(OBJ_LIST))
|
||||
TARGET = $(OUT_PATH)/libwolfcryptjni.jnilib
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ INC_PATH = $(SRC_PATH)/include
|
|||
|
||||
OBJ_LIST = jni_fips.o jni_native_struct.o jni_aes.o jni_des3.o jni_md5.o \
|
||||
jni_sha.o jni_hmac.o jni_rng.o jni_rsa.o jni_dh.o jni_ecc.o \
|
||||
jni_error.o jni_asn.o
|
||||
jni_error.o jni_asn.o jni_logging.o
|
||||
OBJS = $(patsubst %,$(OUT_PATH)/%,$(OBJ_LIST))
|
||||
TARGET = $(OUT_PATH)/libwolfcryptjni.so
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ INC_PATH = $(SRC_PATH)/include
|
|||
|
||||
OBJ_LIST = jni_fips.o jni_native_struct.o jni_aes.o jni_des3.o jni_md5.o \
|
||||
jni_sha.o jni_hmac.o jni_rng.o jni_rsa.o jni_dh.o jni_ecc.o \
|
||||
jni_error.o jni_asn.o
|
||||
jni_error.o jni_asn.o jni_logging.o
|
||||
OBJS = $(patsubst %,$(OUT_PATH)/%,$(OBJ_LIST))
|
||||
TARGET = $(OUT_PATH)/libwolfcryptjni.jnilib
|
||||
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
/* Logging.java
|
||||
*
|
||||
* Copyright (C) 2006-2016 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||
*
|
||||
* wolfSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* wolfSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
package com.wolfssl.wolfcrypt;
|
||||
|
||||
/**
|
||||
* Wrapper for the native WolfCrypt Logging implementation.
|
||||
*
|
||||
* @author Moisés Guimarães
|
||||
* @version 1.0, March 2016
|
||||
*/
|
||||
public class Logging extends WolfObject {
|
||||
|
||||
public static native int wolfSSL_Debugging_ON();
|
||||
public static native void wolfSSL_Debugging_OFF();
|
||||
|
||||
}
|
Loading…
Reference in New Issue