diff options
Diffstat (limited to 'bin/ed/cbc.c')
-rw-r--r-- | bin/ed/cbc.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/bin/ed/cbc.c b/bin/ed/cbc.c index 3985721..b59778b 100644 --- a/bin/ed/cbc.c +++ b/bin/ed/cbc.c @@ -90,16 +90,13 @@ void init_des_cipher(void) { #ifdef DES - int i; - des_ct = des_n = 0; /* initialize the initialization vector */ MEMZERO(ivec, 8); /* initialize the padding vector */ - for (i = 0; i < 8; i++) - pvec[i] = (char) (arc4random() % 256); + arc4random_buf(pvec, sizeof(pvec)); #endif } @@ -164,7 +161,7 @@ get_keyword(void) /* * get the key */ - if (*(p = getpass("Enter key: "))) { + if ((p = getpass("Enter key: ")) != NULL && *p != '\0') { /* * copy it, nul-padded, into the key area |