#include "sdb.h"
#include "adb_auth.h"
#include "utils.h"
+#include "strutils.h"
/* HACK: we need the RSAPublicKey struct
* but RSA_verify conflits with openssl */
FILE *outfile = NULL;
char path[PATH_MAX], info[MAX_PAYLOAD_V1];
uint8_t *encoded = NULL;
- size_t encoded_length;
+ int encoded_length;
int ret = 0;
if (snprintf(path, sizeof(path), "%s.pub", private_key_path)
adb_keys_path = getenv("ADB_VENDOR_KEYS");
if (!adb_keys_path)
return;
- strncpy(keys_path, adb_keys_path, sizeof(keys_path));
+ s_strncpy(keys_path, adb_keys_path, sizeof(keys_path));
path = adb_strtok_r(keys_path, ENV_PATH_SEPARATOR_STR, &save);
while (path) {
t->encryption = ENCR_OFF; // 현재 연결에 대한 암호화 모드를 off
sendokmsg(sock->fd, "Encryption is OFF");
}
- else{
- send_encr_fail(sock, t, ENCR_OFF_FAIL);
- sendfailmsg(sock->fd, "Encryption OFF failed");
- LOG_ERROR("security_deinit failed");
+ else{
+ if(sock != NULL) {
+ send_encr_fail(sock, t, ENCR_OFF_FAIL);
+ sendfailmsg(sock->fd, "Encryption OFF failed");
+ }
+ LOG_ERROR("security_deinit failed");
}
local_socket_close(sock);
}
}
else if(p->msg.arg0 == ENCR_OFF_FAIL){ // sdbd에서 암호화 모드 off에 실패했을 경우 받는 메시지
//t->encryption = ENCR_ON;
- sendfailmsg(sock->fd, "Encryption OFF failed");
- local_socket_close(sock);
+ if (sock != NULL) {
+ sendfailmsg(sock->fd, "Encryption OFF failed");
+ local_socket_close(sock);
+ }
}
put_apacket(enc_p);