read() wants a char array, the EVP API (presumably) wants unsigned char arrays.  They're not the same type.