/usr/share/doc/libfko-doc/libfko.html/Utility-Functions.html is in libfko-doc 2.6.9-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!--
This manual is for the Firewall Knock Operator library, libfko.
(version 2.6.9, last updated 9 June 2016).
Copyright (C) 2009-2013 Damien Stuart.
The libfko manual is free; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
The libfko manual is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this manual; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -->
<!-- Created by GNU Texinfo 6.1, http://www.gnu.org/software/texinfo/ -->
<head>
<title>Firewall Knock Operator Library - libfko: Utility Functions</title>
<meta name="description" content="Firewall Knock Operator Library - libfko: Utility Functions">
<meta name="keywords" content="Firewall Knock Operator Library - libfko: Utility Functions">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Using-libfko.html#Using-libfko" rel="up" title="Using libfko">
<link href="Error-Handling.html#Error-Handling" rel="next" title="Error Handling">
<link href="Retrieving-SPA-Data.html#Retrieving-SPA-Data" rel="prev" title="Retrieving SPA Data">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
blockquote.smallindentedblock {margin-right: 0em; font-size: smaller}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smalllisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body lang="en">
<a name="Utility-Functions"></a>
<div class="header">
<p>
Next: <a href="Error-Handling.html#Error-Handling" accesskey="n" rel="next">Error Handling</a>, Previous: <a href="Retrieving-SPA-Data.html#Retrieving-SPA-Data" accesskey="p" rel="prev">Retrieving SPA Data</a>, Up: <a href="Using-libfko.html#Using-libfko" accesskey="u" rel="up">Using libfko</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Utility-Functions-1"></a>
<h3 class="section">3.6 Utility Functions</h3>
<a name="index-utility-functions"></a>
<a name="index-spa-data_002c-utility-functions"></a>
<p>This section describes the functions not covered elsewhere in this
manual. These are utility functions that operate on the data in the fko
context. All but <code>fko_spa_data_final</code> are called by other functions
and are not normally explicitly called by the user. However, they can
be, so they are listed here.
</p>
<p>All of these functions return an integer representing the return status of
the function. When succesfull, they will return <code>FKO_SUCCESS</code>.
Otherwise, an error code value is returned.
</p>
<dl>
<dt><a name="index-fko_005fspa_005fdata_005ffinal"></a>Function: <em>int</em> <strong>fko_spa_data_final</strong> <em>(fko_ctx_t <var>ctx</var>, char <var>*enc_key</var>, int <var>ken_len</var>, char <var>*hmac_key</var>, int <var>hmac_key_len</var>);</em></dt>
<dd><p>This function is the final step in creating a complete encrypted
<acronym>SPA</acronym> data string suitable for transmission to an fwknop server.
It does require all of the requisite <acronym>SPA</acronym> data fields be set,
otherwise it will fail with an appropriate error code.
</p></dd></dl>
<dl>
<dt><a name="index-fko_005fdecrypt_005fspa_005fdata"></a>Function: <em>int</em> <strong>fko_decrypt_spa_data</strong> <em>(fko_ctx_t <var>ctx</var>, char <var>*dec_key</var>, int <var>key_len</var>);</em></dt>
<dd><p>When given the correct <var>key</var> (password), this function decrypts, decodes,
and parses the encrypted <acronym>SPA</acronym> data that was supplied to the context
via the <code>fko_new_with_data</code> function that was also called without the
<var>key</var> value. Once the data is decrypted, this function will also call
<code>fko_decode_spa_data</code> to decode, parse, validate, and store the data
fields in the context for later retrieval.
</p></dd></dl>
<dl>
<dt><a name="index-fko_005fencrypt_005fspa_005fdata"></a>Function: <em>int</em> <strong>fko_encrypt_spa_data</strong> <em>(fko_ctx_t <var>ctx</var>, char <var>*enc_key</var>, int <var>key_len</var>);</em></dt>
<dd><p>Encrypts the intermediate encoded <acronym>SPA</acronym> data stored in the context.
This function will call <code>fko_encode</code> if necessary. It is normally not
called directly as it is called from <code>fko_spa_data_final</code>.
</p></dd></dl>
<dl>
<dt><a name="index-fko_005fdecode_005fspa_005fdata"></a>Function: <em>int</em> <strong>fko_decode_spa_data</strong> <em>(fko_ctx_t <var>ctx</var>);</em></dt>
<dd><p>This function performs the decoding, parsing, validation of the <acronym>SPA</acronym>
data that was just decrypted. It is normally not called directly as it is
called from <code>fko_decrypt_spa_data</code> (which is in turn called from
<code>fko_new_with_data</code> if a password is supplied to it).
</p></dd></dl>
<dl>
<dt><a name="index-fko_005fencode_005fspa_005fdata"></a>Function: <em>int</em> <strong>fko_encode_spa_data</strong> <em>(fko_ctx_t <var>ctx</var>);</em></dt>
<dd><p>Performs the base64 encoding of those <acronym>SPA</acronym> data fields that
need to be encoded, performs some data validation, and calls
<code>fkp_set_spa_digest</code> to recompute the <acronym>SPA</acronym> message
digest. It is normally not called directly as it is
called from <code>fko_encrypt_spa_data</code> (which is in turn called from
<code>fko_spa_data_final</code>).
</p></dd></dl>
<a name="index-gpg_002dspecific-functions-2"></a>
<p><em>GPG-specific utility functions:</em>
</p>
<dl>
<dt><a name="index-fko_005fgpg_005fsignature_005fid_005fmatch"></a>Function: <em>int</em> <strong>fko_gpg_signature_id_match</strong> <em>(fko_ctx_t <var>ctx</var>, const char <var>*id</var>, unsigned char <var>*id_match</var>);</em></dt>
<dd><p>Sets the value of the <var>id_match</var> variable to true (1) if the value of
<var>id</var> matches the ID of the <acronym>GPG</acronym> signature associated with the
current context. Otherwise, <var>id_match</var> is set to false (0). The return
value is an FKO error status.
</p></dd></dl>
<dl>
<dt><a name="index-fko_005fgpg_005fsignature_005ffpr_005fmatch"></a>Function: <em>int</em> <strong>fko_gpg_signature_fpr_match</strong> <em>(fko_ctx_t <var>ctx</var>, const char <var>*fpr</var>, unsigned char <var>*fpr_match</var>);</em></dt>
<dd><p>Sets the value of the <var>fpr_match</var> variable to true (1) if the value of
<var>fpr</var> matches the fingerprint of the <acronym>GPG</acronym> signature associated
with the current context. Otherwise, <var>fpr_match</var> is set to false (0).
The return value is an FKO error status.
</p></dd></dl>
<hr>
<div class="header">
<p>
Next: <a href="Error-Handling.html#Error-Handling" accesskey="n" rel="next">Error Handling</a>, Previous: <a href="Retrieving-SPA-Data.html#Retrieving-SPA-Data" accesskey="p" rel="prev">Retrieving SPA Data</a>, Up: <a href="Using-libfko.html#Using-libfko" accesskey="u" rel="up">Using libfko</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>
|