mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 11:25:35 +00:00
security-events: Fix SuccessfulAuth using_password declaration.
The SuccessfulAuth using_password field was declared as a pointer to a uint32_t when the field was later read as a uint32_t value. This resulted in unnecessary casts and a non-portable field value reinterpret in main/security_events.c:add_json_object(). i.e., It would work on a 32 bit architecture but not on a 64 bit big endian architecture. Change-Id: Ia08bc797613a62f07e5473425f9ccd8d77c80935
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
void sip_report_invalid_peer(const struct sip_pvt *p);
|
||||
void sip_report_failed_acl(const struct sip_pvt *p, const char *aclname);
|
||||
void sip_report_inval_password(const struct sip_pvt *p, const char *responsechallenge, const char *responsehash);
|
||||
void sip_report_auth_success(const struct sip_pvt *p, uint32_t *using_password);
|
||||
void sip_report_auth_success(const struct sip_pvt *p, uint32_t using_password);
|
||||
void sip_report_session_limit(const struct sip_pvt *p);
|
||||
void sip_report_failed_challenge_response(const struct sip_pvt *p, const char *response, const char *expected_response);
|
||||
void sip_report_chal_sent(const struct sip_pvt *p);
|
||||
|
@@ -122,7 +122,7 @@ void sip_report_inval_password(const struct sip_pvt *p, const char *response_cha
|
||||
ast_security_event_report(AST_SEC_EVT(&inval_password));
|
||||
}
|
||||
|
||||
void sip_report_auth_success(const struct sip_pvt *p, uint32_t *using_password)
|
||||
void sip_report_auth_success(const struct sip_pvt *p, uint32_t using_password)
|
||||
{
|
||||
char session_id[32];
|
||||
|
||||
@@ -271,7 +271,8 @@ void sip_report_inval_transport(const struct sip_pvt *p, const char *transport)
|
||||
}
|
||||
|
||||
int sip_report_security_event(const char *peer, struct ast_sockaddr *addr, const struct sip_pvt *p,
|
||||
const struct sip_request *req, const int res) {
|
||||
const struct sip_request *req, const int res)
|
||||
{
|
||||
|
||||
struct sip_peer *peer_report;
|
||||
enum check_auth_result res_report = res;
|
||||
@@ -297,9 +298,9 @@ int sip_report_security_event(const char *peer, struct ast_sockaddr *addr, const
|
||||
case AUTH_SUCCESSFUL:
|
||||
if (peer_report) {
|
||||
if (ast_strlen_zero(peer_report->secret) && ast_strlen_zero(peer_report->md5secret)) {
|
||||
sip_report_auth_success(p, (uint32_t *) 0);
|
||||
sip_report_auth_success(p, 0);
|
||||
} else {
|
||||
sip_report_auth_success(p, (uint32_t *) 1);
|
||||
sip_report_auth_success(p, 1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
Reference in New Issue
Block a user