Skip to content

Commit

Permalink
Merge pull request #394 from Tarsnap/misc
Browse files Browse the repository at this point in the history
libcperciva import, fix Makefile.am, and fix test
  • Loading branch information
cperciva authored Dec 23, 2024
2 parents 1d21941 + 27bd5ea commit 2bbd6dc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
3 changes: 3 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@ EXTRA_DIST= \
libcperciva/POSIX/posix-restrict.c \
libcperciva/POSIX/posix-stat-st_mtim.c \
libcperciva/POSIX/posix-trivial.c \
libcperciva/apisupport/Build/apisupport-LIBCRYPTO-LOW_LEVEL_AES.c \
libcperciva/apisupport/Build/apisupport-NONPOSIX-MEMLIMIT.c \
libcperciva/apisupport/Build/apisupport.sh \
libcperciva/cpusupport/Build/cpusupport-ARM-AES.c \
libcperciva/cpusupport/Build/cpusupport-ARM-SHA256.c \
libcperciva/cpusupport/Build/cpusupport-HWCAP-ELF_AUX_INFO.c \
Expand Down
4 changes: 2 additions & 2 deletions tests/04-force-resources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ scenario_cmd() {

# Attempt to decrypt it with limited time. We want this
# command to fail, so we negate the normal return code.
setup_check "scrypt dec 1 second"
setup_check "scrypt dec 0.1 seconds"
(
echo "${password}" | ${c_valgrind_cmd} "${bindir}/scrypt" \
dec -P -t 1 "${longwait_encrypted_file}" \
dec -P -t 0.1 "${longwait_encrypted_file}" \
"${longwait_decrypted_file}" \
2> "${longwait_failed_log}"
expected_exitcode 1 $? > "${c_exitfile}"
Expand Down
21 changes: 13 additions & 8 deletions tests/shared_valgrind_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -254,12 +254,13 @@ valgrind_setup() {
fi

# Set up valgrind command.
_valgrind_setup_cmd="valgrind \
--log-file=${_valgrind_setup_logfilename} \
--track-fds=yes \
--trace-children=yes \
--leak-check=full --show-leak-kinds=all \
--errors-for-leak-kinds=all \
_valgrind_setup_cmd="valgrind \
--log-file=${_valgrind_setup_logfilename} \
--track-fds=yes \
--trace-children=yes \
--leak-check=full \
--show-leak-kinds=all \
--errors-for-leak-kinds=all \
--suppressions=${valgrind_suppressions}"
echo "${_valgrind_setup_cmd}"
}
Expand Down Expand Up @@ -333,9 +334,13 @@ _val_checkl() {
return
fi

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

0 comments on commit 2bbd6dc

Please sign in to comment.