Updates from HEAD.
[openssl.git] / engines / ccgost / gost_pmeth.c
index 2861d383272d227598ea3e52ac8e88e8b5f2acb1..caaea99d360b4753083c0a33343eea840f441d1f 100644 (file)
@@ -98,7 +98,14 @@ static int pkey_gost_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
                        pctx->shared_ukm=OPENSSL_malloc((int)p1);
                        memcpy(pctx->shared_ukm,p2,(int) p1);
                        return 1;
-                       
+               case EVP_PKEY_CTRL_PEER_KEY:
+                       if (p1 == 0 || p1 == 1) /* call from EVP_PKEY_derive_set_peer */
+                               return 1;
+                       if (p1 == 2)            /* TLS: peer key used? */
+                               return pctx->peer_key_used;
+                       if (p1 == 3)            /* TLS: peer key used! */
+                               return (pctx->peer_key_used = 1);
+                       return -2;
                }
        return -2;
        }