0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.1.0773: not all crypt code is tested

Problem:    Not all crypt code is tested.
Solution:   Disable unused crypt code.  Add more test coverage.
This commit is contained in:
Bram Moolenaar
2019-01-18 22:48:34 +01:00
parent 0314236aab
commit 987411db9e
6 changed files with 58 additions and 4 deletions

View File

@@ -1381,9 +1381,12 @@ retry:
if (cryptkey != NULL && curbuf->b_cryptstate != NULL
&& size > 0)
{
# ifdef CRYPT_NOT_INPLACE
if (crypt_works_inplace(curbuf->b_cryptstate))
{
# endif
crypt_decode_inplace(curbuf->b_cryptstate, ptr, size);
# ifdef CRYPT_NOT_INPLACE
}
else
{
@@ -1434,6 +1437,7 @@ retry:
}
size = decrypted_size;
}
# endif
}
#endif
@@ -5768,9 +5772,12 @@ buf_write_bytes(struct bw_info *ip)
{
/* Encrypt the data. Do it in-place if possible, otherwise use an
* allocated buffer. */
# ifdef CRYPT_NOT_INPLACE
if (crypt_works_inplace(ip->bw_buffer->b_cryptstate))
{
# endif
crypt_encode_inplace(ip->bw_buffer->b_cryptstate, buf, len);
# ifdef CRYPT_NOT_INPLACE
}
else
{
@@ -5783,6 +5790,7 @@ buf_write_bytes(struct bw_info *ip)
vim_free(outbuf);
return (wlen < len) ? FAIL : OK;
}
# endif
}
#endif