From 918d4dbf20e5e4d414bef4d69414e2e448e73559 Mon Sep 17 00:00:00 2001 From: "aleksei.voronin" <aleksei.voronin@demlabs.net> Date: Wed, 9 Sep 2020 18:46:37 +0300 Subject: [PATCH] [*] encryption type for streams now can be set in config --- CellFrame/python-cellframe.c | 3 +-- CellFrame/wrapping_dap_stream_ctl.c | 4 ++-- include/wrapping_dap_stream_ctl.h | 3 ++- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CellFrame/python-cellframe.c b/CellFrame/python-cellframe.c index 0d2666ff..ebb3cfe1 100644 --- a/CellFrame/python-cellframe.c +++ b/CellFrame/python-cellframe.c @@ -251,8 +251,7 @@ PyObject *python_cellframe_init(PyObject *self, PyObject *args){ } s_init_stream = true; } else if (strcmp(c_value, "StreamCtl") == 0){ -// if (dap_stream_ctl_init(DAP_ENC_KEY_TYPE_OAES, 32) != 0){ - if (dap_stream_ctl_init_py(DAP_ENC_KEY_TYPE_OAES, 32) != 0){ + if (dap_stream_ctl_init_py(g_config, 32) != 0){ PyErr_SetString(CellFrame_error, "Failed to initialize StreamCtl module. "); return NULL; } diff --git a/CellFrame/wrapping_dap_stream_ctl.c b/CellFrame/wrapping_dap_stream_ctl.c index 56b434aa..132ccaa6 100644 --- a/CellFrame/wrapping_dap_stream_ctl.c +++ b/CellFrame/wrapping_dap_stream_ctl.c @@ -9,6 +9,6 @@ PyObject *dap_stream_ctl_add_proc_py(PyObject *self, PyObject *args){ return PyLong_FromLong(0); } -int dap_stream_ctl_init_py(dap_enc_key_type_t key, uint32_t size){ - return dap_stream_ctl_init(key, size); +int dap_stream_ctl_init_py(dap_config_t * a_config, uint32_t size){ + return dap_stream_ctl_init(a_config, size); } diff --git a/include/wrapping_dap_stream_ctl.h b/include/wrapping_dap_stream_ctl.h index bfd6805f..25fbab67 100644 --- a/include/wrapping_dap_stream_ctl.h +++ b/include/wrapping_dap_stream_ctl.h @@ -2,6 +2,7 @@ #define _WRAPPING_DAP_STREAM_CTL_ #include <Python.h> +#include "dap_config.h" #include "dap_enc_key.h" #include "dap_stream_ctl.h" #include "dap_server_python.h" @@ -15,7 +16,7 @@ typedef struct PyDapStreamCtl{ dap_enc_key_type_t dap_enc_key_type; PyObject *dap_stream_ctl_add_proc_py(PyObject *self, PyObject *args); -int dap_stream_ctl_init_py(dap_enc_key_type_t key, uint32_t size); +int dap_stream_ctl_init_py(dap_config_t * a_config, uint32_t size); static PyMethodDef DapStreamCtlMethods[] = { {"addProcHttp", dap_stream_ctl_add_proc_py, METH_VARARGS | METH_STATIC, ""}, -- GitLab