mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-24 11:41:58 +00:00
aescbc: fix segfault on backspace
R=rsc CC=plan9port.codebot http://codereview.appspot.com/5440107
This commit is contained in:
parent
aac05c4092
commit
e80159c932
1 changed files with 5 additions and 2 deletions
|
@ -1,8 +1,9 @@
|
|||
/* encrypt file by writing
|
||||
/*
|
||||
encrypt file by writing
|
||||
v2hdr,
|
||||
16byte initialization vector,
|
||||
AES-CBC(key, random | file),
|
||||
HMAC_SHA1(md5(key), AES-CBC(random | file))
|
||||
HMAC_SHA1(md5(key), AES-CBC(random | file))
|
||||
*/
|
||||
#include <u.h>
|
||||
#include <libc.h>
|
||||
|
@ -91,6 +92,8 @@ main(int argc, char **argv)
|
|||
buf[--n] = 0;
|
||||
}else{
|
||||
pass = readcons("aescbc password", nil, 1);
|
||||
if(pass == nil)
|
||||
exits("readcons");
|
||||
n = strlen(pass);
|
||||
if(n >= BUF)
|
||||
exits("key too long");
|
||||
|
|
Loading…
Reference in a new issue