From e62971ef41285eb171909f24ecf7f897eba38dd9 Mon Sep 17 00:00:00 2001 From: Michael Iedema Date: Wed, 9 Apr 2014 15:20:19 +0200 Subject: [PATCH] - remove qop element from REGISTER because proxies may try to reauth if it is present - make sure SRES is always 8 characters in length, fixes periodic registration failures when leading zeros are present (upstream r8155) --- Control/L3MobilityManagement.cpp | 2 +- SIP/SIPBase.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Control/L3MobilityManagement.cpp b/Control/L3MobilityManagement.cpp index 7a6fbc8..6ac5b81 100644 --- a/Control/L3MobilityManagement.cpp +++ b/Control/L3MobilityManagement.cpp @@ -724,7 +724,7 @@ MachineStatus LUAuthentication::machineRunState(int state, const GSM::L3Message* } else #endif { - string SRESstr = format("%x",mobileSRES); + string SRESstr = format("%08x",mobileSRES); return machPush(new L3RegisterMachine(tran(),SIPDTRegister, SRESstr, &ludata()->mRegistrationResult), stateRegister2Response); diff --git a/SIP/SIPBase.cpp b/SIP/SIPBase.cpp index 4213c73..a3d01a2 100644 --- a/SIP/SIPBase.cpp +++ b/SIP/SIPBase.cpp @@ -493,7 +493,7 @@ SipMessage *SipBase::makeRegisterMsg(DialogType wMethod, const L3LogicalChannel* if (SRES && strlen(SRES)) { if (realm.length() > 0) { string response = makeResponse(authUsername, realm, SRES, registerStr, authUri, RAND); - msg->msmAuthorizationValue = format("Digest realm=\"%s\", username=\"%s\", nonce=\"%s\", uri=\"%s\", response=\"%s\", algorithm=MD5, qop=\"auth\" ", + msg->msmAuthorizationValue = format("Digest realm=\"%s\", username=\"%s\", nonce=\"%s\", uri=\"%s\", response=\"%s\", algorithm=MD5 ", realm.c_str(), authUsername.c_str(), RAND.c_str(), authUri.c_str(), response.c_str()); } else { msg->msmAuthorizationValue = format("Digest, nonce=%s, uri=%s, response=%s",RAND.c_str(),msid.mImsi.c_str(),SRES);