Commit f0080ffc authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Added Android.mk + fixed compil issues

parent 963d1ed9
LOCAL_PATH:= $(call my-dir)/../../src/
include $(CLEAR_VARS)
LOCAL_MODULE:= libbctoolbox
LOCAL_SRC_FILES := \
crypto_mbedtls.c
LOCAL_CFLAGS += -Wno-maybe-uninitialized
LOCAL_C_INCLUDES += \
$(LOCAL_PATH)/ \
$(LOCAL_PATH)/../include \
$(LOCAL_PATH)/../../externals/mbedtls/include
LOCAL_STATIC_LIBRARIES := \
mbedtls
include $(BUILD_STATIC_LIBRARY)
LOCAL_PATH:= $(call my-dir)/../../src/
include $(CLEAR_VARS)
LOCAL_MODULE:= libbctoolbox
LOCAL_SRC_FILES := \
crypto_polarssl.c
LOCAL_CFLAGS += -Wno-maybe-uninitialized
LOCAL_C_INCLUDES += \
$(LOCAL_PATH)/ \
$(LOCAL_PATH)/../include \
$(LOCAL_PATH)/../../externals/polarssl/include
LOCAL_STATIC_LIBRARIES := \
polarssl
include $(BUILD_STATIC_LIBRARY)
...@@ -326,7 +326,7 @@ int32_t bctoolbox_x509_certificate_generate_selfsigned(const char *subject, bcto ...@@ -326,7 +326,7 @@ int32_t bctoolbox_x509_certificate_generate_selfsigned(const char *subject, bcto
/* copy the key+cert in pem format into the given buffer */ /* copy the key+cert in pem format into the given buffer */
if (pem != NULL) { if (pem != NULL) {
if (strlen(file_buffer)+1>pem_length) { if (strlen(file_buffer)+1>pem_length) {
bctoolbox_error("Certificate generation can't copy the certificate to pem buffer: too short [%ld] but need [%ld] bytes", pem_length, strlen(file_buffer)); bctoolbox_error("Certificate generation can't copy the certificate to pem buffer: too short [%ld] but need [%ld] bytes", (long)pem_length, (long)strlen(file_buffer));
return BCTOOLBOX_ERROR_OUTPUT_BUFFER_TOO_SMALL; return BCTOOLBOX_ERROR_OUTPUT_BUFFER_TOO_SMALL;
} }
strncpy(pem, file_buffer, pem_length); strncpy(pem, file_buffer, pem_length);
......
...@@ -310,7 +310,7 @@ int32_t bctoolbox_x509_certificate_generate_selfsigned(const char *subject, bcto ...@@ -310,7 +310,7 @@ int32_t bctoolbox_x509_certificate_generate_selfsigned(const char *subject, bcto
/* copy the key+cert in pem format into the given buffer */ /* copy the key+cert in pem format into the given buffer */
if (pem != NULL) { if (pem != NULL) {
if (strlen(file_buffer)+1>pem_length) { if (strlen(file_buffer)+1>pem_length) {
bctoolbox_error("Certificate generation can't copy the certificate to pem buffer: too short [%ld] but need [%ld] bytes", pem_length, strlen(file_buffer)); bctoolbox_error("Certificate generation can't copy the certificate to pem buffer: too short [%ld] but need [%ld] bytes", (long)pem_length, (long)strlen(file_buffer));
return BCTOOLBOX_ERROR_OUTPUT_BUFFER_TOO_SMALL; return BCTOOLBOX_ERROR_OUTPUT_BUFFER_TOO_SMALL;
} }
strncpy(pem, file_buffer, pem_length); strncpy(pem, file_buffer, pem_length);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment