]> www.wagner.pp.ru Git - openssl-gost/engine.git/commitdiff
Fix coverity issue 300457
authorDmitry Belyavskiy <beldmit@gmail.com>
Mon, 4 May 2020 19:57:42 +0000 (22:57 +0300)
committerDmitry Belyavskiy <beldmit@gmail.com>
Mon, 4 May 2020 20:02:50 +0000 (23:02 +0300)
e_gost_err.c
e_gost_err.h
gost.txt
gost_grasshopper_cipher.c

index 43f328dfbba87204c4b90eda4d9e59e682e2987c..caa98a23c311af886bd3f42d5d938600b9f055d8 100644 (file)
@@ -41,6 +41,8 @@ static ERR_STRING_DATA GOST_str_functs[] = {
     {ERR_PACK(0, GOST_F_GOST_EC_VERIFY, 0), "gost_ec_verify"},
     {ERR_PACK(0, GOST_F_GOST_GRASSHOPPER_CIPHER_CTL, 0),
      "gost_grasshopper_cipher_ctl"},
+    {ERR_PACK(0, GOST_F_GOST_GRASSHOPPER_CIPHER_DO_CTRACPKM_OMAC, 0),
+     "gost_grasshopper_cipher_do_ctracpkm_omac"},
     {ERR_PACK(0, GOST_F_GOST_GRASSHOPPER_SET_ASN1_PARAMETERS, 0),
      "gost_grasshopper_set_asn1_parameters"},
     {ERR_PACK(0, GOST_F_GOST_IMIT_CTRL, 0), "gost_imit_ctrl"},
index d17a165aaae487e1fa26bc5240443ad8e6bed848..48588df98c806e84383dde44a9eedad8634c7f83 100644 (file)
@@ -46,6 +46,7 @@ void ERR_GOST_error(int function, int reason, char *file, int line);
 # define GOST_F_GOST_EC_SIGN                              109
 # define GOST_F_GOST_EC_VERIFY                            110
 # define GOST_F_GOST_GRASSHOPPER_CIPHER_CTL               111
+# define GOST_F_GOST_GRASSHOPPER_CIPHER_DO_CTRACPKM_OMAC  160
 # define GOST_F_GOST_GRASSHOPPER_SET_ASN1_PARAMETERS      112
 # define GOST_F_GOST_IMIT_CTRL                            113
 # define GOST_F_GOST_IMIT_FINAL                           114
index 538cccfadaa024f21d87e95fb0ecc273404c927e..1ee757d330ebbfd866d0d0c9c3c41e64241b7e42 100644 (file)
--- a/gost.txt
+++ b/gost.txt
@@ -23,6 +23,8 @@ GOST_F_GOST_EC_KEYGEN:108:gost_ec_keygen
 GOST_F_GOST_EC_SIGN:109:gost_ec_sign
 GOST_F_GOST_EC_VERIFY:110:gost_ec_verify
 GOST_F_GOST_GRASSHOPPER_CIPHER_CTL:111:gost_grasshopper_cipher_ctl
+GOST_F_GOST_GRASSHOPPER_CIPHER_DO_CTRACPKM_OMAC:160:\
+       gost_grasshopper_cipher_do_ctracpkm_omac
 GOST_F_GOST_GRASSHOPPER_SET_ASN1_PARAMETERS:112:\
        gost_grasshopper_set_asn1_parameters
 GOST_F_GOST_IMIT_CTRL:113:gost_imit_ctrl
index ceafa41a69052c37e71b5a540b67ec917d1f8094..f0419e3029c8f8aa8ebe1d6fdebece9477354d87 100644 (file)
@@ -584,6 +584,10 @@ int gost_grasshopper_cipher_do_ctracpkm_omac(EVP_CIPHER_CTX *ctx,
                return gost2015_final_call(ctx, c->omac_ctx, KUZNYECHIK_MAC_MAX_SIZE, c->tag, gost_grasshopper_cipher_do_ctracpkm);
        }
 
+  if (in == NULL) {
+      GOSTerr(GOST_F_GOST_GRASSHOPPER_CIPHER_DO_CTRACPKM_OMAC, ERR_R_EVP_LIB);
+      return -1;
+  }
        result = gost_grasshopper_cipher_do_ctracpkm(ctx, out, in, inl);
 
        /* As in and out can be the same pointer, process decrypted here */