summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorschwarze <>2018-04-14 11:38:32 +0000
committerschwarze <>2018-04-14 11:38:32 +0000
commitca2431d035ec6e4a115f384ff029c2316dd0d465 (patch)
tree3441ec88df0ca0e179fc62bf6e79e56e8fe26818 /src
parent1e9445503c3ea65f8c138ab5dc555db0f1db91a7 (diff)
downloadopenbsd-ca2431d035ec6e4a115f384ff029c2316dd0d465.tar.gz
openbsd-ca2431d035ec6e4a115f384ff029c2316dd0d465.tar.bz2
openbsd-ca2431d035ec6e4a115f384ff029c2316dd0d465.zip
In eng_lib.c rev. 1.14 2018/04/14 07:18:37, tb@ allowed ENGINE_free(3)
to accept a NULL argument. Document that. While here, make the related sentences more precise and less verbose. Tweaks and OK tb@.
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/man/engine.399
1 files changed, 46 insertions, 53 deletions
diff --git a/src/lib/libcrypto/man/engine.3 b/src/lib/libcrypto/man/engine.3
index d0b83d7745..d93f06f024 100644
--- a/src/lib/libcrypto/man/engine.3
+++ b/src/lib/libcrypto/man/engine.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: engine.3,v 1.13 2018/03/22 21:08:22 schwarze Exp $ 1.\" $OpenBSD: engine.3,v 1.14 2018/04/14 11:38:32 schwarze Exp $
2.\" full merge up to: OpenSSL crypto/engine e6390aca Jul 21 10:06:03 2015 -0400 2.\" full merge up to: OpenSSL crypto/engine e6390aca Jul 21 10:06:03 2015 -0400
3.\" selective merge up to: man3/ENGINE_add 1f13ad31 Dec 25 17:50:39 2017 +0800 3.\" selective merge up to: man3/ENGINE_add 1f13ad31 Dec 25 17:50:39 2017 +0800
4.\" 4.\"
@@ -51,7 +51,7 @@
51.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 51.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
52.\" OF THE POSSIBILITY OF SUCH DAMAGE. 52.\" OF THE POSSIBILITY OF SUCH DAMAGE.
53.\" 53.\"
54.Dd $Mdocdate: March 22 2018 $ 54.Dd $Mdocdate: April 14 2018 $
55.Dt ENGINE 3 55.Dt ENGINE 3
56.Os 56.Os
57.Sh NAME 57.Sh NAME
@@ -704,68 +704,61 @@ query or manipulate the data of an
704.Vt ENGINE 704.Vt ENGINE
705implementation rather than use its functionality. 705implementation rather than use its functionality.
706.Pp 706.Pp
707The
708.Fn ENGINE_new 707.Fn ENGINE_new
709function returns a structural reference to a new (empty) 708allocates and initializes an empty
710.Vt ENGINE 709.Vt ENGINE
711object. 710object and sets its structural reference count to 1
712There are other 711and its functional reference count to 0.
713.Nm engine 712Many functions increment the structural reference count by 1
714API functions that return structural references such as 713when successful.
714Some of them, including
715.Fn ENGINE_by_id , 715.Fn ENGINE_by_id ,
716.Fn ENGINE_get_first , 716.Fn ENGINE_get_first ,
717.Fn ENGINE_get_last , 717.Fn ENGINE_get_last ,
718.Fn ENGINE_get_next , 718.Fn ENGINE_get_next ,
719and 719and
720.Fn ENGINE_get_prev . 720.Fn ENGINE_get_prev ,
721All structural references should be released by a corresponding call 721do so because they return a structural reference to the user.
722to the 722Other functions, including
723.Fn ENGINE_free 723.Fn ENGINE_add ,
724function. 724.Fn ENGINE_init ,
725The 725.Fn ENGINE_get_default_* ,
726.Vt ENGINE 726.Fn ENGINE_get_*_engine ,
727object itself will only actually be cleaned up and deallocated when 727and
728the last structural reference is released. 728.Fn ENGINE_set_default_* ,
729do so because they store a structural refence internally.
730.Fn ENGINE_up_ref
731explicitly increment the structural reference count by 1.
729.Pp 732.Pp
730It should also be noted that many
731.Nm engine
732API function calls that accept a structural reference will internally
733obtain another reference.
734Typically this happens whenever the supplied
735.Vt ENGINE
736will be needed by OpenSSL after the function has returned.
737For example, the function to add a new
738.Vt ENGINE
739to OpenSSL's internal list is
740.Fn ENGINE_add .
741If this function returns success, OpenSSL will have stored a new
742structural reference internally so the caller is still responsible for
743freeing their own reference with
744.Fn ENGINE_free 733.Fn ENGINE_free
745when they are finished with it. 734decrements the structural reference count by 1,
746In a similar way, some functions will automatically release the 735and if it reaches 0, the cleanup function associated with
747structural reference passed to it if part of the function's job is 736.Fa e
748to do so. 737is called, and both the memory used internally by
749For example, the 738.Fa e
750.Fn ENGINE_get_next
751and 739and
752.Fn ENGINE_get_prev 740.Fa e
753functions are used for iterating across the internal 741itself are freed.
754.Vt ENGINE 742If
755list. 743.Fa e
756They 744is a
757will return a new structural reference to the next (or previous)
758.Vt ENGINE
759in the list or
760.Dv NULL 745.Dv NULL
761if at the end (or beginning) of the list, but in either case the 746pointer, no action occurs.
762structural reference passed to the function is released on behalf 747Many functions internally call the equivalent of
763of the caller. 748.Fn ENGINE_free .
764.Pp 749Some of them, including
765To clarify a particular function's handling of references, one should 750.Fn ENGINE_get_next
766always consult that function's manual page, or failing that the 751and
767.In openssl/engine.h 752.Fn ENGINE_get_prev ,
768header file includes some hints. 753thus invalidate the structural reference passed in by the user.
754Other functions, including
755.Fn ENGINE_finish ,
756.Fn ENGINE_remove ,
757.Fn ENGINE_get_default_* ,
758.Fn ENGINE_get_*_engine ,
759and
760.Fn ENGINE_set_default_* ,
761do so when an internally stored structural reference is no longer needed.
769.Pp 762.Pp
770.Em Functional references 763.Em Functional references
771.Pp 764.Pp