Commit e29a6f09 authored by Нестеренко Алексей Юрьевич's avatar Нестеренко Алексей Юрьевич :headphones:
Browse files

Мелкие правки

parent dc71717d
No related merge requests found
Showing with 14 additions and 6 deletions
+14 -6
......@@ -645,10 +645,11 @@
static int aktool_icode_check_maps_segment( size_t length, ak_keypair kp, aktool_ki_t *ki )
{
struct file fm;
ak_uint8 *iptr = NULL;
ak_uint8 ic2[128], *iptr = NULL;
ak_pointer dkey = NULL;
char fmemory[128], icode[128], buffer[4096];
/* формируем имя */
memset( fmemory, 0, sizeof( fmemory ));
ak_snprintf( fmemory, sizeof( fmemory ), "/proc/%d/mem", ki->pid );
......@@ -698,7 +699,18 @@
/* сравниваем значения */
if( kp->value_length == ki->size +8 ) iptr = ( kp->data + kp->key_length + 8 );
else iptr = ( kp->data + kp->key_length );
else { /* здесь обрабатываем обычные файлы */
if( ki->curmem.offset == 0 )
{
iptr = ( kp->data + kp->key_length );
}
else {
/* на месте вычисляем контрольную сумму от файла на диске */
ki->icode_file_offset( ki->handle,
(char *) kp->data, ki->curmem.offset, -1, ic2, ki->size );
iptr = ic2;
}
}
if( !ak_ptr_is_equal_with_log( icode, iptr, ki->size )) {
ki->statistical_data.skipped_segments++;
......
......@@ -1425,8 +1425,6 @@
if( ak_ptr_is_equal_with_log( out, streebog256_testM1, sizeof( out )) != ak_true )
return ak_error_message( ak_error_not_equal_data, __func__ ,
"the 1st test from GOST R 34.11-2012 is wrong" );
if( ak_log_get_level() >= ak_log_maximum )
ak_error_message( ak_error_ok, __func__ , "the 1st test from GOST R 34.11-2012 is Ok" );
}
return ak_hash_context_streebog_clean( &hctx->data.sctx );
......@@ -1464,8 +1462,6 @@
if( ak_ptr_is_equal_with_log( out, streebog512_testM1, sizeof( out )) != ak_true )
return ak_error_message( ak_error_not_equal_data, __func__ ,
"the 1st test from GOST R 34.11-2012 is wrong" );
if( ak_log_get_level() >= ak_log_maximum )
ak_error_message( ak_error_ok, __func__ , "the 1st test from GOST R 34.11-2012 is Ok" );
}
return ak_hash_context_streebog_clean( &hctx->data.sctx );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment