Signature Computation Problem !

Imported from previous forum

Hello,

Basically i’m computing a signature. Before doing this i’m using the API from Morgan Stanley to do certain things. I’m filling up the “pub_info” structure and then i’m calling the “fix_fill_session_info” function given by Morgan Stanley to fill the Session Info structure. Then i’m calling the “fix_fill_key_info” to fill the “key_info” structure.

Now my question is even though the code inside the function does a memcpy of “8” and puts the value from “Signature[0] and Signature[8]” in to “des_key” and “ivec” of the Session_info structure i’m getting length of 29 and 15 each. How’s this possible. I tried this lot of times and it is giving the the same thing. How’s this possible. Has anybody encountered this problem. This is the case even with “chanbinding” of session_info. In this case i’m getting 10 as length. The total comes to 54 where in the total length of the structure is 24 with des_key[8], ivec[8] and chanbinding[8]. 8 each. If i fill this in RawData it comes to 54.

In this case if the Broker who is reading the RawData info will he not read first 8 then second 8 and then the next third 8 from the RawData and do the calculation. The signature will fail in this case.

Has anybody done this and successfully completed. I may need it a little bit immediately. If how it is done the format is given it would be helpful.

Should we set a ‘\0’ at the end of the string in des_key , ivec and chanbinding in 8th position but anyway it is doing a memcpy of 8. So it should’nt be a problem.

Thanks in advance.
Hari
choonsr@yahoo.com

I assume you’re using sizeof() to determine the “length” of the structure. Sounds to me like your compiler is aligning the structure differently from what you expect. You might want to investigate compile switches regarding alignment. Are you using sizeof() against FIX_session_info.des_key FIX_session_info.ivec? While sizeof(FIX_session_info) might return something other than 24 due to alignment issues, I would be surprised to see sizeof(FIX_session_info.des_key) return something other than 8 when they are each defined as unsigned char[8]. You might note your OS, compiler, and compiler settings on your next post.

>
> Hello,
>
> Basically i’m computing a signature. Before doing this i’m using the API from Morgan Stanley to do certain things. I’m filling up the “pub_info” structure and then i’m calling the “fix_fill_session_info” function given by Morgan Stanley to fill the Session Info structure. Then i’m calling the “fix_fill_key_info” to fill the “key_info” structure.
>
> Now my question is even though the code inside the function does a memcpy of “8” and puts the value from “Signature[0] and Signature[8]” in to “des_key” and “ivec” of the Session_info structure i’m getting length of 29 and 15 each. How’s this possible. I tried this lot of times and it is giving the the same thing. How’s this possible. Has anybody encountered this problem. This is the case even with “chanbinding” of session_info. In this case i’m getting 10 as length. The total comes to 54 where in the total length of the structure is 24 with des_key[8], ivec[8] and chanbinding[8]. 8 each. If i fill this in RawData it comes to 54.
>
> In this case if the Broker who is reading the RawData info will he not read first 8 then second 8 and then the next third 8 from the RawData and do the calculation. The signature will fail in this case.
>
> Has anybody done this and successfully completed. I may need it a little bit immediately. If how it is done the format is given it would be helpful.
>
> Should we set a ‘\0’ at the end of the string in des_key , ivec and chanbinding in 8th position but anyway it is doing a memcpy of 8. So it should’nt be a problem.
>
> Thanks in advance.
> Hari
> choonsr@yahoo.com
>
>
>