From 7548c995728229719fc0965494f4b9ffec1f7410 Mon Sep 17 00:00:00 2001 From: Ernesto Ocampo Date: Tue, 14 Jan 2025 14:05:57 +0000 Subject: [PATCH] CC enclave app example: check that handshake is successful. Change-Id: I49e0bd8affcd66a9b1959f46bb6406968593597b --- cc/containers/hello_world_enclave_app/app_service.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cc/containers/hello_world_enclave_app/app_service.cc b/cc/containers/hello_world_enclave_app/app_service.cc index cffadc69f2..472067820e 100644 --- a/cc/containers/hello_world_enclave_app/app_service.cc +++ b/cc/containers/hello_world_enclave_app/app_service.cc @@ -63,8 +63,14 @@ grpc::Status EnclaveApplicationImpl::LegacySession( grpc::Status EnclaveApplicationImpl::OakSession( grpc::ServerContext* context, grpc::ServerReaderWriter* stream) { + // Set up channel and do handshake. auto channel = session_server_.NewChannel( std::make_unique(stream)); + if (!channel.ok()) { + return FromAbsl(channel.status()); + } + + // Handshake done, process requests until closed. while (true) { absl::StatusOr request = (*channel)->Receive(); if (!request.ok()) {