[Cx] fix the Cx integration bug (#919)

- Now security is verified.
This commit is contained in:
Sukchan Lee
2021-04-06 21:36:08 +09:00
parent d40348c00c
commit d3eaaff430
2 changed files with 12 additions and 4 deletions

View File

@@ -233,12 +233,18 @@ uint64_t ogs_uint64_from_string(char *str)
void ogs_extract_digit_from_string(char *digit, char *string)
{
bool extracting = false;
ogs_assert(string);
ogs_assert(digit);
while(*string) {
if (*string >= '0' && *string <= '9')
while (*string) {
if (*string >= '0' && *string <= '9') {
*digit++ = *string;
extracting = true;
} else if (extracting == true) {
break;
}
string++;
}

View File

@@ -313,8 +313,10 @@ static int hss_ogs_diam_cx_mar_cb( struct msg **msg, struct avp *avp,
/* IMS_AKA is only supported */
if (authentication_scheme &&
strcmp(authentication_scheme, OGS_DIAM_CX_AUTH_SCHEME_IMS_AKA) != 0 &&
strcmp(authentication_scheme, OGS_DIAM_CX_AUTH_SCHEME_UNKNOWN) != 0) {
ogs_strcasecmp(authentication_scheme,
OGS_DIAM_CX_AUTH_SCHEME_IMS_AKA) != 0 &&
ogs_strcasecmp(authentication_scheme,
OGS_DIAM_CX_AUTH_SCHEME_UNKNOWN) != 0) {
ogs_error("Authentication-Scheme[%s] is not supported",
authentication_scheme);
result_code = OGS_DIAM_CX_ERROR_AUTH_SCHEME_NOT_SUPPORTED;