| buf[2] << 8
| buf[3];
- if ( size > max ) {
+ if ( size > SASL_MAX_BUFF_SIZE ) {
/* somebody is trying to mess me up. */
ber_log_printf( LDAP_DEBUG_ANY, debuglevel,
"sb_sasl_pkt_length: received illegal packet length "
"of %lu bytes\n", (unsigned long)size );
size = 16; /* this should lead to an error. */
+ } else if ( size > max ) {
+ ber_log_printf( LDAP_DEBUG_ANY, debuglevel,
+ "sb_sasl_pkt_length: received packet length "
+ "of %lu exceeds negotiated max of %lu bytes\n", (unsigned long)size, (unsigned long)max );
}
return size + 4; /* include the size !!! */
int ldap_pvt_sasl_install( Sockbuf *sb, void *ctx_arg )
{
#ifdef NEW_LOGGING
- LDAP_LOG (( "cyrus", LDAP_LEVEL_ENTRY, "ldap_pvt_sasl_install\n" ));
+ LDAP_LOG ( TRANSPORT, ENTRY, "ldap_pvt_sasl_install\n", 0, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_pvt_sasl_install\n",
0, 0, 0 );
}
#ifdef NEW_LOGGING
- LDAP_LOG (( "cyrus", LDAP_LEVEL_DETAIL1,
- "ldap_int_sasl_open: host=%s\n", host ));
+ LDAP_LOG ( TRANSPORT, DETAIL1, "ldap_int_sasl_open: host=%s\n",
+ host, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_int_sasl_open: host=%s\n",
host, 0, 0 );
(void *) &extprops );
#endif
#ifdef NEW_LOGGING
- LDAP_LOG (( "cyrus", LDAP_LEVEL_DETAIL1,
- "ldap_int_sasl_open: ssf=%ld\n", (long) ssf ));
+ LDAP_LOG ( TRANSPORT, DETAIL1,
+ "ldap_int_sasl_open: ssf=%ld\n", (long) ssf, 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_int_sasl_open: ssf=%ld\n",
(long) ssf, 0, 0 );
ber_socket_t sd;
#ifdef NEW_LOGGING
- LDAP_LOG (( "cyrus", LDAP_LEVEL_ARGS,
- "ldap_int_sasl_bind: %s\n", mechs ? mechs : "<null>" ));
+ LDAP_LOG ( TRANSPORT, ARGS, "ldap_int_sasl_bind: %s\n",
+ mechs ? mechs : "<null>", 0, 0 );
#else
Debug( LDAP_DEBUG_TRACE, "ldap_int_sasl_bind: %s\n",
mechs ? mechs : "<null>", 0, 0 );
if( scred && scred->bv_len ) {
/* and server provided us with data? */
#ifdef NEW_LOGGING
- LDAP_LOG (( "cyrus", LDAP_LEVEL_DETAIL1,
+ LDAP_LOG ( TRANSPORT, DETAIL1,
"ldap_int_sasl_bind: rc=%d sasl=%d len=%ld\n",
- rc, saslrc, scred->bv_len ));
+ rc, saslrc, scred->bv_len );
#else
Debug( LDAP_DEBUG_TRACE,
"ldap_int_sasl_bind: rc=%d sasl=%d len=%ld\n",
if( scred && scred->bv_len ) {
/* but server provided us with data! */
#ifdef NEW_LOGGING
- LDAP_LOG (( "cyrus", LDAP_LEVEL_DETAIL1,
+ LDAP_LOG ( TRANSPORT, DETAIL1,
"ldap_int_sasl_bind: rc=%d sasl=%d len=%ld\n",
- rc, saslrc, scred->bv_len ));
+ rc, saslrc, scred->bv_len );
#else
Debug( LDAP_DEBUG_TRACE,
"ldap_int_sasl_bind: rc=%d sasl=%d len=%ld\n",
&credlen );
#ifdef NEW_LOGGING
- LDAP_LOG (( "cyrus", LDAP_LEVEL_DETAIL1,
- "ldap_int_sasl_bind: sasl_client_step: %d\n", saslrc ));
+ LDAP_LOG ( TRANSPORT, DETAIL1,
+ "ldap_int_sasl_bind: sasl_client_step: %d\n", saslrc,0,0 );
#else
Debug( LDAP_DEBUG_TRACE, "sasl_client_step: %d\n",
saslrc, 0, 0 );