Skip to content

Commit

Permalink
Removing the hardcoded SSL roots.
Browse files Browse the repository at this point in the history
- Makes 2 tests fail:
  - httpcli_test
  - interop_test
  • Loading branch information
jboeuf committed Feb 20, 2015
1 parent b472e23 commit 1bc21a4
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 11,345 deletions.
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2237,7 +2237,6 @@ LIBGRPC_SRC = \
src/core/security/base64.c \
src/core/security/credentials.c \
src/core/security/factories.c \
src/core/security/google_root_certs.c \
src/core/security/json_token.c \
src/core/security/secure_endpoint.c \
src/core/security/secure_transport_setup.c \
Expand Down Expand Up @@ -2377,7 +2376,6 @@ src/core/security/auth.c: $(OPENSSL_DEP)
src/core/security/base64.c: $(OPENSSL_DEP)
src/core/security/credentials.c: $(OPENSSL_DEP)
src/core/security/factories.c: $(OPENSSL_DEP)
src/core/security/google_root_certs.c: $(OPENSSL_DEP)
src/core/security/json_token.c: $(OPENSSL_DEP)
src/core/security/secure_endpoint.c: $(OPENSSL_DEP)
src/core/security/secure_transport_setup.c: $(OPENSSL_DEP)
Expand Down Expand Up @@ -2534,7 +2532,6 @@ $(OBJDIR)/$(CONFIG)/src/core/security/auth.o:
$(OBJDIR)/$(CONFIG)/src/core/security/base64.o:
$(OBJDIR)/$(CONFIG)/src/core/security/credentials.o:
$(OBJDIR)/$(CONFIG)/src/core/security/factories.o:
$(OBJDIR)/$(CONFIG)/src/core/security/google_root_certs.o:
$(OBJDIR)/$(CONFIG)/src/core/security/json_token.o:
$(OBJDIR)/$(CONFIG)/src/core/security/secure_endpoint.o:
$(OBJDIR)/$(CONFIG)/src/core/security/secure_transport_setup.o:
Expand Down
2 changes: 0 additions & 2 deletions build.json
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,6 @@
"src/core/security/auth.h",
"src/core/security/base64.h",
"src/core/security/credentials.h",
"src/core/security/google_root_certs.h",
"src/core/security/json_token.h",
"src/core/security/secure_transport_setup.h",
"src/core/security/security_context.h",
Expand All @@ -321,7 +320,6 @@
"src/core/security/base64.c",
"src/core/security/credentials.c",
"src/core/security/factories.c",
"src/core/security/google_root_certs.c",
"src/core/security/json_token.c",
"src/core/security/secure_endpoint.c",
"src/core/security/secure_transport_setup.c",
Expand Down
12 changes: 9 additions & 3 deletions src/core/httpcli/httpcli.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
#include "src/core/httpcli/httpcli_security_context.h"
#include "src/core/httpcli/parser.h"
#include "src/core/security/security_context.h"
#include "src/core/security/google_root_certs.h"
#include "src/core/security/secure_transport_setup.h"
#include "src/core/support/string.h"
#include <grpc/support/alloc.h>
Expand Down Expand Up @@ -182,9 +181,16 @@ static void on_connected(void *arg, grpc_endpoint *tcp) {
req->ep = tcp;
if (req->use_ssl) {
grpc_channel_security_context *ctx = NULL;
const unsigned char *pem_root_certs = NULL;
size_t pem_root_certs_size = grpc_get_default_ssl_roots(&pem_root_certs);
if (pem_root_certs == NULL || pem_root_certs_size == 0) {
gpr_log(GPR_ERROR, "Could not get default pem root certs.");
finish(req, 0);
return;
}
GPR_ASSERT(grpc_httpcli_ssl_channel_security_context_create(
grpc_google_root_certs, grpc_google_root_certs_size,
req->host, &ctx) == GRPC_SECURITY_OK);
pem_root_certs, pem_root_certs_size, req->host, &ctx) ==
GRPC_SECURITY_OK);
grpc_setup_secure_transport(&ctx->base, tcp, on_secure_transport_setup_done,
req);
grpc_security_context_unref(&ctx->base);
Expand Down
11,277 changes: 0 additions & 11,277 deletions src/core/security/google_root_certs.c

This file was deleted.

40 changes: 0 additions & 40 deletions src/core/security/google_root_certs.h

This file was deleted.

4 changes: 2 additions & 2 deletions src/core/security/security_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ static void init_default_pem_root_certs(void) {
}
}

