diff options
author | Adriaan de Jong <dejong@fox-it.com> | 2011-07-14 21:19:12 +0200 |
---|---|---|
committer | David Sommerseth <davids@redhat.com> | 2011-10-22 18:00:34 +0200 |
commit | 0d4ec3d8bbf39e4802781e1b3c881d76e068217f (patch) | |
tree | 2f2e10ad9cd2032d035c5412e43cbe2c896bfa44 /crypto.c | |
parent | 1271be60c88e6d7e0208fdb893f1e553c2b5f0cf (diff) | |
download | openvpn-0d4ec3d8bbf39e4802781e1b3c881d76e068217f.tar.gz openvpn-0d4ec3d8bbf39e4802781e1b3c881d76e068217f.tar.xz openvpn-0d4ec3d8bbf39e4802781e1b3c881d76e068217f.zip |
Moved print messages back to generic crypto.c from cipher backends
Signed-off-by: Adriaan de Jong <dejong@fox-it.com>
Acked-by: David Sommerseth <davids@redhat.com>
Signed-off-by: David Sommerseth <davids@redhat.com>
Diffstat (limited to 'crypto.c')
-rw-r--r-- | crypto.c | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -438,12 +438,26 @@ init_key_ctx (struct key_ctx *ctx, struct key *key, const struct key_type *kt, int enc, const char *prefix) { + struct gc_arena gc = gc_new (); CLEAR (*ctx); if (kt->cipher && kt->cipher_length > 0) { + ALLOC_OBJ(ctx->cipher, cipher_ctx_t); cipher_ctx_init (ctx->cipher, key->cipher, kt->cipher_length, - kt->cipher, enc, prefix); + kt->cipher, enc); + + msg (D_HANDSHAKE, "%s: Cipher '%s' initialized with %d bit key", + prefix, + cipher_kt_name(kt->cipher), + kt->cipher_length *8); + + dmsg (D_SHOW_KEYS, "%s: CIPHER KEY: %s", prefix, + format_hex (key->cipher, kt->cipher_length, 0, &gc)); + dmsg (D_CRYPTO_DEBUG, "%s: CIPHER block_size=%d iv_size=%d", + prefix, + cipher_kt_block_size(kt->cipher), + cipher_kt_iv_size(kt->cipher)); } if (kt->digest && kt->hmac_length > 0) { @@ -451,6 +465,7 @@ init_key_ctx (struct key_ctx *ctx, struct key *key, hmac_ctx_init (ctx->hmac, key->hmac, kt->hmac_length, kt->digest, prefix); } + gc_free (&gc); } void |