NHN_KCP 윈도우 본인인증 모듈 추가

This commit is contained in:
thisgun
2020-06-01 12:01:23 +09:00
parent c7f1466751
commit f1152df518
4 changed files with 64 additions and 30 deletions

View File

@ -100,11 +100,15 @@ 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';
if(strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
// 검증 실패시 처리 영역
if(PHP_INT_MAX == 2147483647) // 32-bit
$bin_exe = '/bin/ct_cli';
else
$bin_exe = '/bin/ct_cli_x64';
} else {
$bin_exe = '/bin/ct_cli_exe.exe';
}
echo "dn_hash 변조 위험있음 (".G5_KCPCERT_PATH.$bin_exe." 파일에 실행권한이 있는지 확인하세요.)";
exit;
@ -133,6 +137,13 @@ if( $cert_enc_use == "Y" )
$dec_res_cd = $ct_cert->mf_get_key_value("res_cd" ); // 암호화된 결과코드
$dec_mes_msg = $ct_cert->mf_get_key_value("res_msg" ); // 암호화된 결과메시지
if(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' && function_exists('mb_detect_encoding') ){
if( mb_detect_encoding($user_name, 'EUC-KR') === 'EUC-KR' ){
$user_name = iconv_utf8($user_name);
$dec_mes_msg = iconv_utf8($dec_mes_msg);
}
}
// 정상인증인지 체크
if(!$phone_no)
alert_close("정상적인 인증이 아닙니다. 올바른 방법으로 이용해 주세요.");