summaryrefslogtreecommitdiff
path: root/sbin/isakmpd/crypto.c
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2010-10-15 10:18:43 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2010-10-15 10:18:43 +0000
commit89306d994fe40773e352c112b7fa88c304e8ffe9 (patch)
treeff163bb612b75e16312b655956e852e998b971fc /sbin/isakmpd/crypto.c
parentb3298c6a74262bc14f1776c9b440c15dbbf0127e (diff)
Switch the remaining users of libdes in src to libcrypto,
telnet portion partially from the latest heimdal. ok mikeb@
Diffstat (limited to 'sbin/isakmpd/crypto.c')
-rw-r--r--sbin/isakmpd/crypto.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/sbin/isakmpd/crypto.c b/sbin/isakmpd/crypto.c
index 9843c682eac..1dac786313f 100644
--- a/sbin/isakmpd/crypto.c
+++ b/sbin/isakmpd/crypto.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: crypto.c,v 1.29 2007/05/07 18:25:30 cloder Exp $ */
+/* $OpenBSD: crypto.c,v 1.30 2010/10/15 10:18:42 jsg Exp $ */
/* $EOM: crypto.c,v 1.32 2000/03/07 20:08:51 niklas Exp $ */
/*
@@ -89,9 +89,9 @@ struct crypto_xf transforms[] = {
enum cryptoerr
des1_init(struct keystate *ks, u_int8_t *key, u_int16_t len)
{
- /* des_set_key returns -1 for parity problems, and -2 for weak keys */
- des_set_odd_parity((void *)key);
- switch (des_set_key((void *)key, ks->ks_des[0])) {
+ /* DES_set_key returns -1 for parity problems, and -2 for weak keys */
+ DES_set_odd_parity((void *)key);
+ switch (DES_set_key((void *)key, &ks->ks_des[0])) {
case -2:
return EWEAKKEY;
default:
@@ -102,28 +102,28 @@ des1_init(struct keystate *ks, u_int8_t *key, u_int16_t len)
void
des1_encrypt(struct keystate *ks, u_int8_t *d, u_int16_t len)
{
- des_cbc_encrypt((void *)d, (void *)d, len, ks->ks_des[0], (void *)ks->riv,
+ DES_cbc_encrypt((void *)d, (void *)d, len, &ks->ks_des[0], (void *)ks->riv,
DES_ENCRYPT);
}
void
des1_decrypt(struct keystate *ks, u_int8_t *d, u_int16_t len)
{
- des_cbc_encrypt((void *)d, (void *)d, len, ks->ks_des[0], (void *)ks->riv,
+ DES_cbc_encrypt((void *)d, (void *)d, len, &ks->ks_des[0], (void *)ks->riv,
DES_DECRYPT);
}
enum cryptoerr
des3_init(struct keystate *ks, u_int8_t *key, u_int16_t len)
{
- des_set_odd_parity((void *)key);
- des_set_odd_parity((void *)(key + 8));
- des_set_odd_parity((void *)(key + 16));
+ DES_set_odd_parity((void *)key);
+ DES_set_odd_parity((void *)(key + 8));
+ DES_set_odd_parity((void *)(key + 16));
/* As of the draft Tripe-DES does not check for weak keys */
- des_set_key((void *)key, ks->ks_des[0]);
- des_set_key((void *)(key + 8), ks->ks_des[1]);
- des_set_key((void *)(key + 16), ks->ks_des[2]);
+ DES_set_key((void *)key, &ks->ks_des[0]);
+ DES_set_key((void *)(key + 8), &ks->ks_des[1]);
+ DES_set_key((void *)(key + 16), &ks->ks_des[2]);
return EOKAY;
}
@@ -134,8 +134,8 @@ des3_encrypt(struct keystate *ks, u_int8_t *data, u_int16_t len)
u_int8_t iv[MAXBLK];
memcpy(iv, ks->riv, ks->xf->blocksize);
- des_ede3_cbc_encrypt((void *)data, (void *)data, len, ks->ks_des[0],
- ks->ks_des[1], ks->ks_des[2], (void *)iv, DES_ENCRYPT);
+ DES_ede3_cbc_encrypt((void *)data, (void *)data, len, &ks->ks_des[0],
+ &ks->ks_des[1], &ks->ks_des[2], (void *)iv, DES_ENCRYPT);
}
void
@@ -144,8 +144,8 @@ des3_decrypt(struct keystate *ks, u_int8_t *data, u_int16_t len)
u_int8_t iv[MAXBLK];
memcpy(iv, ks->riv, ks->xf->blocksize);
- des_ede3_cbc_encrypt((void *)data, (void *)data, len, ks->ks_des[0],
- ks->ks_des[1], ks->ks_des[2], (void *)iv, DES_DECRYPT);
+ DES_ede3_cbc_encrypt((void *)data, (void *)data, len, &ks->ks_des[0],
+ &ks->ks_des[1], &ks->ks_des[2], (void *)iv, DES_DECRYPT);
}
enum cryptoerr