/titanic_50/usr/src/lib/libkmf/ber_der/common/ |
H A D | io.c | 50 kmfber_read(BerElement *ber, char *buf, ber_len_t len) in kmfber_read() argument 55 nleft = ber->ber_end - ber->ber_ptr; in kmfber_read() 58 (void) memmove(buf, ber->ber_ptr, (size_t)actuallen); in kmfber_read() 60 ber->ber_ptr += actuallen; in kmfber_read() 70 kmfber_realloc(BerElement *ber, ber_len_t len) in kmfber_realloc() argument 78 have_bytes = ber->ber_end - ber->ber_buf; in kmfber_realloc() 83 oldbuf = ber->ber_buf; in kmfber_realloc() 85 if (ber->ber_buf == NULL) { in kmfber_realloc() 86 if ((ber->ber_buf = (char *)malloc((size_t)total)) in kmfber_realloc() 90 ber->ber_flags &= ~KMFBER_FLAG_NO_FREE_BUFFER; in kmfber_realloc() [all …]
|
H A D | encode.c | 70 ber_put_tag(BerElement *ber, ber_tag_t tag, int nosos) in ber_put_tag() argument 79 return (kmfber_write(ber, in ber_put_tag() 111 kmfber_put_len(BerElement *ber, ber_int_t len, int nosos) in kmfber_put_len() argument 123 return (kmfber_write(ber, in kmfber_put_len() 146 if (kmfber_write(ber, &lenlen, 1, nosos) != 1) in kmfber_put_len() 151 if (kmfber_write(ber, in kmfber_put_len() 159 ber_put_int_or_enum(BerElement *ber, ber_int_t num, ber_tag_t tag) in ber_put_int_or_enum() argument 194 if ((taglen = ber_put_tag(ber, tag, 0)) == -1) in ber_put_int_or_enum() 197 if ((lenlen = kmfber_put_len(ber, len, 0)) == -1) in ber_put_int_or_enum() 201 if (kmfber_write(ber, in ber_put_int_or_enum() [all …]
|
H A D | decode.c | 65 kmfber_get_tag(BerElement *ber) in kmfber_get_tag() argument 72 if (kmfber_read(ber, (char *)&xbyte, 1) != 1) in kmfber_get_tag() 81 if (kmfber_read(ber, (char *)&xbyte, 1) != 1) in kmfber_get_tag() 104 kmfber_skip_tag(BerElement *ber, ber_len_t *len) in kmfber_skip_tag() argument 125 if ((tag = kmfber_get_tag(ber)) == KMFBER_DEFAULT) in kmfber_skip_tag() 137 if (kmfber_read(ber, (char *)&lc, 1) != 1) in kmfber_skip_tag() 144 if (kmfber_read(ber, (char *)&netlen + diff, noctets) in kmfber_skip_tag() 164 kmfber_peek_tag(BerElement *ber, ber_len_t *len) in kmfber_peek_tag() argument 168 bercopy.ber_end = ber->ber_end; in kmfber_peek_tag() 169 bercopy.ber_ptr = ber->ber_ptr; in kmfber_peek_tag() [all …]
|
/titanic_50/usr/src/lib/libldap5/sources/ldap/ber/ |
H A D | encode.c | 66 ber_put_tag( BerElement *ber, ber_tag_t tag, int nosos ) in ber_put_tag() argument 75 return( ber_write( ber, ((char *) &ntag) + sizeof(ber_int_t) - taglen, in ber_put_tag() 106 ber_put_len( BerElement *ber, ber_len_t len, int nosos ) in ber_put_len() argument 120 return( ber_write( ber, (char *) &netlen + sizeof(ber_int_t) - 1, in ber_put_len() 142 if ( ber_write( ber, &lenlen, 1, nosos ) != 1 ) in ber_put_len() 147 if ( ber_write( ber, (char *) &netlen + (sizeof(ber_int_t) - i), i, nosos ) in ber_put_len() 155 ber_put_int_or_enum( BerElement *ber, ber_int_t num, ber_tag_t tag ) in ber_put_int_or_enum() argument 191 if ( (taglen = ber_put_tag( ber, tag, 0 )) == -1 ) in ber_put_int_or_enum() 194 if ( (lenlen = ber_put_len( ber, len, 0 )) == -1 ) in ber_put_int_or_enum() 198 if ( ber_write( ber, (char *) &netnum + (sizeof(ber_int_t) - i), i, 0 ) in ber_put_int_or_enum() [all …]
|
H A D | io.c | 210 ber_read( BerElement *ber, char *buf, ber_len_t len ) in ber_read() argument 215 nleft = ber->ber_end - ber->ber_ptr; in ber_read() 218 SAFEMEMCPY( buf, ber->ber_ptr, (size_t)actuallen ); in ber_read() 220 ber->ber_ptr += actuallen; in ber_read() 230 nslberi_ber_realloc( BerElement *ber, ber_len_t len ) in nslberi_ber_realloc() argument 238 have_bytes = ber->ber_end - ber->ber_buf; in nslberi_ber_realloc() 243 oldbuf = ber->ber_buf; in nslberi_ber_realloc() 245 if (ber->ber_buf == NULL) { in nslberi_ber_realloc() 246 if ( (ber->ber_buf = (char *)NSLBERI_MALLOC( (size_t)total )) in nslberi_ber_realloc() 250 ber->ber_flags &= ~LBER_FLAG_NO_FREE_BUFFER; in nslberi_ber_realloc() [all …]
|
H A D | decode.c | 53 ber_get_tag( BerElement *ber ) in ber_get_tag() argument 60 if ( ber_read( ber, (char *) &xbyte, 1 ) != 1 ) in ber_get_tag() 69 if ( ber_read( ber, (char *) &xbyte, 1 ) != 1 ) in ber_get_tag() 93 ber_skip_tag( BerElement *ber, ber_len_t *len ) in ber_skip_tag() argument 114 if ( (tag = ber_get_tag( ber )) == LBER_DEFAULT ) in ber_skip_tag() 125 if ( ber_read( ber, (char *) &lc, 1 ) != 1 ) in ber_skip_tag() 132 if ( ber_read( ber, (char *) &netlen + diff, noctets ) in ber_skip_tag() 152 ber_peek_tag( BerElement *ber, ber_len_t *len ) in ber_peek_tag() argument 156 bercopy.ber_end = ber->ber_end; in ber_peek_tag() 157 bercopy.ber_ptr = ber->ber_ptr; in ber_peek_tag() [all …]
|
/titanic_50/usr/src/cmd/ldap/common/ |
H A D | etest.c | 37 BerElement *ber; in main() local 61 if ( (ber = ber_alloc()) == NULLBER ) { in main() 67 if ( ber_printf( ber, "{ti}", 0x1f44, num ) == -1 ) { in main() 72 if ( ber_flush( &sb, ber, 1 ) == -1 ) { in main() 87 if ( ber_printf( ber, "i", i ) == -1 ) { in main() 95 rc = ber_put_enum( ber, i, (char)ber->ber_tag ); in main() 99 rc = ber_put_null( ber, (char)ber->ber_tag ); in main() 105 rc = ber_put_ostring( ber, s, len, (char)ber->ber_tag ); in main() 110 rc = ber_put_string( ber, s, (char)ber->ber_tag ); in main() 116 rc = ber_put_bitstring( ber, s, len, (char)ber->ber_tag ); in main() [all …]
|
/titanic_50/usr/src/head/ |
H A D | lber.h | 146 ber_tag_t LDAP_CALL ber_get_tag(BerElement *ber); 147 ber_tag_t LDAP_CALL ber_skip_tag(BerElement *ber, 149 ber_tag_t LDAP_CALL ber_peek_tag(BerElement *ber, 151 ber_tag_t LDAP_CALL ber_get_int(BerElement *ber, ber_int_t *num); 152 ber_tag_t LDAP_CALL ber_get_stringb(BerElement *ber, char *buf, 154 ber_tag_t LDAP_CALL ber_get_stringa(BerElement *ber, 156 ber_tag_t LDAP_CALL ber_get_stringal(BerElement *ber, 158 ber_tag_t ber_get_bitstringa(BerElement *ber, 160 ber_tag_t LDAP_CALL ber_get_null(BerElement *ber); 161 ber_tag_t LDAP_CALL ber_get_boolean(BerElement *ber, [all …]
|
/titanic_50/usr/src/lib/libldap5/sources/ldap/common/ |
H A D | getattr.c | 47 bytes_remaining( BerElement *ber ) in bytes_remaining() argument 51 if ( ber_get_option( ber, LBER_OPT_REMAINING_BYTES, &len ) != 0 ) { in bytes_remaining() 60 ldap_first_attribute( LDAP *ld, LDAPMessage *entry, BerElement **ber ) in ldap_first_attribute() argument 72 if ( ber == NULL || !NSLDAPI_VALID_LDAPMESSAGE_ENTRY_POINTER( entry )) { in ldap_first_attribute() 77 if ( nsldapi_alloc_ber_with_options( ld, ber ) != LDAP_SUCCESS ) { in ldap_first_attribute() 81 **ber = *entry->lm_ber; in ldap_first_attribute() 91 if ( ber_scanf( *ber, "{xl{", &seqlength ) != LBER_ERROR && in ldap_first_attribute() 92 ber_set_option( *ber, LBER_OPT_REMAINING_BYTES, &seqlength ) in ldap_first_attribute() 98 if ( ber_scanf( *ber, "{ax}", &attr ) != LBER_ERROR || in ldap_first_attribute() 99 bytes_remaining( *ber ) == 0 ) { in ldap_first_attribute() [all …]
|
H A D | search.c | 53 static char *put_complex_filter( BerElement *ber, char *str, 58 static int put_simple_filter( BerElement *ber, char *str ); 59 static int put_substring_filter( BerElement *ber, char *type, 61 static int put_filter_list( BerElement *ber, char *str ); 165 BerElement *ber; in nsldapi_search() local 219 *msgidp, &ber )) != LDAP_SUCCESS ) { in nsldapi_search() 225 (char *) base, ber ); in nsldapi_search() 284 BerElement *ber; in nsldapi_build_search_req() local 313 if (( err = nsldapi_alloc_ber_with_options( ld, &ber )) in nsldapi_build_search_req() 332 err = ber_printf( ber, "{ist{seeiib", msgid, in nsldapi_build_search_req() [all …]
|
H A D | psearch.c | 32 BerElement *ber; in ldap_create_persistentsearch_control() local 57 if (( nsldapi_alloc_ber_with_options( ld, &ber )) != LDAP_SUCCESS ) { in ldap_create_persistentsearch_control() 62 if ( ber_printf( ber, "{ibb}", changetypes, changesonly, in ldap_create_persistentsearch_control() 64 ber_free( ber, 1 ); in ldap_create_persistentsearch_control() 69 rc = nsldapi_build_control( LDAP_CONTROL_PERSISTENTSEARCH, ber, 1, in ldap_create_persistentsearch_control() 83 BerElement *ber; in ldap_parse_entrychange_control() local 122 if (( ber = ber_init( &(ctrls[i]->ldctl_value))) == NULL ) { in ldap_parse_entrychange_control() 127 if ( ber_scanf( ber, "{e", &along ) == LBER_ERROR ) { in ldap_parse_entrychange_control() 128 ber_free( ber, 1 ); in ldap_parse_entrychange_control() 135 if ( ber_scanf( ber, "a", &previousdn ) == LBER_ERROR ) { in ldap_parse_entrychange_control() [all …]
|
H A D | vlistctrl.c | 80 BerElement *ber; in ldap_create_virtuallist_control() local 94 if ( LDAP_SUCCESS != nsldapi_alloc_ber_with_options( ld, &ber ) ) in ldap_create_virtuallist_control() 100 if ( LBER_ERROR == ber_printf( ber, in ldap_create_virtuallist_control() 107 ber_free( ber, 1 ); in ldap_create_virtuallist_control() 113 if ( LBER_ERROR == ber_printf( ber, in ldap_create_virtuallist_control() 121 ber_free( ber, 1 ); in ldap_create_virtuallist_control() 127 if ( LBER_ERROR == ber_printf( ber, in ldap_create_virtuallist_control() 133 ber_free( ber, 1 ); in ldap_create_virtuallist_control() 140 ber, in ldap_create_virtuallist_control() 187 BerElement *ber; in ldap_parse_virtuallist_control() local [all …]
|
H A D | sortctrl.c | 47 BerElement *ber; in ldap_create_sort_control() local 60 if ( ( nsldapi_alloc_ber_with_options( ld, &ber ) ) != LDAP_SUCCESS ) { in ldap_create_sort_control() 66 if ( ber_printf( ber, "{" ) == -1 ) { in ldap_create_sort_control() 76 if ( ber_printf( ber, "{s", (sortKeyList[i])->sk_attrtype ) in ldap_create_sort_control() 83 if ( ber_printf( ber, "ts", LDAP_TAG_SK_MATCHRULE, in ldap_create_sort_control() 93 if ( ber_printf( ber, "tb}", LDAP_TAG_SK_REVERSE, in ldap_create_sort_control() 98 if ( ber_printf( ber, "}" ) == -1 ) { in ldap_create_sort_control() 105 if ( ber_printf( ber, "}" ) == -1 ) { in ldap_create_sort_control() 109 rc = nsldapi_build_control( LDAP_CONTROL_SORTREQUEST, ber, 1, in ldap_create_sort_control() 117 ber_free( ber, 1 ); in ldap_create_sort_control() [all …]
|
H A D | proxyauthctrl.c | 53 BerElement *ber; in ldap_create_proxyauth_control() local 70 if ( ( nsldapi_alloc_ber_with_options( ld, &ber ) ) != LDAP_SUCCESS ) { in ldap_create_proxyauth_control() 77 if ( LBER_ERROR == ber_printf( ber, in ldap_create_proxyauth_control() 82 ber_free( ber, 1 ); in ldap_create_proxyauth_control() 86 rc = nsldapi_build_control( LDAP_CONTROL_PROXYAUTH, ber, 1, in ldap_create_proxyauth_control() 117 BerElement *ber; in ldap_create_proxiedauth_control() local 130 if ( ( nsldapi_alloc_ber_with_options( ld, &ber ) ) != LDAP_SUCCESS ) { in ldap_create_proxiedauth_control() 137 if ( LBER_ERROR == ber_printf( ber, in ldap_create_proxiedauth_control() 142 ber_free( ber, 1 ); in ldap_create_proxiedauth_control() 146 rc = nsldapi_build_control( LDAP_CONTROL_PROXIEDAUTH, ber, 1, 1, ctrlp ); in ldap_create_proxiedauth_control()
|
H A D | control.c | 36 BerElement *ber ) in nsldapi_put_controls() argument 72 if ( ber_printf( ber, "t{", LDAP_TAG_CONTROLS ) == -1 ) { in nsldapi_put_controls() 79 if ( ber_printf( ber, "{s", c->ldctl_oid ) == -1 ) { in nsldapi_put_controls() 86 if ( ber_printf( ber, "b", (int)c->ldctl_iscritical ) in nsldapi_put_controls() 93 if ( ber_printf( ber, "o", c->ldctl_value.bv_val, in nsldapi_put_controls() 100 if ( ber_put_seq( ber ) == -1 ) { in nsldapi_put_controls() 105 if ( ber_put_seq( ber ) == -1 ) { in nsldapi_put_controls() 111 if ( closeseq && ber_put_seq( ber ) == -1 ) { in nsldapi_put_controls() 128 nsldapi_get_controls( BerElement *ber, LDAPControl ***controlsp ) in nsldapi_get_controls() argument 157 if ( ber_get_option( ber, LBER_OPT_REMAINING_BYTES, &len ) != 0 ) { in nsldapi_get_controls() [all …]
|
H A D | extendop.c | 46 BerElement *ber; in ldap_extended_operation() local 98 if (( rc = nsldapi_alloc_ber_with_options( ld, &ber )) in ldap_extended_operation() 104 if ( ber_printf( ber, "{it{tsto}", msgid, LDAP_REQ_EXTENDED, in ldap_extended_operation() 109 ber_free( ber, 1 ); in ldap_extended_operation() 113 if (( rc = nsldapi_put_controls( ld, serverctrls, 1, ber )) in ldap_extended_operation() 115 ber_free( ber, 1 ); in ldap_extended_operation() 121 ber ); in ldap_extended_operation() 188 struct berelement ber; in ldap_parse_extended_result() local 205 ber = *(res->lm_ber); in ldap_parse_extended_result() 211 if ( ber_scanf( &ber, "{iaa", &err, &m, &e ) == LBER_ERROR ) { in ldap_parse_extended_result() [all …]
|
H A D | saslbind.c | 56 BerElement *ber; in ldap_sasl_bind() local 111 if (( rc = nsldapi_alloc_ber_with_options( ld, &ber )) in ldap_sasl_bind() 125 rc = ber_printf( ber, "{it{isto}", msgid, LDAP_REQ_BIND, in ldap_sasl_bind() 131 rc = ber_printf( ber, "{it{ist{s}}", msgid, in ldap_sasl_bind() 135 rc = ber_printf( ber, "{it{ist{so}}", msgid, in ldap_sasl_bind() 144 ber_free( ber, 1 ); in ldap_sasl_bind() 148 if ( (rc = nsldapi_put_controls( ld, serverctrls, 1, ber )) in ldap_sasl_bind() 150 ber_free( ber, 1 ); in ldap_sasl_bind() 156 (char *)dn, ber ); in ldap_sasl_bind() 222 BerElement ber; in ldap_parse_sasl_bind_result() local [all …]
|
H A D | add.c | 85 BerElement *ber; in ldap_add_ext() local 138 if (( lderr = nsldapi_alloc_ber_with_options( ld, &ber )) in ldap_add_ext() 143 if ( ber_printf( ber, "{it{s{", *msgidp, LDAP_REQ_ADD, dn ) in ldap_add_ext() 147 ber_free( ber, 1 ); in ldap_add_ext() 154 rc = ber_printf( ber, "{s[V]}", attrs[i]->mod_type, in ldap_add_ext() 157 rc = ber_printf( ber, "{s[v]}", attrs[i]->mod_type, in ldap_add_ext() 163 ber_free( ber, 1 ); in ldap_add_ext() 168 if ( ber_printf( ber, "}}" ) == -1 ) { in ldap_add_ext() 171 ber_free( ber, 1 ); in ldap_add_ext() 175 if (( lderr = nsldapi_put_controls( ld, serverctrls, 1, ber )) in ldap_add_ext() [all …]
|
H A D | modify.c | 78 BerElement *ber; in ldap_modify_ext() local 136 if (( lderr = nsldapi_alloc_ber_with_options( ld, &ber )) in ldap_modify_ext() 141 if ( ber_printf( ber, "{it{s{", *msgidp, LDAP_REQ_MODIFY, dn ) in ldap_modify_ext() 145 ber_free( ber, 1 ); in ldap_modify_ext() 152 rc = ber_printf( ber, "{e{s[V]}}", in ldap_modify_ext() 156 rc = ber_printf( ber, "{e{s[v]}}", mods[i]->mod_op, in ldap_modify_ext() 163 ber_free( ber, 1 ); in ldap_modify_ext() 168 if ( ber_printf( ber, "}}" ) == -1 ) { in ldap_modify_ext() 171 ber_free( ber, 1 ); in ldap_modify_ext() 175 if (( lderr = nsldapi_put_controls( ld, serverctrls, 1, ber )) in ldap_modify_ext() [all …]
|
H A D | rename.c | 72 BerElement *ber; in ldap_rename() local 142 if (( err = nsldapi_alloc_ber_with_options( ld, &ber )) in ldap_rename() 148 if ( ber_printf( ber, "{it{ssb", *msgidp, LDAP_REQ_MODDN, dn, in ldap_rename() 151 ber_free( ber, 1 ); in ldap_rename() 156 if ( ber_printf( ber, "}" ) == -1 ) { in ldap_rename() 158 ber_free( ber, 1 ); in ldap_rename() 162 if ( ber_printf( ber, "ts}", LDAP_TAG_NEWSUPERIOR, newparent ) in ldap_rename() 165 ber_free( ber, 1 ); in ldap_rename() 170 if (( rc = nsldapi_put_controls( ld, serverctrls, 1, ber )) in ldap_rename() 172 ber_free( ber, 1 ); in ldap_rename() [all …]
|
H A D | delete.c | 65 BerElement *ber; in ldap_delete_ext() local 105 if (( lderr = nsldapi_alloc_ber_with_options( ld, &ber )) in ldap_delete_ext() 110 if ( ber_printf( ber, "{its", *msgidp, LDAP_REQ_DELETE, dn ) in ldap_delete_ext() 114 ber_free( ber, 1 ); in ldap_delete_ext() 118 if (( lderr = nsldapi_put_controls( ld, serverctrls, 1, ber )) in ldap_delete_ext() 120 ber_free( ber, 1 ); in ldap_delete_ext() 126 (char *)dn, ber ); in ldap_delete_ext()
|
H A D | getvalues.c | 45 struct berelement ber; in internal_ldap_get_values() local 61 ber = *entry->lm_ber; in internal_ldap_get_values() 64 if ( ber_scanf( &ber, "{x{{a", &attr ) == LBER_ERROR ) { in internal_ldap_get_values() 73 if ( ber_scanf( &ber, "x}{a", &attr ) == LBER_ERROR ) { in internal_ldap_get_values() 94 rc = ber_scanf( &ber, "[V]", &vals ); in internal_ldap_get_values() 96 rc = ber_scanf( &ber, "[v]", &vals ); in internal_ldap_get_values() 333 struct berelement ber; in internal_ldap_get_lang_values() local 381 ber = *entry->lm_ber; in internal_ldap_get_lang_values() 391 if ( ber_scanf( &ber, "{x{{a", &attr ) == LBER_ERROR ) { in internal_ldap_get_lang_values() 395 if ( ber_scanf( &ber, "{a", &attr ) == LBER_ERROR ) { in internal_ldap_get_lang_values() [all …]
|
H A D | request.c | 81 nsldapi_set_ber_options( LDAP *ld, BerElement *ber ) in nsldapi_set_ber_options() argument 83 ber->ber_options = ld->ld_lberoptions; in nsldapi_set_ber_options() 86 ber_set_string_translators( ber, in nsldapi_set_ber_options() 97 char *dn, BerElement *ber ) in nsldapi_send_initial_request() argument 107 ber_free( ber, 1 ); in nsldapi_send_initial_request() 140 return( nsldapi_send_server_request( ld, ber, msgid, NULL, in nsldapi_send_initial_request() 149 BerElement *ber, /* message to send */ in nsldapi_send_server_request() argument 174 ber_free( ber, 1 ); in nsldapi_send_server_request() 182 ber_free( ber, 1 ); in nsldapi_send_server_request() 222 ber_free( ber, 1 ); in nsldapi_send_server_request() [all …]
|
H A D | compare.c | 74 BerElement *ber; in ldap_compare_ext() local 121 if (( lderr = nsldapi_alloc_ber_with_options( ld, &ber )) in ldap_compare_ext() 126 if ( ber_printf( ber, "{it{s{so}}", *msgidp, LDAP_REQ_COMPARE, dn, in ldap_compare_ext() 131 ber_free( ber, 1 ); in ldap_compare_ext() 135 if (( lderr = nsldapi_put_controls( ld, serverctrls, 1, ber )) in ldap_compare_ext() 137 ber_free( ber, 1 ); in ldap_compare_ext() 143 (char *)dn, ber ); in ldap_compare_ext()
|
H A D | spagectrl.c | 26 BerElement *ber; in ldap_create_page_control() local 32 if ((ber = ber_alloc_t(LBER_USE_DER)) == NULLBER){ in ldap_create_page_control() 36 if (ber_printf(ber, "{io}", pagesize, in ldap_create_page_control() 40 ber_free(ber, 1); in ldap_create_page_control() 44 rc = nsldapi_build_control(LDAP_CONTROL_SIMPLE_PAGE, ber, 1, isCritical, in ldap_create_page_control()
|