mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-03-13 14:27:59 +08:00
Fix a SASL channel-binding leak
This commit is contained in:
parent
58d66a3946
commit
1328777a85
@ -357,6 +357,11 @@ connection_destroy( LloadConnection *c )
|
||||
c->c_sasl_defaults = NULL;
|
||||
}
|
||||
if ( c->c_sasl_authctx ) {
|
||||
#ifdef SASL_CHANNEL_BINDING /* 2.1.25+ */
|
||||
if ( c->c_sasl_cbinding ) {
|
||||
ch_free( c->c_sasl_cbinding );
|
||||
}
|
||||
#endif
|
||||
sasl_dispose( &c->c_sasl_authctx );
|
||||
}
|
||||
#endif /* HAVE_CYRUS_SASL */
|
||||
|
@ -340,6 +340,10 @@ struct LloadConnection {
|
||||
#ifdef HAVE_CYRUS_SASL
|
||||
sasl_conn_t *c_sasl_authctx;
|
||||
void *c_sasl_defaults;
|
||||
#ifdef SASL_CHANNEL_BINDING /* 2.1.25+ */
|
||||
sasl_channel_binding_t *c_sasl_cbinding; /* Else cyrus-sasl would happily
|
||||
* leak it on sasl_dispose */
|
||||
#endif /* SASL_CHANNEL_BINDING */
|
||||
#endif /* HAVE_CYRUS_SASL */
|
||||
|
||||
#ifdef LDAP_API_FEATURE_VERIFY_CREDENTIALS
|
||||
|
@ -321,6 +321,7 @@ sasl_bind_step( LloadConnection *c, BerValue *scred, BerValue *ccred )
|
||||
cb->data = cb_data = cb + 1;
|
||||
memcpy( cb_data, cbv.bv_val, cbv.bv_len );
|
||||
sasl_setprop( ctx, SASL_CHANNEL_BINDING, cb );
|
||||
c->c_sasl_cbinding = cb;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user