/*
SSSD
Encryption/Decryption primitives
Authors:
Simo Sorce <simo@redhat.com>
Copyright (C) Simo Sorce 2016
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program 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, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <talloc.h>
#include <errno.h>
#include "util/crypto/sss_crypto.h"
#include "sss_openssl.h"
struct cipher_mech {
} mechs[] = {
};
{
int evpkeylen;
int evpivlen;
int hmaclen;
int ret;
/* We have no function to return the size of the output for arbitray HMAC
* algorithms so we just truncate to the key size should the hmac be bigger
* (or pad with zeros should the HMAC be smaller) */
/* First Encrypt */
if (evpivlen != 0) {
}
ctx = EVP_CIPHER_CTX_new();
goto done;
}
if (ret != 1) {
goto done;
}
tmplen = 0;
if (ret != 1) {
goto done;
}
if (ret != 1) {
goto done;
}
/* Then HMAC */
mdctx = EVP_MD_CTX_new();
goto done;
}
if (ret != 1) {
goto done;
}
if (ret != 1) {
goto done;
}
if (ret != 1) {
goto done;
}
if (ret != 1) {
goto done;
}
*ciphertext = out;
done:
return ret;
}
{
int evpkeylen;
int evpivlen;
int hmaclen;
int ret;
/* We have no function to return the size of the output for arbitray HMAC
* algorithms so we just assume it was truncated to the key size should
* the hmac be bigger (or pad with zeros should the HMAC be smaller) */
/* First check HMAC */
mdctx = EVP_MD_CTX_new();
goto done;
}
if (ret != 1) {
goto done;
}
if (ret != 1) {
goto done;
}
if (ret != 1) {
goto done;
}
if (ret != 1) {
goto done;
}
if (ret != 0) {
goto done;
}
/* Then Decrypt */
if (evpivlen != 0) {
iv = ciphertext;
}
ctx = EVP_CIPHER_CTX_new();
goto done;
}
if (ret != 1) {
goto done;
}
if (ret != 1) {
goto done;
}
if (ret != 1) {
goto done;
}
done:
return ret;
}