diff options
| -rw-r--r-- | src/lib/libcrypto/man/engine.3 | 99 |
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 |
| 705 | implementation rather than use its functionality. | 705 | implementation rather than use its functionality. |
| 706 | .Pp | 706 | .Pp |
| 707 | The | ||
| 708 | .Fn ENGINE_new | 707 | .Fn ENGINE_new |
| 709 | function returns a structural reference to a new (empty) | 708 | allocates and initializes an empty |
| 710 | .Vt ENGINE | 709 | .Vt ENGINE |
| 711 | object. | 710 | object and sets its structural reference count to 1 |
| 712 | There are other | 711 | and its functional reference count to 0. |
| 713 | .Nm engine | 712 | Many functions increment the structural reference count by 1 |
| 714 | API functions that return structural references such as | 713 | when successful. |
| 714 | Some 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 , |
| 719 | and | 719 | and |
| 720 | .Fn ENGINE_get_prev . | 720 | .Fn ENGINE_get_prev , |
| 721 | All structural references should be released by a corresponding call | 721 | do so because they return a structural reference to the user. |
| 722 | to the | 722 | Other functions, including |
| 723 | .Fn ENGINE_free | 723 | .Fn ENGINE_add , |
| 724 | function. | 724 | .Fn ENGINE_init , |
| 725 | The | 725 | .Fn ENGINE_get_default_* , |
| 726 | .Vt ENGINE | 726 | .Fn ENGINE_get_*_engine , |
| 727 | object itself will only actually be cleaned up and deallocated when | 727 | and |
| 728 | the last structural reference is released. | 728 | .Fn ENGINE_set_default_* , |
| 729 | do so because they store a structural refence internally. | ||
| 730 | .Fn ENGINE_up_ref | ||
| 731 | explicitly increment the structural reference count by 1. | ||
| 729 | .Pp | 732 | .Pp |
| 730 | It should also be noted that many | ||
| 731 | .Nm engine | ||
| 732 | API function calls that accept a structural reference will internally | ||
| 733 | obtain another reference. | ||
| 734 | Typically this happens whenever the supplied | ||
| 735 | .Vt ENGINE | ||
| 736 | will be needed by OpenSSL after the function has returned. | ||
| 737 | For example, the function to add a new | ||
| 738 | .Vt ENGINE | ||
| 739 | to OpenSSL's internal list is | ||
| 740 | .Fn ENGINE_add . | ||
| 741 | If this function returns success, OpenSSL will have stored a new | ||
| 742 | structural reference internally so the caller is still responsible for | ||
| 743 | freeing their own reference with | ||
| 744 | .Fn ENGINE_free | 733 | .Fn ENGINE_free |
| 745 | when they are finished with it. | 734 | decrements the structural reference count by 1, |
| 746 | In a similar way, some functions will automatically release the | 735 | and if it reaches 0, the cleanup function associated with |
| 747 | structural reference passed to it if part of the function's job is | 736 | .Fa e |
| 748 | to do so. | 737 | is called, and both the memory used internally by |
| 749 | For example, the | 738 | .Fa e |
| 750 | .Fn ENGINE_get_next | ||
| 751 | and | 739 | and |
| 752 | .Fn ENGINE_get_prev | 740 | .Fa e |
| 753 | functions are used for iterating across the internal | 741 | itself are freed. |
| 754 | .Vt ENGINE | 742 | If |
| 755 | list. | 743 | .Fa e |
| 756 | They | 744 | is a |
| 757 | will return a new structural reference to the next (or previous) | ||
| 758 | .Vt ENGINE | ||
| 759 | in the list or | ||
| 760 | .Dv NULL | 745 | .Dv NULL |
| 761 | if at the end (or beginning) of the list, but in either case the | 746 | pointer, no action occurs. |
| 762 | structural reference passed to the function is released on behalf | 747 | Many functions internally call the equivalent of |
| 763 | of the caller. | 748 | .Fn ENGINE_free . |
| 764 | .Pp | 749 | Some of them, including |
| 765 | To clarify a particular function's handling of references, one should | 750 | .Fn ENGINE_get_next |
| 766 | always consult that function's manual page, or failing that the | 751 | and |
| 767 | .In openssl/engine.h | 752 | .Fn ENGINE_get_prev , |
| 768 | header file includes some hints. | 753 | thus invalidate the structural reference passed in by the user. |
| 754 | Other functions, including | ||
| 755 | .Fn ENGINE_finish , | ||
| 756 | .Fn ENGINE_remove , | ||
| 757 | .Fn ENGINE_get_default_* , | ||
| 758 | .Fn ENGINE_get_*_engine , | ||
| 759 | and | ||
| 760 | .Fn ENGINE_set_default_* , | ||
| 761 | do 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 |
