1*b767d257SMarek Marczykowski-Górecki /* 2*b767d257SMarek Marczykowski-Górecki * QEMU Crypto "none" random number provider 3*b767d257SMarek Marczykowski-Górecki * 4*b767d257SMarek Marczykowski-Górecki * Copyright (c) 2020 Marek Marczykowski-Górecki 5*b767d257SMarek Marczykowski-Górecki * <marmarek@invisiblethingslab.com> 6*b767d257SMarek Marczykowski-Górecki * 7*b767d257SMarek Marczykowski-Górecki * This library is free software; you can redistribute it and/or 8*b767d257SMarek Marczykowski-Górecki * modify it under the terms of the GNU Lesser General Public 9*b767d257SMarek Marczykowski-Górecki * License as published by the Free Software Foundation; either 10*b767d257SMarek Marczykowski-Górecki * version 2.1 of the License, or (at your option) any later version. 11*b767d257SMarek Marczykowski-Górecki * 12*b767d257SMarek Marczykowski-Górecki * This library is distributed in the hope that it will be useful, 13*b767d257SMarek Marczykowski-Górecki * but WITHOUT ANY WARRANTY; without even the implied warranty of 14*b767d257SMarek Marczykowski-Górecki * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15*b767d257SMarek Marczykowski-Górecki * Lesser General Public License for more details. 16*b767d257SMarek Marczykowski-Górecki * 17*b767d257SMarek Marczykowski-Górecki * You should have received a copy of the GNU Lesser General Public 18*b767d257SMarek Marczykowski-Górecki * License along with this library; if not, see <http://www.gnu.org/licenses/>. 19*b767d257SMarek Marczykowski-Górecki * 20*b767d257SMarek Marczykowski-Górecki */ 21*b767d257SMarek Marczykowski-Górecki 22*b767d257SMarek Marczykowski-Górecki #include "qemu/osdep.h" 23*b767d257SMarek Marczykowski-Górecki 24*b767d257SMarek Marczykowski-Górecki #include "crypto/random.h" 25*b767d257SMarek Marczykowski-Górecki #include "qapi/error.h" 26*b767d257SMarek Marczykowski-Górecki qcrypto_random_init(Error ** errp)27*b767d257SMarek Marczykowski-Góreckiint qcrypto_random_init(Error **errp) 28*b767d257SMarek Marczykowski-Górecki { 29*b767d257SMarek Marczykowski-Górecki return 0; 30*b767d257SMarek Marczykowski-Górecki } 31*b767d257SMarek Marczykowski-Górecki qcrypto_random_bytes(void * buf,size_t buflen,Error ** errp)32*b767d257SMarek Marczykowski-Góreckiint qcrypto_random_bytes(void *buf, 33*b767d257SMarek Marczykowski-Górecki size_t buflen, 34*b767d257SMarek Marczykowski-Górecki Error **errp) 35*b767d257SMarek Marczykowski-Górecki { 36*b767d257SMarek Marczykowski-Górecki error_setg(errp, "Random bytes not available with \"none\" rng"); 37*b767d257SMarek Marczykowski-Górecki return -1; 38*b767d257SMarek Marczykowski-Górecki } 39