aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid du Colombier <0intro@gmail.com>2011-12-07 12:27:07 -0500
committerRuss Cox <rsc@swtch.com>2011-12-07 12:27:07 -0500
commite80159c932a9f8728a7e8adf6a79282dec98a61d (patch)
treef7b149238474d6d27564e1197ede5748de60e4f9 /src
parentaac05c40926da9a9742e4eaaa1b02ea77539e223 (diff)
downloadplan9port-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')
-rw-r--r--src/cmd/auth/secstore/aescbc.c7
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");