Changeset a52eeb1
- Timestamp:
- Feb 9, 2010, 9:49:44 PM (15 years ago)
- Branches:
- master, release-1.10, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- ae50abc
- Parents:
- dacb555
- git-author:
- Anders Kaseorg <andersk@mit.edu> (02/07/10 23:08:47)
- git-committer:
- Anders Kaseorg <andersk@mit.edu> (02/09/10 21:49:44)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
zcrypt.c
rdacb555 ra52eeb1 63 63 #define M_SETKEY 5 64 64 65 static void owl_zcrypt_string_to_schedule(c har *keystring, des_key_schedule *schedule) {65 static void owl_zcrypt_string_to_schedule(const char *keystring, des_key_schedule *schedule) { 66 66 #ifdef HAVE_KERBEROS_IV 67 67 des_cblock key; … … 80 80 char *owl_zcrypt_decrypt(const char *in, const char *class, const char *instance) 81 81 { 82 const char *inptr, *endptr;83 82 char *fname, keystring[MAX_KEY]; 84 83 FILE *fkey; 85 des_key_schedule schedule;86 char *out;87 unsigned char input[8], output[8];88 int i, c1, c2;89 84 90 85 fname=GetZephyrVarKeyFile("zcrypt", class, instance); … … 98 93 fclose(fkey); 99 94 95 return owl_zcrypt_decrypt_with_key(in, keystring); 96 } 97 98 char *owl_zcrypt_decrypt_with_key(const char *in, const char *keystring) 99 { 100 const char *inptr, *endptr; 101 char *out; 102 des_key_schedule schedule; 103 unsigned char input[8], output[8]; 104 int i, c1, c2; 105 100 106 out = owl_malloc(strlen(in) * 16 + 20); 107 101 108 strcpy(out, ""); 102 109 … … 127 134 char *fname, keystring[MAX_KEY]; 128 135 FILE *fkey; 129 des_key_schedule schedule;130 char *out;131 unsigned char input[8], output[8];132 int size, length, i;133 const char *inbuff = NULL, *inptr;134 int num_blocks=0, last_block_size=0;135 136 136 137 fname=GetZephyrVarKeyFile("zcrypt", class, instance); … … 143 144 } 144 145 fclose(fkey); 146 147 return owl_zcrypt_encrypt_with_key(in, keystring); 148 } 149 150 char *owl_zcrypt_encrypt_with_key(const char *in, const char *keystring) 151 { 152 des_key_schedule schedule; 153 char *out; 154 unsigned char input[8], output[8]; 155 int size, length, i; 156 const char *inbuff = NULL, *inptr; 157 int num_blocks=0, last_block_size=0; 145 158 146 159 owl_zcrypt_string_to_schedule(keystring, &schedule);
Note: See TracChangeset
for help on using the changeset viewer.