Browse Source

[crypto] Include "?subject=" in cross-signed certificate URI

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 12 years ago
parent
commit
4855e86d95
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      src/net/validator.c

+ 3
- 3
src/net/validator.c View File

151
 	crosscert = ( crosscert_copy ? crosscert_copy : crosscert_default );
151
 	crosscert = ( crosscert_copy ? crosscert_copy : crosscert_default );
152
 
152
 
153
 	/* Allocate URI string */
153
 	/* Allocate URI string */
154
-	uri_string_len = ( strlen ( crosscert ) + 14 /* "/%08x.der?" */ +
155
-			   base64_encoded_len ( issuer->len ) + 1 /* NUL */ );
154
+	uri_string_len = ( strlen ( crosscert ) + 22 /* "/%08x.der?subject=" */
155
+			   + base64_encoded_len ( issuer->len ) + 1 /* NUL */ );
156
 	uri_string = zalloc ( uri_string_len );
156
 	uri_string = zalloc ( uri_string_len );
157
 	if ( ! uri_string ) {
157
 	if ( ! uri_string ) {
158
 		rc = -ENOMEM;
158
 		rc = -ENOMEM;
163
 	crc = crc32_le ( 0xffffffffUL, issuer->data, issuer->len );
163
 	crc = crc32_le ( 0xffffffffUL, issuer->data, issuer->len );
164
 
164
 
165
 	/* Generate URI string */
165
 	/* Generate URI string */
166
-	len = snprintf ( uri_string, uri_string_len, "%s/%08x.der?",
166
+	len = snprintf ( uri_string, uri_string_len, "%s/%08x.der?subject=",
167
 			 crosscert, crc );
167
 			 crosscert, crc );
168
 	base64_encode ( issuer->data, issuer->len, ( uri_string + len ) );
168
 	base64_encode ( issuer->data, issuer->len, ( uri_string + len ) );
169
 	DBGC ( validator, "VALIDATOR %p downloading cross-signed certificate "
169
 	DBGC ( validator, "VALIDATOR %p downloading cross-signed certificate "

Loading…
Cancel
Save