diff options
author | 2015-03-06 17:40:46 -0800 | |
---|---|---|
committer | 2015-03-06 17:40:46 -0800 | |
commit | 3631e82c890de1ff0382ab3062b2d05193604046 (patch) | |
tree | 9f999024080fb56afb24684c24adb2235ed1dfcc /src/core/security/factories.c | |
parent | 3aca2a624523e8bb27891d759b6fbbe71277be3d (diff) | |
parent | ede76da1b5cb17f0a9d62c4b93c023c2fbaccc1a (diff) |
Merge pull request #835 from ctiller/credit
C++ Credentials Rework
Diffstat (limited to 'src/core/security/factories.c')
-rw-r--r-- | src/core/security/factories.c | 30 |
1 files changed, 1 insertions, 29 deletions
diff --git a/src/core/security/factories.c b/src/core/security/factories.c index c9701b9080..02267d5545 100644 --- a/src/core/security/factories.c +++ b/src/core/security/factories.c @@ -33,9 +33,9 @@ #include <string.h> +#include <grpc/grpc.h> #include "src/core/security/credentials.h" #include "src/core/security/security_context.h" -#include "src/core/surface/lame_client.h" #include <grpc/support/alloc.h> #include <grpc/support/log.h> #include <grpc/support/useful.h> @@ -50,31 +50,3 @@ grpc_channel *grpc_secure_channel_create(grpc_credentials *creds, return grpc_secure_channel_create_with_factories( factories, GPR_ARRAY_SIZE(factories), creds, target, args); } - -grpc_server *grpc_secure_server_create(grpc_server_credentials *creds, - grpc_completion_queue *cq, - const grpc_channel_args *args) { - grpc_security_status status = GRPC_SECURITY_ERROR; - grpc_security_context *ctx = NULL; - grpc_server *server = NULL; - if (creds == NULL) return NULL; /* TODO(ctiller): Return lame server. */ - - if (!strcmp(creds->type, GRPC_CREDENTIALS_TYPE_SSL)) { - status = grpc_ssl_server_security_context_create( - grpc_ssl_server_credentials_get_config(creds), &ctx); - } else if (!strcmp(creds->type, - GRPC_CREDENTIALS_TYPE_FAKE_TRANSPORT_SECURITY)) { - ctx = grpc_fake_server_security_context_create(); - status = GRPC_SECURITY_OK; - } - - if (status != GRPC_SECURITY_OK) { - gpr_log(GPR_ERROR, - "Unable to create secure server with credentials of type %s.", - creds->type); - return NULL; /* TODO(ctiller): Return lame server. */ - } - server = grpc_secure_server_create_internal(cq, args, ctx); - grpc_security_context_unref(ctx); - return server; -} |