tls_credentials_release(tls->server_credentials);
}
wire_buf_deinit(&tls->unwrap_buf);
- queue_deinit(tls->unwrap_queue); /* TODO: break contexts? */
+
+ while (queue_len(tls->unwrap_queue) > 0) {
+ struct protolayer_iter_ctx *ctx = queue_head(tls->unwrap_queue);
+ protolayer_break(ctx, kr_error(EIO));
+ queue_pop(tls->unwrap_queue);
+ }
+ queue_deinit(tls->unwrap_queue);
+
+ while (queue_len(tls->wrap_queue)) {
+ struct protolayer_iter_ctx *ctx = queue_head(tls->wrap_queue);
+ protolayer_break(ctx, kr_error(EIO));
+ queue_pop(tls->wrap_queue);
+ }
+ queue_deinit(tls->wrap_queue);
+
return kr_ok();
}