esp: ensure that do_cmd is set to zero before submitting an ESP select command
[qemu/ar7.git] / include / crypto / tlscredsanon.h
blob3f464a380958266afb47785c00615247b2f4bd1c
1 /*
2 * QEMU crypto TLS anonymous credential support
4 * Copyright (c) 2015 Red Hat, Inc.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
21 #ifndef QCRYPTO_TLSCREDSANON_H
22 #define QCRYPTO_TLSCREDSANON_H
24 #include "crypto/tlscreds.h"
25 #include "qom/object.h"
27 #define TYPE_QCRYPTO_TLS_CREDS_ANON "tls-creds-anon"
28 typedef struct QCryptoTLSCredsAnon QCryptoTLSCredsAnon;
29 DECLARE_INSTANCE_CHECKER(QCryptoTLSCredsAnon, QCRYPTO_TLS_CREDS_ANON,
30 TYPE_QCRYPTO_TLS_CREDS_ANON)
33 typedef struct QCryptoTLSCredsAnonClass QCryptoTLSCredsAnonClass;
35 /**
36 * QCryptoTLSCredsAnon:
38 * The QCryptoTLSCredsAnon object provides a representation
39 * of anonymous credentials used perform a TLS handshake.
40 * This is primarily provided for backwards compatibility and
41 * its use is discouraged as it has poor security characteristics
42 * due to lacking MITM attack protection amongst other problems.
44 * This is a user creatable object, which can be instantiated
45 * via object_new_propv():
47 * <example>
48 * <title>Creating anonymous TLS credential objects in code</title>
49 * <programlisting>
50 * Object *obj;
51 * Error *err = NULL;
52 * obj = object_new_propv(TYPE_QCRYPTO_TLS_CREDS_ANON,
53 * "tlscreds0",
54 * &err,
55 * "endpoint", "server",
56 * "dir", "/path/x509/cert/dir",
57 * "verify-peer", "yes",
58 * NULL);
59 * </programlisting>
60 * </example>
62 * Or via QMP:
64 * <example>
65 * <title>Creating anonymous TLS credential objects via QMP</title>
66 * <programlisting>
67 * {
68 * "execute": "object-add", "arguments": {
69 * "id": "tlscreds0",
70 * "qom-type": "tls-creds-anon",
71 * "props": {
72 * "endpoint": "server",
73 * "dir": "/path/to/x509/cert/dir",
74 * "verify-peer": false
75 * }
76 * }
77 * }
78 * </programlisting>
79 * </example>
82 * Or via the CLI:
84 * <example>
85 * <title>Creating anonymous TLS credential objects via CLI</title>
86 * <programlisting>
87 * qemu-system-x86_64 -object tls-creds-anon,id=tlscreds0,\
88 * endpoint=server,verify-peer=off,\
89 * dir=/path/to/x509/certdir/
90 * </programlisting>
91 * </example>
96 struct QCryptoTLSCredsAnon {
97 QCryptoTLSCreds parent_obj;
98 #ifdef CONFIG_GNUTLS
99 union {
100 gnutls_anon_server_credentials_t server;
101 gnutls_anon_client_credentials_t client;
102 } data;
103 #endif
107 struct QCryptoTLSCredsAnonClass {
108 QCryptoTLSCredsClass parent_class;
112 #endif /* QCRYPTO_TLSCREDSANON_H */