diff options
author | Daniel P. Berrange | 2016-07-21 11:37:14 +0200 |
---|---|---|
committer | Daniel P. Berrange | 2016-07-21 11:46:27 +0200 |
commit | f3c8355c7aaa89a5c5676756d4ba6139ea26b446 (patch) | |
tree | 310a074c7ebc5b1d61c2d069736fa3cc0dc0c03a /crypto/random-stub.c | |
parent | Merge remote-tracking branch 'remotes/ehabkost/tags/x86-pull-request' into st... (diff) | |
download | qemu-f3c8355c7aaa89a5c5676756d4ba6139ea26b446.tar.gz qemu-f3c8355c7aaa89a5c5676756d4ba6139ea26b446.tar.xz qemu-f3c8355c7aaa89a5c5676756d4ba6139ea26b446.zip |
crypto: use /dev/[u]random as a final fallback random source
If neither gcrypt or gnutls are available to provide a
cryptographic random number generator, fallback to consuming
bytes directly from /dev/[u]random.
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'crypto/random-stub.c')
-rw-r--r-- | crypto/random-stub.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/crypto/random-stub.c b/crypto/random-stub.c deleted file mode 100644 index 63bbf41473..0000000000 --- a/crypto/random-stub.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * QEMU Crypto random number provider - * - * Copyright (c) 2015-2016 Red Hat, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, see <http://www.gnu.org/licenses/>. - * - */ - -#include "qemu/osdep.h" - -#include "crypto/random.h" - -int qcrypto_random_bytes(uint8_t *buf G_GNUC_UNUSED, - size_t buflen G_GNUC_UNUSED, - Error **errp) -{ - error_setg(errp, "No random byte source provided in this build"); - return -1; -} |