/*
SSSD
Crypto tests
Author: Jakub Hrozek <jhrozek@redhat.com>
Copyright (C) Red Hat, Inc 2010
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 <stdlib.h>
#include <popt.h>
#include <check.h>
#include "tests/common_check.h"
/* interfaces under test */
#include "util/crypto/sss_crypto.h"
#include "util/crypto/nss/nss_util.h"
#ifdef HAVE_NSS
{
int ret;
ret = nspr_nss_init();
ret = nspr_nss_cleanup();
}
#endif
{
"12345678901234567", /* just above blocksize */
"", /* empty */
NULL}; /* sentinel */
int i;
int ret;
int expected;
#if defined(HAVE_NSS) || defined(HAVE_LIBCRYPTO)
#else
#endif
for (i=0; password[i]; i++) {
}
}
{
const char *keys[] = {
"short",
"proper6789012345678901234567890123456789012345678901234567890123",
"longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong",
NULL };
const char *results[] = {
"\x2b\x27\x53\x07\x17\xd8\xc0\x8f\x97\x27\xdd\xb3\xec\x41\xd8\xa3\x94\x97\xaa\x35",
"\x37\xe7\x0a\x6f\x71\x0b\xa9\x93\x81\x53\x8f\x5c\x06\x83\x44\x2f\xc9\x41\xe3\xed",
"\xbd\x99\xa7\x7f\xfc\x5e\xde\x04\x32\x7f\x7b\x71\x4d\xc0\x3f\x51\x2d\x25\x01\x28",
NULL };
int i;
#if defined(HAVE_NSS) || defined(HAVE_LIBCRYPTO)
#else
#endif
for (i = 0; keys[i]; i++) {
out);
}
}
{
/* Base64 encode the buffer */
}
{
/* Base64 decode the buffer */
}
{
0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7,
0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf,
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f
};
int ret;
fail_if(cipher_text_len == 0);
&plain_text, &plain_text_len);
}
{
/* Do some testing */
#ifdef HAVE_NSS
#endif
/* Add all test cases to the test suite */
suite_add_tcase(s, tc);
return s;
}
{
int opt;
int number_failed;
};
/* Set debug level to invalid value so we can decide if -d 0 was used. */
switch(opt) {
default:
return 1;
}
}
Suite *s = crypto_suite();
}