summaryrefslogtreecommitdiff
path: root/sbin/isakmpd/crypto.c
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>2000-02-25 17:23:43 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>2000-02-25 17:23:43 +0000
commit21910ef24718f8005826a8363b6fa6aea6cca145 (patch)
tree54ded622fa65f31f93fbcbd04d876345c6a13682 /sbin/isakmpd/crypto.c
parent47167191f09ba0d3c55764f63f6be1d9bcb1aa4b (diff)
regress/crypto/Makefile: Merge with EOM 1.5
regress/dh/Makefile: Merge with EOM 1.7 regress/group/Makefile: Merge with EOM 1.9 regress/prf/Makefile: Merge with EOM 1.4 regress/rsakeygen/Makefile: Merge with EOM 1.8 regress/x509/Makefile: Merge with EOM 1.10 Makefile: Merge with EOM 1.62 attribute.c: Merge with EOM 1.10 sa.c: Merge with EOM 1.99 conf.c: Merge with EOM 1.20 crypto.c: Merge with EOM 1.28 isakmpd.c: Merge with EOM 1.45 connection.c: Merge with EOM 1.19 doi.h: Merge with EOM 1.28 field.c: Merge with EOM 1.11 exchange.c: Merge with EOM 1.116 ike_auth.c: Merge with EOM 1.44 pf_key_v2.c: Merge with EOM 1.37 ike_phase_1.c: Merge with EOM 1.22 ipsec.c: Merge with EOM 1.118 isakmp_doi.c: Merge with EOM 1.40 log.c: Merge with EOM 1.26 log.h: Merge with EOM 1.18 math_group.c: Merge with EOM 1.23 message.c: Merge with EOM 1.144 pf_encap.c: Merge with EOM 1.70 policy.c: Merge with EOM 1.18 timer.c: Merge with EOM 1.13 transport.c: Merge with EOM 1.41 udp.c: Merge with EOM 1.47 ui.c: Merge with EOM 1.37 x509.c: Merge with EOM 1.36 author: niklas Made debug logging a compile time selectable feature
Diffstat (limited to 'sbin/isakmpd/crypto.c')
-rw-r--r--sbin/isakmpd/crypto.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/sbin/isakmpd/crypto.c b/sbin/isakmpd/crypto.c
index e1ec3181d23..70a989f0f1c 100644
--- a/sbin/isakmpd/crypto.c
+++ b/sbin/isakmpd/crypto.c
@@ -1,5 +1,5 @@
-/* $OpenBSD: crypto.c,v 1.8 2000/02/19 19:31:32 niklas Exp $ */
-/* $EOM: crypto.c,v 1.27 2000/02/19 07:46:30 niklas Exp $ */
+/* $OpenBSD: crypto.c,v 1.9 2000/02/25 17:23:39 niklas Exp $ */
+/* $EOM: crypto.c,v 1.28 2000/02/20 19:58:36 niklas Exp $ */
/*
* Copyright (c) 1998 Niels Provos. All rights reserved.
@@ -273,7 +273,7 @@ crypto_init (struct crypto_xf *xf, u_int8_t *key, u_int16_t len,
if (len < xf->keymin || len > xf->keymax)
{
- log_debug (LOG_CRYPTO, 10, "crypto_init: invalid key length %d", len);
+ LOG_DBG ((LOG_CRYPTO, 10, "crypto_init: invalid key length %d", len));
*err = EKEYLEN;
return 0;
}
@@ -292,13 +292,13 @@ crypto_init (struct crypto_xf *xf, u_int8_t *key, u_int16_t len,
ks->riv = ks->iv;
ks->liv = ks->iv2;
- log_debug_buf (LOG_CRYPTO, 40, "crypto_init: key", key, len);
+ LOG_DBG_BUF ((LOG_CRYPTO, 40, "crypto_init: key", key, len));
*err = xf->init (ks, key, len);
if (*err != EOKAY)
{
- log_debug (LOG_CRYPTO, 30, "crypto_init: weak key found for %s",
- xf->name);
+ LOG_DBG ((LOG_CRYPTO, 30, "crypto_init: weak key found for %s",
+ xf->name));
free (ks);
return 0;
}
@@ -315,8 +315,8 @@ crypto_update_iv (struct keystate *ks)
ks->riv = ks->liv;
ks->liv = tmp;
- log_debug_buf (LOG_CRYPTO, 50, "crypto_update_iv: updated IV", ks->riv,
- ks->xf->blocksize);
+ LOG_DBG_BUF ((LOG_CRYPTO, 50, "crypto_update_iv: updated IV", ks->riv,
+ ks->xf->blocksize));
}
void
@@ -324,34 +324,34 @@ crypto_init_iv (struct keystate *ks, u_int8_t *buf, size_t len)
{
memcpy (ks->riv, buf, len);
- log_debug_buf (LOG_CRYPTO, 50, "crypto_update_iv: initialized IV", ks->riv,
- len);
+ LOG_DBG_BUF ((LOG_CRYPTO, 50, "crypto_update_iv: initialized IV", ks->riv,
+ len));
}
void
crypto_encrypt (struct keystate *ks, u_int8_t *buf, u_int16_t len)
{
- log_debug_buf (LOG_CRYPTO, 10, "crypto_encrypt: before encryption", buf,
- len);
+ LOG_DBG_BUF ((LOG_CRYPTO, 10, "crypto_encrypt: before encryption", buf,
+ len));
ks->xf->encrypt (ks, buf, len);
memcpy (ks->liv, buf + len - ks->xf->blocksize, ks->xf->blocksize);
- log_debug_buf (LOG_CRYPTO, 30, "crypto_encrypt: after encryption", buf,
- len);
+ LOG_DBG_BUF ((LOG_CRYPTO, 30, "crypto_encrypt: after encryption", buf,
+ len));
}
void
crypto_decrypt (struct keystate *ks, u_int8_t *buf, u_int16_t len)
{
- log_debug_buf (LOG_CRYPTO, 10, "crypto_decrypt: before decryption", buf,
- len);
+ LOG_DBG_BUF ((LOG_CRYPTO, 10, "crypto_decrypt: before decryption", buf,
+ len));
/*
* XXX There is controversy about the correctness of updating the IV
* like this.
*/
memcpy (ks->liv, buf + len - ks->xf->blocksize, ks->xf->blocksize);
ks->xf->decrypt (ks, buf, len);;
- log_debug_buf (LOG_CRYPTO, 30, "crypto_decrypt: after decryption", buf,
- len);
+ LOG_DBG_BUF ((LOG_CRYPTO, 30, "crypto_decrypt: after decryption", buf,
+ len));
}
/* Make a copy of the keystate pointed to by OKS. */