]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Fix certificate attribute extraction
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 10 Jul 2018 23:29:05 +0000 (19:29 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 10 Jul 2018 23:29:05 +0000 (19:29 -0400)
src/lib/tls/session.c
src/lib/tls/validate.c

index 82bdb57f60bf82a8b7a49fc7d167604557e3854e..210ea5ef1d7f3db3185d801a070956754943c988 100644 (file)
@@ -855,7 +855,7 @@ static inline VALUE_PAIR *tls_session_cert_attr_add(TALLOC_CTX *ctx, REQUEST *re
                }
        }
        RINDENT();
-       RDEBUG2("%pP", vp);
+       RDEBUG3("%pP", vp);
        REXDENT();
        fr_cursor_append(cursor, vp);
 
@@ -904,11 +904,11 @@ int tls_session_pairs_from_x509_cert(fr_cursor_t *cursor, TALLOC_CTX *ctx,
 
        identity = (char **)SSL_get_ex_data(session->ssl, FR_TLS_EX_INDEX_IDENTITY);
 
-       if (RDEBUG_ENABLED2) {
+       if (RDEBUG_ENABLED3) {
                buffer[0] = '\0';
                X509_NAME_oneline(X509_get_subject_name(cert), buffer, sizeof(buffer));
                buffer[sizeof(buffer) - 1] = '\0';
-               RDEBUG2("Creating attributes for \"%s\":", buffer[0] ? buffer : "Cert missing subject OID");
+               RDEBUG3("Creating attributes for \"%s\":", buffer[0] ? buffer : "Cert missing subject OID");
        }
 
        /*
index ff3f0e14c7d54c6c72bcb4b6ce108953b36a1525..278f5d5e878e80f2401643a19aa120a16334ca09 100644 (file)
@@ -146,8 +146,10 @@ int tls_validate_cert_cb(int ok, X509_STORE_CTX *x509_ctx)
                 *      tls_session_pairs_from_x509_cert contains a
                 *      reference to cert_vps.
                 */
-               cert_vps = fr_cursor_current(&cursor);
+               cert_vps = fr_cursor_head(&cursor);
                if (cert_vps) {
+                       RDEBUG2("Adding certificate attributes to session-state");
+
                        /*
                         *      Print out all the pairs we have so far
                         */