On Tue, Dec 1, 2009 at 2:34 PM, Carolyn Beeton <[email protected]> wrote:
> I am trying to generate a signed SipXauthIdentity header from sipXbridge, and 
> am stuck on the shared secret.
>
> The signature is an md5 hash of 
> "<timestamp><secret><from-tag><call-id><identity>", but it is the secret part 
> that has me stumped.
>
> The <secret> part looks like it is supposed to be the base64 decoded value of 
> the shared-secret from domain-config 
> (sipXcommserverLib/src/sipXecsService.cpp decodes it).  But I don't seem to 
> be able to make sipxbridge decode it into the same thing.  Could be that Java 
> Strings are messing me up, or just messing with my head.
>
> sipregistrar.log:
> SipRegistrar:"SipXauthIdentity::setSecret(Ù(T^Uj^I<81>Ðü^W1ÿ<9d>$¬õ^ED)"
>
> sipxbridge.log:
> SipXauthIdentity:"SipXauthIdentity.setSecret (decoded) (T^Uj^I^W1$"
>
> When generating the signature, this is what is being encoded in sipxbridge:
>
> "SipXauthIdentity.encode: create md5hash of token 
> 4B156BBC(t^uj^i^w1$839038841122994322194bf9488-2f879805-13c4-20e8af-725d1e20-20e...@[email protected]"
>
> and this is what sipregistar uses to check:
>
> SipRegistrar:"SipXauthIdentity::decode md5hash of 
> 4B156BBCÙ(T^Uj^I<81>Ðü^W1ÿ<9d>$¬õ^ed839038841122994322194bf9488-2f879805-13c4-20e8af-725d1e20-20e...@[email protected]"
>
> So the piece that does not match is the piece that is the secret.


Hi Carolyn,

Can you set the secret as a byte array ( not a String) and then
override the encode method to do the MessageDigest.

public setSecret(byte[] secret) {
 this.secret = secret;
}

@Override
public String encode() {
   MessageDigest digest = MessageDigest.getInstance("MD5");
    headerName + ":" +  digest.digest(secret).....

   etc...
   return encodedString;
}


Scott : This is the first time we have had to do this in java.

Regards,

Ranga

-- 
M. Ranganathan
_______________________________________________
sipx-dev mailing list [email protected]
List Archive: http://list.sipfoundry.org/archive/sipx-dev
Unsubscribe: http://list.sipfoundry.org/mailman/listinfo/sipx-dev
sipXecs IP PBX -- http://www.sipfoundry.org/

Reply via email to