xref: /openbmc/qemu/crypto/pbkdf-stub.c (revision 37788f253a4a9ad5f27dae68aee261c784e1fa17)
1*37788f25SDaniel P. Berrange /*
2*37788f25SDaniel P. Berrange  * QEMU Crypto PBKDF support (Password-Based Key Derivation Function)
3*37788f25SDaniel P. Berrange  *
4*37788f25SDaniel P. Berrange  * Copyright (c) 2015-2016 Red Hat, Inc.
5*37788f25SDaniel P. Berrange  *
6*37788f25SDaniel P. Berrange  * This library is free software; you can redistribute it and/or
7*37788f25SDaniel P. Berrange  * modify it under the terms of the GNU Lesser General Public
8*37788f25SDaniel P. Berrange  * License as published by the Free Software Foundation; either
9*37788f25SDaniel P. Berrange  * version 2 of the License, or (at your option) any later version.
10*37788f25SDaniel P. Berrange  *
11*37788f25SDaniel P. Berrange  * This library is distributed in the hope that it will be useful,
12*37788f25SDaniel P. Berrange  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13*37788f25SDaniel P. Berrange  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14*37788f25SDaniel P. Berrange  * Lesser General Public License for more details.
15*37788f25SDaniel P. Berrange  *
16*37788f25SDaniel P. Berrange  * You should have received a copy of the GNU Lesser General Public
17*37788f25SDaniel P. Berrange  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
18*37788f25SDaniel P. Berrange  *
19*37788f25SDaniel P. Berrange  */
20*37788f25SDaniel P. Berrange 
21*37788f25SDaniel P. Berrange #include "qemu/osdep.h"
22*37788f25SDaniel P. Berrange #include "crypto/pbkdf.h"
23*37788f25SDaniel P. Berrange 
24*37788f25SDaniel P. Berrange bool qcrypto_pbkdf2_supports(QCryptoHashAlgorithm hash G_GNUC_UNUSED)
25*37788f25SDaniel P. Berrange {
26*37788f25SDaniel P. Berrange     return false;
27*37788f25SDaniel P. Berrange }
28*37788f25SDaniel P. Berrange 
29*37788f25SDaniel P. Berrange int qcrypto_pbkdf2(QCryptoHashAlgorithm hash G_GNUC_UNUSED,
30*37788f25SDaniel P. Berrange                    const uint8_t *key G_GNUC_UNUSED,
31*37788f25SDaniel P. Berrange                    size_t nkey G_GNUC_UNUSED,
32*37788f25SDaniel P. Berrange                    const uint8_t *salt G_GNUC_UNUSED,
33*37788f25SDaniel P. Berrange                    size_t nsalt G_GNUC_UNUSED,
34*37788f25SDaniel P. Berrange                    unsigned int iterations G_GNUC_UNUSED,
35*37788f25SDaniel P. Berrange                    uint8_t *out G_GNUC_UNUSED,
36*37788f25SDaniel P. Berrange                    size_t nout G_GNUC_UNUSED,
37*37788f25SDaniel P. Berrange                    Error **errp)
38*37788f25SDaniel P. Berrange {
39*37788f25SDaniel P. Berrange     error_setg_errno(errp, ENOSYS,
40*37788f25SDaniel P. Berrange                      "No crypto library supporting PBKDF in this build");
41*37788f25SDaniel P. Berrange     return -1;
42*37788f25SDaniel P. Berrange }
43