static size_t get_default_pem_roots(const unsigned char **pem_root_certs) {
size_t grpc_get_default_ssl_roots(const unsigned char **pem_root_certs) {
/* TODO([email protected]): Maybe revisit the approach which consists in
loading all the roots once for the lifetime of the process. */
static gpr_once once = GPR_ONCE_INIT;
Expand Down Expand Up @@ -460,7 +460,7 @@ grpc_security_status grpc_ssl_channel_security_context_create(
c->overridden_target_name = gpr_strdup(overridden_target_name);
}
if (config->pem_root_certs == NULL) {
pem_root_certs_size = get_default_pem_roots(&pem_root_certs);
pem_root_certs_size = grpc_get_default_ssl_roots(&pem_root_certs);
if (pem_root_certs == NULL || pem_root_certs_size == 0) {
gpr_log(GPR_ERROR, "Could not get default pem root certs.");
goto error;
Expand Down
2 changes: 2 additions & 0 deletions src/core/security/security_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ grpc_security_status grpc_ssl_server_security_context_create(

/* Secure client channel creation. */

size_t grpc_get_default_ssl_roots(const unsigned char **pem_root_certs);

grpc_channel *grpc_ssl_channel_create(grpc_credentials *ssl_creds,
grpc_credentials *request_metadata_creds,
const char *target,
Expand Down
3 changes: 0 additions & 3 deletions vsprojects/vs2013/grpc.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@
<ClInclude Include="..\..\src\core\security\auth.h" />
<ClInclude Include="..\..\src\core\security\base64.h" />
<ClInclude Include="..\..\src\core\security\credentials.h" />
<ClInclude Include="..\..\src\core\security\google_root_certs.h" />
<ClInclude Include="..\..\src\core\security\json_token.h" />
<ClInclude Include="..\..\src\core\security\secure_transport_setup.h" />
<ClInclude Include="..\..\src\core\security\security_context.h" />
Expand Down Expand Up @@ -195,8 +194,6 @@
</ClCompile>
<ClCompile Include="..\..\src\core\security\factories.c">
</ClCompile>
<ClCompile Include="..\..\src\core\security\google_root_certs.c">
</ClCompile>
<ClCompile Include="..\..\src\core\security\json_token.c">
</ClCompile>
<ClCompile Include="..\..\src\core\security\secure_endpoint.c">
Expand Down
6 changes: 0 additions & 6 deletions vsprojects/vs2013/grpc.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
<ClCompile Include="..\..\src\core\security\factories.c">
<Filter>src\core\security</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\security\google_root_certs.c">
<Filter>src\core\security</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\security\json_token.c">
<Filter>src\core\security</Filter>
</ClCompile>
Expand Down Expand Up @@ -362,9 +359,6 @@
<ClInclude Include="..\..\src\core\security\credentials.h">
<Filter>src\core\security</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\security\google_root_certs.h">
<Filter>src\core\security</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\security\json_token.h">
<Filter>src\core\security</Filter>
</ClInclude>
Expand Down
3 changes: 0 additions & 3 deletions vsprojects/vs2013/grpc_shared.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@
<ClInclude Include="..\..\src\core\security\auth.h" />
<ClInclude Include="..\..\src\core\security\base64.h" />
<ClInclude Include="..\..\src\core\security\credentials.h" />
<ClInclude Include="..\..\src\core\security\google_root_certs.h" />
<ClInclude Include="..\..\src\core\security\json_token.h" />
<ClInclude Include="..\..\src\core\security\secure_transport_setup.h" />
<ClInclude Include="..\..\src\core\security\security_context.h" />
Expand Down Expand Up @@ -199,8 +198,6 @@
</ClCompile>
<ClCompile Include="..\..\src\core\security\factories.c">
</ClCompile>
<ClCompile Include="..\..\src\core\security\google_root_certs.c">
</ClCompile>
<ClCompile Include="..\..\src\core\security\json_token.c">
</ClCompile>
<ClCompile Include="..\..\src\core\security\secure_endpoint.c">
Expand Down
6 changes: 0 additions & 6 deletions vsprojects/vs2013/grpc_shared.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
<ClCompile Include="..\..\src\core\security\factories.c">
<Filter>src\core\security</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\security\google_root_certs.c">
<Filter>src\core\security</Filter>
</ClCompile>
<ClCompile Include="..\..\src\core\security\json_token.c">
<Filter>src\core\security</Filter>
</ClCompile>
Expand Down Expand Up @@ -362,9 +359,6 @@
<ClInclude Include="..\..\src\core\security\credentials.h">
<Filter>src\core\security</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\security\google_root_certs.h">
<Filter>src\core\security</Filter>
</ClInclude>
<ClInclude Include="..\..\src\core\security\json_token.h">
<Filter>src\core\security</Filter>
</ClInclude>
Expand Down

0 comments on commit 1bc21a4

Please sign in to comment.