]> wagner.pp.ru Git - openssl-gost/engine.git/commitdiff
Error codes fixed
authorDmitry Belyavskiy <beldmit@gmail.com>
Thu, 30 Aug 2018 15:07:01 +0000 (18:07 +0300)
committerDmitry Belyavskiy <beldmit@gmail.com>
Thu, 30 Aug 2018 15:07:01 +0000 (18:07 +0300)
e_gost_err.c
e_gost_err.h
gost.txt
gost_omac_acpkm.c

index e28c314f69ded14a0ed2f77e4c0c3912a73d89f8..7e8730d466ef40c687da3ff60e18e345f0e2a224 100644 (file)
@@ -37,6 +37,10 @@ static ERR_STRING_DATA GOST_str_functs[] = {
     {ERR_PACK(0, GOST_F_GOST_IMIT_FINAL, 0), "gost_imit_final"},
     {ERR_PACK(0, GOST_F_GOST_IMIT_UPDATE, 0), "gost_imit_update"},
     {ERR_PACK(0, GOST_F_GOST_KEXP15, 0), "gost_kexp15"},
+    {ERR_PACK(0, GOST_F_OMAC_ACPKM_IMIT_CTRL, 0), "omac_acpkm_imit_ctrl"},
+    {ERR_PACK(0, GOST_F_OMAC_ACPKM_IMIT_FINAL, 0), "omac_acpkm_imit_final"},
+    {ERR_PACK(0, GOST_F_OMAC_ACPKM_IMIT_UPDATE, 0), "omac_acpkm_imit_update"},
+    {ERR_PACK(0, GOST_F_OMAC_ACPKM_KEY, 0), "omac_acpkm_key"},
     {ERR_PACK(0, GOST_F_OMAC_IMIT_CTRL, 0), "omac_imit_ctrl"},
     {ERR_PACK(0, GOST_F_OMAC_IMIT_FINAL, 0), "omac_imit_final"},
     {ERR_PACK(0, GOST_F_OMAC_IMIT_UPDATE, 0), "omac_imit_update"},
index 96d750104f66b79c3babc60cede254517c302ed2..79f8673bde6ebf51707356487cd53805de7cbfb3 100644 (file)
@@ -44,6 +44,10 @@ void ERR_GOST_error(int function, int reason, char *file, int line);
 # define GOST_F_GOST_IMIT_FINAL                           114
 # define GOST_F_GOST_IMIT_UPDATE                          115
 # define GOST_F_GOST_KEXP15                               143
+# define GOST_F_OMAC_ACPKM_IMIT_CTRL                      144
+# define GOST_F_OMAC_ACPKM_IMIT_FINAL                     145
+# define GOST_F_OMAC_ACPKM_IMIT_UPDATE                    146
+# define GOST_F_OMAC_ACPKM_KEY                            147
 # define GOST_F_OMAC_IMIT_CTRL                            116
 # define GOST_F_OMAC_IMIT_FINAL                           117
 # define GOST_F_OMAC_IMIT_UPDATE                          118
index 4a515f9ca2dc5afe5f553f2fe1f325f460663beb..4c66dec294a56c97c4711aa42292f865da8760b1 100644 (file)
--- a/gost.txt
+++ b/gost.txt
@@ -23,6 +23,11 @@ GOST_F_GOST_GRASSHOPPER_SET_ASN1_PARAMETERS:112:\
 GOST_F_GOST_IMIT_CTRL:113:gost_imit_ctrl
 GOST_F_GOST_IMIT_FINAL:114:gost_imit_final
 GOST_F_GOST_IMIT_UPDATE:115:gost_imit_update
+GOST_F_GOST_KEXP15:143:gost_kexp15
+GOST_F_OMAC_ACPKM_IMIT_CTRL:144:omac_acpkm_imit_ctrl
+GOST_F_OMAC_ACPKM_IMIT_FINAL:145:omac_acpkm_imit_final
+GOST_F_OMAC_ACPKM_IMIT_UPDATE:146:omac_acpkm_imit_update
+GOST_F_OMAC_ACPKM_KEY:147:omac_acpkm_key
 GOST_F_OMAC_IMIT_CTRL:116:omac_imit_ctrl
 GOST_F_OMAC_IMIT_FINAL:117:omac_imit_final
 GOST_F_OMAC_IMIT_UPDATE:118:omac_imit_update
index 6542bbf4505a90fb9ad62387ce58c13b4cad0c62..9bdb05f0e510ae2be0957531bfa777e329e79788 100644 (file)
@@ -331,7 +331,7 @@ static int omac_acpkm_imit_update(EVP_MD_CTX *ctx, const void *data,
 {
     OMAC_ACPKM_CTX *c = EVP_MD_CTX_md_data(ctx);
     if (!c->key_set) {
-        GOSTerr(GOST_F_OMAC_IMIT_UPDATE, GOST_R_MAC_KEY_NOT_SET);
+        GOSTerr(GOST_F_OMAC_ACPKM_IMIT_UPDATE, GOST_R_MAC_KEY_NOT_SET);
         return 0;
     }
 
@@ -345,7 +345,7 @@ int omac_acpkm_imit_final(EVP_MD_CTX *ctx, unsigned char *md)
     size_t mac_size = sizeof(mac);
 
     if (!c->key_set) {
-        GOSTerr(GOST_F_OMAC_IMIT_FINAL, GOST_R_MAC_KEY_NOT_SET);
+        GOSTerr(GOST_F_OMAC_ACPKM_IMIT_FINAL, GOST_R_MAC_KEY_NOT_SET);
         return 0;
     }
 
@@ -399,7 +399,7 @@ static int omac_acpkm_key(OMAC_ACPKM_CTX *c, const EVP_CIPHER *cipher,
 
     c->cmac_ctx = CMAC_ACPKM_CTX_new();
     if (c->cmac_ctx == NULL) {
-        GOSTerr(GOST_F_OMAC_KEY, ERR_R_MALLOC_FAILURE);
+        GOSTerr(GOST_F_OMAC_ACPKM_KEY, ERR_R_MALLOC_FAILURE);
         return 0;
     }
 
@@ -431,15 +431,15 @@ int omac_acpkm_imit_ctrl(EVP_MD_CTX *ctx, int type, int arg, void *ptr)
             }
             cipher = EVP_get_cipherbynid(c->cipher_nid);
             if (cipher == NULL) {
-                GOSTerr(GOST_F_OMAC_IMIT_CTRL, GOST_R_CIPHER_NOT_FOUND);
+                GOSTerr(GOST_F_OMAC_ACPKM_IMIT_CTRL, GOST_R_CIPHER_NOT_FOUND);
             }
             if (EVP_MD_meth_get_init(EVP_MD_CTX_md(ctx)) (ctx) <= 0) {
-                GOSTerr(GOST_F_OMAC_IMIT_CTRL, GOST_R_MAC_KEY_NOT_SET);
+                GOSTerr(GOST_F_OMAC_ACPKM_IMIT_CTRL, GOST_R_MAC_KEY_NOT_SET);
                 return 0;
             }
             EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_NO_INIT);
             if (c->key_set) {
-                GOSTerr(GOST_F_OMAC_IMIT_CTRL, GOST_R_BAD_ORDER);
+                GOSTerr(GOST_F_OMAC_ACPKM_IMIT_CTRL, GOST_R_BAD_ORDER);
                 return 0;
             }
             if (arg == 0) {
@@ -448,7 +448,7 @@ int omac_acpkm_imit_ctrl(EVP_MD_CTX *ctx, int type, int arg, void *ptr)
             } else if (arg == 32) {
                 return omac_acpkm_key(c, cipher, ptr, 32);
             }
-            GOSTerr(GOST_F_OMAC_IMIT_CTRL, GOST_R_INVALID_MAC_KEY_SIZE);
+            GOSTerr(GOST_F_OMAC_ACPKM_IMIT_CTRL, GOST_R_INVALID_MAC_KEY_SIZE);
             return 0;
         }
     case EVP_CTRL_KEY_MESH:
@@ -470,7 +470,7 @@ int omac_acpkm_imit_ctrl(EVP_MD_CTX *ctx, int type, int arg, void *ptr)
             switch (c->cipher_nid) {
             case NID_grasshopper_cbc:
                 if (arg < 1 || arg > 16) {
-                    GOSTerr(GOST_F_OMAC_IMIT_CTRL, GOST_R_INVALID_MAC_SIZE);
+                    GOSTerr(GOST_F_OMAC_ACPKM_IMIT_CTRL, GOST_R_INVALID_MAC_SIZE);
                     return 0;
                 }
                 c->dgst_size = arg;