Compare Revisions

The credentials to download the source code are:
 Username: svnusers
 Password: svnusers

Ignore whitespace Rev 620 → Rev 621

/branches/v3/ttcn/LibSip_Steps.ttcn
136,7 → 136,6
) return Credentials {
var Credentials v_result;
var charstring v_nonce := "";
// TODO STF471 change: different cnonce value, e.g. in register and de-register
var charstring v_cnonce := int2str(float2int(int2float(13172657659 - 1317266) * rnd()) + 1317265);
 
// RFC 2617 3.2.2 username:
154,6 → 153,8
// correct way would be to increase c_nonceCount depending on used nonce value
// see RFC 2617, where it is stated, that nonce-count has to be incremented
// every time UE uses the same nonce
// SPEC: for every request with the same nonce used, nonce-count has to be incremented,
// to detect request replay attacks
const charstring cl_nonceCount := "00000001";
var charstring v_qop := p_userprofile.qop;
var charstring v_uri := c_sipScheme & ":" & p_userprofile.registrarDomain;
175,7 → 176,6
v_response := fx_calculateDigestResponse(v_nonce, v_cnonce, v_username, v_realm, v_passwd, v_algorithm, cl_nonceCount, p_method, v_qop, v_uri, cl_hEntity);
 
// Construct credentials for an Authorization field of a request.
// TODO STF471 change: avoid setting absent opaque value
v_digestResponse[0] := {
id := "username",
paramValue := { quotedString := v_username }
204,30 → 204,19
id := "cnonce",
paramValue := { quotedString := v_cnonce }
};
 
if (v_opaque == "") {
v_digestResponse[7] := {
id := "qop",
paramValue := { tokenOrHost := v_qop }
}; // qop
v_digestResponse[8] := {
id := "nc",
paramValue := { tokenOrHost := cl_nonceCount }
}; // nonceCount
}
else {
v_digestResponse[7] := {
v_digestResponse[7] := {
id := "qop",
paramValue := { tokenOrHost := v_qop }
}; // qop
v_digestResponse[8] := {
id := "nc",
paramValue := { tokenOrHost := cl_nonceCount }
}; // nonceCount
if (v_opaque != "") {
v_digestResponse[9] := {
id := "opaque",
paramValue := { quotedString := v_opaque }
}; // already enclosed to " characters
v_digestResponse[8] := {
id := "qop",
paramValue := { tokenOrHost := v_qop }
}; // qop
v_digestResponse[9] := {
id := "nc",
paramValue := { tokenOrHost := cl_nonceCount }
}; // nonceCount
}
v_result := {digestResponse := v_digestResponse};
 
288,7 → 277,6
// calculate a digest response for the Authorize header
v_response := fx_calculateDigestResponse(v_nonce, v_cnonce, v_username, v_realm, v_passwd, v_algorithm, cl_nonceCount, p_method, v_qop, v_uri, cl_hEntity);
 
// TODO STF471 change: avoid setting absent opaque value
v_digestResponse[0] := {
id := "username",
paramValue := { quotedString := v_username }
313,30 → 301,19
id := "cnonce",
paramValue := { quotedString := v_cnonce }
};
 
v_digestResponse[6] := {
id := "qop",
paramValue := { tokenOrHost := v_qop }
}; // qop
v_digestResponse[7] := {
id := "nc",
paramValue := { tokenOrHost := cl_nonceCount }
}; // nonceCount
if (v_opaque == "") {
v_digestResponse[6] := {
id := "qop",
paramValue := { tokenOrHost := v_qop }
}; // qop
v_digestResponse[7] := {
id := "nc",
paramValue := { tokenOrHost := cl_nonceCount }
}; // nonceCount
}
else {
v_digestResponse[6] := {
id := "opaque",
paramValue := { quotedString := v_opaque }
}; // already enclosed to " characters
v_digestResponse[7] := {
id := "qop",
paramValue := { tokenOrHost := v_qop }
}; // qop
v_digestResponse[8] := {
id := "nc",
paramValue := { tokenOrHost := cl_nonceCount }
}; // nonceCount
}
v_result := {digestResponse := v_digestResponse};
 
476,7 → 453,6
v_response := fx_calculateDigestResponse(v_nonce, v_cnonce, v_username, v_realm, v_passwd, v_algorithm, cl_nonceCount, p_method, v_qop, v_uri, cl_hEntity);
 
// Construct credentials for an Authorization field of a request.
// TODO STF471 change: avoid setting absent opaque value
v_digestResponse[0] := {
id := "username",
paramValue := { quotedString := "DifferentToPrivateUser" }
505,30 → 481,19
id := "cnonce",
paramValue := { quotedString := v_cnonce }
};
 
if (v_opaque == "") {
v_digestResponse[7] := {
id := "qop",
paramValue := { tokenOrHost := v_qop }
}; // qop
v_digestResponse[8] := {
id := "nc",
paramValue := { tokenOrHost := cl_nonceCount }
};
}
else {
v_digestResponse[7] := {
v_digestResponse[7] := {
id := "qop",
paramValue := { tokenOrHost := v_qop }
}; // qop
v_digestResponse[8] := {
id := "nc",
paramValue := { tokenOrHost := cl_nonceCount }
};
if (v_opaque != "") {
v_digestResponse[9] := {
id := "opaque",
paramValue := { quotedString := "" }
}; // already enclosed to " characters
v_digestResponse[8] := {
id := "qop",
paramValue := { tokenOrHost := v_qop }
}; // qop
v_digestResponse[9] := {
id := "nc",
paramValue := { tokenOrHost := cl_nonceCount }
};
}
v_result := {digestResponse := v_digestResponse};
 
673,7 → 638,6
return v_result;
}
 
// TODO STF471 added, check location
/**
* @desc Return the updated component variable of via header
* @return component variable of via header
3148,7 → 3112,6
}
} // end f_awaitingResponse
 
// TODO STF471 addition
/**
* @desc Function waiting for a response, repeat if 100 Trying is received
* @param p_Response expected response message
3210,7 → 3173,6
}
} // end f_awaitingResponsePassOnTimeout
 
// TODO STF471 added
/**
* @desc Function waiting for a 200 OK response
* @param p_cSeq_s current cSeq expectation
3360,7 → 3322,6
f_awaitingACK_setHeaders(p_ACK, false);
} // end f_awaitingACK
 
// TODO STF471 added
/**
* @desc function awaiting ACK request
*/
4407,7 → 4368,6
f_awaitingACK(mw_ACK_Request_Base(vc_callId));
}
 
// TODO STF471 added
altstep a_receiveCANCELorNothing(
in template(present) CANCEL_Request p_CANCEL := ?
) runs on SipComponent {
4419,7 → 4379,6
}
}
 
// TODO STF471 added
altstep a_awaitNotify(
in template(present) NOTIFY_Request p_MSG := ?,
inout boolean p_receivedNotify