~ubuntu-branches/ubuntu/natty/postgresql-8.4/natty-security

« back to all changes in this revision

Viewing changes to contrib/pgcrypto/px.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-07-11 16:59:35 UTC
  • mfrom: (5.1.1 karmic)
  • Revision ID: james.westby@ubuntu.com-20090711165935-jfwin6gfrxf0gfsi
Tags: 8.4.0-2
* debian/libpq-dev.install: Ship catalog/genbki.h. (Closes: #536139)
* debian/rules: Drop --enable-cassert for final release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27
27
 * SUCH DAMAGE.
28
28
 *
29
 
 * $PostgreSQL: pgsql/contrib/pgcrypto/px.c,v 1.17 2007/11/15 21:14:31 momjian Exp $
 
29
 * $PostgreSQL: pgsql/contrib/pgcrypto/px.c,v 1.18 2009/06/11 14:48:52 momjian Exp $
30
30
 */
31
31
 
32
32
#include "postgres.h"
106
106
 
107
107
 
108
108
const char *
109
 
px_resolve_alias(const PX_Alias * list, const char *name)
 
109
px_resolve_alias(const PX_Alias *list, const char *name)
110
110
{
111
111
        while (list->name)
112
112
        {
146
146
 */
147
147
 
148
148
static unsigned
149
 
combo_encrypt_len(PX_Combo * cx, unsigned dlen)
 
149
combo_encrypt_len(PX_Combo *cx, unsigned dlen)
150
150
{
151
151
        return dlen + 512;
152
152
}
153
153
 
154
154
static unsigned
155
 
combo_decrypt_len(PX_Combo * cx, unsigned dlen)
 
155
combo_decrypt_len(PX_Combo *cx, unsigned dlen)
156
156
{
157
157
        return dlen;
158
158
}
159
159
 
160
160
static int
161
 
combo_init(PX_Combo * cx, const uint8 *key, unsigned klen,
 
161
combo_init(PX_Combo *cx, const uint8 *key, unsigned klen,
162
162
                   const uint8 *iv, unsigned ivlen)
163
163
{
164
164
        int                     err;
199
199
}
200
200
 
201
201
static int
202
 
combo_encrypt(PX_Combo * cx, const uint8 *data, unsigned dlen,
 
202
combo_encrypt(PX_Combo *cx, const uint8 *data, unsigned dlen,
203
203
                          uint8 *res, unsigned *rlen)
204
204
{
205
205
        int                     err = 0;
270
270
}
271
271
 
272
272
static int
273
 
combo_decrypt(PX_Combo * cx, const uint8 *data, unsigned dlen,
 
273
combo_decrypt(PX_Combo *cx, const uint8 *data, unsigned dlen,
274
274
                          uint8 *res, unsigned *rlen)
275
275
{
276
276
        unsigned        bs,
327
327
}
328
328
 
329
329
static void
330
 
combo_free(PX_Combo * cx)
 
330
combo_free(PX_Combo *cx)
331
331
{
332
332
        if (cx->cipher)
333
333
                px_cipher_free(cx->cipher);
380
380
/* provider */
381
381
 
382
382
int
383
 
px_find_combo(const char *name, PX_Combo ** res)
 
383
px_find_combo(const char *name, PX_Combo **res)
384
384
{
385
385
        int                     err;
386
386
        char       *buf,