Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Мотыгуллин Амир Булатович
libakrypt-motygullin-pcdch
Commits
e29a6f09
Commit
e29a6f09
authored
4 months ago
by
Нестеренко Алексей Юрьевич
Browse files
Options
Download
Patches
Plain Diff
Мелкие правки
parent
dc71717d
master
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aktool/aktool_icode_evaluate.c
+14
-2
aktool/aktool_icode_evaluate.c
source/ak_hash.c
+0
-4
source/ak_hash.c
with
14 additions
and
6 deletions
+14
-6
aktool/aktool_icode_evaluate.c
+
14
−
2
View file @
e29a6f09
...
...
@@ -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
++
;
...
...
This diff is collapsed.
Click to expand it.
source/ak_hash.c
+
0
−
4
View file @
e29a6f09
...
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets