1a090187dSDaniel P. Berrange /* 2a090187dSDaniel P. Berrange * QEMU crypto TLS credential support 3a090187dSDaniel P. Berrange * 4a090187dSDaniel P. Berrange * Copyright (c) 2015 Red Hat, Inc. 5a090187dSDaniel P. Berrange * 6a090187dSDaniel P. Berrange * This library is free software; you can redistribute it and/or 7a090187dSDaniel P. Berrange * modify it under the terms of the GNU Lesser General Public 8a090187dSDaniel P. Berrange * License as published by the Free Software Foundation; either 9*b7cbb874SThomas Huth * version 2.1 of the License, or (at your option) any later version. 10a090187dSDaniel P. Berrange * 11a090187dSDaniel P. Berrange * This library is distributed in the hope that it will be useful, 12a090187dSDaniel P. Berrange * but WITHOUT ANY WARRANTY; without even the implied warranty of 13a090187dSDaniel P. Berrange * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14a090187dSDaniel P. Berrange * Lesser General Public License for more details. 15a090187dSDaniel P. Berrange * 16a090187dSDaniel P. Berrange * You should have received a copy of the GNU Lesser General Public 17a090187dSDaniel P. Berrange * License along with this library; if not, see <http://www.gnu.org/licenses/>. 18a090187dSDaniel P. Berrange * 19a090187dSDaniel P. Berrange */ 20a090187dSDaniel P. Berrange 21121d0712SMarkus Armbruster #ifndef QCRYPTO_TLSCREDS_H 22121d0712SMarkus Armbruster #define QCRYPTO_TLSCREDS_H 23a090187dSDaniel P. Berrange 249af23989SMarkus Armbruster #include "qapi/qapi-types-crypto.h" 25a090187dSDaniel P. Berrange #include "qom/object.h" 26a090187dSDaniel P. Berrange 27a090187dSDaniel P. Berrange #ifdef CONFIG_GNUTLS 28a090187dSDaniel P. Berrange #include <gnutls/gnutls.h> 29a090187dSDaniel P. Berrange #endif 30a090187dSDaniel P. Berrange 31a090187dSDaniel P. Berrange #define TYPE_QCRYPTO_TLS_CREDS "tls-creds" 32a090187dSDaniel P. Berrange #define QCRYPTO_TLS_CREDS(obj) \ 33a090187dSDaniel P. Berrange OBJECT_CHECK(QCryptoTLSCreds, (obj), TYPE_QCRYPTO_TLS_CREDS) 34a090187dSDaniel P. Berrange 35a090187dSDaniel P. Berrange typedef struct QCryptoTLSCreds QCryptoTLSCreds; 36a090187dSDaniel P. Berrange typedef struct QCryptoTLSCredsClass QCryptoTLSCredsClass; 37a090187dSDaniel P. Berrange 38a090187dSDaniel P. Berrange #define QCRYPTO_TLS_CREDS_DH_PARAMS "dh-params.pem" 39a090187dSDaniel P. Berrange 40a090187dSDaniel P. Berrange 41a090187dSDaniel P. Berrange /** 42a090187dSDaniel P. Berrange * QCryptoTLSCreds: 43a090187dSDaniel P. Berrange * 44a090187dSDaniel P. Berrange * The QCryptoTLSCreds object is an abstract base for different 45a090187dSDaniel P. Berrange * types of TLS handshake credentials. Most commonly the 46a090187dSDaniel P. Berrange * QCryptoTLSCredsX509 subclass will be used to provide x509 47a090187dSDaniel P. Berrange * certificate credentials. 48a090187dSDaniel P. Berrange */ 49a090187dSDaniel P. Berrange 50a090187dSDaniel P. Berrange struct QCryptoTLSCreds { 51a090187dSDaniel P. Berrange Object parent_obj; 52a090187dSDaniel P. Berrange char *dir; 53a090187dSDaniel P. Berrange QCryptoTLSCredsEndpoint endpoint; 54a090187dSDaniel P. Berrange #ifdef CONFIG_GNUTLS 55a090187dSDaniel P. Berrange gnutls_dh_params_t dh_params; 56a090187dSDaniel P. Berrange #endif 57a090187dSDaniel P. Berrange bool verifyPeer; 5813f12430SDaniel P. Berrange char *priority; 59a090187dSDaniel P. Berrange }; 60a090187dSDaniel P. Berrange 61a090187dSDaniel P. Berrange 62a090187dSDaniel P. Berrange struct QCryptoTLSCredsClass { 63a090187dSDaniel P. Berrange ObjectClass parent_class; 64a090187dSDaniel P. Berrange }; 65a090187dSDaniel P. Berrange 66a090187dSDaniel P. Berrange 67121d0712SMarkus Armbruster #endif /* QCRYPTO_TLSCREDS_H */ 68