- return gost_tlstree(c->cipher_nid, c->key, diversed_key,
- (const unsigned char *)ptr) ?
- omac_key(c, EVP_get_cipherbynid(c->cipher_nid),
- diversed_key, 32) : 0;
+ int ret = 0;
+ if (gost_tlstree(OBJ_txt2nid(c->cipher_name),
+ c->key, diversed_key,
+ (const unsigned char *)ptr)) {
+ EVP_CIPHER *cipher;
+ if ((cipher = (EVP_CIPHER *)EVP_get_cipherbyname(c->cipher_name))
+ || (cipher = EVP_CIPHER_fetch(NULL, c->cipher_name, NULL)))
+ ret = omac_key(c, cipher, diversed_key, 32);
+ EVP_CIPHER_free(cipher);
+ }
+ return ret;