@@ -1999,7 +1999,7 @@ static int w_stir_verify(struct sip_msg *msg, str *cert_buf,
1999
1999
if ((rc = get_parsed_identity ( msg , & parsed )) < 0 ) {
2000
2000
if (rc == -1 ) {
2001
2001
LM_ERR ("Failed to parse identity header\n" );
2002
- SET_VERIFY_ERR_VARS (IERROR_CODE , IERROR_REASON );
2002
+ SET_VERIFY_ERR_VARS (IERROR_CODE , IERROR_REASON_PARSE_IDENTITY );
2003
2003
} else { /* rc == -4 */
2004
2004
LM_INFO ("Invalid identity header\n" );
2005
2005
SET_VERIFY_ERR_VARS (INVALID_IDENTITY_CODE , INVALID_IDENTITY_REASON );
@@ -2028,7 +2028,7 @@ static int w_stir_verify(struct sip_msg *msg, str *cert_buf,
2028
2028
2029
2029
if ((now = time (0 )) == -1 ) {
2030
2030
LM_ERR ("Failed to get current time\n" );
2031
- SET_VERIFY_ERR_VARS (IERROR_CODE , IERROR_REASON );
2031
+ SET_VERIFY_ERR_VARS (IERROR_CODE , IERROR_REASON_GET_CURRENT_TIME );
2032
2032
rc = -1 ;
2033
2033
goto error ;
2034
2034
}
@@ -2045,7 +2045,7 @@ static int w_stir_verify(struct sip_msg *msg, str *cert_buf,
2045
2045
2046
2046
if (get_date_ts (date_hf , & date_ts ) < 0 ) {
2047
2047
LM_ERR ("Failed to get UNIX time from Date header\n" );
2048
- SET_VERIFY_ERR_VARS (IERROR_CODE , IERROR_REASON );
2048
+ SET_VERIFY_ERR_VARS (IERROR_CODE , IERROR_REASON_GET_TIME_FROM_DATE_HEADER );
2049
2049
rc = -1 ;
2050
2050
goto error ;
2051
2051
}
@@ -2095,7 +2095,7 @@ static int w_stir_verify(struct sip_msg *msg, str *cert_buf,
2095
2095
2096
2096
if (load_cert (& cert , & certchain , cert_buf ) < 0 ) {
2097
2097
LM_ERR ("Failed to load certificate\n" );
2098
- SET_VERIFY_ERR_VARS (IERROR_CODE , IERROR_REASON );
2098
+ SET_VERIFY_ERR_VARS (IERROR_CODE , IERROR_REASON_LOAD_CERTIFICATE );
2099
2099
rc = -1 ;
2100
2100
goto error ;
2101
2101
}
@@ -2119,7 +2119,7 @@ static int w_stir_verify(struct sip_msg *msg, str *cert_buf,
2119
2119
if ((rc = validate_certificate (cert , certchain )) < 0 ) {
2120
2120
if (rc == -1 ) {
2121
2121
LM_ERR ("Error validating certificate\n" );
2122
- SET_VERIFY_ERR_VARS (IERROR_CODE , IERROR_REASON );
2122
+ SET_VERIFY_ERR_VARS (IERROR_CODE , IERROR_REASON_VALIDATE_CERTIFICATE );
2123
2123
goto error ;
2124
2124
} else { /* rc == -8 */
2125
2125
LM_INFO ("Invalid certificate\n" );
@@ -2135,7 +2135,7 @@ static int w_stir_verify(struct sip_msg *msg, str *cert_buf,
2135
2135
if ((rc = verify_signature (cert , parsed , iat_ts , orig_tn_p , dest_tn_p )) <= 0 ) {
2136
2136
if (rc < 0 ) {
2137
2137
LM_ERR ("Error while verifying signature\n" );
2138
- SET_VERIFY_ERR_VARS (IERROR_CODE , IERROR_REASON );
2138
+ SET_VERIFY_ERR_VARS (IERROR_CODE , IERROR_REASON_VERIFY_SIGNATURE );
2139
2139
rc = -1 ;
2140
2140
goto error ;
2141
2141
} else {
0 commit comments