Skip to contentSkip to conversation

tls: fixed intentation in X509 definitions

PATCH In review James Prestwood 2 participants 4 messages Nov 17, 2018 – Nov 19, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tls: fixed intentation in X509 definitions

Someones editor must have been misbehaving

---
 ell/tls.c | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)
ell/tls.c +17 -17
index 9dc97ff..2d2dd4b 100644
@@ -2549,23 +2549,23 @@ const char *tls_handshake_state_to_str(enum tls_handshake_state state)
 /* X509 Certificates and Certificate Chains */
 
 #define X509_CERTIFICATE_POS			0
-#define   X509_TBSCERTIFICATE_POS		  0
-#define     X509_TBSCERT_VERSION_POS		    0
-#define     X509_TBSCERT_SERIAL_POS		    1
-#define     X509_TBSCERT_SIGNATURE_POS		    2
-#define       X509_ALGORITHM_ID_ALGORITHM_POS	      0
-#define       X509_ALGORITHM_ID_PARAMS_POS	      1
-#define     X509_TBSCERT_ISSUER_DN_POS		    3
-#define     X509_TBSCERT_VALIDITY_POS		    4
-#define     X509_TBSCERT_SUBJECT_DN_POS		    5
-#define     X509_TBSCERT_SUBJECT_KEY_POS	    6
-#define       X509_SUBJECT_KEY_ALGORITHM_POS	      0
-#define       X509_SUBJECT_KEY_VALUE_POS	      1
-#define     X509_TBSCERT_ISSUER_UID_POS		    7
-#define     X509_TBSCERT_SUBJECT_UID_POS	    8
-#define     X509_TBSCERT_EXTENSIONS_POS		    9
-#define   X509_SIGNATURE_ALGORITHM_POS		  1
-#define   X509_SIGNATURE_VALUE_POS		  2
+#define X509_TBSCERTIFICATE_POS			0
+#define X509_TBSCERT_VERSION_POS		0
+#define X509_TBSCERT_SERIAL_POS			1
+#define X509_TBSCERT_SIGNATURE_POS		2
+#define X509_ALGORITHM_ID_ALGORITHM_POS		0
+#define X509_ALGORITHM_ID_PARAMS_POS		1
+#define X509_TBSCERT_ISSUER_DN_POS		3
+#define X509_TBSCERT_VALIDITY_POS		4
+#define X509_TBSCERT_SUBJECT_DN_POS		5
+#define X509_TBSCERT_SUBJECT_KEY_POS		6
+#define X509_SUBJECT_KEY_ALGORITHM_POS		0
+#define X509_SUBJECT_KEY_VALUE_POS		1
+#define X509_TBSCERT_ISSUER_UID_POS		7
+#define X509_TBSCERT_SUBJECT_UID_POS		8
+#define X509_TBSCERT_EXTENSIONS_POS		9
+#define X509_SIGNATURE_ALGORITHM_POS		1
+#define X509_SIGNATURE_VALUE_POS		2
 
 struct tls_cert *tls_cert_load_file(const char *filename)
 {
Signature · 1 line
2.17.1
#1 lore raw

Hi James -

Quoted 1 line · James Prestwood

Someones editor must have been misbehaving

Looks like the existing indentation is intended to reflect the nexted structure of the certificates. For example, look at the sequence of numbers in each column.

Mat

Quoted 57 lines

---
ell/tls.c | 34 +++++++++++++++++-----------------

1 file changed, 17 insertions(+), 17 deletions(-)
ell/tls.c +17 -17
index 9dc97ff..2d2dd4b 100644
@@ -2549,23 +2549,23 @@ const char *tls_handshake_state_to_str(enum tls_handshake_state state)
 /* X509 Certificates and Certificate Chains */
 
 #define X509_CERTIFICATE_POS			0
-#define   X509_TBSCERTIFICATE_POS		  0
-#define     X509_TBSCERT_VERSION_POS		    0
-#define     X509_TBSCERT_SERIAL_POS		    1
-#define     X509_TBSCERT_SIGNATURE_POS		    2
-#define       X509_ALGORITHM_ID_ALGORITHM_POS	      0
-#define       X509_ALGORITHM_ID_PARAMS_POS	      1
-#define     X509_TBSCERT_ISSUER_DN_POS		    3
-#define     X509_TBSCERT_VALIDITY_POS		    4
-#define     X509_TBSCERT_SUBJECT_DN_POS		    5
-#define     X509_TBSCERT_SUBJECT_KEY_POS	    6
-#define       X509_SUBJECT_KEY_ALGORITHM_POS	      0
-#define       X509_SUBJECT_KEY_VALUE_POS	      1
-#define     X509_TBSCERT_ISSUER_UID_POS		    7
-#define     X509_TBSCERT_SUBJECT_UID_POS	    8
-#define     X509_TBSCERT_EXTENSIONS_POS		    9
-#define   X509_SIGNATURE_ALGORITHM_POS		  1
-#define   X509_SIGNATURE_VALUE_POS		  2
+#define X509_TBSCERTIFICATE_POS			0
+#define X509_TBSCERT_VERSION_POS		0
+#define X509_TBSCERT_SERIAL_POS			1
+#define X509_TBSCERT_SIGNATURE_POS		2
+#define X509_ALGORITHM_ID_ALGORITHM_POS		0
+#define X509_ALGORITHM_ID_PARAMS_POS		1
+#define X509_TBSCERT_ISSUER_DN_POS		3
+#define X509_TBSCERT_VALIDITY_POS		4
+#define X509_TBSCERT_SUBJECT_DN_POS		5
+#define X509_TBSCERT_SUBJECT_KEY_POS		6
+#define X509_SUBJECT_KEY_ALGORITHM_POS		0
+#define X509_SUBJECT_KEY_VALUE_POS		1
+#define X509_TBSCERT_ISSUER_UID_POS		7
+#define X509_TBSCERT_SUBJECT_UID_POS		8
+#define X509_TBSCERT_EXTENSIONS_POS		9
+#define X509_SIGNATURE_ALGORITHM_POS		1
+#define X509_SIGNATURE_VALUE_POS		2
 
 struct tls_cert *tls_cert_load_file(const char *filename)
 {
Signature · 6 lines
2.17.1

_______________________________________________
ell mailing list
ell(a)lists.01.org
https://lists.01.org/mailman/listinfo/ell

--
Mat Martineau
Intel OTC

#2 lore raw
Quoted 8 lines · Mat Martineau

Hi James -

Quoted 1 line · James Prestwood

Someones editor must have been misbehaving

Looks like the existing indentation is intended to reflect the nested

(fixed typo) ^

Quoted 3 lines

structure of the certificates. For example, look at the sequence of numbers in each column.

Mat

Quoted 54 lines
Quoted 54 lines

---
ell/tls.c | 34 +++++++++++++++++-----------------

1 file changed, 17 insertions(+), 17 deletions(-)
ell/tls.c +17 -17
index 9dc97ff..2d2dd4b 100644
@@ -2549,23 +2549,23 @@ const char *tls_handshake_state_to_str(enum 
 tls_handshake_state state)
 /* X509 Certificates and Certificate Chains */
 
 #define X509_CERTIFICATE_POS			0
-#define   X509_TBSCERTIFICATE_POS		  0
-#define     X509_TBSCERT_VERSION_POS		    0
-#define     X509_TBSCERT_SERIAL_POS		    1
-#define     X509_TBSCERT_SIGNATURE_POS		    2
-#define       X509_ALGORITHM_ID_ALGORITHM_POS	      0
-#define       X509_ALGORITHM_ID_PARAMS_POS	      1
-#define     X509_TBSCERT_ISSUER_DN_POS		    3
-#define     X509_TBSCERT_VALIDITY_POS		    4
-#define     X509_TBSCERT_SUBJECT_DN_POS		    5
-#define     X509_TBSCERT_SUBJECT_KEY_POS	    6
-#define       X509_SUBJECT_KEY_ALGORITHM_POS	      0
-#define       X509_SUBJECT_KEY_VALUE_POS	      1
-#define     X509_TBSCERT_ISSUER_UID_POS		    7
-#define     X509_TBSCERT_SUBJECT_UID_POS	    8
-#define     X509_TBSCERT_EXTENSIONS_POS		    9
-#define   X509_SIGNATURE_ALGORITHM_POS		  1
-#define   X509_SIGNATURE_VALUE_POS		  2
+#define X509_TBSCERTIFICATE_POS			0
+#define X509_TBSCERT_VERSION_POS		0
+#define X509_TBSCERT_SERIAL_POS			1
+#define X509_TBSCERT_SIGNATURE_POS		2
+#define X509_ALGORITHM_ID_ALGORITHM_POS		0
+#define X509_ALGORITHM_ID_PARAMS_POS		1
+#define X509_TBSCERT_ISSUER_DN_POS		3
+#define X509_TBSCERT_VALIDITY_POS		4
+#define X509_TBSCERT_SUBJECT_DN_POS		5
+#define X509_TBSCERT_SUBJECT_KEY_POS		6
+#define X509_SUBJECT_KEY_ALGORITHM_POS		0
+#define X509_SUBJECT_KEY_VALUE_POS		1
+#define X509_TBSCERT_ISSUER_UID_POS		7
+#define X509_TBSCERT_SUBJECT_UID_POS		8
+#define X509_TBSCERT_EXTENSIONS_POS		9
+#define X509_SIGNATURE_ALGORITHM_POS		1
+#define X509_SIGNATURE_VALUE_POS		2
 
 struct tls_cert *tls_cert_load_file(const char *filename)

{

Signature · 1 line
2.17.1
Quoted 14 lines
Quoted 5 lines

_______________________________________________
ell mailing list
ell(a)lists.01.org
https://lists.01.org/mailman/listinfo/ell

--
Mat Martineau
Intel OTC
_______________________________________________
ell mailing list
ell(a)lists.01.org
https://lists.01.org/mailman/listinfo/ell

--
Mat Martineau
Intel OTC

#3 lore raw
In reply to Mat Martineau
Quoted 10 lines · Mat Martineau

Hi James -

Quoted 1 line · James Prestwood

Someones editor must have been misbehaving

Looks like the existing indentation is intended to reflect the nexted
structure of the certificates. For example, look at the sequence of numbers in each column.

Ah ok that makes sense. You can disregard this then, it just looked very strange at first paging through the code :)

Thanks,
James

Quoted 65 lines

Mat

Quoted 49 lines

---
ell/tls.c | 34 +++++++++++++++++-----------------

1 file changed, 17 insertions(+), 17 deletions(-)
ell/tls.c +17 -17
index 9dc97ff..2d2dd4b 100644
@@ -2549,23 +2549,23 @@ const char *tls_handshake_state_to_str(enum
 tls_handshake_state state)
 /* X509 Certificates and Certificate Chains */
 
 #define X509_CERTIFICATE_POS			0
-#define   X509_TBSCERTIFICATE_POS		  0
-#define     X509_TBSCERT_VERSION_POS		    0
-#define     X509_TBSCERT_SERIAL_POS		    1
-#define     X509_TBSCERT_SIGNATURE_POS		    2
-#define       X509_ALGORITHM_ID_ALGORITHM_POS	      0
-#define       X509_ALGORITHM_ID_PARAMS_POS	      1
-#define     X509_TBSCERT_ISSUER_DN_POS		    3
-#define     X509_TBSCERT_VALIDITY_POS		    4
-#define     X509_TBSCERT_SUBJECT_DN_POS		    5
-#define     X509_TBSCERT_SUBJECT_KEY_POS	    6
-#define       X509_SUBJECT_KEY_ALGORITHM_POS	      0
-#define       X509_SUBJECT_KEY_VALUE_POS	      1
-#define     X509_TBSCERT_ISSUER_UID_POS		    7
-#define     X509_TBSCERT_SUBJECT_UID_POS	    8
-#define     X509_TBSCERT_EXTENSIONS_POS		    9
-#define   X509_SIGNATURE_ALGORITHM_POS		  1
-#define   X509_SIGNATURE_VALUE_POS		  2
+#define X509_TBSCERTIFICATE_POS			0
+#define X509_TBSCERT_VERSION_POS		0
+#define X509_TBSCERT_SERIAL_POS			1
+#define X509_TBSCERT_SIGNATURE_POS		2
+#define X509_ALGORITHM_ID_ALGORITHM_POS		0
+#define X509_ALGORITHM_ID_PARAMS_POS		1
+#define X509_TBSCERT_ISSUER_DN_POS		3
+#define X509_TBSCERT_VALIDITY_POS		4
+#define X509_TBSCERT_SUBJECT_DN_POS		5
+#define X509_TBSCERT_SUBJECT_KEY_POS		6
+#define X509_SUBJECT_KEY_ALGORITHM_POS		0
+#define X509_SUBJECT_KEY_VALUE_POS		1
+#define X509_TBSCERT_ISSUER_UID_POS		7
+#define X509_TBSCERT_SUBJECT_UID_POS		8
+#define X509_TBSCERT_EXTENSIONS_POS		9
+#define X509_SIGNATURE_ALGORITHM_POS		1
+#define X509_SIGNATURE_VALUE_POS		2
 
 struct tls_cert *tls_cert_load_file(const char *filename)
Quoted 9 lines

{

Signature · 6 lines
2.17.1

_______________________________________________
ell mailing list
ell(a)lists.01.org
https://lists.01.org/mailman/listinfo/ell

--
Mat Martineau
Intel OTC