acpi: applesmc: use AcpiDevAmlIfClass:build_dev_aml to provide device's AML
[qemu.git] / crypto / rsakey.c
blobcc40e072f07b5c20aa829769d7555fbc4a1021c7
1 /*
2 * QEMU Crypto RSA key parser
4 * Copyright (c) 2022 Bytedance
5 * Author: lei he <helei.sig11@bytedance.com>
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
22 #include "rsakey.h"
24 void qcrypto_akcipher_rsakey_free(QCryptoAkCipherRSAKey *rsa_key)
26 if (!rsa_key) {
27 return;
29 g_free(rsa_key->n.data);
30 g_free(rsa_key->e.data);
31 g_free(rsa_key->d.data);
32 g_free(rsa_key->p.data);
33 g_free(rsa_key->q.data);
34 g_free(rsa_key->dp.data);
35 g_free(rsa_key->dq.data);
36 g_free(rsa_key->u.data);
37 g_free(rsa_key);
40 #if defined(CONFIG_NETTLE) && defined(CONFIG_HOGWEED)
41 #include "rsakey-nettle.c.inc"
42 #else
43 #include "rsakey-builtin.c.inc"
44 #endif