aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/security/server_auth_filter.c
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-07-31 11:22:35 -0700
committerGravatar Craig Tiller <ctiller@google.com>2015-07-31 11:22:35 -0700
commit45ce927c7cf7abbdb452989d6d58c875a800e4ea (patch)
treebc4091d4fafc5421ac3f2799621b1dda29394ce6 /src/core/security/server_auth_filter.c
parentbe043d9ce7d69eb3787ed232f0bc8a3f99e69807 (diff)
Properly send GRPC_STATUS_UNAUTHENTICATED from server auth failures
Diffstat (limited to 'src/core/security/server_auth_filter.c')
-rw-r--r--src/core/security/server_auth_filter.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/security/server_auth_filter.c b/src/core/security/server_auth_filter.c
index 10dfb09926..fd0f94b19c 100644
--- a/src/core/security/server_auth_filter.c
+++ b/src/core/security/server_auth_filter.c
@@ -110,7 +110,6 @@ static void on_md_processing_done(void *user_data,
grpc_auth_context *result) {
grpc_call_element *elem = user_data;
call_data *calld = elem->call_data;
- channel_data *chand = elem->channel_data;
if (success) {
calld->consumed_md = consumed_md;
@@ -124,10 +123,11 @@ static void on_md_processing_done(void *user_data,
GRPC_AUTH_CONTEXT_REF(result, "refing new context.");
calld->on_done_recv->cb(calld->on_done_recv->cb_arg, success);
} else {
- grpc_transport_stream_op_add_cancellation(
- &calld->transport_op, GRPC_STATUS_UNAUTHENTICATED,
- grpc_mdstr_from_string(chand->mdctx,
- "Authentication metadata processing failed."));
+ gpr_slice message = gpr_slice_from_copied_string(
+ "Authentication metadata processing failed.");
+ grpc_sopb_reset(calld->recv_ops);
+ grpc_transport_stream_op_add_close(&calld->transport_op,
+ GRPC_STATUS_UNAUTHENTICATED, &message);
grpc_call_next_op(elem, &calld->transport_op);
}
}