RE: [Cdsa-discuss] Certificate Revocation List-Doubt
Status: Abandoned
Brought to you by:
mdwood-intel
From: Bowler, D. <dav...@in...> - 2003-06-09 19:16:35
|
There are two issues with the way you're doing things, both relating to the overall size of the serial number. field_ptr[0].FieldValue.Length = sizeof(uint8); should be something like: field_ptr[0].FieldValue.Length = sizeof(uint32); and *(field_ptr[0].FieldValue.Data) = (uint8)(new_serial); could be something like memcpy((field_ptr[0].FieldValue.Data), &(new_serial), sizeof(uint32)); There are obviously many ways to write what you're trying to write, but the important thing is to make sure you're moving the full serial number value into the data field and put the correct length into the length field. David > -----Original Message----- > From: akila m [mailto:ak...@ya...] > Sent: Thursday, June 05, 2003 9:40 PM > To: cds...@li... > Cc: cds...@li... > Subject: Re: [Cdsa-discuss] Certificate Revocation List-Doubt > > > hello Sir, > We use CDSA v3.14 for developing our Enterprise > Certificate Authority. We have been able to create and > store certificates successfully. But with a problem. > > The problem is in assigning serial number. > > i populate the certificate fields and use > CSSM_CL_CertCreateTemplate API to create certificate. > In observation i understood the serial number which is > passed as uint32 is coverted to hex and stored in > CSSMOID_X509V1SerialNumber. > > say if the serial number i pass is 10 then in > certificate its stored as "0A", its corresponding hex > value. > > But when i give "1000", its corresponding hex value is > "3E8", but in certificate its stored as "E8" only. if > i give any other value also, it takes only the last > two values of corresponding hex value. why is it > so.... > > i do it like this > > uint32 new_serial = 1000; > uint32 ref = 15; > > field_ptr[0].FieldOid = CSSMOID_X509V1SerialNumber; > field_ptr[0].FieldValue.Length = sizeof(uint8); > field_ptr[0].FieldValue.Data = (uint8 *)malloc > (sizeof(uint8) + > ref); > *(field_ptr[0].FieldValue.Data) = (uint8) > (new_serial); > > > 1. do i have to store it in a different way > > 2. whats wrong in this code > > Any information regarding this would be of much help > > > With Regards > M. Akila > > > > __________________________________ > Do you Yahoo!? > Yahoo! Calendar - Free online calendar with sync to Outlook(TM). > http://calendar.yahoo.com > > > ------------------------------------------------------- > This SF.net email is sponsored by: Etnus, makers of > TotalView, The best > thread debugger on the planet. Designed with thread debugging features > you've never dreamed of, try TotalView 6 free at www.etnus.com. > _______________________________________________ > Cdsa-discuss mailing list > Cds...@li... > https://lists.sourceforge.net/lists/listinfo/cdsa-discuss > |