~ubuntu-branches/ubuntu/wily/gsasl/wily-proposed

« back to all changes in this revision

Viewing changes to lib/gltests/test-gc-pbkdf2-sha1.c

  • Committer: Bazaar Package Importer
  • Author(s): Jamie Strandboge
  • Date: 2010-04-14 07:26:51 UTC
  • mfrom: (2.1.9 experimental)
  • Revision ID: james.westby@ubuntu.com-20100414072651-hoc2231ulo8onq2x
Tags: 1.4.4-1ubuntu1
* Merge from Debian experimental (LP: #548480). Bugfix only release.
  Remaining changes:
  - debian/rules: Include clean-la.mk from cdbs to clean up the
    dependency_libs field in libgsasl.la.
* debian/control: drop libgsasl7 Depends on libgcrypt to what we have in
  Lucid (1.4.4-5). See Debian bug #564661.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2002, 2003, 2004, 2005, 2007  Free Software Foundation
 
2
 * Copyright (C) 2002, 2003, 2004, 2005, 2007, 2010 Free Software Foundation, Inc.
3
3
 *
4
4
 * This program is free software; you can redistribute it and/or modify
5
5
 * it under the terms of the GNU General Public License as published by
6
 
 * the Free Software Foundation; either version 2, or (at your option)
 
6
 * the Free Software Foundation; either version 3, or (at your option)
7
7
 * any later version.
8
8
 *
9
9
 * This program is distributed in the hope that it will be useful,
89
89
  for (i = 0; i < sizeof (pkcs5) / sizeof (pkcs5[0]); i++)
90
90
    {
91
91
      rc = gc_pbkdf2_sha1 (pkcs5[i].password, strlen (pkcs5[i].password),
92
 
                           pkcs5[i].salt, strlen (pkcs5[i].salt),
93
 
                           pkcs5[i].iterations, out, pkcs5[i].dklen);
 
92
                           pkcs5[i].salt, strlen (pkcs5[i].salt),
 
93
                           pkcs5[i].iterations, out, pkcs5[i].dklen);
94
94
      if (rc != GC_OK)
95
 
        {
96
 
          printf ("PKCS5 entry %ld failed fatally: %d\n",
97
 
                  (unsigned long) i, rc);
98
 
          return 1;
99
 
        }
 
95
        {
 
96
          printf ("PKCS5 entry %ld failed fatally: %d\n",
 
97
                  (unsigned long) i, rc);
 
98
          return 1;
 
99
        }
100
100
 
101
101
      if (memcmp (pkcs5[i].expected, out, pkcs5[i].dklen) != 0)
102
 
        {
103
 
          printf ("PKCS5 entry %ld failed\n", (unsigned long) i);
104
 
          return 1;
105
 
        }
 
102
        {
 
103
          printf ("PKCS5 entry %ld failed\n", (unsigned long) i);
 
104
          return 1;
 
105
        }
106
106
    }
107
107
 
108
108
  return 0;