diff --git a/adm/config_form.php b/adm/config_form.php index 02da0575d..aaec76ca8 100644 --- a/adm/config_form.php +++ b/adm/config_form.php @@ -1282,7 +1282,10 @@ if($config['cf_cert_use']) { // kcp일 때 if($config['cf_cert_hp'] == 'kcp') { - $exe = G5_KCPCERT_PATH.'/bin/ct_cli'; + if(PHP_INT_MAX == 2147483647) // 32-bit + $exe = G5_KCPCERT_PATH . '/bin/ct_cli'; + else + $exe = G5_KCPCERT_PATH . '/bin/ct_cli_x64'; echo module_exec_check($exe, 'ct_cli'); } diff --git a/perms.sh b/perms.sh index 6542ef41b..8719b01c4 100644 --- a/perms.sh +++ b/perms.sh @@ -2,6 +2,7 @@ # kcp 본인확인 실행 파일 chmod 755 plugin/kcpcert/bin/ct_cli +chmod 755 plugin/kcpcert/bin/ct_cli_x64 # okname 본인확인 실행 파일 chmod 755 plugin/okname/bin/okname diff --git a/plugin/kcpcert/bin/ct_cli_x64 b/plugin/kcpcert/bin/ct_cli_x64 new file mode 100755 index 000000000..4fc53b04d Binary files /dev/null and b/plugin/kcpcert/bin/ct_cli_x64 differ diff --git a/plugin/kcpcert/kcpcert_result.php b/plugin/kcpcert/kcpcert_result.php index e18c9d1ff..255122187 100644 --- a/plugin/kcpcert/kcpcert_result.php +++ b/plugin/kcpcert/kcpcert_result.php @@ -101,8 +101,12 @@ if( $cert_enc_use == "Y" ) if ( $ct_cert->check_valid_hash ( $home_dir , $dn_hash , $veri_str ) != "1" ) { // 검증 실패시 처리 영역 + if(PHP_INT_MAX == 2147483647) // 32-bit + $bin_exe = '/bin/ct_cli'; + else + $bin_exe = '/bin/ct_cli_x64'; - echo "dn_hash 변조 위험있음 (".G5_KCPCERT_PATH."/bin/ct_cli 파일에 실행권한이 있는지 확인하세요.)"; + echo "dn_hash 변조 위험있음 (".G5_KCPCERT_PATH.$bin_exe." 파일에 실행권한이 있는지 확인하세요.)"; exit; // 오류 처리 ( dn_hash 변조 위험있음) } diff --git a/plugin/kcpcert/lib/ct_cli_lib.php b/plugin/kcpcert/lib/ct_cli_lib.php index dc40539d2..32a77d5cf 100644 --- a/plugin/kcpcert/lib/ct_cli_lib.php +++ b/plugin/kcpcert/lib/ct_cli_lib.php @@ -16,19 +16,19 @@ class C_CT_CLI // 변수 초기화 영역 function mf_clear() { - $this->m_dec_data=""; + $this->m_dec_data=""; } // hash 처리 영역 function make_hash_data( $home_dir , $str ) { - $hash_data = $this -> mf_exec( $home_dir . "/bin/ct_cli" , + $hash_data = $this -> mf_exec( $home_dir . "/bin/ct_cli" , "lf_CT_CLI__make_hash_data", $str ); if ( $hash_data == "" ) { $hash_data = "HS01"; } - + return $hash_data; } @@ -49,7 +49,12 @@ class C_CT_CLI // 암호화 인증데이터 복호화 function decrypt_enc_cert ( $home_dir, $site_cd , $cert_no , $enc_cert_data , $opt) { - $dec_data = $this -> mf_exec( $home_dir . "/bin/ct_cli" , + if(PHP_INT_MAX == 2147483647) // 32-bit + $bin_exe = $home_dir . '/bin/ct_cli'; + else + $bin_exe = $home_dir . '/bin/ct_cli_x64'; + + $dec_data = $this -> mf_exec( $bin_exe , "lf_CT_CLI__decrypt_enc_cert" , $site_cd , $cert_no ,