cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: SSL/TLS support using Windows SSPI Schannel API

From: Marc Hoersken <info_at_marc-hoersken.de>
Date: Mon, 23 Apr 2012 22:32:36 +0200

2012/4/23 Salisbury, Mark <mark.salisbury_at_hp.com>:
> I think I didn't explain my concern very well - let me try again with fewer words :)
>
> If you are asked to send 100 bytes, which is translated into 125 encrypted bytes, but only 30 bytes (encrypted) are actually sent, how do you know how many unencrypted bytes were sent?  (how do you know what to return to the caller for bytes written?)  I don’t think the caller cares how many encrypted bytes were sent.
>
> If you tell the caller 30 bytes were sent, it will call you back at an offset 30 bytes into its buffer.

I would tell the caller that 1 byte (>0 to make sure that he does not
think it is an error) was send and handle the offset myself. Take a
look at my implementation which uses two internal buffers, including
offset counters. For decryption I know exactly how many decrypted
bytes I returned to the caller and how many bytes were already
decrypted from the incoming data stream. The same principle can be
applied to the outgoing data stream, but with only one buffer which
stores the encrypted data that needs to be sent.

Best regards,
Marc

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-04-23