diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2014-04-16 05:16:40 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2014-04-16 05:16:40 +0000 |
commit | 6f169be833c71e5310da5761957e4a538dfffaed (patch) | |
tree | 6630c46ba040eccf1867366fbb24921757ada189 /usr.bin | |
parent | 8ff5c8b4228f225c897bc50c542e3a47525eed62 (diff) |
Upgrade from des_old misery
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/gzsig/ssh.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/usr.bin/gzsig/ssh.c b/usr.bin/gzsig/ssh.c index 45e42aa1f35..e7911411f92 100644 --- a/usr.bin/gzsig/ssh.c +++ b/usr.bin/gzsig/ssh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh.c,v 1.2 2005/05/29 09:10:23 djm Exp $ */ +/* $OpenBSD: ssh.c,v 1.3 2014/04/16 05:16:39 miod Exp $ */ /* * ssh.c @@ -56,8 +56,8 @@ extern int sign_passwd_cb(char *, int, int, void *); struct des3_state { - des_key_schedule k1, k2, k3; - des_cblock iv1, iv2, iv3; + DES_key_schedule k1, k2, k3; + DES_cblock iv1, iv2, iv3; }; static int @@ -153,13 +153,13 @@ des3_init(u_char *sesskey, int len) if ((state = malloc(sizeof(*state))) == NULL) return (NULL); - des_set_key((void *)sesskey, state->k1); - des_set_key((void *)(sesskey + 8), state->k2); + DES_set_key((const_DES_cblock *)sesskey, &state->k1); + DES_set_key((const_DES_cblock *)(sesskey + 8), &state->k2); if (len <= 16) - des_set_key((void *)sesskey, state->k3); + DES_set_key((const_DES_cblock *)sesskey, &state->k3); else - des_set_key((void *)(sesskey + 16), state->k3); + DES_set_key((const_DES_cblock *)(sesskey + 16), &state->k3); memset(state->iv1, 0, 8); memset(state->iv2, 0, 8); @@ -176,9 +176,9 @@ des3_decrypt(u_char *src, u_char *dst, int len, void *state) dstate = (struct des3_state *)state; memcpy(dstate->iv1, dstate->iv2, 8); - des_ncbc_encrypt(src, dst, len, dstate->k3, &dstate->iv3, DES_DECRYPT); - des_ncbc_encrypt(dst, dst, len, dstate->k2, &dstate->iv2, DES_ENCRYPT); - des_ncbc_encrypt(dst, dst, len, dstate->k1, &dstate->iv1, DES_DECRYPT); + DES_ncbc_encrypt(src, dst, len, &dstate->k3, &dstate->iv3, DES_DECRYPT); + DES_ncbc_encrypt(dst, dst, len, &dstate->k2, &dstate->iv2, DES_ENCRYPT); + DES_ncbc_encrypt(dst, dst, len, &dstate->k1, &dstate->iv1, DES_DECRYPT); } static int |