aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/https/x509/dn.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/daemon/https/x509/dn.c')
-rw-r--r--src/daemon/https/x509/dn.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/daemon/https/x509/dn.c b/src/daemon/https/x509/dn.c
index 784ac4a7..27c53084 100644
--- a/src/daemon/https/x509/dn.c
+++ b/src/daemon/https/x509/dn.c
@@ -37,7 +37,7 @@
37 */ 37 */
38 38
39/* Converts the given OID to an ldap acceptable string or 39/* Converts the given OID to an ldap acceptable string or
40 * a dotted OID. 40 * a dotted OID.
41 */ 41 */
42static const char * 42static const char *
43oid2ldap_string (const char *oid) 43oid2ldap_string (const char *oid)
@@ -173,7 +173,7 @@ _gnutls_x509_parse_dn (ASN1_TYPE asn1_struct,
173 goto cleanup; 173 goto cleanup;
174 } 174 }
175 175
176 /* Read the OID 176 /* Read the OID
177 */ 177 */
178 mhd_gtls_str_cpy (tmpbuffer3, sizeof (tmpbuffer3), tmpbuffer2); 178 mhd_gtls_str_cpy (tmpbuffer3, sizeof (tmpbuffer3), tmpbuffer2);
179 mhd_gtls_str_cat (tmpbuffer3, sizeof (tmpbuffer3), ".type"); 179 mhd_gtls_str_cat (tmpbuffer3, sizeof (tmpbuffer3), ".type");
@@ -190,7 +190,7 @@ _gnutls_x509_parse_dn (ASN1_TYPE asn1_struct,
190 goto cleanup; 190 goto cleanup;
191 } 191 }
192 192
193 /* Read the Value 193 /* Read the Value
194 */ 194 */
195 mhd_gtls_str_cpy (tmpbuffer3, sizeof (tmpbuffer3), tmpbuffer2); 195 mhd_gtls_str_cpy (tmpbuffer3, sizeof (tmpbuffer3), tmpbuffer2);
196 mhd_gtls_str_cat (tmpbuffer3, sizeof (tmpbuffer3), ".value"); 196 mhd_gtls_str_cat (tmpbuffer3, sizeof (tmpbuffer3), ".value");
@@ -280,7 +280,8 @@ _gnutls_x509_parse_dn (ASN1_TYPE asn1_struct,
280 gnutls_assert (); 280 gnutls_assert ();
281 _gnutls_x509_log 281 _gnutls_x509_log
282 ("Found OID: '%s' with value '%s'\n", 282 ("Found OID: '%s' with value '%s'\n",
283 oid, mhd_gtls_bin2hex (value2, len, escaped, sizeof_escaped)); 283 oid, mhd_gtls_bin2hex (value2, len, escaped,
284 sizeof_escaped));
284 goto cleanup; 285 goto cleanup;
285 } 286 }
286 STR_APPEND (str_escape (string, escaped, sizeof_escaped)); 287 STR_APPEND (str_escape (string, escaped, sizeof_escaped));
@@ -416,7 +417,7 @@ _gnutls_x509_parse_dn_oid (ASN1_TYPE asn1_struct,
416 goto cleanup; 417 goto cleanup;
417 } 418 }
418 419
419 /* Read the OID 420 /* Read the OID
420 */ 421 */
421 mhd_gtls_str_cpy (tmpbuffer3, sizeof (tmpbuffer3), tmpbuffer2); 422 mhd_gtls_str_cpy (tmpbuffer3, sizeof (tmpbuffer3), tmpbuffer2);
422 mhd_gtls_str_cat (tmpbuffer3, sizeof (tmpbuffer3), ".type"); 423 mhd_gtls_str_cat (tmpbuffer3, sizeof (tmpbuffer3), ".type");
@@ -436,7 +437,7 @@ _gnutls_x509_parse_dn_oid (ASN1_TYPE asn1_struct,
436 if (strcmp (oid, given_oid) == 0 && indx == i++) 437 if (strcmp (oid, given_oid) == 0 && indx == i++)
437 { /* Found the OID */ 438 { /* Found the OID */
438 439
439 /* Read the Value 440 /* Read the Value
440 */ 441 */
441 mhd_gtls_str_cpy (tmpbuffer3, sizeof (tmpbuffer3), tmpbuffer2); 442 mhd_gtls_str_cpy (tmpbuffer3, sizeof (tmpbuffer3), tmpbuffer2);
442 mhd_gtls_str_cat (tmpbuffer3, sizeof (tmpbuffer3), ".value"); 443 mhd_gtls_str_cat (tmpbuffer3, sizeof (tmpbuffer3), ".value");
@@ -585,7 +586,7 @@ _gnutls_x509_get_dn_oid (ASN1_TYPE asn1_struct,
585 goto cleanup; 586 goto cleanup;
586 } 587 }
587 588
588 /* Read the OID 589 /* Read the OID
589 */ 590 */
590 mhd_gtls_str_cpy (tmpbuffer3, sizeof (tmpbuffer3), tmpbuffer2); 591 mhd_gtls_str_cpy (tmpbuffer3, sizeof (tmpbuffer3), tmpbuffer2);
591 mhd_gtls_str_cat (tmpbuffer3, sizeof (tmpbuffer3), ".type"); 592 mhd_gtls_str_cat (tmpbuffer3, sizeof (tmpbuffer3), ".type");
@@ -722,7 +723,7 @@ _gnutls_x509_encode_and_write_attribute (const char *given_oid,
722 723
723 if (multi != 0) 724 if (multi != 0)
724 { /* if not writing an AttributeTypeAndValue, but an Attribute */ 725 { /* if not writing an AttributeTypeAndValue, but an Attribute */
725 mhd_gtls_str_cat (tmp, sizeof (tmp), "s"); /* values */ 726 mhd_gtls_str_cat (tmp, sizeof (tmp), "s"); /* values */
726 727
727 result = asn1_write_value (asn1_struct, tmp, "NEW", 1); 728 result = asn1_write_value (asn1_struct, tmp, "NEW", 1);
728 if (result != ASN1_SUCCESS) 729 if (result != ASN1_SUCCESS)
@@ -777,7 +778,7 @@ _gnutls_x509_write_attribute (const char *given_oid,
777 778
778 if (multi != 0) 779 if (multi != 0)
779 { /* if not writing an AttributeTypeAndValue, but an Attribute */ 780 { /* if not writing an AttributeTypeAndValue, but an Attribute */
780 mhd_gtls_str_cat (tmp, sizeof (tmp), "s"); /* values */ 781 mhd_gtls_str_cat (tmp, sizeof (tmp), "s"); /* values */
781 782
782 result = asn1_write_value (asn1_struct, tmp, "NEW", 1); 783 result = asn1_write_value (asn1_struct, tmp, "NEW", 1);
783 if (result != ASN1_SUCCESS) 784 if (result != ASN1_SUCCESS)
@@ -830,7 +831,7 @@ _gnutls_x509_decode_and_read_attribute (ASN1_TYPE asn1_struct,
830 char tmpbuffer[128]; 831 char tmpbuffer[128];
831 int len, result; 832 int len, result;
832 833
833 /* Read the OID 834 /* Read the OID
834 */ 835 */
835 mhd_gtls_str_cpy (tmpbuffer, sizeof (tmpbuffer), where); 836 mhd_gtls_str_cpy (tmpbuffer, sizeof (tmpbuffer), where);
836 mhd_gtls_str_cat (tmpbuffer, sizeof (tmpbuffer), ".type"); 837 mhd_gtls_str_cat (tmpbuffer, sizeof (tmpbuffer), ".type");
@@ -845,14 +846,14 @@ _gnutls_x509_decode_and_read_attribute (ASN1_TYPE asn1_struct,
845 return result; 846 return result;
846 } 847 }
847 848
848 /* Read the Value 849 /* Read the Value
849 */ 850 */
850 851
851 mhd_gtls_str_cpy (tmpbuffer, sizeof (tmpbuffer), where); 852 mhd_gtls_str_cpy (tmpbuffer, sizeof (tmpbuffer), where);
852 mhd_gtls_str_cat (tmpbuffer, sizeof (tmpbuffer), ".value"); 853 mhd_gtls_str_cat (tmpbuffer, sizeof (tmpbuffer), ".value");
853 854
854 if (multi) 855 if (multi)
855 mhd_gtls_str_cat (tmpbuffer, sizeof (tmpbuffer), "s.?1"); /* .values.?1 */ 856 mhd_gtls_str_cat (tmpbuffer, sizeof (tmpbuffer), "s.?1"); /* .values.?1 */
856 857
857 result = 858 result =
858 _gnutls_x509_read_value (asn1_struct, tmpbuffer, value, octet_string); 859 _gnutls_x509_read_value (asn1_struct, tmpbuffer, value, octet_string);
@@ -899,7 +900,7 @@ _gnutls_x509_set_dn_oid (ASN1_TYPE asn1_struct,
899 mhd_gtls_str_cpy (asn1_rdn_name, sizeof (asn1_rdn_name), asn1_name); 900 mhd_gtls_str_cpy (asn1_rdn_name, sizeof (asn1_rdn_name), asn1_name);
900 mhd_gtls_str_cat (asn1_rdn_name, sizeof (asn1_rdn_name), ".rdnSequence"); 901 mhd_gtls_str_cat (asn1_rdn_name, sizeof (asn1_rdn_name), ".rdnSequence");
901 902
902 /* create a new element 903 /* create a new element
903 */ 904 */
904 result = asn1_write_value (asn1_struct, asn1_rdn_name, "NEW", 1); 905 result = asn1_write_value (asn1_struct, asn1_rdn_name, "NEW", 1);
905 if (result != ASN1_SUCCESS) 906 if (result != ASN1_SUCCESS)