[chainmaker][#436]add cert inteface
@@ -25,10 +25,11 @@ extern Suite *make_wallet_suite(void);
extern Suite *make_parameters_suite(void);
extern Suite *make_contract_suite(void);
-char chainmaker_key_ptr_buf[1024];
-char chainmaker_cert_ptr_buf[1024];
+char chainmaker_sign_key_buf[1024];
+char chainmaker_sign_cert_buf[1024];
+char chainmaker_ca_cert_buf[1024];
-int read_key_cert_content(char* key_ptr, char* cert_ptr)
+int read_key_cert_content(char* key_ptr, char* cert_ptr, char* ca_ptr)
{
int fd = 0;
int len;
@@ -60,6 +61,17 @@ int read_key_cert_content(char* key_ptr, char* cert_ptr)
{
return -1;
}
+
+ fd = open("../../../tests/BoAT_chainmaker_linuxDefault/cert_key/ca.crt", O_RDONLY);
+ if (fd < 0)
+ {
+ return -1;
+ }
+ fd = read(fd, ca_ptr, 1024);
+ if (len < 0)
+ {
+ return -1;
+ }
return 0;
}
@@ -72,14 +84,14 @@ int main(int argc, char *argv[])
Suite *suite_wallet = make_wallet_suite();
Suite *suite_paramters = make_parameters_suite();
Suite *suite_contract = make_contract_suite();
- read_key_cert_content(chainmaker_key_ptr_buf, chainmaker_cert_ptr_buf);
+ read_key_cert_content(chainmaker_sign_key_buf, chainmaker_sign_cert_buf, chainmaker_ca_cert_buf);
/* create srunner and add first suite to it.
The first suite in a suite runner is always added in function srunner_create,
here set suite_wallet as first adding suite. */
sr = srunner_create(suite_wallet);
/* set generate test log in running path */
- srunner_set_log(sr, "ccheck_log.txt");
+ srunner_set_log(sr, "check_log.txt");
/* add other suite to srunner, more test suite should be add in here */
srunner_add_suite(sr, suite_paramters);
srunner_add_suite(sr, suite_contract);
