Skip to content

Commit

Permalink
Let's search the default paramset and not hardcode its position
Browse files Browse the repository at this point in the history
  • Loading branch information
beldmit committed Oct 9, 2015
1 parent 01dca9b commit ea10e1a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions gost_crypt.c
Expand Up @@ -205,8 +205,13 @@ const struct gost_cipher_info *get_encryption_params(ASN1_OBJECT *obj)
struct gost_cipher_info *param;
if (!obj) {
const char *params = get_gost_engine_param(GOST_PARAM_CRYPT_PARAMS);
if (!params || !strlen(params))
return &gost_cipher_list[4];
if (!params || !strlen(params)) {
int i;
for (i = 0; gost_cipher_list[i].nid != NID_undef; i++)
if (gost_cipher_list[i].nid == NID_id_tc26_gost_28147_param_Z)
return &gost_cipher_list[i];
return &gost_cipher_list[0];
}

nid = OBJ_txt2nid(params);
if (nid == NID_undef) {
Expand Down

0 comments on commit ea10e1a

Please sign in to comment.