diff --git a/adm/config_form.php b/adm/config_form.php index 44f9296b6..c63189411 100644 --- a/adm/config_form.php +++ b/adm/config_form.php @@ -418,6 +418,8 @@ if (!isset($config['cf_cert_kcp_enckey'])) { $sql = "ALTER TABLE `{$g5['config_table']}` ADD COLUMN `cf_cert_kcp_enckey` VARCHAR(100) NOT NULL DEFAULT '' AFTER `cf_cert_kcp_cd`; "; sql_query($sql, false); + + $config['cf_cert_kcp_enckey'] = ''; } if (!$config['cf_faq_skin']) { @@ -1075,7 +1077,7 @@ if ($config['cf_sms_use'] && $config['cf_icode_id'] && $config['cf_icode_pw']) { - 기술관리센터 > 인증센터 > 가맹점 인증키관리 에서 인증키 발급 후에 인증키 정보를 입력해 주세요.
입력하지 않거나 잘못 입력시 휴대폰 본인확인을 취소 하셨습니다. 라고 메시지가 나오면서 창이 닫히는 오류가 발생됩니다.') ?> + NHN_KCP 상점관리자 > 기술관리센터 > 인증센터 > 가맹점 인증키관리 에서 인증키 발급 후에 인증키 정보를 입력') ?> NHN KCP 상점관리자 @@ -1682,16 +1684,19 @@ if ($config['cf_cert_use']) { // kcp일 때 if ($config['cf_cert_hp'] == 'kcp') { + + $bin_path = ((int)$config['cf_cert_use'] === 2 && !$config['cf_cert_kcp_enckey']) ? 'bin_old' : 'bin'; + if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') { if (PHP_INT_MAX == 2147483647) { // 32-bit - $exe = G5_KCPCERT_PATH . '/bin/ct_cli'; + $exe = G5_KCPCERT_PATH . '/'.$bin_path.'/ct_cli'; } else { - $exe = G5_KCPCERT_PATH . '/bin/ct_cli_x64'; + $exe = G5_KCPCERT_PATH . '/'.$bin_path.'/ct_cli_x64'; } } else { - $exe = G5_KCPCERT_PATH . '/bin/ct_cli_exe.exe'; + $exe = G5_KCPCERT_PATH . '/'.$bin_path.'/ct_cli_exe.exe'; } - + echo module_exec_check($exe, 'ct_cli'); } diff --git a/plugin/kcpcert/bin_old/ct_cli b/plugin/kcpcert/bin_old/ct_cli new file mode 100755 index 000000000..2446ab62f Binary files /dev/null and b/plugin/kcpcert/bin_old/ct_cli differ diff --git a/plugin/kcpcert/bin_old/ct_cli_exe.exe b/plugin/kcpcert/bin_old/ct_cli_exe.exe new file mode 100644 index 000000000..3abbd50c0 Binary files /dev/null and b/plugin/kcpcert/bin_old/ct_cli_exe.exe differ diff --git a/plugin/kcpcert/bin_old/ct_cli_x64 b/plugin/kcpcert/bin_old/ct_cli_x64 new file mode 100755 index 000000000..4fc53b04d Binary files /dev/null and b/plugin/kcpcert/bin_old/ct_cli_x64 differ diff --git a/plugin/kcpcert/find_kcpcert_result.php b/plugin/kcpcert/find_kcpcert_result.php index 0b3f78a02..870c19a9d 100644 --- a/plugin/kcpcert/find_kcpcert_result.php +++ b/plugin/kcpcert/find_kcpcert_result.php @@ -68,6 +68,11 @@ for($i=0; $icheck_valid_hash ( $home_dir , $dn_hash , $veri_str ) != "1" ) + + $enc_cert_real_data = $enc_cert_data2; + $bin_path = 'bin'; + + if ((int)$config['cf_cert_use'] === 2 && !$config['cf_cert_kcp_enckey']) { + $bin_path = 'bin_old'; + $enc_cert_real_data = $enc_cert_data; + } + + if ( $ct_cert->check_valid_hash ( $home_dir , $kcp_enc_key, $dn_hash , $veri_str ) != "1" ) { if(strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') { // 검증 실패시 처리 영역 if(PHP_INT_MAX == 2147483647) // 32-bit - $bin_exe = '/bin/ct_cli'; + $bin_exe = '/'.$bin_path.'/ct_cli'; else - $bin_exe = '/bin/ct_cli_x64'; + $bin_exe = '/'.$bin_path.'/ct_cli_x64'; } else { - $bin_exe = '/bin/ct_cli_exe.exe'; + $bin_exe = '/'.$bin_path.'/ct_cli_exe.exe'; } echo "dn_hash 변조 위험있음 (".G5_KCPCERT_PATH.$bin_exe." 파일에 실행권한이 있는지 확인하세요.)"; @@ -116,13 +129,13 @@ if( $cert_enc_use == "Y" ) } // 가맹점 DB 처리 페이지 영역 - + // 인증데이터 복호화 함수 // 해당 함수는 암호화된 enc_cert_data 를 // site_cd 와 cert_no 를 가지고 복화화 하는 함수 입니다. // 정상적으로 복호화 된경우에만 인증데이터를 가져올수 있습니다. $opt = "1" ; // 복호화 인코딩 옵션 ( UTF - 8 사용시 "1" ) - $ct_cert->decrypt_enc_cert( $home_dir , $site_cd , $cert_no , $enc_cert_data , $opt ); + $ct_cert->decrypt_enc_cert( $home_dir , $kcp_enc_key, $site_cd , $cert_no , $enc_cert_real_data , $opt ); $comm_id = $ct_cert->mf_get_key_value("comm_id" ); // 이동통신사 코드 $phone_no = $ct_cert->mf_get_key_value("phone_no" ); // 전화번호 diff --git a/plugin/kcpcert/kcpcert_form.php b/plugin/kcpcert/kcpcert_form.php index b82329651..ed205a597 100644 --- a/plugin/kcpcert/kcpcert_form.php +++ b/plugin/kcpcert/kcpcert_form.php @@ -90,9 +90,6 @@ $ct_cert->mf_clear(); - - - @@ -114,7 +111,11 @@ $ct_cert->mf_clear(); + + + +