X-Git-Url: http://wagner.pp.ru/gitweb/?a=blobdiff_plain;f=gost_crypt.c;h=668e881be38a1c7be8966336c2653a38c122ddba;hb=13dcbd17f3c370a7005459e1b2e6470b0262d844;hp=a32d48947581b8ebc084bd6e98c0d56dcd8bbd27;hpb=cba16944bff9d8c5dcf37be641822cd3de6d2ec1;p=openssl-gost%2Fengine.git diff --git a/gost_crypt.c b/gost_crypt.c index a32d489..668e881 100644 --- a/gost_crypt.c +++ b/gost_crypt.c @@ -8,6 +8,7 @@ **********************************************************************/ #include #include "gost89.h" +#include #include #include "e_gost_err.h" #include "gost_lcl.h" @@ -156,7 +157,6 @@ struct gost_cipher_info gost_cipher_list[] = { /* * {NID_id_GostR3411_94_CryptoProParamSet,&GostR3411_94_CryptoProParamSet,0}, */ - {NID_id_Gost28147_89_cc, &GostR3411_94_CryptoProParamSet, 0}, {NID_id_Gost28147_89_CryptoPro_A_ParamSet, &Gost28147_CryptoProParamSetA, 1}, {NID_id_Gost28147_89_CryptoPro_B_ParamSet, &Gost28147_CryptoProParamSetB, @@ -183,7 +183,7 @@ const struct gost_cipher_info *get_encryption_params(ASN1_OBJECT *obj) if (!obj) { const char *params = get_gost_engine_param(GOST_PARAM_CRYPT_PARAMS); if (!params || !strlen(params)) - return &gost_cipher_list[5]; + return &gost_cipher_list[4]; nid = OBJ_txt2nid(params); if (nid == NID_undef) { @@ -507,22 +507,22 @@ int gost89_set_asn1_parameters(EVP_CIPHER_CTX *ctx, ASN1_TYPE *params) GOST_CIPHER_PARAMS *gcp = GOST_CIPHER_PARAMS_new(); ASN1_OCTET_STRING *os = NULL; if (!gcp) { - GOSTerr(GOST_F_GOST89_SET_ASN1_PARAMETERS, GOST_R_NO_MEMORY); + GOSTerr(GOST_F_GOST89_SET_ASN1_PARAMETERS, ERR_R_MALLOC_FAILURE); return 0; } if (!ASN1_OCTET_STRING_set(gcp->iv, ctx->iv, ctx->cipher->iv_len)) { GOST_CIPHER_PARAMS_free(gcp); - GOSTerr(GOST_F_GOST89_SET_ASN1_PARAMETERS, GOST_R_NO_MEMORY); + GOSTerr(GOST_F_GOST89_SET_ASN1_PARAMETERS, ERR_R_MALLOC_FAILURE); return 0; } ASN1_OBJECT_free(gcp->enc_param_set); gcp->enc_param_set = OBJ_nid2obj(c->paramNID); len = i2d_GOST_CIPHER_PARAMS(gcp, NULL); - p = buf = (unsigned char *)OPENSSL_malloc(len); + p = buf = OPENSSL_malloc(len); if (!buf) { GOST_CIPHER_PARAMS_free(gcp); - GOSTerr(GOST_F_GOST89_SET_ASN1_PARAMETERS, GOST_R_NO_MEMORY); + GOSTerr(GOST_F_GOST89_SET_ASN1_PARAMETERS, ERR_R_MALLOC_FAILURE); return 0; } i2d_GOST_CIPHER_PARAMS(gcp, &p); @@ -532,7 +532,7 @@ int gost89_set_asn1_parameters(EVP_CIPHER_CTX *ctx, ASN1_TYPE *params) if (!os || !ASN1_OCTET_STRING_set(os, buf, len)) { OPENSSL_free(buf); - GOSTerr(GOST_F_GOST89_SET_ASN1_PARAMETERS, GOST_R_NO_MEMORY); + GOSTerr(GOST_F_GOST89_SET_ASN1_PARAMETERS, ERR_R_MALLOC_FAILURE); return 0; } OPENSSL_free(buf);