Mercurial > vim
comparison src/testdir/test_crypt.vim @ 32677:4091ae33b9ec v9.0.1669
patch 9.0.1669: Crash syncing swapfile in new buffer when using sodium crypt
Commit: https://github.com/vim/vim/commit/19e6c4fd2d262075d39cb802ea5b85f5ec92f153
Author: Christian Brabandt <cb@256bit.org>
Date: Tue Jun 27 18:57:10 2023 +0100
patch 9.0.1669: Crash syncing swapfile in new buffer when using sodium crypt
Problem: Crash syncing swapfile in new buffer when using sodium crypt.
(James McCoy)
Solution: Add checks for sodium encryption. (Christian Brabandt,
closes #12591, closes #12585)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 27 Jun 2023 20:00:04 +0200 |
parents | 695b50472e85 |
children | 8fe1e8750883 |
comparison
equal
deleted
inserted
replaced
32676:1873e1b4b13c | 32677:4091ae33b9ec |
---|---|
103 " Wait for Vim to write the file and exit. Then wipe out the terminal buffer. | 103 " Wait for Vim to write the file and exit. Then wipe out the terminal buffer. |
104 call WaitForAssert({-> assert_equal("finished", term_getstatus(buf))}) | 104 call WaitForAssert({-> assert_equal("finished", term_getstatus(buf))}) |
105 exe buf .. 'bwipe!' | 105 exe buf .. 'bwipe!' |
106 call assert_true(filereadable('Xfoo')) | 106 call assert_true(filereadable('Xfoo')) |
107 | 107 |
108 let buf = RunVimInTerminal('--cmd "set ch=3 cm=xchacha20v2 key=foo" Xfoo', #{rows: 10}) | 108 let buf = RunVimInTerminal('--cmd "set ch=3 cm=xchacha20v2 key=foo" Xfoo', #{wait_for_ruler: 0, rows: 10}) |
109 call g:TermWait(buf, g:RunningWithValgrind() ? 1000 : 50) | 109 call g:TermWait(buf, g:RunningWithValgrind() ? 1000 : 50) |
110 call StopVimInTerminal(buf) | 110 call StopVimInTerminal(buf) |
111 | 111 |
112 call delete('Xfoo') | 112 call delete('Xfoo') |
113 endfunc | 113 endfunc |
390 set key= | 390 set key= |
391 bwipe! | 391 bwipe! |
392 call delete('Xtest1.txt') | 392 call delete('Xtest1.txt') |
393 endfunc | 393 endfunc |
394 | 394 |
395 func Test_crypt_set_key_segfault() | |
396 CheckFeature sodium | |
397 | |
398 defer delete('Xtest2.txt') | |
399 new Xtest2.txt | |
400 call setline(1, 'nothing') | |
401 set cryptmethod=xchacha20 | |
402 set key=foobar | |
403 w | |
404 new Xtest3 | |
405 put ='other content' | |
406 setl modified | |
407 sil! preserve | |
408 bwipe! | |
409 | |
410 set cryptmethod& | |
411 set key= | |
412 bwipe! | |
413 endfunc | |
414 | |
395 " vim: shiftwidth=2 sts=2 expandtab | 415 " vim: shiftwidth=2 sts=2 expandtab |