[libvirt] [PATCH 06/12] Integrate TLS/SASL directly into the socket APIs

Eric Blake eblake at redhat.com
Mon Mar 21 23:06:20 UTC 2011


On 03/18/2011 12:54 PM, Daniel P. Berrange wrote:
> This extends the basic virNetSocket APIs to allow them to have
> a handle to the TLS/SASL session objects, once established.
> This ensures that any data reads/writes are automagically
> passed through the TLS/SASL encryption layers if required.
> 
> * src/rpc/virnetsocket.c, src/rpc/virnetsocket.h: Wire up
>   SASL/TLS encryption
> ---
>  src/rpc/virnetsocket.c |  274 +++++++++++++++++++++++++++++++++++++++++++++++-
>  src/rpc/virnetsocket.h |   11 ++
>  2 files changed, 282 insertions(+), 3 deletions(-)

> @@ -416,7 +432,7 @@ error:
>  }
>  
>  
> -#if HAVE_SYS_UN_H
> +#ifdef HAVE_SYS_UN_H

Why the spurious change?

> +
> +
> +static ssize_t virNetSocketWriteSASL(virNetSocketPtr sock, const char *buf, size_t len)
> +{
> +    int ret;
> +    size_t tosend = virNetSASLSessionGetMaxBufSize(sock->saslSession);
> +
> +    /* SASL doesn't neccessarily let us send the whole

s/neccessarily/necessarily/

> +    /* Send some of the encoded stuff out on the wire */
> +    ret = virNetSocketWriteWire(sock,
> +                                sock->saslEncoded + sock->saslEncodedOffset,
> +                                sock->saslEncodedLength - sock->saslEncodedOffset);
> +
> +    if (ret <= 0)
> +        return ret; /* -1 error, 0 == egain */

s/egain/eagain/

ACK with those nits fixed.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110321/d200210b/attachment-0001.sig>


More information about the libvir-list mailing list