diff options
author | David du Colombier <0intro@gmail.com> | 2011-12-07 12:27:07 -0500 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2011-12-07 12:27:07 -0500 |
commit | e80159c932a9f8728a7e8adf6a79282dec98a61d (patch) | |
tree | f7b149238474d6d27564e1197ede5748de60e4f9 /src/cmd/auth/secstore | |
parent | aac05c40926da9a9742e4eaaa1b02ea77539e223 (diff) | |
download | plan9port-e80159c932a9f8728a7e8adf6a79282dec98a61d.tar.gz plan9port-e80159c932a9f8728a7e8adf6a79282dec98a61d.tar.bz2 plan9port-e80159c932a9f8728a7e8adf6a79282dec98a61d.zip |
aescbc: fix segfault on backspace
R=rsc
CC=plan9port.codebot
http://codereview.appspot.com/5440107
Diffstat (limited to 'src/cmd/auth/secstore')
-rw-r--r-- | src/cmd/auth/secstore/aescbc.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/cmd/auth/secstore/aescbc.c b/src/cmd/auth/secstore/aescbc.c index 88383bb4..627744d0 100644 --- a/src/cmd/auth/secstore/aescbc.c +++ b/src/cmd/auth/secstore/aescbc.c @@ -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"); |