partically revert last change

This commit is contained in:
root 2019-07-16 06:18:44 +00:00
parent 7636225414
commit 5cc304a261

@ -327,11 +327,6 @@ int cipher_aes128cfb_encrypt(const char *data,char *output,int &len,char * key)
else first_time=0;
}
if(len>=16)
{
AES_ECB_encrypt_buffer(data,key,buf); //tmp solution, to fix a problem
}
AES_CFB_encrypt_buffer((unsigned char *)output,(unsigned char *)buf,len,(unsigned char *)key,(unsigned char *)zero_iv);
return 0;
}
@ -379,15 +374,7 @@ int cipher_aes128cfb_decrypt(const char *data,char *output,int &len,char * key)
if(first_time==0) key=0;
else first_time=0;
}
char buf[buf_len];
memcpy(buf,data,len);//TODO inefficient code
if(len>=16)
{
AES_ECB_decrypt_buffer(data,key,buf);//tmp solution to fix a problem
}
AES_CFB_decrypt_buffer((unsigned char *)output,(unsigned char *)buf,len,(unsigned char *)key,(unsigned char *)zero_iv);
AES_CFB_decrypt_buffer((unsigned char *)output,(unsigned char *)data,len,(unsigned char *)key,(unsigned char *)zero_iv);
//if(de_padding(output,len,16)<0) return -1;
return 0;
}