aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorHans Nilsson <[email protected]>2014-01-28 15:09:35 +0100
committerHans Nilsson <[email protected]>2014-01-28 15:09:35 +0100
commitdc7eeae35b5a9e23a08584605e71c4007dfd74ee (patch)
treeb5db58006d3c7f676105310074d7961e8952b127 /lib
parent6de916efa8df952ca1e24cccda673134982c0da0 (diff)
parent9ec3ad0d292a5b89a332cb24ed2246a3bfdf9443 (diff)
downloadotp-dc7eeae35b5a9e23a08584605e71c4007dfd74ee.tar.gz
otp-dc7eeae35b5a9e23a08584605e71c4007dfd74ee.tar.bz2
otp-dc7eeae35b5a9e23a08584605e71c4007dfd74ee.zip
Merge branch 'master' of super:otp
Diffstat (limited to 'lib')
-rw-r--r--lib/public_key/doc/src/public_key.xml49
-rw-r--r--lib/public_key/include/public_key.hrl3
-rw-r--r--lib/ssh/src/ssh.erl4
-rw-r--r--lib/ssl/src/ssl_connection.hrl2
-rw-r--r--lib/ssl/src/ssl_handshake.erl6
-rw-r--r--lib/ssl/src/ssl_internal.hrl1
6 files changed, 35 insertions, 30 deletions
diff --git a/lib/public_key/doc/src/public_key.xml b/lib/public_key/doc/src/public_key.xml
index 002f641f1d..bd19d0e434 100644
--- a/lib/public_key/doc/src/public_key.xml
+++ b/lib/public_key/doc/src/public_key.xml
@@ -71,7 +71,7 @@
<p>Use the following include directive to get access to the
records and constant macros described here and in the User's Guide.</p>
- <code> -include_lib("public_key/include/public_key.hrl"). </code>
+ <code> -include_lib("public_key/include/public_key.hrl").</code>
<p><em>Data Types </em></p>
@@ -84,44 +84,49 @@
<p><code>der_encoded() = binary()</code></p>
<p><code>pki_asn1_type() = 'Certificate' | 'RSAPrivateKey'| 'RSAPublicKey' |
- 'DSAPrivateKey' | 'DSAPublicKey' | 'DHParameter' | 'SubjectPublicKeyInfo' |
- 'PrivateKeyInfo' | 'CertificationRequest' | 'ECPrivateKey'|
- 'EcpkParameters'</code></p>
+ 'DSAPrivateKey' | 'DSAPublicKey' | 'DHParameter' |
+ 'SubjectPublicKeyInfo' | 'PrivateKeyInfo' |
+ 'CertificationRequest' | 'ECPrivateKey' | 'EcpkParameters'</code></p>
<p><code>pem_entry () = {pki_asn1_type(), binary(), %% DER or encrypted DER
- not_encrypted | cipher_info()} </code></p>
+ not_encrypted | cipher_info()}</code></p>
- <p><code>cipher_info() = {"RC2-CBC | "DES-CBC" | "DES-EDE3-CBC", crypto:rand_bytes(8)} |
- 'PBES2-params'} </code></p>
+ <p><code>cipher_info() = {"RC2-CBC | "DES-CBC" | "DES-EDE3-CBC",
+ crypto:rand_bytes(8)} | 'PBES2-params'}</code></p>
+ <p><code>public_key() = rsa_public_key() | dsa_public_key() | ec_public_key()</code></p>
+ <p><code>private_key() = rsa_public_key() | dsa_public_key() | ec_public_key()</code></p>
<p><code>rsa_public_key() = #'RSAPublicKey'{}</code></p>
- <p><code>rsa_private_key() = #'RSAPrivateKey'{} </code></p>
+ <p><code>rsa_private_key() = #'RSAPrivateKey'{}</code></p>
- <p><code>dsa_public_key() = {integer(), #'Dss-Parms'{}} </code></p>
+ <p><code>dsa_public_key() = {integer(), #'Dss-Parms'{}}</code></p>
<p><code>dsa_private_key() = #'DSAPrivateKey'{}</code></p>
- <p><code>ec_public_key() = {#'ECPoint'{}, #'EcpkParameters'{} | {namedCurve, oid()}} </code></p>
+ <p><code>ec_public_key() = {#'ECPoint'{}, #'EcpkParameters'{} |
+ {namedCurve, oid()}}</code></p>
<p><code>ec_private_key() = #'ECPrivateKey'{}</code></p>
- <p><code> public_crypt_options() = [{rsa_pad, rsa_padding()}]. </code></p>
+ <p><code>public_crypt_options() = [{rsa_pad, rsa_padding()}].</code></p>
- <p><code> rsa_padding() = 'rsa_pkcs1_padding' | 'rsa_pkcs1_oaep_padding'
- | 'rsa_no_padding'</code></p>
+ <p><code>rsa_padding() = 'rsa_pkcs1_padding' | 'rsa_pkcs1_oaep_padding' |
+ 'rsa_no_padding'</code></p>
- <p><code> rsa_digest_type() = 'md5' | 'sha' | 'sha224' | 'sha256' | 'sha384' | 'sha512' </code></p>
+ <p><code>rsa_digest_type() = 'md5' | 'sha' | 'sha224' | 'sha256' | 'sha384' |
+ 'sha512'</code></p>
- <p><code> dss_digest_type() = 'sha' </code></p>
+ <p><code>dss_digest_type() = 'sha'</code></p>
- <p><code> ecdsa_digest_type() = 'sha'| 'sha224' | 'sha256' | 'sha384' | 'sha512' </code></p>
+ <p><code>ecdsa_digest_type() = 'sha'| 'sha224' | 'sha256' | 'sha384' | 'sha512'</code></p>
- <p><code> crl_reason() = unspecified | keyCompromise | cACompromise | affiliationChanged | superseded | cessationOfOperation | certificateHold | privilegeWithdrawn | aACompromise
- </code></p>
+ <p><code>crl_reason() = unspecified | keyCompromise | cACompromise |
+ affiliationChanged | superseded | cessationOfOperation |
+ certificateHold | privilegeWithdrawn | aACompromise</code></p>
- <p><code> ssh_file() = openssh_public_key | rfc4716_public_key |
- known_hosts | auth_keys </code></p>
+ <p><code>ssh_file() = openssh_public_key | rfc4716_public_key | known_hosts |
+ auth_keys</code></p>
<!-- <p><code>policy_tree() = [Root, Children]</code></p> -->
@@ -430,7 +435,7 @@
constructing the input to this function and that should be run through the <c>verify_fun</c>.</d>
<v> CertChain = [der_encode()]</v>
<d>A list of DER encoded certificates in trust order ending with the peer certificate.</d>
- <v> Options = proplists:proplists()</v>
+ <v> Options = proplists:proplist()</v>
<v>PublicKeyInfo = {?'rsaEncryption' | ?'id-dsa',
rsa_public_key() | integer(), 'NULL' | 'Dss-Parms'{}}</v>
<v> PolicyTree = term() </v>
@@ -492,7 +497,7 @@ fun(OtpCert :: #'OTPCertificate'{}, Event :: {bad_cert, Reason :: atom()} |
<type>
<v> OTPCertificate = #'OTPCertificate'{}</v>
<v> DPAndCRLs = [{DP::#'DistributionPoint'{} ,CRL::#'CertificateList'{}}] </v>
- <v> Options = proplists:proplists()</v>
+ <v> Options = proplists:proplist()</v>
<v> CRLStatus() = valid | {bad_cert, revocation_status_undetermined} |
{bad_cert, {revoked, crl_reason()}}</v>
</type>
diff --git a/lib/public_key/include/public_key.hrl b/lib/public_key/include/public_key.hrl
index 1e882e76ee..8afc841fa6 100644
--- a/lib/public_key/include/public_key.hrl
+++ b/lib/public_key/include/public_key.hrl
@@ -88,7 +88,8 @@
-define(privilegeWithdrawn, 9).
-define(aACompromise, 10).
--type public_key() :: rsa_public_key() | dsa_public_key().
+-type public_key() :: rsa_public_key() | dsa_public_key() | ec_public_key().
+-type private_key() :: rsa_private_key() | dsa_private_key() | ec_private_key().
-type rsa_public_key() :: #'RSAPublicKey'{}.
-type rsa_private_key() :: #'RSAPrivateKey'{}.
-type dsa_private_key() :: #'DSAPrivateKey'{}.
diff --git a/lib/ssh/src/ssh.erl b/lib/ssh/src/ssh.erl
index 2685b1553b..9f571adba2 100644
--- a/lib/ssh/src/ssh.erl
+++ b/lib/ssh/src/ssh.erl
@@ -59,8 +59,8 @@ stop() ->
application:stop(ssh).
%%--------------------------------------------------------------------
--spec connect(string(), integer(), proplists:proplists()) -> {ok, pid()} | {error, term()}.
--spec connect(string(), integer(), proplists:proplists(), timeout()) -> {ok, pid()} | {error, term()}.
+-spec connect(string(), integer(), proplists:proplist()) -> {ok, pid()} | {error, term()}.
+-spec connect(string(), integer(), proplists:proplist(), timeout()) -> {ok, pid()} | {error, term()}.
%%
%% Description: Starts an ssh connection.
%%--------------------------------------------------------------------
diff --git a/lib/ssl/src/ssl_connection.hrl b/lib/ssl/src/ssl_connection.hrl
index 27489ca325..adb2e1debe 100644
--- a/lib/ssl/src/ssl_connection.hrl
+++ b/lib/ssl/src/ssl_connection.hrl
@@ -41,7 +41,7 @@
data_tag :: atom(), % ex tcp.
close_tag :: atom(), % ex tcp_closed
error_tag :: atom(), % ex tcp_error
- host :: string() | inet:ipaddress(),
+ host :: string() | inet:ip_address(),
port :: integer(),
socket :: port(),
ssl_options :: #ssl_options{},
diff --git a/lib/ssl/src/ssl_handshake.erl b/lib/ssl/src/ssl_handshake.erl
index 487dfc01d9..7b4cf8eb06 100644
--- a/lib/ssl/src/ssl_handshake.erl
+++ b/lib/ssl/src/ssl_handshake.erl
@@ -164,7 +164,7 @@ next_protocol(SelectedProtocol) ->
%%--------------------------------------------------------------------
-spec client_certificate_verify(undefined | der_cert(), binary(),
- tls_version(), term(), private_key(),
+ tls_version(), term(), public_key:private_key(),
tls_handshake_history()) ->
#certificate_verify{} | ignore | #alert{}.
%%
@@ -207,12 +207,12 @@ certificate_request(CipherSuite, CertDbHandle, CertDbRef, Version) ->
{premaster_secret, binary(), public_key_info()} |
{dh, binary()} |
{dh, {binary(), binary()}, #'DHParameter'{}, {HashAlgo::atom(), SignAlgo::atom()},
- binary(), binary(), private_key()} |
+ binary(), binary(), public_key:private_key()} |
{ecdh, #'ECPrivateKey'{}} |
{psk, binary()} |
{dhe_psk, binary(), binary()} |
{srp, {binary(), binary()}, #srp_user{}, {HashAlgo::atom(), SignAlgo::atom()},
- binary(), binary(), private_key()}) ->
+ binary(), binary(), public_key:private_key()}) ->
#client_key_exchange{} | #server_key_exchange{}.
%%
diff --git a/lib/ssl/src/ssl_internal.hrl b/lib/ssl/src/ssl_internal.hrl
index 5a823ec8a4..102215119d 100644
--- a/lib/ssl/src/ssl_internal.hrl
+++ b/lib/ssl/src/ssl_internal.hrl
@@ -35,7 +35,6 @@
-type certdb_ref() :: reference().
-type db_handle() :: term().
-type der_cert() :: binary().
--type private_key() :: #'RSAPrivateKey'{} | #'DSAPrivateKey'{} | #'ECPrivateKey'{}.
-type issuer() :: tuple().
-type serialnumber() :: integer().
-type cert_key() :: {reference(), integer(), issuer()}.