Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/lib/crypto/mem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*/

#include <cstdio>
#include <cstring>
#include "mem.h"
#include "logging.h"
#include <botan/ffi.h>
Expand Down
8 changes: 4 additions & 4 deletions src/lib/crypto/s2k_ossl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ pgp_s2k_iterated(pgp_hash_alg_t alg,
}
}
auto dgst = hash->sec_finish();
size_t out_cpy = std::min(dgst.size(), output_len);
memcpy(out, dgst.data(), out_cpy);
output_len -= out_cpy;
out += out_cpy;
size_t out_copy = std::min(dgst.size(), output_len);
memcpy(out, dgst.data(), out_copy);
output_len -= out_copy;
out += out_copy;
zeroes++;
}
return 0;
Expand Down
4 changes: 2 additions & 2 deletions src/lib/fingerprint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ template <> struct hash<pgp::Fingerprint> {
{
/* since fingerprint value is hash itself, we may use its low bytes */
size_t res = 0;
size_t cpy = std::min(sizeof(res), fp.size());
std::memcpy(&res, fp.data(), cpy);
size_t copy = std::min(sizeof(res), fp.size());
std::memcpy(&res, fp.data(), copy);
return res;
}
};
Expand Down
4 changes: 3 additions & 1 deletion src/tests/cli_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2785,7 +2785,7 @@ def test_homedir_accessibility(self):
self.assertRegex(err, RE_KEYSTORE_INFO)
os.mkdir(os.path.join(RNPDIR, 'existing'), 0o700)
ret, _, err = run_proc(RNPK, ['--homedir', os.path.join(RNPDIR, 'existing'), '--generate', '--password=none'])
self.assertEqual(ret, 0, 'failed to use writeable and existing homedir')
self.assertEqual(ret, 0, 'failed to use writable and existing homedir')
self.assertNotRegex(err, r'(?s)^.*Home directory .* does not exist or is not writable!')
self.assertNotRegex(err, RE_KEYSTORE_INFO)

Expand Down Expand Up @@ -3370,6 +3370,8 @@ def test_cv25519_bit_fix(self):
self.assertRegex(out, r'(?s)^.*Cv25519 key bits are set correctly and do not require fixing.*$')
ret, _, _ = run_proc(RNP, ['--homedir', RNPDIR, '--password', 'password', '-d', data_path(MSG_ES_25519)])
self.assertEqual(ret, 0)
# Remove already existing key and import tweaked one again to make sure it works with GnuPG
ret, _, _ = run_proc(GPG, ['--batch', '--homedir', GPGHOME, '--yes', '--delete-secret-key', 'dde0ee539c017d2bd3f604a53176fc1486aa2528'])
ret, _, _ = run_proc(GPG, ['--batch', '--homedir', GPGHOME, '--batch', '--passphrase', 'password', '--import', os.path.join(RNPDIR, SECRING)])
self.assertEqual(ret, 0)
ret, _, _ = run_proc(GPG, ['--batch', '--homedir', GPGHOME, GPG_LOOPBACK, '--batch', '--passphrase', 'password',
Expand Down
2 changes: 1 addition & 1 deletion src/tests/file-utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ TEST_F(rnp_tests, test_rnp_access)
/* Should fail, but unfortunately _waccess() works this way */
assert_int_equal(0, rnp_access("C:\\Windows\\System32\\User32.dll", W_OK));
#else
/* Assume we are running as non-root and root directory is non-writeable for us */
/* Assume we are running as non-root and root directory is non-writable for us */
assert_int_equal(0, rnp_access("/", F_OK));
assert_int_equal(0, rnp_access("/", R_OK));
assert_int_equal(-1, rnp_access("/", W_OK));
Expand Down
Loading