/*
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 "util/crypto/sss_crypto.h"
#include "util/crypto/nss/nss_util.h"
#include "util/crypto/nss/nss_crypto.h"
struct cipher_mech {
} mechs[] = {
};
{
int ivlen;
int hmaclen;
int outlen;
int clen;
union {
unsigned int u;
int s;
} tmplen;
unsigned int digestlen;
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) */
if (!tmp_ctx) {
return ENOMEM;
}
/* initialize NSS if needed */
ret = nspr_nss_init();
goto done;
}
/* First Encrypt */
if (ivlen != 0) {
}
goto done;
}
goto done;
}
if (sret != SECSuccess) {
goto done;
}
if (sret != SECSuccess) {
goto done;
}
goto done;
}
/* Then HMAC */
goto done;
}
goto done;
}
if (sret != SECSuccess) {
goto done;
}
if (sret != SECSuccess) {
goto done;
}
if (sret != SECSuccess) {
goto done;
}
done:
return ret;
}
{
int ivlen;
int hmaclen;
int outlen;
unsigned int tmplen;
unsigned int digestlen;
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) */
if (!tmp_ctx) {
return ENOMEM;
}
/* initialize NSS if needed */
ret = nspr_nss_init();
goto done;
}
/* First check HMAC */
goto done;
}
goto done;
}
if (sret != SECSuccess) {
goto done;
}
if (sret != SECSuccess) {
goto done;
}
if (sret != SECSuccess) {
goto done;
}
if (ret != 0) {
goto done;
}
/* Then Decrypt */
if (ivlen != 0) {
if (!ivbuf) {
goto done;
}
}
goto done;
}
goto done;
}
if (sret != SECSuccess) {
goto done;
}
if (sret != SECSuccess) {
goto done;
}
done:
return ret;
}