Lines Matching refs:b
72 static int asn1_bio_flush_ex(BIO *b, BIO_ASN1_BUF_CTX *ctx,
74 static int asn1_bio_setup_ex(BIO *b, BIO_ASN1_BUF_CTX *ctx,
99 static int asn1_bio_new(BIO *b) in asn1_bio_new() argument
109 BIO_set_data(b, ctx); in asn1_bio_new()
110 BIO_set_init(b, 1); in asn1_bio_new()
130 static int asn1_bio_free(BIO *b) in asn1_bio_free() argument
134 if (b == NULL) in asn1_bio_free()
137 ctx = BIO_get_data(b); in asn1_bio_free()
142 ctx->prefix_free(b, &ctx->ex_buf, &ctx->ex_len, &ctx->ex_arg); in asn1_bio_free()
144 ctx->suffix_free(b, &ctx->ex_buf, &ctx->ex_len, &ctx->ex_arg); in asn1_bio_free()
148 BIO_set_data(b, NULL); in asn1_bio_free()
149 BIO_set_init(b, 0); in asn1_bio_free()
154 static int asn1_bio_write(BIO *b, const char *in, int inl) in asn1_bio_write() argument
161 ctx = BIO_get_data(b); in asn1_bio_write()
162 next = BIO_next(b); in asn1_bio_write()
173 if (!asn1_bio_setup_ex(b, ctx, ctx->prefix, in asn1_bio_write()
181 ret = asn1_bio_flush_ex(b, ctx, ctx->prefix_free, in asn1_bio_write()
239 BIO_clear_retry_flags(b); in asn1_bio_write()
247 BIO_clear_retry_flags(b); in asn1_bio_write()
248 BIO_copy_next_retry(b); in asn1_bio_write()
254 static int asn1_bio_flush_ex(BIO *b, BIO_ASN1_BUF_CTX *ctx, in asn1_bio_flush_ex() argument
262 ret = BIO_write(BIO_next(b), ctx->ex_buf + ctx->ex_pos, ctx->ex_len); in asn1_bio_flush_ex()
270 cleanup(b, &ctx->ex_buf, &ctx->ex_len, &ctx->ex_arg); in asn1_bio_flush_ex()
279 static int asn1_bio_setup_ex(BIO *b, BIO_ASN1_BUF_CTX *ctx, in asn1_bio_setup_ex() argument
284 if (setup && !setup(b, &ctx->ex_buf, &ctx->ex_len, &ctx->ex_arg)) { in asn1_bio_setup_ex()
285 BIO_clear_retry_flags(b); in asn1_bio_setup_ex()
295 static int asn1_bio_read(BIO *b, char *in, int inl) in asn1_bio_read() argument
297 BIO *next = BIO_next(b); in asn1_bio_read()
303 static int asn1_bio_puts(BIO *b, const char *str) in asn1_bio_puts() argument
305 return asn1_bio_write(b, str, strlen(str)); in asn1_bio_puts()
308 static int asn1_bio_gets(BIO *b, char *str, int size) in asn1_bio_gets() argument
310 BIO *next = BIO_next(b); in asn1_bio_gets()
316 static long asn1_bio_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp) in asn1_bio_callback_ctrl() argument
318 BIO *next = BIO_next(b); in asn1_bio_callback_ctrl()
324 static long asn1_bio_ctrl(BIO *b, int cmd, long arg1, void *arg2) in asn1_bio_ctrl() argument
331 ctx = BIO_get_data(b); in asn1_bio_ctrl()
334 next = BIO_next(b); in asn1_bio_ctrl()
375 if (!asn1_bio_setup_ex(b, ctx, ctx->suffix, in asn1_bio_ctrl()
381 ret = asn1_bio_flush_ex(b, ctx, ctx->suffix_free, in asn1_bio_ctrl()
390 BIO_clear_retry_flags(b); in asn1_bio_ctrl()
404 static int asn1_bio_set_ex(BIO *b, int cmd, in asn1_bio_set_ex() argument
410 return BIO_ctrl(b, cmd, 0, &extmp); in asn1_bio_set_ex()
413 static int asn1_bio_get_ex(BIO *b, int cmd, in asn1_bio_get_ex() argument
419 ret = BIO_ctrl(b, cmd, 0, &extmp); in asn1_bio_get_ex()
427 int BIO_asn1_set_prefix(BIO *b, asn1_ps_func *prefix, in BIO_asn1_set_prefix() argument
430 return asn1_bio_set_ex(b, BIO_C_SET_PREFIX, prefix, prefix_free); in BIO_asn1_set_prefix()
433 int BIO_asn1_get_prefix(BIO *b, asn1_ps_func **pprefix, in BIO_asn1_get_prefix() argument
436 return asn1_bio_get_ex(b, BIO_C_GET_PREFIX, pprefix, pprefix_free); in BIO_asn1_get_prefix()
439 int BIO_asn1_set_suffix(BIO *b, asn1_ps_func *suffix, in BIO_asn1_set_suffix() argument
442 return asn1_bio_set_ex(b, BIO_C_SET_SUFFIX, suffix, suffix_free); in BIO_asn1_set_suffix()
445 int BIO_asn1_get_suffix(BIO *b, asn1_ps_func **psuffix, in BIO_asn1_get_suffix() argument
448 return asn1_bio_get_ex(b, BIO_C_GET_SUFFIX, psuffix, psuffix_free); in BIO_asn1_get_suffix()