[xmlsec] How to avoid the node passed to xmlSecEncCtxXmlEncrypt
to be released
fg at 4js.com
Thu Mar 13 02:21:54 PST 2008
Yes I agree, but it would be more efficient if I wouldn't have to do
that. And I have the same problem when I try to encrypt only the content
of an element, where all sub-nodes are removed. Actually, I try to write
an API where you give the node to be encrypted, but the node passed to
my function is still alive, and simply destroying the nodes inside the
library is impossible in my case, because some other references can
point on these nodes.
Therefore may I suggest a request ? Could you add an option in the
'xmlSecEncCtxPtr' structure to specify how the nodes to be replaced
should be handled, and return them in a list in the structure if for
instance the option was set to not releasing them so that the user can
choose to release them by hand or not. And the same kind of feature when
decrypting a node, because in some cases you want to keep trace of the
My 2 cents contribution that could really help in my case, and allow the
programmer to choose instead of the library.
If you agree I could make a patch, using flags or flags2 in the
'xmlSecEncCtxPtr' structure, and add a new entry of type xmlNodePtr with
the list of nodes that were replaced but not released according to flags
or flags2 value. BTW what is the difference between flags and flags2 ?
Are they used because I didn't find any information in the documentation ?
Aleksey Sanin a écrit :
> Well, you can always copy the node yourself before encrypting it.
> Frank Gross wrote:
>> I noticed that function 'xmlSecEncCtxXmlEncrypt' releases the node
>> that was encrypted when replaced by the 'EncryptedData' node.
>> Does it exist a way to not release that node, and let the user choose
>> whether he wants to destroy it or not ?
>> xmlsec mailing list
>> xmlsec at aleksey.com
More information about the xmlsec