Defining an installation prefix for grpc's root certs at compilation time.

pull/665/head
Nicolas "Pixel" Noble 10 years ago
parent b681d0adba
commit 72743820ab
  1. 2
      Makefile
  2. 7
      src/core/security/security_context.c
  3. 2
      templates/Makefile.template

@ -163,7 +163,7 @@ HOST_LD = $(LD)
HOST_LDXX = $(LDXX) HOST_LDXX = $(LDXX)
CPPFLAGS += $(CPPFLAGS_$(CONFIG)) CPPFLAGS += $(CPPFLAGS_$(CONFIG))
DEFINES += $(DEFINES_$(CONFIG)) DEFINES += $(DEFINES_$(CONFIG)) INSTALL_PREFIX=\"$(prefix)\"
LDFLAGS += $(LDFLAGS_$(CONFIG)) LDFLAGS += $(LDFLAGS_$(CONFIG))
CFLAGS += -std=c89 -pedantic CFLAGS += -std=c89 -pedantic

@ -60,6 +60,12 @@
"AES256-GCM-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:AES128-" \ "AES256-GCM-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:AES128-" \
"SHA256:AES256-SHA256" "SHA256:AES256-SHA256"
#ifndef INSTALL_PREFIX
static const char *installed_roots_path = "/etc/grpc/roots.pem";
#else
static const char *installed_roots_path = INSTALL_PREFIX "/etc/grpc/roots.pem";
#endif
/* -- Common methods. -- */ /* -- Common methods. -- */
grpc_security_status grpc_security_context_create_handshaker( grpc_security_status grpc_security_context_create_handshaker(
@ -404,6 +410,7 @@ static void init_default_pem_root_certs(void) {
default_pem_root_certs = gpr_load_file(default_root_certs_path, NULL); default_pem_root_certs = gpr_load_file(default_root_certs_path, NULL);
gpr_free(default_root_certs_path); gpr_free(default_root_certs_path);
} }
(void) installed_roots_path;
} }
static size_t get_default_pem_roots(const unsigned char **pem_root_certs) { static size_t get_default_pem_roots(const unsigned char **pem_root_certs) {

@ -180,7 +180,7 @@ HOST_LD = $(LD)
HOST_LDXX = $(LDXX) HOST_LDXX = $(LDXX)
CPPFLAGS += $(CPPFLAGS_$(CONFIG)) CPPFLAGS += $(CPPFLAGS_$(CONFIG))
DEFINES += $(DEFINES_$(CONFIG)) DEFINES += $(DEFINES_$(CONFIG)) INSTALL_PREFIX=\"$(prefix)\"
LDFLAGS += $(LDFLAGS_$(CONFIG)) LDFLAGS += $(LDFLAGS_$(CONFIG))
CFLAGS += -std=c89 -pedantic CFLAGS += -std=c89 -pedantic

Loading…
Cancel
Save