mirror of
https://github.com/nmap/nmap.git
synced 2025-12-28 18:39:03 +00:00
merging nse_openssl branch
This commit is contained in:
@@ -1164,6 +1164,233 @@ if(s) code_to_be_done_on_match end
|
||||
<indexterm class="endofrange" startref="nse-pcre-indexterm"/>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="nse-openssl">
|
||||
<indexterm class="startofrange" id="nse-openssl-indexterm"><primary><varname>openssl</varname> NSE module</primary></indexterm>
|
||||
<indexterm><primary>OpenSSL</primary><secondary>in NSE</secondary></indexterm>
|
||||
<title>OpenSSL NSE bindings</title>
|
||||
|
||||
<para>
|
||||
The <literal>openssl</literal> module provides functions for
|
||||
dealing with multiprecision integers. The functions reside inside the
|
||||
<literal>openssl</literal> namespace.
|
||||
</para>
|
||||
|
||||
<variablelist>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>openssl.bignum_num_bits( bignum )</option></term>
|
||||
<listitem>
|
||||
<para>Returns the size of <literal>bignum</literal> in bits.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>openssl.bignum_num_bytes( bignum )</option></term>
|
||||
<listitem>
|
||||
<para>Returns the size of <literal>bignum</literal> in bytes.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>openssl.bignum_set_bit( bignum, position )</option></term>
|
||||
<listitem>
|
||||
<para>Sets bit at <literal>position</literal> in <literal>bignum</literal>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>openssl.bignum_clear_bit( bignum, position )</option></term>
|
||||
<listitem>
|
||||
<para>Clears bit at <literal>position</literal> in <literal>bignum</literal>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>openssl.bignum_is_bit_set( bignum, position )</option></term>
|
||||
<listitem>
|
||||
<para>Get bit at <literal>position</literal> in <literal>bignum</literal>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>openssl.bignum_set_negative( bignum, negative )</option></term>
|
||||
<listitem>
|
||||
<para>Set sign of <literal>bignum</literal>. If <literal>negative</literal> is <literal>false</literal> the sign becomes positive otherwise it becomes negative.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>openssl.bignum_is_negative( bignum )</option></term>
|
||||
<listitem>
|
||||
<para>Check sign of <literal>bignum</literal>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>openssl.bignum_bin2bn( string )</option></term>
|
||||
<listitem>
|
||||
<para>Converts binary encoded <literal>string</literal> into a <literal>bignum</literal>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>openssl.bignum_dec2bn( string )</option></term>
|
||||
<listitem>
|
||||
<para>Converts decimal encoded <literal>string</literal> into a <literal>bignum</literal>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>openssl.bignum_hex2bn( string )</option></term>
|
||||
<listitem>
|
||||
<para>Converts hex-encoded <literal>string</literal> into a <literal>bignum</literal>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>openssl.bignum_bn2bin( bignum )</option></term>
|
||||
<listitem>
|
||||
<para>Converts <literal>bignum</literal> into a binary encoded string.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>openssl.bignum_bn2dec( bignum )</option></term>
|
||||
<listitem>
|
||||
<para>Converts <literal>bignum</literal> into a decimal encoded string.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>openssl.bignum_bn2hex( bignum )</option></term>
|
||||
<listitem>
|
||||
<para>Converts <literal>bignum</literal> into a hex-encoded string.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>openssl.bignum_rand( bits )</option></term>
|
||||
<listitem>
|
||||
<para>Returns random <literal>bignum</literal> with <literal>bits</literal> bit size.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>openssl.bignum_pseudo_rand( bits )</option></term>
|
||||
<listitem>
|
||||
<para>Returns pseudo random <literal>bignum</literal> with <literal>bits</literal> bit size.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>openssl.bignum_mod_exp( a, p, m )</option></term>
|
||||
<listitem>
|
||||
<para>Returns bignum which is the result of <literal>a</literal>^<literal>p</literal> mod <literal>m</literal>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>openssl.rand_bytes( bytes )</option></term>
|
||||
<listitem>
|
||||
<para>Returns a string of <literal>bytes</literal> length with random data.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>openssl.rand_pseudo_bytes( bytes )</option></term>
|
||||
<listitem>
|
||||
<para>Returns a string of <literal>bytes</literal> length with pseudo random data.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>openssl.md2( message )</option></term>
|
||||
<listitem>
|
||||
<para>Returns the MD2 digest of <literal>message</literal>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>openssl.md4( message )</option></term>
|
||||
<listitem>
|
||||
<para>Returns the MD4 digest of <literal>message</literal>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>openssl.md5( message )</option></term>
|
||||
<listitem>
|
||||
<para>Returns the MD5 digest of <literal>message</literal>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>openssl.sha1( message )</option></term>
|
||||
<listitem>
|
||||
<para>Returns the SHA1 digest of <literal>message</literal>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>openssl.ripemd160( message )</option></term>
|
||||
<listitem>
|
||||
<para>Returns the RIPEMD160 digest of <literal>message</literal>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>openssl.digest( algorithm, message )</option></term>
|
||||
<listitem>
|
||||
<para>Returns the digest specified by <literal>algorithm</literal> of <literal>message</literal>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>openssl.hmac( algorithm, key, message )</option></term>
|
||||
<listitem>
|
||||
<para></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>openssl.encrypt( algorithm, key, iv, data, padding = false )</option></term>
|
||||
<listitem>
|
||||
<para>Encrypt <literal>data</literal> with the encryption algorithm <literal>algorithm</literal>, <literal>key</literal> and the initialization vector <literal>iv</literal>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>openssl.decrypt( algorithm, key, iv, data, padding = false )</option></term>
|
||||
<listitem>
|
||||
<para>Decrypt <literal>data</literal> with the encryption algorithm <literal>algorithm</literal>, <literal>key</literal> and the initialization vector <literal>iv</literal>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>openssl.supported_ciphers()</option></term>
|
||||
<listitem>
|
||||
<para>Returns a table with the names of the supported cipher algorithms.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>openssl.supported_digests()</option></term>
|
||||
<listitem>
|
||||
<para>Returns a table with the names of the supported digest algorithms.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>openssl.DES_string_to_key( string data )</option></term>
|
||||
<listitem>
|
||||
<para>Converts <literal>data</literal> which must be a 7-byte string into a 8-byte DES key and sets the parity.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
<indexterm class="endofrange" startref="nse-openssl-indexterm"/>
|
||||
</sect2>
|
||||
|
||||
<sect2 id="nse-lib-ipOps">
|
||||
<title>IP Operations</title>
|
||||
<indexterm><primary><varname>ipOps</varname> NSE module</primary></indexterm>
|
||||
|
||||
Reference in New Issue
Block a user