summaryrefslogtreecommitdiff
path: root/src/crypt.c
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2008-09-01 20:14:50 +0200
committerSimon Josefsson <simon@josefsson.org>2008-09-01 20:14:50 +0200
commit0496db853570e40530d5fe72a0d9a548fddbb25b (patch)
tree8b875444e338a6328e3216670a293a2141017a8d /src/crypt.c
parent521f94612499c5f83fe8bb0b1568fea327cbef60 (diff)
downloadgnutls-0496db853570e40530d5fe72a0d9a548fddbb25b.tar.gz
Use gnulib more. Remove code.
Diffstat (limited to 'src/crypt.c')
-rw-r--r--src/crypt.c31
1 files changed, 6 insertions, 25 deletions
diff --git a/src/crypt.c b/src/crypt.c
index 290fe5b8e4..c36230a1d0 100644
--- a/src/crypt.c
+++ b/src/crypt.c
@@ -21,22 +21,6 @@
#include <config.h>
-/* Gnulib portability files. */
-#include <version-etc.h>
-
-#ifndef ENABLE_SRP
-
-#include <stdio.h>
-
-int
-main (int argc, char **argv)
-{
- printf ("\nSRP not supported. This program is a dummy.\n\n");
- return 1;
-};
-
-#else
-
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@@ -57,8 +41,8 @@ main (int argc, char **argv)
/* Gnulib portability files. */
#include <getpass.h>
-
-#define _MAX(x,y) (x>y?x:y)
+#include <minmax.h>
+#include <version-etc.h>
/* This may need some rewrite. A lot of stuff which should be here
* are in the library, which is not good.
@@ -288,7 +272,7 @@ find_strchr (char *username, char *file)
{
i++;
}
- if (strncmp (username, line, _MAX (i, strlen (username))) == 0)
+ if (strncmp (username, line, MAX (i, strlen (username))) == 0)
{
/* find the index */
pos = strrchr (line, ':');
@@ -368,7 +352,7 @@ verify_passwd (char *conffile, char *tpasswd, char *username,
{
i++;
}
- if (strncmp (username, line, _MAX (i, strlen (username))) == 0)
+ if (strncmp (username, line, MAX (i, strlen (username))) == 0)
{
char *verifier_pos, *salt_pos;
@@ -633,9 +617,8 @@ crypt_int (const char *username, const char *passwd, int salt_size,
if (pp == NULL)
continue;
- if (strncmp
- (p, username,
- _MAX (strlen (username), (unsigned int) (pp - p))) == 0)
+ if (strncmp (p, username,
+ MAX (strlen (username), (unsigned int) (pp - p))) == 0)
{
put = 1;
fprintf (fd, "%s:%s:%u\n", username, cr, iindex);
@@ -727,8 +710,6 @@ read_conf_values (gnutls_datum_t * g, gnutls_datum_t * n, char *str)
return index;
}
-#endif /* ENABLE_SRP */
-
void
srptool_version (void)
{