summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--cipher.c14
-rw-r--r--key.c10
3 files changed, 25 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 93bef7c3b..bf795be27 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,9 @@
3 - deraadt@cvs.openbsd.org 2002/06/23 03:25:50 3 - deraadt@cvs.openbsd.org 2002/06/23 03:25:50
4 [tildexpand.c] 4 [tildexpand.c]
5 KNF 5 KNF
6 - deraadt@cvs.openbsd.org 2002/06/23 03:26:19
7 [cipher.c key.c]
8 KNF
6 9
720020623 1020020623
8 - (stevesk) [configure.ac] bug #255 LOGIN_NEEDS_UTMPX for AIX. 11 - (stevesk) [configure.ac] bug #255 LOGIN_NEEDS_UTMPX for AIX.
@@ -1047,4 +1050,4 @@
1047 - (stevesk) entropy.c: typo in debug message 1050 - (stevesk) entropy.c: typo in debug message
1048 - (djm) ssh-keygen -i needs seeded RNG; report from markus@ 1051 - (djm) ssh-keygen -i needs seeded RNG; report from markus@
1049 1052
1050$Id: ChangeLog,v 1.2254 2002/06/23 21:20:34 mouring Exp $ 1053$Id: ChangeLog,v 1.2255 2002/06/23 21:21:30 mouring Exp $
diff --git a/cipher.c b/cipher.c
index b18c701fb..6db340d7a 100644
--- a/cipher.c
+++ b/cipher.c
@@ -35,7 +35,7 @@
35 */ 35 */
36 36
37#include "includes.h" 37#include "includes.h"
38RCSID("$OpenBSD: cipher.c,v 1.59 2002/06/19 18:01:00 markus Exp $"); 38RCSID("$OpenBSD: cipher.c,v 1.60 2002/06/23 03:26:52 deraadt Exp $");
39 39
40#include "xmalloc.h" 40#include "xmalloc.h"
41#include "log.h" 41#include "log.h"
@@ -95,11 +95,13 @@ cipher_blocksize(Cipher *c)
95{ 95{
96 return (c->block_size); 96 return (c->block_size);
97} 97}
98
98u_int 99u_int
99cipher_keylen(Cipher *c) 100cipher_keylen(Cipher *c)
100{ 101{
101 return (c->key_len); 102 return (c->key_len);
102} 103}
104
103u_int 105u_int
104cipher_get_number(Cipher *c) 106cipher_get_number(Cipher *c)
105{ 107{
@@ -314,6 +316,7 @@ struct ssh1_3des_ctx
314{ 316{
315 EVP_CIPHER_CTX k1, k2, k3; 317 EVP_CIPHER_CTX k1, k2, k3;
316}; 318};
319
317static int 320static int
318ssh1_3des_init(EVP_CIPHER_CTX *ctx, const u_char *key, const u_char *iv, 321ssh1_3des_init(EVP_CIPHER_CTX *ctx, const u_char *key, const u_char *iv,
319 int enc) 322 int enc)
@@ -356,6 +359,7 @@ ssh1_3des_init(EVP_CIPHER_CTX *ctx, const u_char *key, const u_char *iv,
356#endif 359#endif
357 return (1); 360 return (1);
358} 361}
362
359static int 363static int
360ssh1_3des_cbc(EVP_CIPHER_CTX *ctx, u_char *dest, const u_char *src, u_int len) 364ssh1_3des_cbc(EVP_CIPHER_CTX *ctx, u_char *dest, const u_char *src, u_int len)
361{ 365{
@@ -377,6 +381,7 @@ ssh1_3des_cbc(EVP_CIPHER_CTX *ctx, u_char *dest, const u_char *src, u_int len)
377#endif 381#endif
378 return (1); 382 return (1);
379} 383}
384
380static int 385static int
381ssh1_3des_cleanup(EVP_CIPHER_CTX *ctx) 386ssh1_3des_cleanup(EVP_CIPHER_CTX *ctx)
382{ 387{
@@ -389,6 +394,7 @@ ssh1_3des_cleanup(EVP_CIPHER_CTX *ctx)
389 } 394 }
390 return (1); 395 return (1);
391} 396}
397
392static const EVP_CIPHER * 398static const EVP_CIPHER *
393evp_ssh1_3des(void) 399evp_ssh1_3des(void)
394{ 400{
@@ -430,7 +436,9 @@ swap_bytes(const u_char *src, u_char *dst, int n)
430 *dst++ = c[3]; 436 *dst++ = c[3];
431 } 437 }
432} 438}
439
433static int (*orig_bf)(EVP_CIPHER_CTX *, u_char *, const u_char *, u_int) = NULL; 440static int (*orig_bf)(EVP_CIPHER_CTX *, u_char *, const u_char *, u_int) = NULL;
441
434static int 442static int
435bf_ssh1_cipher(EVP_CIPHER_CTX *ctx, u_char *out, const u_char *in, u_int len) 443bf_ssh1_cipher(EVP_CIPHER_CTX *ctx, u_char *out, const u_char *in, u_int len)
436{ 444{
@@ -441,6 +449,7 @@ bf_ssh1_cipher(EVP_CIPHER_CTX *ctx, u_char *out, const u_char *in, u_int len)
441 swap_bytes(out, out, len); 449 swap_bytes(out, out, len);
442 return (ret); 450 return (ret);
443} 451}
452
444static const EVP_CIPHER * 453static const EVP_CIPHER *
445evp_ssh1_bf(void) 454evp_ssh1_bf(void)
446{ 455{
@@ -483,6 +492,7 @@ ssh_rijndael_init(EVP_CIPHER_CTX *ctx, const u_char *key, const u_char *iv,
483 memcpy(c->r_iv, iv, RIJNDAEL_BLOCKSIZE); 492 memcpy(c->r_iv, iv, RIJNDAEL_BLOCKSIZE);
484 return (1); 493 return (1);
485} 494}
495
486static int 496static int
487ssh_rijndael_cbc(EVP_CIPHER_CTX *ctx, u_char *dest, const u_char *src, 497ssh_rijndael_cbc(EVP_CIPHER_CTX *ctx, u_char *dest, const u_char *src,
488 u_int len) 498 u_int len)
@@ -528,6 +538,7 @@ ssh_rijndael_cbc(EVP_CIPHER_CTX *ctx, u_char *dest, const u_char *src,
528 } 538 }
529 return (1); 539 return (1);
530} 540}
541
531static int 542static int
532ssh_rijndael_cleanup(EVP_CIPHER_CTX *ctx) 543ssh_rijndael_cleanup(EVP_CIPHER_CTX *ctx)
533{ 544{
@@ -540,6 +551,7 @@ ssh_rijndael_cleanup(EVP_CIPHER_CTX *ctx)
540 } 551 }
541 return (1); 552 return (1);
542} 553}
554
543static const EVP_CIPHER * 555static const EVP_CIPHER *
544evp_rijndael(void) 556evp_rijndael(void)
545{ 557{
diff --git a/key.c b/key.c
index 2d850c8e5..fb1f8410a 100644
--- a/key.c
+++ b/key.c
@@ -32,7 +32,7 @@
32 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */ 33 */
34#include "includes.h" 34#include "includes.h"
35RCSID("$OpenBSD: key.c,v 1.44 2002/05/31 13:16:48 markus Exp $"); 35RCSID("$OpenBSD: key.c,v 1.45 2002/06/23 03:26:19 deraadt Exp $");
36 36
37#include <openssl/evp.h> 37#include <openssl/evp.h>
38 38
@@ -89,6 +89,7 @@ key_new(int type)
89 } 89 }
90 return k; 90 return k;
91} 91}
92
92Key * 93Key *
93key_new_private(int type) 94key_new_private(int type)
94{ 95{
@@ -120,6 +121,7 @@ key_new_private(int type)
120 } 121 }
121 return k; 122 return k;
122} 123}
124
123void 125void
124key_free(Key *k) 126key_free(Key *k)
125{ 127{
@@ -359,6 +361,7 @@ read_bignum(char **cpp, BIGNUM * value)
359 *cpp = cp; 361 *cpp = cp;
360 return 1; 362 return 1;
361} 363}
364
362static int 365static int
363write_bignum(FILE *f, BIGNUM *num) 366write_bignum(FILE *f, BIGNUM *num)
364{ 367{
@@ -485,6 +488,7 @@ key_read(Key *ret, char **cpp)
485 } 488 }
486 return success; 489 return success;
487} 490}
491
488int 492int
489key_write(Key *key, FILE *f) 493key_write(Key *key, FILE *f)
490{ 494{
@@ -516,6 +520,7 @@ key_write(Key *key, FILE *f)
516 } 520 }
517 return success; 521 return success;
518} 522}
523
519char * 524char *
520key_type(Key *k) 525key_type(Key *k)
521{ 526{
@@ -532,6 +537,7 @@ key_type(Key *k)
532 } 537 }
533 return "unknown"; 538 return "unknown";
534} 539}
540
535char * 541char *
536key_ssh_name(Key *k) 542key_ssh_name(Key *k)
537{ 543{
@@ -545,6 +551,7 @@ key_ssh_name(Key *k)
545 } 551 }
546 return "ssh-unknown"; 552 return "ssh-unknown";
547} 553}
554
548u_int 555u_int
549key_size(Key *k) 556key_size(Key *k)
550{ 557{
@@ -807,7 +814,6 @@ key_verify(
807} 814}
808 815
809/* Converts a private to a public key */ 816/* Converts a private to a public key */
810
811Key * 817Key *
812key_demote(Key *k) 818key_demote(Key *k)
813{ 819{