SUPPORT-8761. Подробное логирование ошибки об истекшей лицензии (+ о неправильном пароле)
This commit is contained in:
parent
2ae3112330
commit
bc51d2a8cd
2 changed files with 32 additions and 1 deletions
|
|
@ -5,6 +5,7 @@
|
|||
#include "library.h"
|
||||
#include "logger.h"
|
||||
|
||||
|
||||
static capi_function_list_t cp_function_list;
|
||||
static library_t libcapi;
|
||||
|
||||
|
|
@ -203,6 +204,28 @@ exit:
|
|||
return is_verified;
|
||||
}
|
||||
|
||||
static void
|
||||
log_sign_hash_data_last_error()
|
||||
{
|
||||
DWORD error = cp_function_list.GetLastError();
|
||||
|
||||
switch (error) {
|
||||
case ERROR_FUNCTION_FAILED:
|
||||
LOG_ERROR("sign_hash_data exit with error. Last error code: "
|
||||
"license is expired or not yet valid (0x%08x)", error);
|
||||
break;
|
||||
|
||||
case SCARD_W_WRONG_CHV:
|
||||
LOG_ERROR("sign_hash_data exit with error. Last error code: "
|
||||
"the wrong PIN was presented (0x%08x)", error);
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_ERROR("sign_hash_data exit with error. Last error code: 0x%08x", error);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
sign_hash_data(const cryptopro_context_t *ctx, const str_t *data, /*out*/ str_t *sign)
|
||||
{
|
||||
|
|
@ -288,8 +311,9 @@ exit:
|
|||
}
|
||||
|
||||
if (rc) {
|
||||
LOG_ERROR("sign_hash_data exit with error. Last error code: 0x%08x", cp_function_list.GetLastError());
|
||||
log_sign_hash_data_last_error();
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue