miniupnpd/upnpsoap.c: DeviceProtection has to check peer certificate
This commit is contained in:
parent
974692e7ac
commit
1b8ed0b59d
|
@ -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) {
|
||||||
|
/* we should get the Roles of the session (based on client certificate) */
|
||||||
|
X509 * peercert;
|
||||||
|
peercert = SSL_get_peer_certificate(h->ssl);
|
||||||
|
if(peercert != NULL) {
|
||||||
RoleList = "Admin Basic";
|
RoleList = "Admin Basic";
|
||||||
else
|
X509_free(peercert);
|
||||||
RoleList = "Public";
|
}
|
||||||
#else
|
}
|
||||||
RoleList = "Public";
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bodylen = snprintf(body, sizeof(body), resp,
|
bodylen = snprintf(body, sizeof(body), resp,
|
||||||
|
|
Loading…
Reference in New Issue