summaryrefslogtreecommitdiff
path: root/authfile.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2001-12-21 14:56:54 +1100
committerDamien Miller <djm@mindrot.org>2001-12-21 14:56:54 +1100
commit5a6b4fe22583394886092aad5787b5fa8355276e (patch)
treec6366cbaf2c3ea9bd1ac8f162f9452e1e9ca0434 /authfile.c
parentf6681a3a96ae06d62db49594ba0dcf352f817801 (diff)
- stevesk@cvs.openbsd.org 2001/12/19 17:16:13
[authfile.c bufaux.c bufaux.h buffer.c buffer.h packet.c packet.h ssh.c] change the buffer/packet interface to use void* vs. char*; ok markus@
Diffstat (limited to 'authfile.c')
-rw-r--r--authfile.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/authfile.c b/authfile.c
index abf2877f5..3bfca4ac5 100644
--- a/authfile.c
+++ b/authfile.c
@@ -36,7 +36,7 @@
36 */ 36 */
37 37
38#include "includes.h" 38#include "includes.h"
39RCSID("$OpenBSD: authfile.c,v 1.41 2001/12/19 07:18:56 deraadt Exp $"); 39RCSID("$OpenBSD: authfile.c,v 1.42 2001/12/19 17:16:13 stevesk Exp $");
40 40
41#include <openssl/err.h> 41#include <openssl/err.h>
42#include <openssl/evp.h> 42#include <openssl/evp.h>
@@ -128,7 +128,7 @@ key_save_private_rsa1(Key *key, const char *filename, const char *passphrase,
128 buffer_put_cstring(&encrypted, comment); 128 buffer_put_cstring(&encrypted, comment);
129 129
130 /* Allocate space for the private part of the key in the buffer. */ 130 /* Allocate space for the private part of the key in the buffer. */
131 buffer_append_space(&encrypted, &cp, buffer_len(&buffer)); 131 cp = buffer_append_space(&encrypted, buffer_len(&buffer));
132 132
133 cipher_set_key_string(&ciphercontext, cipher, passphrase); 133 cipher_set_key_string(&ciphercontext, cipher, passphrase);
134 cipher_encrypt(&ciphercontext, (u_char *) cp, 134 cipher_encrypt(&ciphercontext, (u_char *) cp,
@@ -239,7 +239,7 @@ key_load_public_rsa1(int fd, const char *filename, char **commentp)
239 lseek(fd, (off_t) 0, SEEK_SET); 239 lseek(fd, (off_t) 0, SEEK_SET);
240 240
241 buffer_init(&buffer); 241 buffer_init(&buffer);
242 buffer_append_space(&buffer, &cp, len); 242 cp = buffer_append_space(&buffer, len);
243 243
244 if (read(fd, cp, (size_t) len) != (size_t) len) { 244 if (read(fd, cp, (size_t) len) != (size_t) len) {
245 debug("Read from key file %.200s failed: %.100s", filename, 245 debug("Read from key file %.200s failed: %.100s", filename,
@@ -324,7 +324,7 @@ key_load_private_rsa1(int fd, const char *filename, const char *passphrase,
324 lseek(fd, (off_t) 0, SEEK_SET); 324 lseek(fd, (off_t) 0, SEEK_SET);
325 325
326 buffer_init(&buffer); 326 buffer_init(&buffer);
327 buffer_append_space(&buffer, &cp, len); 327 cp = buffer_append_space(&buffer, len);
328 328
329 if (read(fd, cp, (size_t) len) != (size_t) len) { 329 if (read(fd, cp, (size_t) len) != (size_t) len) {
330 debug("Read from key file %.200s failed: %.100s", filename, 330 debug("Read from key file %.200s failed: %.100s", filename,
@@ -378,7 +378,7 @@ key_load_private_rsa1(int fd, const char *filename, const char *passphrase,
378 } 378 }
379 /* Initialize space for decrypted data. */ 379 /* Initialize space for decrypted data. */
380 buffer_init(&decrypted); 380 buffer_init(&decrypted);
381 buffer_append_space(&decrypted, &cp, buffer_len(&buffer)); 381 cp = buffer_append_space(&decrypted, buffer_len(&buffer));
382 382
383 /* Rest of the buffer is encrypted. Decrypt it using the passphrase. */ 383 /* Rest of the buffer is encrypted. Decrypt it using the passphrase. */
384 cipher_set_key_string(&ciphercontext, cipher, passphrase); 384 cipher_set_key_string(&ciphercontext, cipher, passphrase);