1 /* 2 * Common code for the Ansible Vault format. 3 */ 4 5 #include "formats.h" 6 7 #define FORMAT_NAME "Ansible Vault" 8 #define FORMAT_TAG "$ansible$" 9 #define TAG_LENGTH (sizeof(FORMAT_TAG) - 1) 10 #define BINARY_SIZE 32 11 #define BINARY_SIZE_CMP 16 12 13 #define SALTLEN 32 14 #define BLOBLEN 8192 15 16 struct custom_salt{ 17 int salt_length; 18 int iterations; 19 int bloblen; 20 unsigned char salt[SALTLEN]; 21 unsigned char checksum[32]; 22 unsigned char blob[BLOBLEN]; 23 }; 24 25 extern struct fmt_tests ansible_tests[]; 26 27 int ansible_common_valid(char *ciphertext, struct fmt_main *self); 28 void *ansible_common_get_salt(char *ciphertext); 29 extern void *ansible_common_get_binary(char *ciphertext); 30 unsigned int ansible_common_iteration_count(void *salt); 31