Fix messages.
[shishi.git] / lib / crypto-null.c
blobc724c9385bfa7d55ac5c290dee9d0f288ed7677f
1 /* crypto-null.c NULL crypto functions
2 * Copyright (C) 2002, 2003 Simon Josefsson
4 * This file is part of Shishi.
6 * Shishi is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * Shishi is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with Shishi; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 * Note: This file is #include'd by crypto.c.
24 static int
25 null_encrypt (Shishi * handle,
26 Shishi_key * key,
27 int keyusage,
28 const char *iv, size_t ivlen,
29 char **ivout, size_t * ivoutlen,
30 const char *in, size_t inlen, char **out, size_t * outlen)
32 *outlen = inlen;
33 *out = xmalloc (*outlen);
34 memcpy (*out, in, inlen);
36 if (ivout)
37 *ivout = NULL;
38 if (ivoutlen)
39 *ivoutlen = 0;
41 return SHISHI_OK;
44 static int
45 null_decrypt (Shishi * handle,
46 Shishi_key * key,
47 int keyusage,
48 const char *iv, size_t ivlen,
49 char **ivout, size_t * ivoutlen,
50 const char *in, size_t inlen, char **out, size_t * outlen)
52 *outlen = inlen;
53 *out = xmalloc (*outlen);
54 memcpy (*out, in, inlen);
56 if (ivout)
57 *ivout = NULL;
58 if (ivoutlen)
59 *ivoutlen = 0;
61 return SHISHI_OK;
64 static int
65 null_random_to_key (Shishi * handle,
66 const char *random, size_t randomlen, Shishi_key * outkey)
68 return SHISHI_OK;
71 static int
72 null_string_to_key (Shishi * handle,
73 const char *password, size_t passwordlen,
74 const char *salt, size_t saltlen,
75 const char *parameter, Shishi_key * outkey)
77 return SHISHI_OK;