Module: kamailio
Branch: master
Commit: dd15786aba0b48a83efeef258d689217ac5375a9
URL: https://github.com/kamailio/kamailio/commit/dd15786aba0b48a83efeef258d68921…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2020-06-01T13:10:29+02:00
crypto: aes helper functions relocated to dedicated files
---
Added: src/modules/crypto/crypto_aes.c
Added: src/modules/crypto/crypto_aes.h
---
Diff: https://github.com/kamailio/kamailio/commit/dd15786aba0b48a83efeef258d68921…
Patch: https://github.com/kamailio/kamailio/commit/dd15786aba0b48a83efeef258d68921…
---
diff --git a/src/modules/crypto/crypto_aes.c b/src/modules/crypto/crypto_aes.c
new file mode 100644
index 0000000000..9573c7264d
--- /dev/null
+++ b/src/modules/crypto/crypto_aes.c
@@ -0,0 +1,21 @@
+/**
+ * Copyright (C) 2016-2020 Daniel-Constantin Mierla (asipto.com)
+ *
+ * This file is part of Kamailio, a free SIP server.
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version
+ *
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
diff --git a/src/modules/crypto/crypto_aes.h b/src/modules/crypto/crypto_aes.h
new file mode 100644
index 0000000000..a98a95016e
--- /dev/null
+++ b/src/modules/crypto/crypto_aes.h
@@ -0,0 +1,35 @@
+/**
+ * Copyright (C) 2016-2020 Daniel-Constantin Mierla (asipto.com)
+ *
+ * This file is part of Kamailio, a free SIP server.
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version
+ *
+ *
+ * This file is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef _CRYPTO_AES_H_
+#define _CRYPTO_AES_H_
+
+#include <openssl/evp.h>
+
+int crypto_aes_init(unsigned char *key_data, int key_data_len,
+ unsigned char *salt, EVP_CIPHER_CTX *e_ctx, EVP_CIPHER_CTX *d_ctx);
+
+unsigned char *crypto_aes_encrypt(EVP_CIPHER_CTX *e, unsigned char *plaintext,
+ int *len);
+
+unsigned char *crypto_aes_decrypt(EVP_CIPHER_CTX *e, unsigned char *ciphertext,
+ int *len);
+#endif
\ No newline at end of file