From 8d74dcfa1fc1576cc65ae8f46cc446848ec977be Mon Sep 17 00:00:00 2001
From: Alexander Lysikov <alexander.lysikov@demlabs.net>
Date: Thu, 24 Mar 2022 21:38:39 +0500
Subject: [PATCH] fixed bug 5857

---
 dap-sdk/net/server/enc_server/dap_enc_http.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/dap-sdk/net/server/enc_server/dap_enc_http.c b/dap-sdk/net/server/enc_server/dap_enc_http.c
index 69f6104fc..0257ea516 100644
--- a/dap-sdk/net/server/enc_server/dap_enc_http.c
+++ b/dap-sdk/net/server/enc_server/dap_enc_http.c
@@ -136,7 +136,10 @@ void enc_http_proc(struct dap_http_simple *cl_st, void * arg)
             *return_code = Http_Status_BadRequest;
             return;
         }
-        l_pkey_exchange_key->gen_bob_shared_key(l_pkey_exchange_key, alice_msg, l_pkey_exchange_size, (void**)&l_pkey_exchange_key->pub_key_data);
+        if(l_pkey_exchange_key->gen_bob_shared_key) {
+            l_pkey_exchange_key->gen_bob_shared_key(l_pkey_exchange_key, alice_msg, l_pkey_exchange_size,
+                    (void**) &l_pkey_exchange_key->pub_key_data);
+        }
 
         dap_enc_ks_key_t * l_enc_key_ks = dap_enc_ks_new();
         if (s_acl_callback) {
-- 
GitLab