version 1.44, 2013/02/26 19:56:14
|
version 1.46, 2013/02/27 15:31:23
|
Line 612 instruction_digest(struct_processus *s_e
|
Line 612 instruction_digest(struct_processus *s_e
|
|
|
logical1 somme_invalide; |
logical1 somme_invalide; |
|
|
long i; |
|
long longueur_chaine; |
long longueur_chaine; |
|
|
struct_liste_chainee *l_element_courant; |
struct_liste_chainee *l_element_courant; |
Line 628 instruction_digest(struct_processus *s_e
|
Line 627 instruction_digest(struct_processus *s_e
|
unsigned char *tampon; |
unsigned char *tampon; |
unsigned char *vecteur_initialisation; |
unsigned char *vecteur_initialisation; |
|
|
|
unsigned int i; |
unsigned int longueur_bloc; |
unsigned int longueur_bloc; |
unsigned int longueur_somme; |
unsigned int longueur_somme; |
unsigned int longueur_tampon; |
unsigned int longueur_tampon; |
Line 1474 instruction_digest(struct_processus *s_e
|
Line 1474 instruction_digest(struct_processus *s_e
|
case d_code_fin_chaine: |
case d_code_fin_chaine: |
{ |
{ |
EVP_sum = EVP_dss(); |
EVP_sum = EVP_dss(); |
longueur_bloc = SHA_CBLOCK; |
|
break; |
break; |
} |
} |
|
|
Line 1483 instruction_digest(struct_processus *s_e
|
Line 1482 instruction_digest(struct_processus *s_e
|
if (fonction[4] == d_code_fin_chaine) |
if (fonction[4] == d_code_fin_chaine) |
{ |
{ |
EVP_sum = EVP_dss1(); |
EVP_sum = EVP_dss1(); |
longueur_bloc = SHA_CBLOCK; |
|
} |
} |
else |
else |
{ |
{ |
Line 1547 instruction_digest(struct_processus *s_e
|
Line 1545 instruction_digest(struct_processus *s_e
|
d_code_fin_chaine) |
d_code_fin_chaine) |
{ |
{ |
EVP_sum = EVP_ecdsa(); |
EVP_sum = EVP_ecdsa(); |
longueur_bloc = SHA_CBLOCK; |
|
} |
} |
else |
else |
{ |
{ |
Line 1612 instruction_digest(struct_processus *s_e
|
Line 1609 instruction_digest(struct_processus *s_e
|
if (fonction[3] == d_code_fin_chaine) |
if (fonction[3] == d_code_fin_chaine) |
{ |
{ |
EVP_sum = EVP_md2(); |
EVP_sum = EVP_md2(); |
longueur_bloc = MD2_BLOCK; |
|
} |
} |
else |
else |
{ |
{ |
Line 1629 instruction_digest(struct_processus *s_e
|
Line 1625 instruction_digest(struct_processus *s_e
|
if (fonction[3] == d_code_fin_chaine) |
if (fonction[3] == d_code_fin_chaine) |
{ |
{ |
EVP_sum = EVP_md4(); |
EVP_sum = EVP_md4(); |
longueur_bloc = MD4_CBLOCK; |
|
} |
} |
else |
else |
{ |
{ |
Line 1646 instruction_digest(struct_processus *s_e
|
Line 1641 instruction_digest(struct_processus *s_e
|
if (fonction[3] == d_code_fin_chaine) |
if (fonction[3] == d_code_fin_chaine) |
{ |
{ |
EVP_sum = EVP_md5(); |
EVP_sum = EVP_md5(); |
longueur_bloc = MD5_CBLOCK; |
|
} |
} |
else |
else |
{ |
{ |
Line 1667 instruction_digest(struct_processus *s_e
|
Line 1661 instruction_digest(struct_processus *s_e
|
if (fonction[4] == d_code_fin_chaine) |
if (fonction[4] == d_code_fin_chaine) |
{ |
{ |
EVP_sum = EVP_mdc2(); |
EVP_sum = EVP_mdc2(); |
longueur_bloc = MDC2_BLOCK; |
|
} |
} |
else |
else |
{ |
{ |
Line 1714 instruction_digest(struct_processus *s_e
|
Line 1707 instruction_digest(struct_processus *s_e
|
if (strcmp(fonction, "RIPEMD160") == 0) |
if (strcmp(fonction, "RIPEMD160") == 0) |
{ |
{ |
EVP_sum = EVP_ripemd160(); |
EVP_sum = EVP_ripemd160(); |
longueur_bloc = RIPEMD160_CBLOCK; |
|
} |
} |
else |
else |
{ |
{ |
Line 1741 instruction_digest(struct_processus *s_e
|
Line 1733 instruction_digest(struct_processus *s_e
|
case d_code_fin_chaine: |
case d_code_fin_chaine: |
{ |
{ |
EVP_sum = EVP_sha(); |
EVP_sum = EVP_sha(); |
longueur_bloc = SHA_CBLOCK; |
|
break; |
break; |
} |
} |
|
|
Line 1750 instruction_digest(struct_processus *s_e
|
Line 1741 instruction_digest(struct_processus *s_e
|
if (fonction[4] == d_code_fin_chaine) |
if (fonction[4] == d_code_fin_chaine) |
{ |
{ |
EVP_sum = EVP_sha1(); |
EVP_sum = EVP_sha1(); |
longueur_bloc = SHA_CBLOCK; |
|
} |
} |
else |
else |
{ |
{ |
Line 1776 instruction_digest(struct_processus *s_e
|
Line 1766 instruction_digest(struct_processus *s_e
|
{ |
{ |
EVP_sum = |
EVP_sum = |
EVP_sha224(); |
EVP_sha224(); |
longueur_bloc = |
|
SHA256_CBLOCK; |
|
} |
} |
else |
else |
{ |
{ |
Line 1809 instruction_digest(struct_processus *s_e
|
Line 1797 instruction_digest(struct_processus *s_e
|
{ |
{ |
EVP_sum = |
EVP_sum = |
EVP_sha256(); |
EVP_sha256(); |
longueur_bloc = |
|
SHA256_CBLOCK; |
|
} |
} |
else |
else |
{ |
{ |
Line 1858 instruction_digest(struct_processus *s_e
|
Line 1844 instruction_digest(struct_processus *s_e
|
{ |
{ |
EVP_sum = |
EVP_sum = |
EVP_sha384(); |
EVP_sha384(); |
longueur_bloc = |
|
SHA512_CBLOCK; |
|
} |
} |
else |
else |
{ |
{ |
Line 1905 instruction_digest(struct_processus *s_e
|
Line 1889 instruction_digest(struct_processus *s_e
|
{ |
{ |
EVP_sum = |
EVP_sum = |
EVP_sha512(); |
EVP_sha512(); |
longueur_bloc = |
|
SHA512_CBLOCK; |
|
} |
} |
else |
else |
{ |
{ |
Line 1975 instruction_digest(struct_processus *s_e
|
Line 1957 instruction_digest(struct_processus *s_e
|
if (strcmp(fonction, "WHIRLPOOL") == 0) |
if (strcmp(fonction, "WHIRLPOOL") == 0) |
{ |
{ |
EVP_sum = EVP_whirlpool(); |
EVP_sum = EVP_whirlpool(); |
longueur_bloc = WHIRLPOOL_BBLOCK / 8; |
|
} |
} |
else |
else |
{ |
{ |
Line 2015 instruction_digest(struct_processus *s_e
|
Line 1996 instruction_digest(struct_processus *s_e
|
if (strcmp(fonction, "AES-128-CBC") == 0) |
if (strcmp(fonction, "AES-128-CBC") == 0) |
{ |
{ |
EVP_chiffrement = EVP_aes_128_cbc(); |
EVP_chiffrement = EVP_aes_128_cbc(); |
longueur_clef_attendue = 16; |
|
longueur_somme = AES_BLOCK_SIZE; |
|
} |
} |
else if (strcmp(fonction, "AES-192-CBC") == 0) |
else if (strcmp(fonction, "AES-192-CBC") == 0) |
{ |
{ |
EVP_chiffrement = EVP_aes_192_cbc(); |
EVP_chiffrement = EVP_aes_192_cbc(); |
longueur_clef_attendue = 24; |
|
longueur_somme = AES_BLOCK_SIZE; |
|
} |
} |
else if (strcmp(fonction, "AES-256-CBC") == 0) |
else if (strcmp(fonction, "AES-256-CBC") == 0) |
{ |
{ |
EVP_chiffrement = EVP_aes_256_cbc(); |
EVP_chiffrement = EVP_aes_256_cbc(); |
longueur_clef_attendue = 32; |
|
longueur_somme = AES_BLOCK_SIZE; |
|
} |
} |
else |
else |
{ |
{ |
Line 2042 instruction_digest(struct_processus *s_e
|
Line 2017 instruction_digest(struct_processus *s_e
|
return; |
return; |
} |
} |
|
|
|
longueur_clef_attendue = EVP_CIPHER_key_length(EVP_chiffrement); |
|
longueur_somme = EVP_CIPHER_block_size(EVP_chiffrement); |
|
|
# endif |
# endif |
} |
} |
else if (strncmp(fonction, "DES", 3) == 0) |
else if (strncmp(fonction, "DES", 3) == 0) |
Line 2062 instruction_digest(struct_processus *s_e
|
Line 2040 instruction_digest(struct_processus *s_e
|
if (strcmp(fonction, "DES-CBC") == 0) |
if (strcmp(fonction, "DES-CBC") == 0) |
{ |
{ |
EVP_chiffrement = EVP_des_cbc(); |
EVP_chiffrement = EVP_des_cbc(); |
longueur_clef_attendue = 7; |
|
longueur_somme = 8; |
|
} |
} |
else if (strcmp(fonction, "DES-EDE-CBC") == 0) |
else if (strcmp(fonction, "DES-EDE-CBC") == 0) |
{ |
{ |
EVP_chiffrement = EVP_des_ede_cbc(); |
EVP_chiffrement = EVP_des_ede_cbc(); |
longueur_clef_attendue = 7; |
|
longueur_somme = 8; |
|
} |
} |
else if (strcmp(fonction, "DES-EDE3-CBC") == 0) |
else if (strcmp(fonction, "DES-EDE3-CBC") == 0) |
{ |
{ |
EVP_chiffrement = EVP_des_ede3_cbc(); |
EVP_chiffrement = EVP_des_ede3_cbc(); |
longueur_clef_attendue = 7; |
|
longueur_somme = 8; |
|
} |
} |
else if (strcmp(fonction, "DESX-CBC") == 0) |
else if (strcmp(fonction, "DESX-CBC") == 0) |
{ |
{ |
EVP_chiffrement = EVP_desx_cbc(); |
EVP_chiffrement = EVP_desx_cbc(); |
longueur_clef_attendue = 7; |
|
longueur_somme = 8; |
|
} |
} |
else |
else |
{ |
{ |
Line 2094 instruction_digest(struct_processus *s_e
|
Line 2064 instruction_digest(struct_processus *s_e
|
d_ex_chiffrement_indisponible; |
d_ex_chiffrement_indisponible; |
return; |
return; |
} |
} |
|
|
|
longueur_clef_attendue = EVP_CIPHER_key_length(EVP_chiffrement); |
|
longueur_somme = EVP_CIPHER_block_size(EVP_chiffrement); |
|
|
# endif |
# endif |
} |
} |
else if (strncmp(fonction, "CAMELLIA", 8) == 0) |
else if (strncmp(fonction, "CAMELLIA", 8) == 0) |
Line 2114 instruction_digest(struct_processus *s_e
|
Line 2088 instruction_digest(struct_processus *s_e
|
if (strcmp(fonction, "CAMELLIA-128-CBC") == 0) |
if (strcmp(fonction, "CAMELLIA-128-CBC") == 0) |
{ |
{ |
EVP_chiffrement = EVP_camellia_128_cbc(); |
EVP_chiffrement = EVP_camellia_128_cbc(); |
longueur_clef_attendue = 16; |
|
longueur_somme = CAMELLIA_BLOCK_SIZE; |
|
} |
} |
else if (strcmp(fonction, "CAMELLIA-192-CBC") == 0) |
else if (strcmp(fonction, "CAMELLIA-192-CBC") == 0) |
{ |
{ |
EVP_chiffrement = EVP_camellia_192_cbc(); |
EVP_chiffrement = EVP_camellia_192_cbc(); |
longueur_clef_attendue = 24; |
|
longueur_somme = CAMELLIA_BLOCK_SIZE; |
|
} |
} |
else if (strcmp(fonction, "CAMELLIA-256-CBC") == 0) |
else if (strcmp(fonction, "CAMELLIA-256-CBC") == 0) |
{ |
{ |
EVP_chiffrement = EVP_camellia_256_cbc(); |
EVP_chiffrement = EVP_camellia_256_cbc(); |
longueur_clef_attendue = 32; |
|
longueur_somme = CAMELLIA_BLOCK_SIZE; |
|
} |
} |
else |
else |
{ |
{ |
Line 2140 instruction_digest(struct_processus *s_e
|
Line 2108 instruction_digest(struct_processus *s_e
|
d_ex_chiffrement_indisponible; |
d_ex_chiffrement_indisponible; |
return; |
return; |
} |
} |
|
|
|
longueur_clef_attendue = EVP_CIPHER_key_length(EVP_chiffrement); |
|
longueur_somme = EVP_CIPHER_block_size(EVP_chiffrement); |
|
|
# endif |
# endif |
} |
} |
else if (strncmp(fonction, "RC2", 3) == 0) |
else if (strncmp(fonction, "RC2", 3) == 0) |
Line 2160 instruction_digest(struct_processus *s_e
|
Line 2132 instruction_digest(struct_processus *s_e
|
if (strcmp(fonction, "RC2-CBC") == 0) |
if (strcmp(fonction, "RC2-CBC") == 0) |
{ |
{ |
EVP_chiffrement = EVP_rc2_cbc(); |
EVP_chiffrement = EVP_rc2_cbc(); |
longueur_clef_attendue = 0; |
|
longueur_clef_min = 1; |
|
longueur_clef_max = 16; |
|
longueur_somme = RC2_BLOCK; |
|
} |
} |
else if (strcmp(fonction, "RC2-40-CBC") == 0) |
else if (strcmp(fonction, "RC2-40-CBC") == 0) |
{ |
{ |
EVP_chiffrement = EVP_rc2_40_cbc(); |
EVP_chiffrement = EVP_rc2_40_cbc(); |
longueur_clef_attendue = 0; |
|
longueur_clef_min = 1; |
|
longueur_clef_max = 16; |
|
longueur_somme = RC2_BLOCK; |
|
} |
} |
else if (strcmp(fonction, "RC2-64-CBC") == 0) |
else if (strcmp(fonction, "RC2-64-CBC") == 0) |
{ |
{ |
EVP_chiffrement = EVP_rc2_64_cbc(); |
EVP_chiffrement = EVP_rc2_64_cbc(); |
longueur_clef_attendue = 0; |
|
longueur_clef_min = 1; |
|
longueur_clef_max = 16; |
|
longueur_somme = RC2_BLOCK; |
|
} |
} |
else |
else |
{ |
{ |
Line 2192 instruction_digest(struct_processus *s_e
|
Line 2152 instruction_digest(struct_processus *s_e
|
d_ex_chiffrement_indisponible; |
d_ex_chiffrement_indisponible; |
return; |
return; |
} |
} |
|
|
|
longueur_clef_attendue = 0; |
|
longueur_clef_min = 1; |
|
longueur_clef_max = 16; |
|
longueur_somme = EVP_CIPHER_block_size(EVP_chiffrement); |
|
|
# endif |
# endif |
} |
} |
else if (strncmp(fonction, "IDEA", 4) == 0) |
else if (strncmp(fonction, "IDEA", 4) == 0) |
Line 2212 instruction_digest(struct_processus *s_e
|
Line 2178 instruction_digest(struct_processus *s_e
|
if (strcmp(fonction, "IDEA-CBC") == 0) |
if (strcmp(fonction, "IDEA-CBC") == 0) |
{ |
{ |
EVP_chiffrement = EVP_idea_cbc(); |
EVP_chiffrement = EVP_idea_cbc(); |
longueur_clef_attendue = 16; |
|
longueur_somme = IDEA_BLOCK; |
|
} |
} |
else |
else |
{ |
{ |
Line 2226 instruction_digest(struct_processus *s_e
|
Line 2190 instruction_digest(struct_processus *s_e
|
d_ex_chiffrement_indisponible; |
d_ex_chiffrement_indisponible; |
return; |
return; |
} |
} |
|
|
|
longueur_clef_attendue = EVP_CIPHER_key_length(EVP_chiffrement); |
|
longueur_somme = EVP_CIPHER_block_size(EVP_chiffrement); |
|
|
# endif |
# endif |
} |
} |
else |
else |
Line 2312 instruction_digest(struct_processus *s_e
|
Line 2280 instruction_digest(struct_processus *s_e
|
|
|
if ((tampon = chiffrement(EVP_chiffrement, d_vrai, |
if ((tampon = chiffrement(EVP_chiffrement, d_vrai, |
chaine, longueur_chaine, clef, longueur_clef, |
chaine, longueur_chaine, clef, longueur_clef, |
vecteur_initialisation, longueur_clef, |
vecteur_initialisation, &longueur_tampon)) == NULL) |
longueur_somme, &longueur_tampon)) == NULL) |
|
{ |
{ |
free(fonction); |
free(fonction); |
free(vecteur_initialisation); |
free(vecteur_initialisation); |
Line 2363 instruction_digest(struct_processus *s_e
|
Line 2330 instruction_digest(struct_processus *s_e
|
l_element_courant = (*s_objet_argument_1).objet; |
l_element_courant = (*s_objet_argument_1).objet; |
l_element_courant = (*l_element_courant).suivant; |
l_element_courant = (*l_element_courant).suivant; |
|
|
|
longueur_bloc = EVP_MD_block_size(EVP_sum); |
|
|
if ((clef = formateur_flux(s_etat_processus, (unsigned char *) |
if ((clef = formateur_flux(s_etat_processus, (unsigned char *) |
(*(*l_element_courant).donnee).objet, &longueur_clef)) |
(*(*l_element_courant).donnee).objet, &longueur_clef)) |
== NULL) |
== NULL) |