miniupnpd/upnpsoap.c: DeviceProtection has to check peer certificate

This commit is contained in:
Thomas Bernard 2014-04-15 15:40:03 +02:00
parent 974692e7ac
commit 1b8ed0b59d
1 changed files with 10 additions and 7 deletions

View File

@ -1905,15 +1905,18 @@ GetAssignedRoles(struct upnphttp * h, const char * action)
"</u:%sResponse>"; "</u:%sResponse>";
char body[1024]; char body[1024];
int bodylen; int bodylen;
const char * RoleList; /* list of roles separated by spaces */ const char * RoleList = "Public"; /* list of roles separated by spaces */
#ifdef ENABLE_HTTPS #ifdef ENABLE_HTTPS
if(h->ssl != NULL) if(h->ssl != NULL) {
RoleList = "Admin Basic"; /* we should get the Roles of the session (based on client certificate) */
else X509 * peercert;
RoleList = "Public"; peercert = SSL_get_peer_certificate(h->ssl);
#else if(peercert != NULL) {
RoleList = "Public"; RoleList = "Admin Basic";
X509_free(peercert);
}
}
#endif #endif
bodylen = snprintf(body, sizeof(body), resp, bodylen = snprintf(body, sizeof(body), resp,