Mercurial > hg > octave-shane > gnulib-hg
annotate lib/hmac.h @ 15727:144db791c6fa
Ensure EBADF returns for socket functions on mingw.
* lib/accept.c (rpl_accept): Fail with error EBADF if the file
descriptor is invalid.
* lib/bind.c (rpl_bind): Likewise.
* lib/connect.c (rpl_connect): Likewise.
* lib/getpeername.c (rpl_getpeername): Likewise.
* lib/getsockname.c (rpl_getsockname): Likewise.
* lib/getsockopt.c (rpl_getsockopt): Likewise.
* lib/listen.c (rpl_listen): Likewise.
* lib/recv.c (rpl_recv): Likewise.
* lib/recvfrom.c (rpl_recvfrom): Likewise.
* lib/send.c (rpl_send): Likewise.
* lib/sendto.c (rpl_sendto): Likewise.
* lib/setsockopt.c (rpl_setsockopt): Likewise.
* lib/shutdown.c (rpl_shutdown): Likewise.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Wed, 21 Sep 2011 00:20:59 +0200 |
parents | 97fc9a21a8fb |
children | 8250f2777afc |
rev | line source |
---|---|
6344 | 1 /* hmac.h -- hashed message authentication codes |
14079
97fc9a21a8fb
maint: update almost all copyright ranges to include 2011
Jim Meyering <meyering@redhat.com>
parents:
12559
diff
changeset
|
2 Copyright (C) 2005, 2009-2011 Free Software Foundation, Inc. |
6344 | 3 |
4 This program is free software; you can redistribute it and/or modify | |
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) | |
7 any later version. | |
8 | |
9 This program is distributed in the hope that it will be useful, | |
10 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 GNU General Public License for more details. | |
13 | |
14 You should have received a copy of the GNU General Public License | |
15 along with this program; if not, write to the Free Software Foundation, | |
16 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ | |
17 | |
18 /* Written by Simon Josefsson. */ | |
19 | |
20 #ifndef HMAC_H | |
21 # define HMAC_H 1 | |
22 | |
23 #include <stddef.h> | |
24 | |
25 /* Compute Hashed Message Authentication Code with MD5, as described | |
26 in RFC 2104, over BUFFER data of BUFLEN bytes using the KEY of | |
27 KEYLEN bytes, writing the output to pre-allocated 16 byte minimum | |
28 RESBUF buffer. Return 0 on success. */ | |
29 int | |
30 hmac_md5 (const void *key, size_t keylen, | |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
6364
diff
changeset
|
31 const void *buffer, size_t buflen, void *resbuf); |
6344 | 32 |
6364
fb852f022f3f
Add hmac-sha1 module.
Simon Josefsson <simon@josefsson.org>
parents:
6344
diff
changeset
|
33 /* Compute Hashed Message Authentication Code with SHA-1, over BUFFER |
fb852f022f3f
Add hmac-sha1 module.
Simon Josefsson <simon@josefsson.org>
parents:
6344
diff
changeset
|
34 data of BUFLEN bytes using the KEY of KEYLEN bytes, writing the |
fb852f022f3f
Add hmac-sha1 module.
Simon Josefsson <simon@josefsson.org>
parents:
6344
diff
changeset
|
35 output to pre-allocated 20 byte minimum RESBUF buffer. Return 0 on |
fb852f022f3f
Add hmac-sha1 module.
Simon Josefsson <simon@josefsson.org>
parents:
6344
diff
changeset
|
36 success. */ |
fb852f022f3f
Add hmac-sha1 module.
Simon Josefsson <simon@josefsson.org>
parents:
6344
diff
changeset
|
37 int |
fb852f022f3f
Add hmac-sha1 module.
Simon Josefsson <simon@josefsson.org>
parents:
6344
diff
changeset
|
38 hmac_sha1 (const void *key, size_t keylen, |
12421
e8d2c6fc33ad
Use spaces for indentation, not tabs.
Bruno Haible <bruno@clisp.org>
parents:
6364
diff
changeset
|
39 const void *in, size_t inlen, void *resbuf); |
6364
fb852f022f3f
Add hmac-sha1 module.
Simon Josefsson <simon@josefsson.org>
parents:
6344
diff
changeset
|
40 |
6344 | 41 #endif /* HMAC_H */ |