/illumos-gate/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 …]
|
/illumos-gate/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 | 49 ber_get_tag( BerElement *ber ) in ber_get_tag() argument 56 if ( ber_read( ber, (char *) &xbyte, 1 ) != 1 ) in ber_get_tag() 65 if ( ber_read( ber, (char *) &xbyte, 1 ) != 1 ) in ber_get_tag() 89 ber_skip_tag( BerElement *ber, ber_len_t *len ) in ber_skip_tag() argument 110 if ( (tag = ber_get_tag( ber )) == LBER_DEFAULT ) in ber_skip_tag() 121 if ( ber_read( ber, (char *) &lc, 1 ) != 1 ) in ber_skip_tag() 128 if ( ber_read( ber, (char *) &netlen + diff, noctets ) in ber_skip_tag() 148 ber_peek_tag( BerElement *ber, ber_len_t *len ) in ber_peek_tag() argument 152 bercopy.ber_end = ber->ber_end; in ber_peek_tag() 153 bercopy.ber_ptr = ber->ber_ptr; in ber_peek_tag() [all …]
|
/illumos-gate/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 …]
|
/illumos-gate/usr/src/head/ |
H A D | lber.h | 144 ber_tag_t LDAP_CALL ber_get_tag(BerElement *ber); 145 ber_tag_t LDAP_CALL ber_skip_tag(BerElement *ber, 147 ber_tag_t LDAP_CALL ber_peek_tag(BerElement *ber, 149 ber_tag_t LDAP_CALL ber_get_int(BerElement *ber, ber_int_t *num); 150 ber_tag_t LDAP_CALL ber_get_stringb(BerElement *ber, char *buf, 152 ber_tag_t LDAP_CALL ber_get_stringa(BerElement *ber, 154 ber_tag_t LDAP_CALL ber_get_stringal(BerElement *ber, 156 ber_tag_t ber_get_bitstringa(BerElement *ber, 158 ber_tag_t LDAP_CALL ber_get_null(BerElement *ber); 159 ber_tag_t LDAP_CALL ber_get_boolean(BerElement *ber, [all …]
|
/illumos-gate/usr/src/lib/libldap5/sources/ldap/common/ |
H A D | getattr.c | 45 bytes_remaining( BerElement *ber ) in bytes_remaining() argument 49 if ( ber_get_option( ber, LBER_OPT_REMAINING_BYTES, &len ) != 0 ) { in bytes_remaining() 58 ldap_first_attribute( LDAP *ld, LDAPMessage *entry, BerElement **ber ) in ldap_first_attribute() argument 70 if ( ber == NULL || !NSLDAPI_VALID_LDAPMESSAGE_ENTRY_POINTER( entry )) { in ldap_first_attribute() 75 if ( nsldapi_alloc_ber_with_options( ld, ber ) != LDAP_SUCCESS ) { in ldap_first_attribute() 79 **ber = *entry->lm_ber; in ldap_first_attribute() 89 if ( ber_scanf( *ber, "{xl{", &seqlength ) != LBER_ERROR && in ldap_first_attribute() 90 ber_set_option( *ber, LBER_OPT_REMAINING_BYTES, &seqlength ) in ldap_first_attribute() 96 if ( ber_scanf( *ber, "{ax}", &attr ) != LBER_ERROR || in ldap_first_attribute() 97 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 | 30 BerElement *ber; in ldap_create_persistentsearch_control() local 55 if (( nsldapi_alloc_ber_with_options( ld, &ber )) != LDAP_SUCCESS ) { in ldap_create_persistentsearch_control() 60 if ( ber_printf( ber, "{ibb}", changetypes, changesonly, in ldap_create_persistentsearch_control() 62 ber_free( ber, 1 ); in ldap_create_persistentsearch_control() 67 rc = nsldapi_build_control( LDAP_CONTROL_PERSISTENTSEARCH, ber, 1, in ldap_create_persistentsearch_control() 81 BerElement *ber; in ldap_parse_entrychange_control() local 120 if (( ber = ber_init( &(ctrls[i]->ldctl_value))) == NULL ) { in ldap_parse_entrychange_control() 125 if ( ber_scanf( ber, "{e", &along ) == LBER_ERROR ) { in ldap_parse_entrychange_control() 126 ber_free( ber, 1 ); in ldap_parse_entrychange_control() 133 if ( ber_scanf( ber, "a", &previousdn ) == LBER_ERROR ) { in ldap_parse_entrychange_control() [all …]
|
H A D | vlistctrl.c | 78 BerElement *ber; in ldap_create_virtuallist_control() local 92 if ( LDAP_SUCCESS != nsldapi_alloc_ber_with_options( ld, &ber ) ) in ldap_create_virtuallist_control() 98 if ( LBER_ERROR == ber_printf( ber, in ldap_create_virtuallist_control() 105 ber_free( ber, 1 ); in ldap_create_virtuallist_control() 111 if ( LBER_ERROR == ber_printf( ber, in ldap_create_virtuallist_control() 119 ber_free( ber, 1 ); in ldap_create_virtuallist_control() 125 if ( LBER_ERROR == ber_printf( ber, in ldap_create_virtuallist_control() 131 ber_free( ber, 1 ); in ldap_create_virtuallist_control() 138 ber, in ldap_create_virtuallist_control() 185 BerElement *ber; in ldap_parse_virtuallist_control() local [all …]
|
H A D | sortctrl.c | 45 BerElement *ber; in ldap_create_sort_control() local 58 if ( ( nsldapi_alloc_ber_with_options( ld, &ber ) ) != LDAP_SUCCESS ) { in ldap_create_sort_control() 64 if ( ber_printf( ber, "{" ) == -1 ) { in ldap_create_sort_control() 74 if ( ber_printf( ber, "{s", (sortKeyList[i])->sk_attrtype ) in ldap_create_sort_control() 81 if ( ber_printf( ber, "ts", LDAP_TAG_SK_MATCHRULE, in ldap_create_sort_control() 91 if ( ber_printf( ber, "tb}", LDAP_TAG_SK_REVERSE, in ldap_create_sort_control() 96 if ( ber_printf( ber, "}" ) == -1 ) { in ldap_create_sort_control() 103 if ( ber_printf( ber, "}" ) == -1 ) { in ldap_create_sort_control() 107 rc = nsldapi_build_control( LDAP_CONTROL_SORTREQUEST, ber, 1, in ldap_create_sort_control() 115 ber_free( ber, 1 ); in ldap_create_sort_control() [all …]
|
H A D | control.c | 34 BerElement *ber ) in nsldapi_put_controls() argument 70 if ( ber_printf( ber, "t{", LDAP_TAG_CONTROLS ) == -1 ) { in nsldapi_put_controls() 77 if ( ber_printf( ber, "{s", c->ldctl_oid ) == -1 ) { in nsldapi_put_controls() 84 if ( ber_printf( ber, "b", (int)c->ldctl_iscritical ) in nsldapi_put_controls() 91 if ( ber_printf( ber, "o", c->ldctl_value.bv_val, in nsldapi_put_controls() 98 if ( ber_put_seq( ber ) == -1 ) { in nsldapi_put_controls() 103 if ( ber_put_seq( ber ) == -1 ) { in nsldapi_put_controls() 109 if ( closeseq && ber_put_seq( ber ) == -1 ) { in nsldapi_put_controls() 126 nsldapi_get_controls( BerElement *ber, LDAPControl ***controlsp ) in nsldapi_get_controls() argument 155 if ( ber_get_option( ber, LBER_OPT_REMAINING_BYTES, &len ) != 0 ) { in nsldapi_get_controls() [all …]
|
H A D | proxyauthctrl.c | 51 BerElement *ber; in ldap_create_proxyauth_control() local 68 if ( ( nsldapi_alloc_ber_with_options( ld, &ber ) ) != LDAP_SUCCESS ) { in ldap_create_proxyauth_control() 75 if ( LBER_ERROR == ber_printf( ber, in ldap_create_proxyauth_control() 80 ber_free( ber, 1 ); in ldap_create_proxyauth_control() 84 rc = nsldapi_build_control( LDAP_CONTROL_PROXYAUTH, ber, 1, in ldap_create_proxyauth_control() 115 BerElement *ber; in ldap_create_proxiedauth_control() local 128 if ( ( nsldapi_alloc_ber_with_options( ld, &ber ) ) != LDAP_SUCCESS ) { in ldap_create_proxiedauth_control() 135 if ( LBER_ERROR == ber_printf( ber, in ldap_create_proxiedauth_control() 140 ber_free( ber, 1 ); in ldap_create_proxiedauth_control() 144 rc = nsldapi_build_control( LDAP_CONTROL_PROXIEDAUTH, ber, 1, 1, ctrlp ); in ldap_create_proxiedauth_control()
|
H A D | extendop.c | 44 BerElement *ber; in ldap_extended_operation() local 96 if (( rc = nsldapi_alloc_ber_with_options( ld, &ber )) in ldap_extended_operation() 102 if ( ber_printf( ber, "{it{tsto}", msgid, LDAP_REQ_EXTENDED, in ldap_extended_operation() 107 ber_free( ber, 1 ); in ldap_extended_operation() 111 if (( rc = nsldapi_put_controls( ld, serverctrls, 1, ber )) in ldap_extended_operation() 113 ber_free( ber, 1 ); in ldap_extended_operation() 119 ber ); in ldap_extended_operation() 186 struct berelement ber; in ldap_parse_extended_result() local 203 ber = *(res->lm_ber); in ldap_parse_extended_result() 209 if ( ber_scanf( &ber, "{iaa", &err, &m, &e ) == LBER_ERROR ) { in ldap_parse_extended_result() [all …]
|
H A D | saslbind.c | 54 BerElement *ber; in ldap_sasl_bind() local 109 if (( rc = nsldapi_alloc_ber_with_options( ld, &ber )) in ldap_sasl_bind() 123 rc = ber_printf( ber, "{it{isto}", msgid, LDAP_REQ_BIND, in ldap_sasl_bind() 129 rc = ber_printf( ber, "{it{ist{s}}", msgid, in ldap_sasl_bind() 133 rc = ber_printf( ber, "{it{ist{so}}", msgid, in ldap_sasl_bind() 142 ber_free( ber, 1 ); in ldap_sasl_bind() 146 if ( (rc = nsldapi_put_controls( ld, serverctrls, 1, ber )) in ldap_sasl_bind() 148 ber_free( ber, 1 ); in ldap_sasl_bind() 154 (char *)dn, ber ); in ldap_sasl_bind() 220 BerElement ber; in ldap_parse_sasl_bind_result() local [all …]
|
H A D | add.c | 83 BerElement *ber; in ldap_add_ext() local 136 if (( lderr = nsldapi_alloc_ber_with_options( ld, &ber )) in ldap_add_ext() 141 if ( ber_printf( ber, "{it{s{", *msgidp, LDAP_REQ_ADD, dn ) in ldap_add_ext() 145 ber_free( ber, 1 ); in ldap_add_ext() 152 rc = ber_printf( ber, "{s[V]}", attrs[i]->mod_type, in ldap_add_ext() 155 rc = ber_printf( ber, "{s[v]}", attrs[i]->mod_type, in ldap_add_ext() 161 ber_free( ber, 1 ); in ldap_add_ext() 166 if ( ber_printf( ber, "}}" ) == -1 ) { in ldap_add_ext() 169 ber_free( ber, 1 ); in ldap_add_ext() 173 if (( lderr = nsldapi_put_controls( ld, serverctrls, 1, ber )) in ldap_add_ext() [all …]
|
H A D | modify.c | 76 BerElement *ber; in ldap_modify_ext() local 134 if (( lderr = nsldapi_alloc_ber_with_options( ld, &ber )) in ldap_modify_ext() 139 if ( ber_printf( ber, "{it{s{", *msgidp, LDAP_REQ_MODIFY, dn ) in ldap_modify_ext() 143 ber_free( ber, 1 ); in ldap_modify_ext() 150 rc = ber_printf( ber, "{e{s[V]}}", in ldap_modify_ext() 154 rc = ber_printf( ber, "{e{s[v]}}", mods[i]->mod_op, in ldap_modify_ext() 161 ber_free( ber, 1 ); in ldap_modify_ext() 166 if ( ber_printf( ber, "}}" ) == -1 ) { in ldap_modify_ext() 169 ber_free( ber, 1 ); in ldap_modify_ext() 173 if (( lderr = nsldapi_put_controls( ld, serverctrls, 1, ber )) in ldap_modify_ext() [all …]
|
H A D | rename.c | 70 BerElement *ber; in ldap_rename() local 140 if (( err = nsldapi_alloc_ber_with_options( ld, &ber )) in ldap_rename() 146 if ( ber_printf( ber, "{it{ssb", *msgidp, LDAP_REQ_MODDN, dn, in ldap_rename() 149 ber_free( ber, 1 ); in ldap_rename() 154 if ( ber_printf( ber, "}" ) == -1 ) { in ldap_rename() 156 ber_free( ber, 1 ); in ldap_rename() 160 if ( ber_printf( ber, "ts}", LDAP_TAG_NEWSUPERIOR, newparent ) in ldap_rename() 163 ber_free( ber, 1 ); in ldap_rename() 168 if (( rc = nsldapi_put_controls( ld, serverctrls, 1, ber )) in ldap_rename() 170 ber_free( ber, 1 ); in ldap_rename() [all …]
|
H A D | request.c | 79 nsldapi_set_ber_options( LDAP *ld, BerElement *ber ) in nsldapi_set_ber_options() argument 81 ber->ber_options = ld->ld_lberoptions; in nsldapi_set_ber_options() 84 ber_set_string_translators( ber, in nsldapi_set_ber_options() 95 char *dn, BerElement *ber ) in nsldapi_send_initial_request() argument 105 ber_free( ber, 1 ); in nsldapi_send_initial_request() 138 return( nsldapi_send_server_request( ld, ber, msgid, NULL, in nsldapi_send_initial_request() 147 BerElement *ber, /* message to send */ in nsldapi_send_server_request() argument 172 ber_free( ber, 1 ); in nsldapi_send_server_request() 180 ber_free( ber, 1 ); in nsldapi_send_server_request() 220 ber_free( ber, 1 ); in nsldapi_send_server_request() [all …]
|
H A D | delete.c | 63 BerElement *ber; in ldap_delete_ext() local 103 if (( lderr = nsldapi_alloc_ber_with_options( ld, &ber )) in ldap_delete_ext() 108 if ( ber_printf( ber, "{its", *msgidp, LDAP_REQ_DELETE, dn ) in ldap_delete_ext() 112 ber_free( ber, 1 ); in ldap_delete_ext() 116 if (( lderr = nsldapi_put_controls( ld, serverctrls, 1, ber )) in ldap_delete_ext() 118 ber_free( ber, 1 ); in ldap_delete_ext() 124 (char *)dn, ber ); in ldap_delete_ext()
|
H A D | getvalues.c | 43 struct berelement ber; in internal_ldap_get_values() local 59 ber = *entry->lm_ber; in internal_ldap_get_values() 62 if ( ber_scanf( &ber, "{x{{a", &attr ) == LBER_ERROR ) { in internal_ldap_get_values() 71 if ( ber_scanf( &ber, "x}{a", &attr ) == LBER_ERROR ) { in internal_ldap_get_values() 92 rc = ber_scanf( &ber, "[V]", &vals ); in internal_ldap_get_values() 94 rc = ber_scanf( &ber, "[v]", &vals ); in internal_ldap_get_values() 331 struct berelement ber; in internal_ldap_get_lang_values() local 379 ber = *entry->lm_ber; in internal_ldap_get_lang_values() 389 if ( ber_scanf( &ber, "{x{{a", &attr ) == LBER_ERROR ) { in internal_ldap_get_lang_values() 393 if ( ber_scanf( &ber, "{a", &attr ) == LBER_ERROR ) { in internal_ldap_get_lang_values() [all …]
|
H A D | compare.c | 72 BerElement *ber; in ldap_compare_ext() local 119 if (( lderr = nsldapi_alloc_ber_with_options( ld, &ber )) in ldap_compare_ext() 124 if ( ber_printf( ber, "{it{s{so}}", *msgidp, LDAP_REQ_COMPARE, dn, in ldap_compare_ext() 129 ber_free( ber, 1 ); in ldap_compare_ext() 133 if (( lderr = nsldapi_put_controls( ld, serverctrls, 1, ber )) in ldap_compare_ext() 135 ber_free( ber, 1 ); in ldap_compare_ext() 141 (char *)dn, ber ); in ldap_compare_ext()
|
H A D | spagectrl.c | 24 BerElement *ber; in ldap_create_page_control() local 30 if ((ber = ber_alloc_t(LBER_USE_DER)) == NULLBER){ in ldap_create_page_control() 34 if (ber_printf(ber, "{io}", pagesize, in ldap_create_page_control() 38 ber_free(ber, 1); in ldap_create_page_control() 42 rc = nsldapi_build_control(LDAP_CONTROL_SIMPLE_PAGE, ber, 1, isCritical, in ldap_create_page_control()
|