- Timestamp:
- 2015-05-09T19:50:30Z (10 years ago)
- Children:
- ec8b369
- Parents:
- 356e2dd (diff), 5014380 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
unix.c
r356e2dd rb8c336b 212 212 argv[0], argv[0], argv[0], argv[0], argv[0]); 213 213 } else if (strcmp(argv[2], "enc") == 0) { 214 pass_len = arc_encode(argv[4], strlen(argv[4]), (unsigned char **) &pass_cr, argv[3], 12); 215 printf("%s\n", base64_encode(pass_cr, pass_len)); 214 char *encoded; 215 216 pass_len = arc_encode(argv[4], strlen(argv[4]), &pass_cr, argv[3], 12); 217 218 encoded = base64_encode(pass_cr, pass_len); 219 printf("%s\n", encoded); 220 g_free(encoded); 221 g_free(pass_cr); 216 222 } else if (strcmp(argv[2], "dec") == 0) { 217 pass_len = base64_decode(argv[4], (unsigned char **)&pass_cr);223 pass_len = base64_decode(argv[4], &pass_cr); 218 224 arc_decode(pass_cr, pass_len, (char **) &pass_cl, argv[3]); 219 225 printf("%s\n", pass_cl); 226 227 g_free(pass_cr); 228 g_free(pass_cl); 220 229 } else if (strcmp(argv[2], "hash") == 0) { 221 230 md5_byte_t pass_md5[21]; 222 231 md5_state_t md5_state; 232 char *encoded; 223 233 224 234 random_bytes(pass_md5 + 16, 5); … … 228 238 md5_finish(&md5_state, pass_md5); 229 239 230 printf("%s\n", base64_encode(pass_md5, 21)); 240 encoded = base64_encode(pass_md5, 21); 241 printf("%s\n", encoded); 242 g_free(encoded); 231 243 } else if (strcmp(argv[2], "unhash") == 0) { 232 244 printf("Hash %s submitted to a massive Beowulf cluster of\n"
Note: See TracChangeset
for help on using the changeset viewer.