2 * Copyright (C) 2014 Nikos Mavrogiannopoulos
4 * Author: Nikos Mavrogiannopoulos
6 * This file is part of GnuTLS.
8 * GnuTLS is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 3 of the License, or
11 * (at your option) any later version.
13 * GnuTLS is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with GnuTLS; if not, write to the Free Software Foundation,
20 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
29 #include <gnutls/gnutls.h>
30 #include <gnutls/crypto.h>
34 /* See <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=760476>. */
44 res = read(3, buf, 16);
48 /* close all descriptors */
52 res = gnutls_global_init();
54 fail("global_init\n");
57 res = read(3, buf, 16);
59 fail("could not open fd, or OS doesn't assign fds in a serial way (%d)\n", res);
63 res = gnutls_global_init();
65 fail("global_init2\n");
69 res = gnutls_rnd(GNUTLS_RND_RANDOM, buf, sizeof(buf));
73 gnutls_global_deinit();
76 success("init-close success\n");