Browse Source

Use "unsigned int" instead of BSD "u_int" in <util.h> so that it can

be included in source files that specify POSIX source.  libutil isn't
a standard POSIX library, but no need to be gratuitously incompatible.
Fixes x11/st.
ok tedu, guenther, kettenis
OPENBSD_5_3
matthew 12 years ago
parent
commit
ddc0736e18
2 changed files with 6 additions and 6 deletions
  1. +4
    -4
      src/lib/libutil/pkcs5_pbkdf2.c
  2. +2
    -2
      src/lib/libutil/util.h

+ 4
- 4
src/lib/libutil/pkcs5_pbkdf2.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: pkcs5_pbkdf2.c,v 1.2 2012/09/06 20:49:59 matthew Exp $ */
/* $OpenBSD: pkcs5_pbkdf2.c,v 1.3 2012/09/09 18:08:21 matthew Exp $ */
/*- /*-
* Copyright (c) 2008 Damien Bergamini <damien.bergamini@free.fr> * Copyright (c) 2008 Damien Bergamini <damien.bergamini@free.fr>
@ -74,12 +74,12 @@ hmac_sha1(const u_int8_t *text, size_t text_len, const u_int8_t *key,
*/ */
int int
pkcs5_pbkdf2(const char *pass, size_t pass_len, const char *salt, size_t salt_len, pkcs5_pbkdf2(const char *pass, size_t pass_len, const char *salt, size_t salt_len,
u_int8_t *key, size_t key_len, u_int rounds)
u_int8_t *key, size_t key_len, unsigned int rounds)
{ {
u_int8_t *asalt, obuf[SHA1_DIGEST_LENGTH]; u_int8_t *asalt, obuf[SHA1_DIGEST_LENGTH];
u_int8_t d1[SHA1_DIGEST_LENGTH], d2[SHA1_DIGEST_LENGTH]; u_int8_t d1[SHA1_DIGEST_LENGTH], d2[SHA1_DIGEST_LENGTH];
u_int i, j;
u_int count;
unsigned int i, j;
unsigned int count;
size_t r; size_t r;
if (rounds < 1 || key_len == 0) if (rounds < 1 || key_len == 0)


+ 2
- 2
src/lib/libutil/util.h View File

@ -1,4 +1,4 @@
/* $OpenBSD: util.h,v 1.31 2012/09/06 19:41:59 tedu Exp $ */
/* $OpenBSD: util.h,v 1.32 2012/09/09 18:08:21 matthew Exp $ */
/* $NetBSD: util.h,v 1.2 1996/05/16 07:00:22 thorpej Exp $ */ /* $NetBSD: util.h,v 1.2 1996/05/16 07:00:22 thorpej Exp $ */
/*- /*-
@ -115,7 +115,7 @@ int fmt_scaled(long long, char *);
int scan_scaled(char *, long long *); int scan_scaled(char *, long long *);
int isduid(const char *, int); int isduid(const char *, int);
int pkcs5_pbkdf2(const char *, size_t, const char *, size_t, int pkcs5_pbkdf2(const char *, size_t, const char *, size_t,
u_int8_t *, size_t, u_int);
u_int8_t *, size_t, unsigned int);
__END_DECLS __END_DECLS


Loading…
Cancel
Save