[xmlsec] decrypting badly encoded xml
Aleksey Sanin
aleksey at aleksey.com
Sat Jun 13 14:45:39 PDT 2009
Search for xmlParseInNodeContext ()
Aleksey
Michael K wrote:
> Hello Aleksey,
> Can I patch xmlsec to cleanup the decrypted text before passing it on to xmlParseInNodeContext. If so where should this code be inserted ?
>
> thanks,
> Michael
>
>
>
> ----- Original Message ----
> From: Aleksey Sanin <aleksey at aleksey.com>
> To: Michael K <vk2bea at yahoo.com>
> Cc: xmlsec at aleksey.com
> Sent: Saturday, June 13, 2009 3:49:44 PM
> Subject: Re: [xmlsec] decrypting badly encoded xml
>
> Hm... I don't think you can do anything about this. At least,
> not easily. xmlsec calls xmlParseInNodeContext from libxml2
> and it expects a well formed XML. You can patch both libraries and
> specify encoding manually though.
>
> Aleksey
>
> Michael K wrote:
>> I am AES decoding some <EncryptedData> containing strings that was not utf-8 compliant.
>>
>> When I decode the <EncryptedData> I get the error....
>>
>> Entity: line 4: parser error : Input is not proper UTF-8, indicate encoding !
>> Bytes: 0xE2 0x3F 0x3F 0x41
>> <text>II The Way Forward�??A New Approach</text>
>> ^
>> Entity: line 8: parser error : chunk is not well balanced
>> </navLabel>
>> ^
>>
>> The call to xmlSecEncCtxDecrypt(encCtx, enc_node) fails because of this utf-8 problem. There are other tags encrypted between the <EncryptedData> tags (other than this one that has a problem) than I cannot recover because of this failure.
>> Is there a way of forcing the xmlsec/libxml to ignore the utf-8 problem ? I have no control of the encrypted data so I cannot correct the original problem.
>>
>> Michael
>>
>>
>> _______________________________________________
>> xmlsec mailing list
>> xmlsec at aleksey.com
>> http://www.aleksey.com/mailman/listinfo/xmlsec
>
>
>
>
More information about the xmlsec
mailing list