diff options
Diffstat (limited to 'src/include/microhttpd.h')
-rw-r--r-- | src/include/microhttpd.h | 80 |
1 files changed, 77 insertions, 3 deletions
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h index e97e1abd..f1256149 100644 --- a/src/include/microhttpd.h +++ b/src/include/microhttpd.h | |||
@@ -580,9 +580,14 @@ enum MHD_OPTION | |||
580 | * Desired size of the stack for threads created by MHD. Followed | 580 | * Desired size of the stack for threads created by MHD. Followed |
581 | * by an argument of type 'size_t'. Use 0 for system 'default'. | 581 | * by an argument of type 'size_t'. Use 0 for system 'default'. |
582 | */ | 582 | */ |
583 | MHD_OPTION_THREAD_STACK_SIZE = 19 | 583 | MHD_OPTION_THREAD_STACK_SIZE = 19, |
584 | |||
585 | 584 | ||
585 | /** | ||
586 | * Memory pointer for the certificate (ca.pem) to be used by the | ||
587 | * HTTPS daemon for client authentification. | ||
588 | * This option should be followed by a "const char*" argument. | ||
589 | */ | ||
590 | MHD_OPTION_HTTPS_MEM_TRUST =20 | ||
586 | }; | 591 | }; |
587 | 592 | ||
588 | 593 | ||
@@ -719,7 +724,12 @@ enum MHD_ConnectionInfoType | |||
719 | /** | 724 | /** |
720 | * Get the GNUTLS session handle. | 725 | * Get the GNUTLS session handle. |
721 | */ | 726 | */ |
722 | MHD_CONNECTION_INFO_GNUTLS_SESSION | 727 | MHD_CONNECTION_INFO_GNUTLS_SESSION, |
728 | |||
729 | /** | ||
730 | * Get the GNUTLS client certificate handle. | ||
731 | */ | ||
732 | MHD_CONNECTION_INFO_GNUTLS_CLIENT_CERT | ||
723 | }; | 733 | }; |
724 | 734 | ||
725 | /** | 735 | /** |
@@ -1430,6 +1440,65 @@ MHD_queue_auth_fail_response (struct MHD_Connection *connection, | |||
1430 | int signal_stale); | 1440 | int signal_stale); |
1431 | 1441 | ||
1432 | 1442 | ||
1443 | /** | ||
1444 | * Get the username and password from the basic authorization header sent by the client | ||
1445 | * | ||
1446 | * @param connection The MHD connection structure | ||
1447 | * @param password a pointer for the password | ||
1448 | * @return NULL if no username could be found, a pointer | ||
1449 | * to the username if found | ||
1450 | */ | ||
1451 | char * | ||
1452 | MHD_basic_auth_get_username_password(struct MHD_Connection *connection, | ||
1453 | char** password); | ||
1454 | |||
1455 | /** | ||
1456 | * Queues a response to request basic authentication from the client | ||
1457 | * | ||
1458 | * @param connection The MHD connection structure | ||
1459 | * @param realm the realm presented to the client | ||
1460 | * @return MHD_YES on success, MHD_NO otherwise | ||
1461 | */ | ||
1462 | int | ||
1463 | MHD_queue_basic_auth_fail_response(struct MHD_Connection *connection, | ||
1464 | const char *realm, | ||
1465 | struct MHD_Response *response); | ||
1466 | |||
1467 | /** | ||
1468 | * Get the client's certificate | ||
1469 | * | ||
1470 | * @param connection The MHD connection structure | ||
1471 | * @return NULL if no valid client certificate could be found, a pointer | ||
1472 | * to the certificate if found | ||
1473 | */ | ||
1474 | void* | ||
1475 | MHD_cert_auth_get_certificate(struct MHD_Connection *connection); | ||
1476 | |||
1477 | /** | ||
1478 | * Get the distinguished name from the client's certificate | ||
1479 | * | ||
1480 | * @param connection The MHD connection structure | ||
1481 | * @return NULL if no dn or certificate could be found, a pointer | ||
1482 | * to the dn if found | ||
1483 | */ | ||
1484 | char * | ||
1485 | MHD_cert_auth_get_dn(struct MHD_Connection *connection); | ||
1486 | |||
1487 | /** | ||
1488 | * Get the alternative name of specified type from the client's certificate | ||
1489 | * | ||
1490 | * @param connection The MHD connection structure | ||
1491 | * @param nametype The requested name type | ||
1492 | * @param index The position of the alternative name if multiple names are | ||
1493 | * matching the requested type, 0 for the first matching name | ||
1494 | * @return NULL if no matching alternative name could be found, a pointer | ||
1495 | * to the alternative name if found | ||
1496 | */ | ||
1497 | char * | ||
1498 | MHD_cert_auth_get_alt_name(struct MHD_Connection *connection, | ||
1499 | int nametype, | ||
1500 | unsigned int index); | ||
1501 | |||
1433 | /* ********************** generic query functions ********************** */ | 1502 | /* ********************** generic query functions ********************** */ |
1434 | 1503 | ||
1435 | /** | 1504 | /** |
@@ -1454,6 +1523,11 @@ union MHD_ConnectionInfo | |||
1454 | void * /* gnutls_session_t */ tls_session; | 1523 | void * /* gnutls_session_t */ tls_session; |
1455 | 1524 | ||
1456 | /** | 1525 | /** |
1526 | * GNUtls client certificate handle, of type "gnutls_x509_crt_t". | ||
1527 | */ | ||
1528 | void * /* gnutls_x509_crt_t */ client_cert; | ||
1529 | |||
1530 | /** | ||
1457 | * Address information for the client. | 1531 | * Address information for the client. |
1458 | */ | 1532 | */ |
1459 | struct sockaddr_in * client_addr; | 1533 | struct sockaddr_in * client_addr; |