# adding the plugin source files
LOCAL_SRC_FILES += $(call add_plugin, android-dns)
-ifneq ($(call plugin_enabled, android-dns),)
LOCAL_SHARED_LIBRARIES += libcutils
-endif
LOCAL_SRC_FILES += $(call add_plugin, android-log)
ifneq ($(call plugin_enabled, android-log),)
#include <stdio.h>\r
#include <utils/chunk.h>\r
#include <utils/debug.h>\r
+#include <cutils/properties.h>\r
\r
#define REKEY_MAX_BYTE 256\r
#define HEX_STR_LEN 4\r
#define E_NUM 7\r
#define N_NUM 407\r
\r
+#define SHOW_KEY_PROPERTY "vendor.charon.showkey"\r
+\r
/**\r
* Computes a^b mod c\r
*/\r
* Print Encrypt original secret codes\r
*/\r
void rekey_secret_code(chunk_t *ori_chunk, char *key_name) {\r
- char rekey_str[REKEY_MAX_BYTE] = {0};\r
- char val[HEX_STR_LEN];\r
+ if (property_get_bool(SHOW_KEY_PROPERTY, 0)) {\r
+ DBG1(DBG_IKE, "%s secret %B", key_name, ori_chunk);\r
+ } else {\r
+ char rekey_str[REKEY_MAX_BYTE] = {0};\r
+ char temp_str[HEX_STR_LEN];\r
\r
- for(int i = 0; i < ori_chunk->len ; i++) {\r
- sprintf(val,"%03d", powmod(ori_chunk->ptr[i], E_NUM, N_NUM) );\r
- strncat(rekey_str, val, 3);\r
+ for(int i = 0; i < ori_chunk->len ; i++) {\r
+ sprintf(temp_str, "%03d", powmod(ori_chunk->ptr[i], E_NUM, N_NUM));\r
+ strncat(rekey_str, temp_str, 3);\r
+ }\r
+ DBG1(DBG_IKE, "%s : %s", key_name, rekey_str);\r
}\r
-\r
- DBG1(DBG_IKE, "%s : %s", key_name, rekey_str);\r
-}
\ No newline at end of file
+}\r