~ubuntu-branches/ubuntu/quantal/gnutls26/quantal

« back to all changes in this revision

Viewing changes to src/crypt.c

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2011-05-20 13:07:18 UTC
  • mfrom: (12.1.11 sid)
  • Revision ID: james.westby@ubuntu.com-20110520130718-db41dybbanzfvlji
Tags: 2.10.5-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Fix build failure with --no-add-needed.
  - Build for multiarch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Simon Josefsson
3
 
 * Copyright (C) 2001,2003 Nikos Mavrogiannopoulos
4
 
 * Copyright (C) 2004 Free Software Foundation
5
 
 *
6
 
 * This file is part of GNUTLS.
7
 
 *
8
 
 * GNUTLS is free software: you can redistribute it and/or modify
9
 
 * it under the terms of the GNU General Public License as published by
 
2
 * Copyright (C) 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
 
3
 * Free Software Foundation, Inc.
 
4
 *
 
5
 * This file is part of GnuTLS.
 
6
 *
 
7
 * GnuTLS is free software: you can redistribute it and/or modify it
 
8
 * under the terms of the GNU General Public License as published by
10
9
 * the Free Software Foundation, either version 3 of the License, or
11
10
 * (at your option) any later version.
12
 
 *               
13
 
 * GNUTLS is distributed in the hope that it will be useful,
14
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 
 * GNU General Public License for more details.
17
 
 *                               
 
11
 *
 
12
 * GnuTLS is distributed in the hope that it will be useful, but
 
13
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
15
 * General Public License for more details.
 
16
 *
18
17
 * You should have received a copy of the GNU General Public License
19
 
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
18
 * along with this program.  If not, see
 
19
 * <http://www.gnu.org/licenses/>.
20
20
 */
21
21
 
22
22
#include <config.h>
394
394
{
395
395
  gaainfo info;
396
396
  const char *passwd;
397
 
  int salt, ret;
 
397
  int salt_size, ret;
398
398
  struct passwd *pwd;
399
399
 
400
400
  set_program_name (argv[0]);
413
413
      return -1;
414
414
    }
415
415
 
416
 
  salt = info.salt;
417
 
 
418
416
  if (info.create_conf != NULL)
419
417
    {
420
418
      return generate_create_conf (info.create_conf);
421
419
    }
422
420
 
423
421
  if (info.passwd == NULL)
424
 
    info.passwd = (char*) KPASSWD;
 
422
    info.passwd = (char *) KPASSWD;
425
423
  if (info.passwd_conf == NULL)
426
 
    info.passwd_conf = (char*) KPASSWD_CONF;
 
424
    info.passwd_conf = (char *) KPASSWD_CONF;
427
425
 
428
426
  if (info.username == NULL)
429
427
    {
443
441
#endif
444
442
    }
445
443
 
446
 
  salt = 16;
 
444
  salt_size = 16;
447
445
 
448
446
  passwd = getpass ("Enter password: ");
449
447
  if (passwd == NULL)
460
458
    }
461
459
 
462
460
 
463
 
  return crypt_int (info.username, passwd, salt,
 
461
  return crypt_int (info.username, passwd, salt_size,
464
462
                    info.passwd_conf, info.passwd, info.index);
465
463
 
466
464
}
712
710
  return index;
713
711
}
714
712
 
715
 
extern void srptool_version(void);
 
713
extern void srptool_version (void);
716
714
 
717
715
void
718
716
srptool_version (void)