summaryrefslogtreecommitdiffstats
path: root/src/lib/crypto/t_encrypt.c
diff options
context:
space:
mode:
authorSam Hartman <hartmans@mit.edu>2001-11-06 15:25:49 +0000
committerSam Hartman <hartmans@mit.edu>2001-11-06 15:25:49 +0000
commit207af9b0e6f257d475f64f74fcba3ff911aeeee0 (patch)
tree34d216251347e8a5fbbfb912e10319842eb07fb7 /src/lib/crypto/t_encrypt.c
parent4c73c7fce2a8ec612a1994dcb90c5e2feba2a02a (diff)
downloadkrb5-207af9b0e6f257d475f64f74fcba3ff911aeeee0.tar.gz
krb5-207af9b0e6f257d475f64f74fcba3ff911aeeee0.tar.xz
krb5-207af9b0e6f257d475f64f74fcba3ff911aeeee0.zip
* Add krb5_c_init_state and krb5_c_free_state functions
* Add init_state and free_state to enc_providers as operations that need to be filled in * Implement generic free_state and des-specific init_state * Implement arcfour-specific init_state * Add functions to find enctype state functions and call them * Add tests for above git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13948 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/crypto/t_encrypt.c')
-rw-r--r--src/lib/crypto/t_encrypt.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/lib/crypto/t_encrypt.c b/src/lib/crypto/t_encrypt.c
index 6cdfc21c62..db20210c38 100644
--- a/src/lib/crypto/t_encrypt.c
+++ b/src/lib/crypto/t_encrypt.c
@@ -1,5 +1,5 @@
/*
- * lib/crypto/t_encrypt.c
+main * lib/crypto/t_encrypt.c
*
* Copyright2001 by the Massachusetts Institute of Technology.
* All Rights Reserved.
@@ -53,9 +53,11 @@ if( retval) { \
abort(); \
} else printf ("OK\n");
-int main () {
+int
+main ()
+{
krb5_context context ;
- krb5_data in, out, check;
+ krb5_data in, out, check, state;
int i;
size_t len;
krb5_enc_data enc_out;
@@ -85,6 +87,14 @@ int main () {
krb5_c_encrypt (context, &key, 7, 0, &in, &enc_out));
test ("Decrypting",
krb5_c_decrypt (context, &key, 7, 0, &enc_out, &check));
+ test ("init_state",
+ krb5_c_init_state (context, &key, 7, &state));
+ test ("Encrypting with state",
+ krb5_c_encrypt (context, &key, 7, &state, &in, &enc_out));
+ test ("Decrypting",
+ krb5_c_decrypt (context, &key, 7, 0, &enc_out, &check));
+ test ("free_state",
+ krb5_c_free_state (context, &key, &state));
}
return 0;
}