]> wagner.pp.ru Git - openssl-gost/engine.git/blobdiff - gost_pmeth.c
gost_kimp15, untested
[openssl-gost/engine.git] / gost_pmeth.c
index 5c7352b338dd51d396f2ddf84ac01917db271913..92c7bca399e1b18cc6064abdfcb8b90a1190f4fe 100644 (file)
@@ -151,6 +151,10 @@ static int pkey_gost_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
             return 0;
         }
         memcpy(pctx->shared_ukm, p2, (int)p1);
+        pctx->shared_ukm_size = p1;
+        return 1;
+    case EVP_PKEY_CTRL_CIPHER:
+        pctx->cipher_nid = p1;
         return 1;
     case EVP_PKEY_CTRL_PEER_KEY:
         if (p1 == 0 || p1 == 1) /* call from EVP_PKEY_derive_set_peer */
@@ -614,7 +618,6 @@ static int pkey_gost_mac_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
         }
     case EVP_PKEY_CTRL_MAC_LEN:
         {
-                               /*TODO*/
             if (p1 < 1 || p1 > 8) {
 
                 GOSTerr(GOST_F_PKEY_GOST_MAC_CTRL, GOST_R_INVALID_MAC_SIZE);
@@ -746,8 +749,7 @@ static int pkey_gost_omac_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2, si
         }
     case EVP_PKEY_CTRL_MAC_LEN:
         {
-                               /*TODO*/
-            if (p1 < 1 || p1 > 8) {
+            if (p1 < 1 || p1 > max_size) {
 
                 GOSTerr(GOST_F_PKEY_GOST_OMAC_CTRL, GOST_R_INVALID_MAC_SIZE);
                 return 0;