Browse Source

[crypto] Rename KEY= to PRIVKEY= and "key" to "privkey"

The setting name "key" conflicts with the setting name "key" already
in use by the 802.11 code.  Resolve the conflict by renaming the newer
setting to "privkey".

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 12 years ago
parent
commit
4fa1a2b4fe
2 changed files with 21 additions and 18 deletions
  1. 18
    15
      src/Makefile.housekeeping
  2. 3
    3
      src/crypto/clientcert.c

+ 18
- 15
src/Makefile.housekeeping View File

608
 
608
 
609
 # (Single-element) list of client private keys
609
 # (Single-element) list of client private keys
610
 #
610
 #
611
-KEY_LIST := $(BIN)/.private_key.list
612
-ifeq ($(wildcard $(KEY_LIST)),)
613
-KEY_OLD := <invalid>
611
+ifdef KEY
612
+PRIVKEY	:= $(KEY) # Maintain backwards compatibility
613
+endif
614
+PRIVKEY_LIST := $(BIN)/.private_key.list
615
+ifeq ($(wildcard $(PRIVKEY_LIST)),)
616
+PRIVKEY_OLD := <invalid>
614
 else
617
 else
615
-KEY_OLD := $(shell cat $(KEY_LIST))
618
+PRIVKEY_OLD := $(shell cat $(PRIVKEY_LIST))
616
 endif
619
 endif
617
-ifneq ($(KEY_OLD),$(KEY))
618
-$(shell $(ECHO) "$(KEY)" > $(KEY_LIST))
620
+ifneq ($(PRIVKEY_OLD),$(PRIVKEY))
621
+$(shell $(ECHO) "$(PRIVKEY)" > $(PRIVKEY_LIST))
619
 endif
622
 endif
620
 
623
 
621
-$(KEY_LIST) :
624
+$(PRIVKEY_LIST) :
622
 
625
 
623
-VERYCLEANUP += $(KEY_LIST)
626
+VERYCLEANUP += $(PRIVKEY_LIST)
624
 
627
 
625
 # Embedded client private key
628
 # Embedded client private key
626
 #
629
 #
627
-KEY_INC := $(BIN)/.private_key.der
630
+PRIVKEY_INC := $(BIN)/.private_key.der
628
 
631
 
629
-ifdef KEY
630
-$(KEY_INC) : $(KEY) $(KEY_LIST)
632
+ifdef PRIVKEY
633
+$(PRIVKEY_INC) : $(PRIVKEY) $(PRIVKEY_LIST)
631
 	$(Q)$(OPENSSL) rsa -in $< -outform DER -out $@
634
 	$(Q)$(OPENSSL) rsa -in $< -outform DER -out $@
632
 
635
 
633
-clientcert_DEPS += $(KEY_INC)
636
+clientcert_DEPS += $(PRIVKEY_INC)
634
 endif
637
 endif
635
 
638
 
636
-CLEANUP += $(KEY_INC)
639
+CLEANUP += $(PRIVKEY_INC)
637
 
640
 
638
-clientcert_DEPS += $(KEY_LIST)
641
+clientcert_DEPS += $(PRIVKEY_LIST)
639
 
642
 
640
-CFLAGS_clientcert += $(if $(KEY),-DPRIVATE_KEY="\"$(KEY_INC)\"")
643
+CFLAGS_clientcert += $(if $(PRIVKEY),-DPRIVATE_KEY="\"$(PRIVKEY_INC)\"")
641
 
644
 
642
 # These files use .incbin inline assembly to include a binary file.
645
 # These files use .incbin inline assembly to include a binary file.
643
 # Unfortunately ccache does not detect this dependency and caches
646
 # Unfortunately ccache does not detect this dependency and caches

+ 3
- 3
src/crypto/clientcert.c View File

99
 };
99
 };
100
 
100
 
101
 /** Client private key setting */
101
 /** Client private key setting */
102
-static struct setting key_setting __setting ( SETTING_CRYPTO ) = {
103
-	.name = "key",
102
+static struct setting privkey_setting __setting ( SETTING_CRYPTO ) = {
103
+	.name = "privkey",
104
 	.description = "Client private key",
104
 	.description = "Client private key",
105
 	.tag = DHCP_EB_KEY,
105
 	.tag = DHCP_EB_KEY,
106
 	.type = &setting_type_hex,
106
 	.type = &setting_type_hex,
146
 
146
 
147
 		/* Fetch new client private key, if any */
147
 		/* Fetch new client private key, if any */
148
 		free ( key );
148
 		free ( key );
149
-		len = fetch_setting_copy ( NULL, &key_setting, &key );
149
+		len = fetch_setting_copy ( NULL, &privkey_setting, &key );
150
 		if ( len < 0 ) {
150
 		if ( len < 0 ) {
151
 			rc = len;
151
 			rc = len;
152
 			DBGC ( &client_certificate, "CLIENTCERT cannot fetch "
152
 			DBGC ( &client_certificate, "CLIENTCERT cannot fetch "

Loading…
Cancel
Save