Skip to content

Commit

Permalink
fixup! X509_dup.pod: add caveat that extra data is not copied and hin…
Browse files Browse the repository at this point in the history
…ts, e.g., to use X509_up_ref() instead
  • Loading branch information
DDvO committed Dec 19, 2023
1 parent 8bffa77 commit 806075f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions doc/man3/X509_dup.pod
Original file line number Diff line number Diff line change
Expand Up @@ -364,10 +364,11 @@ may contain extra data besides the ASN.1 structure.
For instance, an B<X509> object usually is augmented
by cached information on X.509v3 extensions, etc.
Such extra data is not copied.
If it needs to be retained, maybe better use B<I<TYPE>_up_ref>().
If it needs to be retained, it may be better to use B<I<TYPE>_up_ref>().
For the case of B<X509> objects, an alternative to using L<X509_up_ref(3)>
is to still call, e.g., I<copied_cert = X509_dup(cert)>, yet followed by
I<X509_check_purpose(copied_cert, -1, 0)>, which re-builds the cached data.
is to still call B<I<TYPE>_dup>(), e.g., I<copied_cert = X509_dup(cert)>,
followed by I<X509_check_purpose(copied_cert, -1, 0)>,
which re-builds the cached data.

B<I<TYPE>_free>() releases the object and all pointers and sub-objects
within it.
Expand Down

0 comments on commit 806075f

Please sign in to comment.