mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
nbd: implement TLS support in the protocol negotiation
This extends the NBD protocol handling code so that it is capable of negotiating TLS support during the connection setup. This involves requesting the STARTTLS protocol option before any other NBD options. Signed-off-by: Daniel P. Berrange <berrange@redhat.com> Message-Id: <1455129674-17255-14-git-send-email-berrange@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
69b49502d8
commit
f95910fe6b
8 changed files with 296 additions and 13 deletions
15
nbd/common.c
15
nbd/common.c
|
@ -75,3 +75,18 @@ ssize_t nbd_wr_syncv(QIOChannel *ioc,
|
|||
g_free(local_iov_head);
|
||||
return done;
|
||||
}
|
||||
|
||||
|
||||
void nbd_tls_handshake(Object *src,
|
||||
Error *err,
|
||||
void *opaque)
|
||||
{
|
||||
struct NBDTLSHandshakeData *data = opaque;
|
||||
|
||||
if (err) {
|
||||
TRACE("TLS failed %s", error_get_pretty(err));
|
||||
data->error = error_copy(err);
|
||||
}
|
||||
data->complete = true;
|
||||
g_main_loop_quit(data->loop);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue