diff options
author | Stefan Metzmacher <metze@samba.org> | 2007-08-02 17:41:47 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:29:09 -0500 |
commit | cc8d70036477f30c6c9c8a6e37d1e2680107c0a6 (patch) | |
tree | 6b38b08a5b2aa33e187883b5844f45b75a7fe12a /source3/libads/sasl_wrapping.c | |
parent | 6c6fed5e656d64df9c9c12d7909f2c2289208bf7 (diff) | |
download | samba-cc8d70036477f30c6c9c8a6e37d1e2680107c0a6.tar.gz samba-cc8d70036477f30c6c9c8a6e37d1e2680107c0a6.tar.bz2 samba-cc8d70036477f30c6c9c8a6e37d1e2680107c0a6.zip |
r24131: - make it more clear what the different min and max fields mean
- with the "GSSAPI" sasl mech the plain, sign or seal negotiation
is independed from the req_flags and ret_flags
- verify the server supports the wrapping type we want
- better handling on negotiated buffer sizes
metze
(This used to be commit d0ec7323870ca16b28d458ff5f7dacce278b7d54)
Diffstat (limited to 'source3/libads/sasl_wrapping.c')
-rw-r--r-- | source3/libads/sasl_wrapping.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source3/libads/sasl_wrapping.c b/source3/libads/sasl_wrapping.c index c620aae7ac..2bfa079235 100644 --- a/source3/libads/sasl_wrapping.c +++ b/source3/libads/sasl_wrapping.c @@ -42,7 +42,7 @@ static ber_slen_t ads_saslwrap_prepare_inbuf(ADS_STRUCT *ads) ads->ldap.in.ofs = 0; ads->ldap.in.needed = 0; ads->ldap.in.left = 0; - ads->ldap.in.size = 4 + ads->ldap.in.min; + ads->ldap.in.size = 4 + ads->ldap.in.min_wrapped; ads->ldap.in.buf = talloc_array(ads->ldap.mem_ctx, uint8, ads->ldap.in.size); if (!ads->ldap.in.buf) { @@ -99,11 +99,11 @@ static ber_slen_t ads_saslwrap_read(Sockbuf_IO_Desc *sbiod, void *buf, ber_len_t if (ads->ldap.in.ofs < 4) goto eagain; ads->ldap.in.needed = RIVAL(ads->ldap.in.buf, 0); - if (ads->ldap.in.needed > ads->ldap.in.max) { + if (ads->ldap.in.needed > ads->ldap.in.max_wrapped) { errno = EINVAL; return -1; } - if (ads->ldap.in.needed < ads->ldap.in.min) { + if (ads->ldap.in.needed < ads->ldap.in.min_wrapped) { errno = EINVAL; return -1; } @@ -208,7 +208,7 @@ static ber_slen_t ads_saslwrap_write(Sockbuf_IO_Desc *sbiod, void *buf, ber_len_ return -1; } - rlen = MIN(len, ads->ldap.out.max); + rlen = MIN(len, ads->ldap.out.max_unwrapped); ret = ads_saslwrap_prepare_outbuf(ads, rlen); if (ret < 0) return ret; |