diff options
Diffstat (limited to 'src/lib/libcrypto/pkcs7/bio_ber.c')
-rw-r--r-- | src/lib/libcrypto/pkcs7/bio_ber.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/lib/libcrypto/pkcs7/bio_ber.c b/src/lib/libcrypto/pkcs7/bio_ber.c index 2f17723e98..4803966fd2 100644 --- a/src/lib/libcrypto/pkcs7/bio_ber.c +++ b/src/lib/libcrypto/pkcs7/bio_ber.c | |||
@@ -69,6 +69,7 @@ static int ber_read(BIO *h,char *buf,int size); | |||
69 | static long ber_ctrl(BIO *h,int cmd,long arg1,char *arg2); | 69 | static long ber_ctrl(BIO *h,int cmd,long arg1,char *arg2); |
70 | static int ber_new(BIO *h); | 70 | static int ber_new(BIO *h); |
71 | static int ber_free(BIO *data); | 71 | static int ber_free(BIO *data); |
72 | static long ber_callback_ctrl(BIO *h,int cmd,void *(*fp)()); | ||
72 | #define BER_BUF_SIZE (32) | 73 | #define BER_BUF_SIZE (32) |
73 | 74 | ||
74 | /* This is used to hold the state of the BER objects being read. */ | 75 | /* This is used to hold the state of the BER objects being read. */ |
@@ -92,7 +93,7 @@ typedef struct bio_ber_struct | |||
92 | /* most of the following are used when doing non-blocking IO */ | 93 | /* most of the following are used when doing non-blocking IO */ |
93 | /* reading */ | 94 | /* reading */ |
94 | long num_left; /* number of bytes still to read/write in block */ | 95 | long num_left; /* number of bytes still to read/write in block */ |
95 | int depth; /* used with idefinite encoding. */ | 96 | int depth; /* used with indefinite encoding. */ |
96 | int finished; /* No more read data */ | 97 | int finished; /* No more read data */ |
97 | 98 | ||
98 | /* writting */ | 99 | /* writting */ |
@@ -115,6 +116,7 @@ static BIO_METHOD methods_ber= | |||
115 | ber_ctrl, | 116 | ber_ctrl, |
116 | ber_new, | 117 | ber_new, |
117 | ber_free, | 118 | ber_free, |
119 | ber_callback_ctrl, | ||
118 | }; | 120 | }; |
119 | 121 | ||
120 | BIO_METHOD *BIO_f_ber(void) | 122 | BIO_METHOD *BIO_f_ber(void) |
@@ -409,6 +411,20 @@ again: | |||
409 | return(ret); | 411 | return(ret); |
410 | } | 412 | } |
411 | 413 | ||
414 | static long ber_callback_ctrl(BIO *b, int cmd, void *(*fp)()) | ||
415 | { | ||
416 | long ret=1; | ||
417 | |||
418 | if (b->next_bio == NULL) return(0); | ||
419 | switch (cmd) | ||
420 | { | ||
421 | default: | ||
422 | ret=BIO_callback_ctrl(b->next_bio,cmd,fp); | ||
423 | break; | ||
424 | } | ||
425 | return(ret); | ||
426 | } | ||
427 | |||
412 | /* | 428 | /* |
413 | void BIO_set_cipher_ctx(b,c) | 429 | void BIO_set_cipher_ctx(b,c) |
414 | BIO *b; | 430 | BIO *b; |