unsigned long *len )
{
unsigned long tag;
- BerElement *ber = ber_dup( ber_in );
+ BerElement *ber;
+
+ assert( ber_in != NULL );
+
+ ber = ber_dup( ber_in );
if( ber == NULL ) {
return LBER_ERROR;
{
unsigned long tag, len;
+ assert( ber != NULL );
+
if ( (tag = ber_skip_tag( ber, &len )) == LBER_DEFAULT )
return( LBER_DEFAULT );
char *transbuf;
#endif /* STR_TRANSLATION */
+ assert( ber != NULL );
+
if ( (tag = ber_skip_tag( ber, &datalen )) == LBER_DEFAULT )
return( LBER_DEFAULT );
if ( datalen > (*len - 1) )
{
unsigned long datalen, tag;
+ assert( ber != NULL );
+ assert( buf != NULL );
+
if ( (tag = ber_skip_tag( ber, &datalen )) == LBER_DEFAULT ) {
*buf = NULL;
return( LBER_DEFAULT );
{
unsigned long len, tag;
+ assert( ber != NULL );
+ assert( bv != NULL );
+
if ( (tag = ber_skip_tag( ber, &len )) == LBER_DEFAULT ) {
*bv = NULL;
return( LBER_DEFAULT );
unsigned long datalen, tag;
unsigned char unusedbits;
+ assert( ber != NULL );
+ assert( buf != NULL );
+ assert( blen != NULL );
+
if ( (tag = ber_skip_tag( ber, &datalen )) == LBER_DEFAULT ) {
*buf = NULL;
return( LBER_DEFAULT );
{
unsigned long len, tag;
+ assert( ber != NULL );
+
if ( (tag = ber_skip_tag( ber, &len )) == LBER_DEFAULT )
return( LBER_DEFAULT );
long longbool;
int rc;
+ assert( ber != NULL );
+ assert( boolval != NULL );
+
rc = ber_get_int( ber, &longbool );
*boolval = longbool;
unsigned long
ber_first_element( BerElement *ber, unsigned long *len, char **last )
{
+ assert( ber != NULL );
+ assert( len != NULL );
+ assert( last != NULL );
+
/* skip the sequence header, use the len to mark where to stop */
if ( ber_skip_tag( ber, len ) == LBER_DEFAULT ) {
*last = NULL;
unsigned long
ber_next_element( BerElement *ber, unsigned long *len, char *last )
{
+ assert( ber != NULL );
+ assert( len != NULL );
+ assert( last != NULL );
+
if ( ber->ber_ptr == last ) {
#ifdef LBER_END_SEQORSET
return( LBER_END_SEQORSET );
long *l;
unsigned long rc, tag, len;
- assert( ber != NULL );
-
#ifdef HAVE_STDARG
va_start( ap, fmt );
#else
}
BerElement *
-ber_alloc( void )
+ber_alloc( void ) /* deprecated */
{
return( ber_alloc_t( 0 ) );
}
BerElement *
-der_alloc( void )
+der_alloc( void ) /* deprecated */
{
return( ber_alloc_t( LBER_USE_DER ) );
}
assert( ber != NULL );
- if ( (new = ber_alloc()) == NULL )
+ if ( (new = ber_alloc_t( ber->ber_options )) == NULL ) {
return( NULL );
+ }
*new = *ber;
(void) memset( (char *)ber, '\0', sizeof( BerElement ));
ber->ber_tag = LBER_DEFAULT;
ber->ber_options = (char) options;
+ ber->ber_debug = ber_int_debug;
}
/* New C-API ber_init() */