LDAP v3.
If you'd like to modify the format only you can specify an empty string
and zero for the first two parameters. Example: ssl_c_i_dn(,0,rfc2253)
- If the requested entry's ASN.1 value contains an embedded NUL byte
- followed by other data, it is considered malformed and no data is
- returned.
+ If the requested entry's ASN.1 value (or, when no <entry> is specified,
+ any entry in the DN) contains an embedded NUL byte followed by other
+ data, it is considered malformed and no data is returned.
ssl_c_key_alg : string
Returns the name of the algorithm used to generate the key of the certificate
different protocols. Currently supported is rfc2253 for LDAP v3. If you'd like
to modify the format only you can specify an empty string and zero for the
first two parameters. Example: ssl_c_r_dn(,0,rfc2253)
- If the requested entry's ASN.1 value contains an embedded NUL byte
- followed by other data, it is considered malformed and no data is
- returned.
+ If the requested entry's ASN.1 value (or, when no <entry> is specified,
+ any entry in the DN) contains an embedded NUL byte followed by other
+ data, it is considered malformed and no data is returned.
ssl_c_s_dn([<entry>[,<occ>[,<format>]]]) : string
When the incoming connection was made over an SSL/TLS transport layer,
LDAP v3.
If you'd like to modify the format only you can specify an empty string
and zero for the first two parameters. Example: ssl_c_s_dn(,0,rfc2253)
- If the requested entry's ASN.1 value contains an embedded NUL byte
- followed by other data, it is considered malformed and no data is
- returned.
+ If the requested entry's ASN.1 value (or, when no <entry> is specified,
+ any entry in the DN) contains an embedded NUL byte followed by other
+ data, it is considered malformed and no data is returned.
ssl_c_san : string
When the incoming connection was made over an SSL/TLS transport layer, and was
LDAP v3.
If you'd like to modify the format only you can specify an empty string
and zero for the first two parameters. Example: ssl_f_i_dn(,0,rfc2253)
- If the requested entry's ASN.1 value contains an embedded NUL byte
- followed by other data, it is considered malformed and no data is
- returned.
+ If the requested entry's ASN.1 value (or, when no <entry> is specified,
+ any entry in the DN) contains an embedded NUL byte followed by other
+ data, it is considered malformed and no data is returned.
ssl_f_key_alg : string
Returns the name of the algorithm used to generate the key of the certificate
LDAP v3.
If you'd like to modify the format only you can specify an empty string
and zero for the first two parameters. Example: ssl_f_s_dn(,0,rfc2253)
- If the requested entry's ASN.1 value contains an embedded NUL byte
- followed by other data, it is considered malformed and no data is
- returned.
+ If the requested entry's ASN.1 value (or, when no <entry> is specified,
+ any entry in the DN) contains an embedded NUL byte followed by other
+ data, it is considered malformed and no data is returned.
ssl_f_serial : binary
Returns the serial of the certificate presented by the frontend when the
LDAP v3.
If you'd like to modify the format only you can specify an empty string
and zero for the first two parameters. Example: ssl_s_i_dn(,0,rfc2253)
- If the requested entry's ASN.1 value contains an embedded NUL byte
- followed by other data, it is considered malformed and no data is
- returned.
+ If the requested entry's ASN.1 value (or, when no <entry> is specified,
+ any entry in the DN) contains an embedded NUL byte followed by other
+ data, it is considered malformed and no data is returned.
ssl_s_key_alg : string
Returns the name of the algorithm used to generate the key of the certificate
LDAP v3.
If you'd like to modify the format only you can specify an empty string
and zero for the first two parameters. Example: ssl_s_s_dn(,0,rfc2253)
- If the requested entry's ASN.1 value contains an embedded NUL byte
- followed by other data, it is considered malformed and no data is
- returned.
+ If the requested entry's ASN.1 value (or, when no <entry> is specified,
+ any entry in the DN) contains an embedded NUL byte followed by other
+ data, it is considered malformed and no data is returned.
ssl_s_serial : binary
Returns the serial of the certificate presented by the server when the
__X509_NAME_CONST__ ASN1_OBJECT *obj;
__X509_NAME_CONST__ ASN1_STRING *data;
const unsigned char *data_ptr;
+ const unsigned char *nul;
int data_len;
int i, n, ln;
int l = 0;
data = X509_NAME_ENTRY_get_data(ne);
data_ptr = ASN1_STRING_get0_data(data);
data_len = ASN1_STRING_length(data);
+
+ /* reject the whole DN if this entry carries an embedded NUL
+ * (truncation/injection risk for NUL-terminated consumers);
+ * trailing NUL(s) carry nothing after them so they're harmless
+ * padding, just keep one and skip the extra ones
+ */
+ nul = memchr(data_ptr, 0, data_len);
+ if (nul) {
+ const unsigned char *q;
+
+ for (q = nul; q < data_ptr + data_len; q++) {
+ if (*q)
+ return 0;
+ }
+ data_len = nul - data_ptr + 1;
+ }
+
n = OBJ_obj2nid(obj);
if ((n == NID_undef) || ((s = OBJ_nid2sn(n)) == NULL)) {
i2t_ASN1_OBJECT(tmp, sizeof(tmp), obj);