Skip to content

Commit 2bbd6dc

Browse files
authored
Merge pull request #394 from Tarsnap/misc
libcperciva import, fix Makefile.am, and fix test
2 parents 1d21941 + 27bd5ea commit 2bbd6dc

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

Makefile.am

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,9 @@ EXTRA_DIST= \
217217
libcperciva/POSIX/posix-restrict.c \
218218
libcperciva/POSIX/posix-stat-st_mtim.c \
219219
libcperciva/POSIX/posix-trivial.c \
220+
libcperciva/apisupport/Build/apisupport-LIBCRYPTO-LOW_LEVEL_AES.c \
221+
libcperciva/apisupport/Build/apisupport-NONPOSIX-MEMLIMIT.c \
222+
libcperciva/apisupport/Build/apisupport.sh \
220223
libcperciva/cpusupport/Build/cpusupport-ARM-AES.c \
221224
libcperciva/cpusupport/Build/cpusupport-ARM-SHA256.c \
222225
libcperciva/cpusupport/Build/cpusupport-HWCAP-ELF_AUX_INFO.c \

tests/04-force-resources.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ scenario_cmd() {
1919

2020
# Attempt to decrypt it with limited time. We want this
2121
# command to fail, so we negate the normal return code.
22-
setup_check "scrypt dec 1 second"
22+
setup_check "scrypt dec 0.1 seconds"
2323
(
2424
echo "${password}" | ${c_valgrind_cmd} "${bindir}/scrypt" \
25-
dec -P -t 1 "${longwait_encrypted_file}" \
25+
dec -P -t 0.1 "${longwait_encrypted_file}" \
2626
"${longwait_decrypted_file}" \
2727
2> "${longwait_failed_log}"
2828
expected_exitcode 1 $? > "${c_exitfile}"

tests/shared_valgrind_functions.sh

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -254,12 +254,13 @@ valgrind_setup() {
254254
fi
255255

256256
# Set up valgrind command.
257-
_valgrind_setup_cmd="valgrind \
258-
--log-file=${_valgrind_setup_logfilename} \
259-
--track-fds=yes \
260-
--trace-children=yes \
261-
--leak-check=full --show-leak-kinds=all \
262-
--errors-for-leak-kinds=all \
257+
_valgrind_setup_cmd="valgrind \
258+
--log-file=${_valgrind_setup_logfilename} \
259+
--track-fds=yes \
260+
--trace-children=yes \
261+
--leak-check=full \
262+
--show-leak-kinds=all \
263+
--errors-for-leak-kinds=all \
263264
--suppressions=${valgrind_suppressions}"
264265
echo "${_valgrind_setup_cmd}"
265266
}
@@ -333,9 +334,13 @@ _val_checkl() {
333334
return
334335
fi
335336

336-
# Check the error summary.
337+
# Check the error summary. Get the number of expected errors from the
338+
# ${valgrind_fds_log} file. (Ideally this would be 0, but due to
339+
# porting issues, some versions of valgrind on some platforms always
340+
# report a non-zero number of errors.)
337341
_val_checkl_num_errors=$(grep "ERROR SUMMARY: " "${_val_checkl_logfile}" | awk '{print $4}')
338-
if [ "${_val_checkl_num_errors}" -gt 0 ]; then
342+
_val_checkl_num_errors_basic=$(grep "ERROR SUMMARY: " "${valgrind_fds_log}" | awk '{ print $4}')
343+
if [ "${_val_checkl_num_errors}" != "${_val_checkl_num_errors_basic}" ]; then
339344
# There was some other error(s) -- invalid read or write,
340345
# conditional jump based on uninitialized value(s), invalid
341346
# free, etc.

0 commit comments

Comments
 (0)