137788f25SDaniel P. Berrange /* 237788f25SDaniel P. Berrange * QEMU Crypto PBKDF support (Password-Based Key Derivation Function) 337788f25SDaniel P. Berrange * 437788f25SDaniel P. Berrange * Copyright (c) 2015-2016 Red Hat, Inc. 537788f25SDaniel P. Berrange * 637788f25SDaniel P. Berrange * This library is free software; you can redistribute it and/or 737788f25SDaniel P. Berrange * modify it under the terms of the GNU Lesser General Public 837788f25SDaniel P. Berrange * License as published by the Free Software Foundation; either 9b7cbb874SThomas Huth * version 2.1 of the License, or (at your option) any later version. 1037788f25SDaniel P. Berrange * 1137788f25SDaniel P. Berrange * This library is distributed in the hope that it will be useful, 1237788f25SDaniel P. Berrange * but WITHOUT ANY WARRANTY; without even the implied warranty of 1337788f25SDaniel P. Berrange * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 1437788f25SDaniel P. Berrange * Lesser General Public License for more details. 1537788f25SDaniel P. Berrange * 1637788f25SDaniel P. Berrange * You should have received a copy of the GNU Lesser General Public 1737788f25SDaniel P. Berrange * License along with this library; if not, see <http://www.gnu.org/licenses/>. 1837788f25SDaniel P. Berrange * 1937788f25SDaniel P. Berrange */ 2037788f25SDaniel P. Berrange 2137788f25SDaniel P. Berrange #include "qemu/osdep.h" 22da34e65cSMarkus Armbruster #include "qapi/error.h" 2337788f25SDaniel P. Berrange #include "crypto/pbkdf.h" 2437788f25SDaniel P. Berrange 25*ef834aa2SMarkus Armbruster bool qcrypto_pbkdf2_supports(QCryptoHashAlgo hash G_GNUC_UNUSED) 2637788f25SDaniel P. Berrange { 2737788f25SDaniel P. Berrange return false; 2837788f25SDaniel P. Berrange } 2937788f25SDaniel P. Berrange 30*ef834aa2SMarkus Armbruster int qcrypto_pbkdf2(QCryptoHashAlgo hash G_GNUC_UNUSED, 3137788f25SDaniel P. Berrange const uint8_t *key G_GNUC_UNUSED, 3237788f25SDaniel P. Berrange size_t nkey G_GNUC_UNUSED, 3337788f25SDaniel P. Berrange const uint8_t *salt G_GNUC_UNUSED, 3437788f25SDaniel P. Berrange size_t nsalt G_GNUC_UNUSED, 3559b060beSDaniel P. Berrange uint64_t iterations G_GNUC_UNUSED, 3637788f25SDaniel P. Berrange uint8_t *out G_GNUC_UNUSED, 3737788f25SDaniel P. Berrange size_t nout G_GNUC_UNUSED, 3837788f25SDaniel P. Berrange Error **errp) 3937788f25SDaniel P. Berrange { 4037788f25SDaniel P. Berrange error_setg_errno(errp, ENOSYS, 4137788f25SDaniel P. Berrange "No crypto library supporting PBKDF in this build"); 4237788f25SDaniel P. Berrange return -1; 4337788f25SDaniel P. Berrange } 44