diff options
-rw-r--r-- | src/lib/libcrypto/bio/bio_lib.c | 11 | ||||
-rw-r--r-- | src/lib/libcrypto/bio/bio_local.h | 3 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/lib/libcrypto/bio/bio_lib.c b/src/lib/libcrypto/bio/bio_lib.c index b33ebe167b..c09ad8fe8e 100644 --- a/src/lib/libcrypto/bio/bio_lib.c +++ b/src/lib/libcrypto/bio/bio_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bio_lib.c,v 1.38 2022/11/30 01:56:18 jsing Exp $ */ | 1 | /* $OpenBSD: bio_lib.c,v 1.39 2022/12/02 19:44:04 tb Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -161,6 +161,7 @@ BIO_set(BIO *bio, const BIO_METHOD *method) | |||
161 | bio->retry_reason = 0; | 161 | bio->retry_reason = 0; |
162 | bio->num = 0; | 162 | bio->num = 0; |
163 | bio->ptr = NULL; | 163 | bio->ptr = NULL; |
164 | bio->prev_bio = NULL; | ||
164 | bio->next_bio = NULL; | 165 | bio->next_bio = NULL; |
165 | bio->references = 1; | 166 | bio->references = 1; |
166 | bio->num_read = 0L; | 167 | bio->num_read = 0L; |
@@ -636,6 +637,8 @@ BIO_push(BIO *b, BIO *bio) | |||
636 | while (lb->next_bio != NULL) | 637 | while (lb->next_bio != NULL) |
637 | lb = lb->next_bio; | 638 | lb = lb->next_bio; |
638 | lb->next_bio = bio; | 639 | lb->next_bio = bio; |
640 | if (bio != NULL) | ||
641 | bio->prev_bio = lb; | ||
639 | /* called to do internal processing */ | 642 | /* called to do internal processing */ |
640 | BIO_ctrl(b, BIO_CTRL_PUSH, 0, lb); | 643 | BIO_ctrl(b, BIO_CTRL_PUSH, 0, lb); |
641 | return (b); | 644 | return (b); |
@@ -653,7 +656,13 @@ BIO_pop(BIO *b) | |||
653 | 656 | ||
654 | BIO_ctrl(b, BIO_CTRL_POP, 0, b); | 657 | BIO_ctrl(b, BIO_CTRL_POP, 0, b); |
655 | 658 | ||
659 | if (b->prev_bio != NULL) | ||
660 | b->prev_bio->next_bio = b->next_bio; | ||
661 | if (b->next_bio != NULL) | ||
662 | b->next_bio->prev_bio = b->prev_bio; | ||
663 | |||
656 | b->next_bio = NULL; | 664 | b->next_bio = NULL; |
665 | b->prev_bio = NULL; | ||
657 | return (ret); | 666 | return (ret); |
658 | } | 667 | } |
659 | 668 | ||
diff --git a/src/lib/libcrypto/bio/bio_local.h b/src/lib/libcrypto/bio/bio_local.h index 94dd460bc5..4eecf7e04a 100644 --- a/src/lib/libcrypto/bio/bio_local.h +++ b/src/lib/libcrypto/bio/bio_local.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bio_local.h,v 1.4 2022/11/28 07:50:00 tb Exp $ */ | 1 | /* $OpenBSD: bio_local.h,v 1.5 2022/12/02 19:44:04 tb Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -87,6 +87,7 @@ struct bio_st { | |||
87 | int num; | 87 | int num; |
88 | void *ptr; | 88 | void *ptr; |
89 | struct bio_st *next_bio; /* used by filter BIOs */ | 89 | struct bio_st *next_bio; /* used by filter BIOs */ |
90 | struct bio_st *prev_bio; /* used by filter BIOs */ | ||
90 | int references; | 91 | int references; |
91 | unsigned long num_read; | 92 | unsigned long num_read; |
92 | unsigned long num_write; | 93 | unsigned long num_write; |