]> wagner.pp.ru Git - openssl-gost/engine.git/commitdiff
Fix Coverity #305798
authorDmitry Belyavskiy <beldmit@gmail.com>
Sat, 22 Aug 2020 15:49:57 +0000 (18:49 +0300)
committerDmitry Belyavskiy <beldmit@gmail.com>
Sat, 22 Aug 2020 15:49:57 +0000 (18:49 +0300)
test_tlstree.c

index 5b847f551eaf8c4677cff022aeca15f57c0174ad..1c4ecb8b80047a58d3b8f72346cfc7a383588dab 100644 (file)
@@ -101,7 +101,7 @@ int main(void)
        int i;
 
        OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL);
-               
+
        memset(data63, 0, 4096);
 
        md = EVP_get_digestbynid(NID_grasshopper_mac);
@@ -126,7 +126,10 @@ int main(void)
 
        ciph = EVP_get_cipherbynid(NID_id_tc26_cipher_gostr3412_2015_kuznyechik_ctracpkm);
        enc = EVP_CIPHER_CTX_new();
-       EVP_EncryptInit_ex(enc, ciph, NULL, enc_key, full_iv);
+       if (EVP_EncryptInit_ex(enc, ciph, NULL, enc_key, full_iv) <= 0) {
+               fprintf(stderr, "Internal error");
+               exit(1);
+       }
 
        for (i = 7; i >= 0; i--) {
                ++seq0[i];