From 9a065ead487d1d655b8a73e84ee68e2c51ee21b0 Mon Sep 17 00:00:00 2001
From: Alex Wilson If a test case fails, the test server can report the exact line
- number at which it failed. There are two ways of doing this,
- either by using the The The The attribute If both the There are some macros defined in the The line macro, is quite
- essential when writing test cases. It tells the test server
- exactly what line of code that is being executed, so that it can
- report this line back if the test case fails. Use this macro at
- the beginning of every test case line of code.
- The config macro, is used to
retrieve information from the Examples of the If the The The Examples of the The line and line_trace macros are deprecated, see
+ below. In the past, ERTS did not produce line numbers when generating
+ stacktraces, test_server was thus unable to provide them when reporting
+ test failures. It had instead two different mecanisms to do it: either by
+ using the Random number generator. The module contains several different algorithms and can be
+ extended with more in the future. The current uniform
+ distribution algorithms uses the
+ The implemented algorithms are: The current default algorithm is Every time a random number is requested, a state is used to
+ calculate it and a new state produced. The state can either be
+ implicit or it can be an explicit argument and return value.
+ The functions with implicit state use the process dictionary
+ variable If a process calls The functions with explicit state never use the process
+ dictionary. Examples: This random number generator is not cryptographically
+ strong. If a strong cryptographic random number generator is
+ needed, use one of functions in the
+ Algorithm dependent state. Algorithm dependent state which can be printed or saved to file. Seeds random number generation with the given algorithm and time dependent
+ data if Otherwise recreates the exported seed in the process
+ dictionary, and returns the state.
+ See also: Seeds random number generation with the given algorithm and time dependent
+ data if Otherwise recreates the exported seed and returns the state.
+ See also: Seeds random number generation with the given algorithm and
+ integers in the process dictionary and returns
+ the state. Seeds random number generation with the given algorithm and
+ integers and returns the state. Returns the random number state in an external format.
+ To be used with Returns the random number generator state in an external format.
+ To be used with Returns a random float uniformly distributed in the value
+ range Given a state, Given an integer Given an integer Returns a standard normal deviate float (that is, the mean
+ is 0 and the standard deviation is 1) and updates the state in
+ the process dictionary. Given a state, It should be noted that this random number generator is not cryptographically
strong. If a strong cryptographic random number generator is needed for
example The new and improved This chapter briefly describes erlang records derived from ASN1
- specifications used to handle Use the following include directive to get access to the
- records and constant macros (OIDs) described in the following sections.
-
+ %% Simple usage. Creates and seeds the default algorithm
+ %% with a non-constant seed if not already done.
+ R0 = rand:uniform(),
+ R1 = rand:uniform(),
+
+ %% Use a given algorithm.
+ _ = rand:seed(exs1024),
+ R2 = rand:uniform(),
+
+ %% Use a given algorithm with a constant seed.
+ _ = rand:seed(exs1024, {123, 123534, 345345}),
+ R3 = rand:uniform(),
+
+ %% Use the functional api with non-constant seed.
+ S0 = rand:seed_s(exsplus),
+ {R4, S1} = rand:uniform_s(S0),
+
+ %% Create a standard normal deviate.
+ {SND0, S2} = rand:normal_s(S1),
+
+
+
-include_lib("public_key/include/public_key.hrl").
- The used ASN1 specifications are available
The used ASN.1 specifications are available in the
Common non standard erlang
- data types used to described the record fields in the
- below sections are defined in
Common non-standard Erlang
+ data types used to describe the record fields in the
+ following sections are defined in the
=
=
=
Erlang representation of PKIX certificates derived from ASN.1 + specifications and RFC 5280 are as follows:
#'Certificate'{
tbsCertificate, % #'TBSCertificate'{}
@@ -117,8 +132,7 @@ semantics, please see
+ }.
#'OTPCertificate'{
@@ -143,20 +157,20 @@ semantics, please see
+ }.
-Here,
The available OID names are as follows:
The data type
#'AttributeTypeAndValue'{
type, % id_attributes()
value % term()
- }.
-
+ }.
-The attribute OID name atoms and their corresponding value types +are as follows:
The data types
#'Validity'{
notBefore, % time()
@@ -271,13 +291,12 @@ oid names see table below. Ex: ?'id-dsa-with-sha1'
#'SubjectPublicKeyInfoAlgorithm'{
algorithm, % id_public_key_algorithm()
parameters % public_key_params()
- }.
-
+ }.
-The public-key algorithm OID name atoms are as follows:
@@ -302,8 +321,7 @@ oid names see table below. Ex: ?'id-dsa-with-sha1'
extnID, % id_extensions() | oid()
critical, % boolean()
extnValue % der_encoded()
- }.
-
+ }.
The standard certificate extensions OID name atoms and their + corresponding value types are as follows:
+Here:
+And for
@@ -501,8 +531,7 @@ oid names see table below. Ex: ?'id-dsa-with-sha1'
[#AttributeTypeAndValue{}]}
reasons, % [dist_reason()]
cRLIssuer % [general_name()]
- }).
-
+ }).
The private internet extensions OID name atoms and their corresponding value + types are as follows:
+Here, the data type
#'IssuingDistributionPoint'{
distributionPoint, % {fullName, [general_name()]} | {nameRelativeToCRLIssuer,
@@ -608,18 +647,19 @@ oid names see table below. Ex: ?'id-dsa-with-sha1'
onlySomeReasons, % [dist_reason()]
indirectCRL, % boolean()
onlyContainsAttributeCerts % boolean()
- }).
-
+ }).
The CRL entry extensions OID name atoms and their corresponding value types are as follows:
Here:
+Erlang representation of a PKCS#10 certification request + derived from ASN.1 specifications and RFC 5280 are as follows:
#'CertificationRequest'{
certificationRequestInfo #'CertificationRequestInfo'{},
@@ -682,8 +736,7 @@ oid names see table below. Ex: ?'id-dsa-with-sha1'
#'AttributePKCS-10'{
type = oid(),
values = [der_encoded()]
-}
-
+}
public_key deals with public key related file formats, digital
- signatures and The
It is assumed that the reader has a basic understanding - of the concepts of using public keys and digital certificates.
+It is assumed that the reader is familiar with the Erlang programming + language and has a basic understanding of the concepts of using public-keys + and digital certificates.
The public_key decode and encode functions will try to use the NIFs - which are in the ASN1 compilers runtime modules if they can be found. - So for the best performance you want to have the ASN1 application in the - path of your system.
+The
This application provides an API to public key infrastructure +
This application provides an API to public-key infrastructure
from
This module provides functions to handle public key infrastructure. It can - encode/decode different file formats (PEM, openssh), sign and verify digital signatures and validate - certificate paths and certificate revocation lists. +
This module provides functions to handle public-key infrastructure. It can + encode/decode different file formats (PEM, OpenSSH), sign and verify digital signatures, + and validate certificate paths and certificate revocation lists.
All records used in this manual
+ All records used in this Reference Manual
are generated from ASN.1 specifications
and are documented in the User's Guide. See
Use the following include directive to get access to the - records and constant macros described here and in the User's Guide.
+ records and constant macros described here and in the User's Guide: -include_lib("public_key/include/public_key.hrl").
- Data Types
- -oid() - Object Identifier, a tuple of integers as generated by the ASN1 compiler.
boolean() = true | false
string() = [bytes()]
der_encoded() = binary()
pki_asn1_type() = 'Certificate' | 'RSAPrivateKey'| 'RSAPublicKey' |
- 'DSAPrivateKey' | 'DSAPublicKey' | 'DHParameter' |
- 'SubjectPublicKeyInfo' | 'PrivateKeyInfo' |
- 'CertificationRequest' | 'ECPrivateKey' | 'EcpkParameters'
pem_entry () = {pki_asn1_type(), binary(), %% DER or encrypted DER
- not_encrypted | cipher_info()}
cipher_info() = {"RC2-CBC | "DES-CBC" | "DES-EDE3-CBC",
- crypto:rand_bytes(8) | {#'PBEParameter{}, digest_type()} |#'PBES2-params'{}}
public_key() = rsa_public_key() | dsa_public_key() | ec_public_key()
private_key() = rsa_private_key() | dsa_private_key() | ec_private_key()
rsa_public_key() = #'RSAPublicKey'{}
rsa_private_key() = #'RSAPrivateKey'{}
dsa_public_key() = {integer(), #'Dss-Parms'{}}
dsa_private_key() = #'DSAPrivateKey'{}
ec_public_key() = {#'ECPoint'{}, #'EcpkParameters'{} |
- {namedCurve, oid()}}
ec_private_key() = #'ECPrivateKey'{}
public_crypt_options() = [{rsa_pad, rsa_padding()}].
rsa_padding() = 'rsa_pkcs1_padding' | 'rsa_pkcs1_oaep_padding' |
- 'rsa_no_padding'
The following data types are used in the functions for
digest_type() - Union of below digest types
Object identifier, a tuple of integers as generated by the
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
Union of
=
=
=
=
=
=
rsa_digest_type() = 'md5' | 'sha' | 'sha224' | 'sha256' | 'sha384' |
- 'sha512'
dss_digest_type() = 'sha'
ecdsa_digest_type() = 'sha'| 'sha224' | 'sha256' | 'sha384' | 'sha512'
crl_reason() = unspecified | keyCompromise | cACompromise |
- affiliationChanged | superseded | cessationOfOperation |
- certificateHold | privilegeWithdrawn | aACompromise
issuer_name() = {rdnSequence,[#'AttributeTypeAndValue'{}]}
ssh_file() = openssh_public_key | rfc4716_public_key | known_hosts |
- auth_keys
Compute shared secret
+Computes shared secret.
Public key decryption using the private key. See also
Public key decryption using the public key. See also
Decodes a public key ASN.1 DER encoded entity.
+Decodes a public-key ASN.1 DER encoded entity.
Encodes a public key entity with ASN.1 DER encoding.
+Encodes a public-key entity with ASN.1 DER encoding.
Generates a new keypair
+Generates a new keypair.
Decode PEM binary data and return +
Decodes PEM binary data and returns entries as ASN.1 DER encoded entities.
Creates a PEM binary
+Creates a PEM binary.
Decodes a PEM entry. pem_decode/1 returns a list of PEM - entries. Note that if the PEM entry is of type - 'SubjectPublickeyInfo' it will be further decoded to an - rsa_public_key() or dsa_public_key().
+Decodes a PEM entry.
Creates a PEM entry that can be feed to pem_encode/1.
+Creates a PEM entry that can be feed to
Public key encryption using the private key. +
Public-key encryption using the private key.
See also
Public key encryption using the public key. See also
Public-key encryption using the public key. See also
Decodes an ASN.1 DER encoded PKIX certificate. The otp option - will use the customized ASN.1 specification OTP-PKIX.asn1 for +
Decodes an ASN.1 DER-encoded PKIX certificate. Option
DER encodes a PKIX x509 certificate or part of such a certificate. This function must be used for encoding certificates or parts of certificates - that are decoded/created in the otp format, whereas for the plain format this - function will directly call der_encode/2.
+ that are decoded/created in the Checks if
Checks if
Checks if a Certificate is a fixed Diffie-Hellman Cert.
+Checks if a certificate is a fixed Diffie-Hellman certificate.
Checks if a Certificate is self signed.
+Checks if a certificate is self-signed.
Returns the issuer id.
+Returns the issuer id.
Normalizes a issuer name so that it can be easily +
Normalizes an issuer name so that it can be easily compared to another issuer name.
Performs a basic path validation according to
Available options are:
+Available options:
+The fun should be defined as:
+The fun must be defined as:
fun(OtpCert :: #'OTPCertificate'{},
@@ -478,53 +536,53 @@ fun(OtpCert :: #'OTPCertificate'{},
{unknown, UserState :: term()}.
- If the verify callback fun returns {fail, Reason}, the +
If the verify callback fun returns
Possible reasons for a bad certificate are:
+Possible reasons for a bad certificate:
Certificate is no longer valid as its expiration date has passed.
Certificate issuer name does not match the name of the issuer certificate in the chain.
Certificate was not signed by its issuer certificate in the chain.
Invalid Subject Alternative Name extension.
Certificate, required to have the basic constraints extension, does not have + a basic constraints extension.
Certificate key is used in an invalid way according to the key-usage extension.
Certificate has been revoked.
Application-specific error reason that is to be checked by the
Performs CRL validation. It is intended to be called from +
Performs CRL validation. It is intended to be called from
the verify fun of
Available options:
+Available options are:
+The fun has the following type spec:
+The fun has the following type specification:
fun(#'DistributionPoint'{}, #'CertificateList'{}) ->
#'CertificateList'{}
- The fun should use the information in the distribution point to acesses - the lates possible version of the CRL. If this fun is not specified - public_key will use the default implementation: +
The fun uses the information in the distribution point to access
+ the latest possible version of the CRL. If this fun is not specified,
+
fun(_DP, CRL) -> CRL end
The fun has the following type spec:
+The fun has the following type specification:
fun(#'DistributionPoint'{}, #'CertificateList'{},
{rdnSequence,[#'AttributeTypeAndValue'{}]}, term()) ->
{ok, #'OTPCertificate'{}, [der_encoded]}
- The fun should return the root certificate and certificate chain +
The fun returns the root certificate and certificate chain that has signed the CRL.
fun(DP, CRL, Issuer, UserState) -> {ok, RootCert, CertChain}
@@ -635,83 +696,83 @@ fun(#'DistributionPoint'{}, #'CertificateList'{},
Signs a 'OTPTBSCertificate'. Returns the corresponding - der encoded certificate.
+Signs an 'OTPTBSCertificate'. Returns the corresponding + DER-encoded certificate.
Translates signature algorithm oid to erlang digest and signature types. +
Translates signature algorithm OID to Erlang digest and signature types.
Verify PKIX x.509 certificate signature.
+Verifies PKIX x.509 certificate signature.
Creates a digital signature.
+Creates a digital signature.
Decodes a ssh file-binary. In the case of know_hosts or - auth_keys the binary may include one or more lines of the +
Decodes an SSH file-binary. In the case of
{headers, [{string(), utf8_string()}]}
{bits, integer()} - In SSH version 1 files.
{bits, integer()} - In SSH version 1 files.
Encodes a list of ssh file entries (public keys and attributes) to a binary. Possible
- attributes depends on the file type, see
Encodes a list of SSH file entries (public keys and attributes) to a binary. Possible
+ attributes depend on the file type, see
Verifies a digital signature
+Veryfies a digital signature.
This chapter briefly describes Erlang records derived from ASN1 +
This section briefly describes Erlang records derived from ASN.1 specifications used to handle public and private keys. - The intent is to describe the data types - and not to specify the semantics of each component. For information on the - semantics, please see the relevant standards and RFCs.
+ The scope is to describe the data types of each component, + not the semantics. For information on the + semantics, refer to the relevant standards and RFCs.Use the following include directive to get access to the - records and constant macros described in the following sections.
+ records and constant macros described in the following sections: -include_lib("public_key/include/public_key.hrl").
@@ -49,13 +49,15 @@
Common non-standard Erlang
- data types used to described the record fields in the
- below sections are defined in
RSA as defined by the PKCS-1 standard and
#'RSAPublicKey'{
@@ -80,15 +82,15 @@
prime, % integer()
exponent, % integer()
coefficient % integer()
- }.
-
+ }.
The DSA as defined by the
+
#'DSAPrivateKey',{
@@ -104,13 +106,13 @@
p, % integer()
q, % integer()
g % integer()
- }.
-
+ }.
The Elliptic Curve (ECC) as defined by
#'ECPrivateKey'{
diff --git a/lib/public_key/doc/src/records.xml b/lib/public_key/doc/src/records.xml
new file mode 100644
index 0000000000..75265791af
--- /dev/null
+++ b/lib/public_key/doc/src/records.xml
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+ 2008
+ 2014
+ Ericsson AB, All Rights Reserved
+
+
+ The contents of this file are subject to the Erlang Public License,
+ Version 1.1, (the "License"); you may not use this file except in
+ compliance with the License. You should have received a copy of the
+ Erlang Public License along with this software. If not, it can be
+ retrieved online at http://www.erlang.org/.
+
+ Software distributed under the License is distributed on an "AS IS"
+ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ the License for the specific language governing rights and limitations
+ under the License.
+
+ The Initial Developer of the Original Code is Ericsson AB.
+
+
+ Records
+ Tommy MÃ¥nevik
+
+ 2015-04-01
+
+ records.xml
+
+
+ This section describes Erlang records derived from ASN.1 specifications,
+ used to handle the following:
+
+
+ - Public and private keys
+ X509 certificates and CertificationRequest
+
+
+
+
+
+
+
+
diff --git a/lib/public_key/doc/src/ref_man.xml b/lib/public_key/doc/src/ref_man.xml
index b7078891d4..9c80cf4b9f 100644
--- a/lib/public_key/doc/src/ref_man.xml
+++ b/lib/public_key/doc/src/ref_man.xml
@@ -31,8 +31,8 @@
ref_man.xml
- Provides functions to handle public key infrastructure
- from RFC 3280 (X.509 certificates) and some parts of the PKCS-standard.
+
The public_key application provides functions to handle public-key infrastructure
+ from RFC 3280 (X.509 certificates) and parts of the PKCS standard.
diff --git a/lib/public_key/doc/src/using_public_key.xml b/lib/public_key/doc/src/using_public_key.xml
index 450bd7e35f..69b8c0dcb9 100644
--- a/lib/public_key/doc/src/using_public_key.xml
+++ b/lib/public_key/doc/src/using_public_key.xml
@@ -22,27 +22,27 @@
Getting Started
+
+
+
+
using_public_key.xml
-
- General information
+ This section describes examples of how to use the
+ public_key API. Keys and certificates used in the following
+ sections are generated only for testing the public_key
+ application.
- This chapter is dedicated to showing some
- examples of how to use the public_key API. Keys and certificates
- used in the following sections are generated only for the purpose
- of testing the public key application.
+ Some shell printouts in the following examples
+ are abbreviated for increased readability.
- Note that some shell printouts, in the following examples,
- have been abbreviated for increased readability.
-
-
-
+
- PEM files
- Public key data (keys, certificates etc) may be stored in PEM format. PEM files
- comes from the Private Enhanced Mail Internet standard and has a
- structure that looks like this:
+ PEM Files
+ Public-key data (keys, certificates, and so on) can be stored in
+ Privacy Enhanced Mail (PEM) format.
+ The PEM files have the following structure:
<text>
-----BEGIN <SOMETHING>-----
@@ -51,19 +51,20 @@
-----END <SOMETHING>-----
<text>
- A file can contain several BEGIN/END blocks. Text lines between
- blocks are ignored. Attributes, if present, are currently ignored except
- for Proc-Type and DEK-Info that are used when the DER data is
- encrypted.
+ A file can contain several BEGIN/END blocks. Text lines between
+ blocks are ignored. Attributes, if present, are ignored except
+ for Proc-Type and DEK-Info , which are used when DER
+ data is encrypted.
- DSA private key
+ DSA Private Key
+ A DSA private key can look as follows:
+ File handling is not done by the public_key application.
- Note file handling is not done by the public_key application.
1> {ok, PemBin} = file:read_file("dsa.pem").
{ok,<<"-----BEGIN DSA PRIVATE KEY-----\nMIIBuw"...>>}
- This PEM file only has one entry, a private DSA key.
+ The following PEM file has only one entry, a private DSA key:
2> [DSAEntry] = public_key:pem_decode(PemBin).
[{'DSAPrivateKey',<<48,130,1,187,2,1,0,2,129,129,0,183,
179,230,217,37,99,144,157,21,228,204,
@@ -80,21 +81,20 @@
- RSA private key encrypted with a password.
+ RSA Private Key with Password
+ An RSA private key encrypted with a password can look as follows:
1> {ok, PemBin} = file:read_file("rsa.pem").
{ok,<<"Bag Attribut"...>>}
- This PEM file only has one entry a private RSA key.
+ The following PEM file has only one entry, a private RSA key:
2>[RSAEntry] = public_key:pem_decode(PemBin).
[{'RSAPrivateKey',<<224,108,117,203,152,40,15,77,128,126,
221,195,154,249,85,208,202,251,109,
119,120,57,29,89,19,9,...>>,
- {"DES-EDE3-CBC",<<"kÙeø¼pµL">>}}]
-
-
+ {"DES-EDE3-CBC",<<"kÙeø¼pµL">>}}]
- In this example the password is "abcd1234".
+In this following example, the password is
3> Key = public_key:pem_entry_decode(RSAEntry, "abcd1234").
#'RSAPrivateKey'{version = 'two-prime',
modulus = 1112355156729921663373...2737107,
@@ -110,11 +110,12 @@
X509 Certificates
+ The following is an example of X509 certificates:
1> {ok, PemBin} = file:read_file("cacerts.pem").
{ok,<<"-----BEGIN CERTIFICATE-----\nMIIC7jCCAl"...>>}
- This file includes two certificates
+ The following file includes two certificates:
2> [CertEntry1, CertEntry2] = public_key:pem_decode(PemBin).
[{'Certificate',<<48,130,2,238,48,130,2,87,160,3,2,1,2,2,
9,0,230,145,97,214,191,2,120,150,48,13,
@@ -124,7 +125,7 @@
1,48,13,6,9,42,134,72,134,247,...>>>,
not_encrypted}]
- Certificates may of course be decoded as usual ...
+ Certificates can be decoded as usual:
2> Cert = public_key:pem_entry_decode(CertEntry1).
#'Certificate'{
tbsCertificate =
@@ -212,22 +213,23 @@
signature =
{0,
<<163,186,7,163,216,152,63,47,154,234,139,73,154,96,120,
- 165,2,52,196,195,109,167,192,...>>}}
-
-
- Parts of certificates can be decoded with
- public_key:der_decode/2 using that parts ASN.1 type.
- Although application specific certificate
- extension requires application specific ASN.1 decode/encode-functions.
- Example, the first value of the rdnSequence above is of ASN.1 type
- 'X520CommonName'. ({2,5,4,3} = ?id-at-commonName)
+ 165,2,52,196,195,109,167,192,...>>}}
+
+ Parts of certificates can be decoded with
+
public_key:der_decode('X520CommonName', <<19,8,101,114,108,97,110,103,67,65>>).
{printableString,"erlangCA"}
- ... but certificates can also be decode using the pkix_decode_cert/2 that - can customize and recursively decode standard parts of a certificate.
+However, certificates can also be decoded using
3>{_, DerCert, _} = CertEntry1.
+
4> public_key:pkix_decode_cert(DerCert, otp).
#'OTPCertificate'{
tbsCertificate =
@@ -316,28 +318,26 @@
signature =
{0,
<<163,186,7,163,216,152,63,47,154,234,139,73,154,96,120,
- 165,2,52,196,195,109,167,192,...>>}}
-
+ 165,2,52,196,195,109,167,192,...>>}}
- This call is equivalent to public_key:pem_entry_decode(CertEntry1)
+This call is equivalent to
5> public_key:pkix_decode_cert(DerCert, plain).
-#'Certificate'{ ...}
-
+#'Certificate'{ ...}
If you have public key data and and want to create a PEM file - you can do that by calling the functions - public_key:pem_entry_encode/2 and pem_encode/1 and then saving the - result to a file. For example assume you have PubKey = - 'RSAPublicKey'{} then you can create a PEM-"RSA PUBLIC KEY" file - (ASN.1 type 'RSAPublicKey') or a PEM-"PUBLIC KEY" file - ('SubjectPublicKeyInfo' ASN.1 type).
+If you have public-key data and want to create a PEM file
+ this can be done by calling functions
+
The second element of the PEM-entry will be the ASN.1 DER encoded - key data.
+The second element of the PEM-entry is the ASN.1
1> PemEntry = public_key:pem_entry_encode('RSAPublicKey', RSAPubKey).
{'RSAPublicKey', <<48,72,...>>, not_encrypted}
@@ -348,7 +348,7 @@
3> file:write_file("rsa_pub_key.pem", PemBin).
ok
- or
+or:
1> PemEntry = public_key:pem_entry_encode('SubjectPublicKeyInfo', RSAPubKey).
{'SubjectPublicKeyInfo', <<48,92...>>, not_encrypted}
@@ -363,96 +363,106 @@ ok
Suppose you have PrivateKey = #'RSAPrivateKey{}' and the - plaintext Msg = binary() and the corresponding public key - PublicKey = #'RSAPublicKey'{} then you can do the following. - Note that you normally will only do one of the encrypt or - decrypt operations and the peer will do the other. -
- -Encrypt with the private key
+Suppose you have the followwing private key and a corresponding public key:
+Then you can proceed as follows:
+ +Encrypt with the private key:
RsaEncrypted = public_key:encrypt_private(Msg, PrivateKey),
Msg = public_key:decrypt_public(RsaEncrypted, PublicKey),
- Encrypt with the public key
+Encrypt with the public key:
RsaEncrypted = public_key:encrypt_public(Msg, PublicKey),
Msg = public_key:decrypt_private(RsaEncrypted, PrivateKey),
+
+ You normally do only one of the encrypt or decrypt operations, + and the peer does the other.
Suppose you have PrivateKey = #'RSAPrivateKey{}'or - #'DSAPrivateKey'{} and the plaintext Msg = binary() and the - corresponding public key PublicKey = #'RSAPublicKey'{} or - {integer(), #'DssParams'{}} then you can do the following. Note - that you normally will only do one of the sign or verify operations - and the peer will do the other.
+Suppose you have the following private key and a corresponding public key:
+ +Then you can proceed as follows:
Signature = public_key:sign(Msg, sha, PrivateKey),
true = public_key:verify(Msg, sha, Signature, PublicKey),
- It might be appropriate to calculate the message digest before - calling sign or verify and then you can use the none as second - argument.
+You normally do only one of the sign or verify operations, + and the peer does the other.
It can be appropriate to calculate the message digest before
+ calling
Digest = crypto:sha(Msg),
Signature = public_key:sign(Digest, none, PrivateKey),
-true = public_key:verify(Digest, none, Signature, PublicKey),
-
+true = public_key:verify(Digest, none, Signature, PublicKey),
SSH typically uses PEM files for private keys but has its - own file format for storing public keys. The erlang public_key - application can be used to parse the content of SSH public key files.
+ own file format for storing public keys. TheRFC 4716 SSH files looks confusingly like PEM files, - but there are some differences.
+ but there are some differences:1> {ok, SshBin} = file:read_file("ssh2_rsa_pub").
{ok, <<"---- BEGIN SSH2 PUBLIC KEY ----\nAAAA"...>>}
- This is equivalent to calling public_key:ssh_decode(SshBin, rfc4716_public_key). +
This is equivalent to calling
2> public_key:ssh_decode(SshBin, public_key).
[{#'RSAPublicKey'{modulus = 794430685...91663,
- publicExponent = 35}, []}]
-
+ publicExponent = 35}, []}]
OpenSSH public-key format looks as follows:
1> {ok, SshBin} = file:read_file("openssh_dsa_pub").
{ok,<<"ssh-dss AAAAB3Nza"...>>}
- This is equivalent to calling public_key:ssh_decode(SshBin, openssh_public_key). +
This is equivalent to calling
2> public_key:ssh_decode(SshBin, public_key).
[{{15642692...694280725,
#'Dss-Parms'{p = 17291273936...696123221,
q = 1255626590179665817295475654204371833735706001853,
g = 10454211196...480338645}},
- [{comment,"dhopson@VMUbuntu-DSH"}]}]
-
+ [{comment,"dhopson@VMUbuntu-DSH"}]}]
Known hosts - OpenSSH format looks as follows:
1> {ok, SshBin} = file:read_file("known_hosts").
{ok,<<"hostname.domain.com,192.168.0.1 ssh-rsa AAAAB...>>}
- Returns a list of public keys and their related attributes - each pair of key and attributes corresponds to one entry in - the known hosts file.
+Returns a list of public keys and their related attributes. + Each pair of key and attribute corresponds to one entry in + the known hosts file:
2> public_key:ssh_decode(SshBin, known_hosts).
[{#'RSAPublicKey'{modulus = 1498979460408...72721699,
@@ -461,19 +471,19 @@ true = public_key:verify(Digest, none, Signature, PublicKey),
{#'RSAPublicKey'{modulus = 14989794604088...2721699,
publicExponent = 35},
[{comment,"foo@bar.com"},
- {hostnames,["|1|BWO5qDxk/cFH0wa05JLdHn+j6xQ=|rXQvIxh5cDD3C43k5DPDamawVNA="]}]}]
-
+ {hostnames,["|1|BWO5qDxk/cFH0wa05JLdHn+j6xQ=|rXQvIxh5cDD3C43k5DPDamawVNA="]}]}]
Authorized keys - OpenSSH format looks as follows:
1> {ok, SshBin} = file:read_file("auth_keys").
{ok, <<"command=\"dump /home\",no-pty,no-port-forwarding ssh-rsa AAA...>>}
- Returns a list of public keys and their related attributes - each pair of key and attributes corresponds to one entry in - the authorized key file.
+Returns a list of public keys and their related attributes. + Each pair of key and attribute corresponds to one entry in + the authorized key file:
2> public_key:ssh_decode(SshBin, auth_keys).
[{#'RSAPublicKey'{modulus = 794430685...691663,
@@ -485,16 +495,15 @@ true = public_key:verify(Digest, none, Signature, PublicKey),
#'Dss-Parms'{p = 17291273936185...763696123221,
q = 1255626590179665817295475654204371833735706001853,
g = 10454211195705...60511039590076780999046480338645}},
- [{comment,"dhopson@VMUbuntu-DSH"}]}]
-
+ [{comment,"dhopson@VMUbuntu-DSH"}]}]
If you got a public key
N> SshBin = public_key:ssh_encode([{PubKey, Attributes}], openssh_public_key),
<<"ssh-rsa "...>>
N+1> file:write_file("id_rsa.pub", SshBin).
--
cgit v1.2.3
From f1484e1bd971d75bb232bc4f50d25473e1046e65 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?=
Date: Thu, 7 May 2015 15:45:43 +0200
Subject: code: Make load_native_code_for_all_loaded/0 comply to spec
7309ff4c38325 introduced a mismatch between
load_native_code_for_all_loaded/0 and its spec. We could just delete
spec, but it is cleaner to ensure that the function always returns
'ok'.
Noticed-by: Tuncer Ayaz
---
lib/kernel/src/code.erl | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
(limited to 'lib')
diff --git a/lib/kernel/src/code.erl b/lib/kernel/src/code.erl
index a8cbdf9667..d73d1ff281 100644
--- a/lib/kernel/src/code.erl
+++ b/lib/kernel/src/code.erl
@@ -564,7 +564,8 @@ load_native_code_for_all_loaded() ->
catch
_:_ ->
ok
- end.
+ end,
+ ok.
load_all_native(Loaded, ChunkTag) ->
catch load_all_native_1(Loaded, ChunkTag).
--
cgit v1.2.3
From 25575183ca581a080478ad499e308a76e44e4def Mon Sep 17 00:00:00 2001
From: Ingela Anderton Andin
Date: Fri, 24 Apr 2015 17:42:54 +0200
Subject: public_key: Change structure to what editor intended
---
lib/public_key/doc/src/Makefile | 3 +-
lib/public_key/doc/src/cert_records.xml | 743 -----------------------
lib/public_key/doc/src/public_key.xml | 3 +-
lib/public_key/doc/src/public_key_records.xml | 155 -----
lib/public_key/doc/src/records.xml | 821 +++++++++++++++++++++++++-
5 files changed, 804 insertions(+), 921 deletions(-)
delete mode 100644 lib/public_key/doc/src/cert_records.xml
delete mode 100644 lib/public_key/doc/src/public_key_records.xml
(limited to 'lib')
diff --git a/lib/public_key/doc/src/Makefile b/lib/public_key/doc/src/Makefile
index 17fb67e95c..2adc13a5cf 100644
--- a/lib/public_key/doc/src/Makefile
+++ b/lib/public_key/doc/src/Makefile
@@ -42,8 +42,7 @@ XML_REF6_FILES =
XML_PART_FILES = part.xml part_notes.xml
XML_CHAPTER_FILES = \
introduction.xml \
- public_key_records.xml \
- cert_records.xml \
+ records.xml \
using_public_key.xml \
notes.xml
diff --git a/lib/public_key/doc/src/cert_records.xml b/lib/public_key/doc/src/cert_records.xml
deleted file mode 100644
index 4d4533fe21..0000000000
--- a/lib/public_key/doc/src/cert_records.xml
+++ /dev/null
@@ -1,743 +0,0 @@
-
-
-
-
-
-
- 2008
- 2014
- Ericsson AB, All Rights Reserved
-
-
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
-
- The Initial Developer of the Original Code is Ericsson AB.
-
-
- Certificate Records
- Ingela Anderton Andin
-
-
-
-
- 2008-02-06
- A
- cert_records.xml
-
-
- This section briefly describes Erlang records derived from ASN.1
- specifications used to handle X509 certificates and CertificationRequest .
- The scope is to describe the data types of each component,
- not the semantics. For information on the semantics, refer to RFC 5280 and
- PKCS-10 .
-
-
- Use the following include directive to get access to the
- records and constant macros (OIDs) described in the following sections:
-
- -include_lib("public_key/include/public_key.hrl").
-
- The used ASN.1 specifications are available in the asn1 subdirectory
- of the public_key application.
-
-
- Common Data Types
-
- Common non-standard Erlang
- data types used to describe the record fields in the
- following sections are defined in the public_key Reference Manual , or
- follows here:
-
-
- time()
- = uct_time() | general_time()
-
- uct_time()
- = {utcTime, "YYMMDDHHMMSSZ"}
-
- general_time()
- = {generalTime, "YYYYMMDDHHMMSSZ"}
-
- general_name()
- - =
{rfc822Name, string()}
- | {dNSName, string()}
- | {x400Address, string()}
- | {directoryName, {rdnSequence, [#AttributeTypeAndValue'{}]}}
- | {eidPartyName, special_string()}
- | {eidPartyName, special_string(), special_string()}
- | {uniformResourceIdentifier, string()}
- | {ipAddress, string()}
- | {registeredId, oid()}
- | {otherName, term()}
-
-
- special_string()
- - =
{teletexString, string()}
- | {printableString, string()}
- | {universalString, string()}
- | {utf8String, binary()}
- | {bmpString, string()}
-
-
- dist_reason()
- - =
unused
- | keyCompromise
- | cACompromise
- | affiliationChanged
- | superseded
- | cessationOfOperation
- | certificateHold
- | privilegeWithdrawn
- | aACompromise
-
-
-
-
-
-
- PKIX Certificates
- Erlang representation of PKIX certificates derived from ASN.1
- specifications and RFC 5280 are as follows:
-
-#'Certificate'{
- tbsCertificate, % #'TBSCertificate'{}
- signatureAlgorithm, % #'AlgorithmIdentifier'{}
- signature % bitstring()
- }.
-
-#'TBSCertificate'{
- version, % v1 | v2 | v3
- serialNumber, % integer()
- signature, % #'AlgorithmIdentifier'{}
- issuer, % {rdnSequence, [#AttributeTypeAndValue'{}]}
- validity, % #'Validity'{}
- subject, % {rdnSequence, [#AttributeTypeAndValue'{}]}
- subjectPublicKeyInfo, % #'SubjectPublicKeyInfo'{}
- issuerUniqueID, % binary() | asn1_novalue
- subjectUniqueID, % binary() | asn1_novalue
- extensions % [#'Extension'{}]
- }.
-
-#'AlgorithmIdentifier'{
- algorithm, % oid()
- parameters % der_encoded()
- }.
-
-
-#'OTPCertificate'{
- tbsCertificate, % #'OTPTBSCertificate'{}
- signatureAlgorithm, % #'SignatureAlgorithm'
- signature % bitstring()
- }.
-
-#'OTPTBSCertificate'{
- version, % v1 | v2 | v3
- serialNumber, % integer()
- signature, % #'SignatureAlgorithm'
- issuer, % {rdnSequence, [#AttributeTypeAndValue'{}]}
- validity, % #'Validity'{}
- subject, % {rdnSequence, [#AttributeTypeAndValue'{}]}
- subjectPublicKeyInfo, % #'OTPSubjectPublicKeyInfo'{}
- issuerUniqueID, % binary() | asn1_novalue
- subjectUniqueID, % binary() | asn1_novalue
- extensions % [#'Extension'{}]
- }.
-
-#'SignatureAlgorithm'{
- algorithm, % id_signature_algorithm()
- parameters % asn1_novalue | #'Dss-Parms'{}
- }.
-
-Here, id_signature_algorithm() = ?OID name, for available OID names, for example
-?id-dsa-with-sha1 . That is, by prepending "?" to the OID name, represented as an Erlang atom.
-The available OID names are as follows:
-
-
- OID Name |
-
-
- id-dsa-with-sha1 |
-
-
- id-dsaWithSHA1 (ISO or OID to above) |
-
-
- md2WithRSAEncryption |
-
-
- md5WithRSAEncryption |
-
-
- sha1WithRSAEncryption |
-
-
- sha-1WithRSAEncryption (ISO or OID to above) |
-
-
- sha224WithRSAEncryption |
-
-
- sha256WithRSAEncryption |
-
-
- sha512WithRSAEncryption |
-
-
- ecdsa-with-SHA1 |
-
- Signature Algorithm OIDs
-
-
-The data type 'AttributeTypeAndValue' , is represented as
- the following erlang record:
-
-
-#'AttributeTypeAndValue'{
- type, % id_attributes()
- value % term()
- }.
-
-The attribute OID name atoms and their corresponding value types
-are as follows:
-
-
- OID Name |
- Value Type |
-
-
- id-at-name |
- special_string() |
-
-
- id-at-surname |
- special_string() |
-
-
- id-at-givenName |
- special_string() |
-
-
- id-at-initials |
- special_string() |
-
-
- id-at-generationQualifier |
- special_string() |
-
-
- id-at-commonName |
- special_string() |
-
-
- id-at-localityName |
- special_string() |
-
-
- id-at-stateOrProvinceName |
- special_string() |
-
-
- id-at-organizationName |
- special_string() |
-
-
- id-at-title |
- special_string() |
-
-
- id-at-dnQualifier |
- {printableString, string()} |
-
-
- id-at-countryName |
- {printableString, string()} |
-
-
- id-at-serialNumber |
- {printableString, string()} |
-
-
- id-at-pseudonym |
- special_string() |
-
- Attribute OIDs
-
-
-The data types 'Validity' , 'SubjectPublicKeyInfo' , and
-'SubjectPublicKeyInfoAlgorithm' are represented as the following Erlang records:
-
-
-#'Validity'{
- notBefore, % time()
- notAfter % time()
- }.
-
-#'SubjectPublicKeyInfo'{
- algorithm, % #AlgorithmIdentifier{}
- subjectPublicKey % binary()
- }.
-
-#'SubjectPublicKeyInfoAlgorithm'{
- algorithm, % id_public_key_algorithm()
- parameters % public_key_params()
- }.
-
-The public-key algorithm OID name atoms are as follows:
-
-
- OID Name |
-
-
- rsaEncryption |
-
-
- id-dsa |
-
-
- dhpublicnumber |
-
-
- id-keyExchangeAlgorithm |
-
-
- id-ecPublicKey |
-
- Public-Key Algorithm OIDs
-
-
-
-#'Extension'{
- extnID, % id_extensions() | oid()
- critical, % boolean()
- extnValue % der_encoded()
- }.
-
-id_extensions()
- Standard Certificate Extensions ,
- Private Internet Extensions ,
- CRL Extensions and
- CRL Entry Extensions .
-
-
-
-
-
-
- Standard Certificate Extensions
-
- The standard certificate extensions OID name atoms and their
- corresponding value types are as follows:
-
-
-
- OID Name |
- Value Type |
-
-
- id-ce-authorityKeyIdentifier |
- #'AuthorityKeyIdentifier'{} |
-
-
- id-ce-subjectKeyIdentifier |
- oid() |
-
-
- id-ce-keyUsage |
- [key_usage()] |
-
-
- id-ce-privateKeyUsagePeriod |
- #'PrivateKeyUsagePeriod'{} |
-
-
- id-ce-certificatePolicies |
- #'PolicyInformation'{} |
-
-
-
- id-ce-policyMappings |
- #'PolicyMappings_SEQOF'{} |
-
-
-
- id-ce-subjectAltName |
- general_name() |
-
-
-
- id-ce-issuerAltName |
- general_name() |
-
-
-
- id-ce-subjectDirectoryAttributes |
- [#'Attribute'{}] |
-
-
-
- id-ce-basicConstraints |
- #'BasicConstraints'{} |
-
-
- id-ce-nameConstraints |
- #'NameConstraints'{} |
-
-
- id-ce-policyConstraints |
- #'PolicyConstraints'{} |
-
-
- id-ce-extKeyUsage |
- [id_key_purpose()] |
-
-
-
- id-ce-cRLDistributionPoints |
- [#'DistributionPoint'{}] |
-
-
-
- id-ce-inhibitAnyPolicy |
- integer() |
-
-
-
- id-ce-freshestCRL |
- [#'DistributionPoint'{}] |
-
-
-
- Standard Certificate Extensions
-
-
- Here:
-
- key_usage()
- - =
digitalSignature
- | nonRepudiation
- | keyEncipherment
- | dataEncipherment
- | keyAgreement
- | keyCertSign
- | cRLSign
- | encipherOnly
- | decipherOnly
-
-
-
- And for id_key_purpose() :
-
-
-
- OID Name |
-
-
- id-kp-serverAuth |
-
-
- id-kp-clientAuth |
-
-
- id-kp-codeSigning |
-
-
- id-kp-emailProtection |
-
-
- id-kp-timeStamping |
-
-
- id-kp-OCSPSigning |
-
- Key Purpose OIDs
-
-
-
-#'AuthorityKeyIdentifier'{
- keyIdentifier, % oid()
- authorityCertIssuer, % general_name()
- authorityCertSerialNumber % integer()
- }.
-
-#'PrivateKeyUsagePeriod'{
- notBefore, % general_time()
- notAfter % general_time()
- }.
-
-#'PolicyInformation'{
- policyIdentifier, % oid()
- policyQualifiers % [#PolicyQualifierInfo{}]
- }.
-
-#'PolicyQualifierInfo'{
- policyQualifierId, % oid()
- qualifier % string() | #'UserNotice'{}
- }.
-
-#'UserNotice'{
- noticeRef, % #'NoticeReference'{}
- explicitText % string()
- }.
-
-#'NoticeReference'{
- organization, % string()
- noticeNumbers % [integer()]
- }.
-
-#'PolicyMappings_SEQOF'{
- issuerDomainPolicy, % oid()
- subjectDomainPolicy % oid()
- }.
-
-#'Attribute'{
- type, % oid()
- values % [der_encoded()]
- }).
-
-#'BasicConstraints'{
- cA, % boolean()
- pathLenConstraint % integer()
- }).
-
-#'NameConstraints'{
- permittedSubtrees, % [#'GeneralSubtree'{}]
- excludedSubtrees % [#'GeneralSubtree'{}]
- }).
-
-#'GeneralSubtree'{
- base, % general_name()
- minimum, % integer()
- maximum % integer()
- }).
-
-#'PolicyConstraints'{
- requireExplicitPolicy, % integer()
- inhibitPolicyMapping % integer()
- }).
-
-#'DistributionPoint'{
- distributionPoint, % {fullName, [general_name()]} | {nameRelativeToCRLIssuer,
- [#AttributeTypeAndValue{}]}
- reasons, % [dist_reason()]
- cRLIssuer % [general_name()]
- }).
-
-
-
-
-
- Private Internet Extensions
-
- The private internet extensions OID name atoms and their corresponding value
- types are as follows:
-
-
-
- OID Name |
- Value Type |
-
-
- id-pe-authorityInfoAccess |
- [#'AccessDescription'{}] |
-
-
- id-pe-subjectInfoAccess |
- [#'AccessDescription'{}] |
-
- Private Internet Extensions
-
-
-
-#'AccessDescription'{
- accessMethod, % oid()
- accessLocation % general_name()
- }).
-
-
-
-
- CRL and CRL Extensions Profile
-
- Erlang representation of CRL and CRL extensions profile
- derived from ASN.1 specifications and RFC 5280 are as follows:
-
-
-#'CertificateList'{
- tbsCertList, % #'TBSCertList{}
- signatureAlgorithm, % #'AlgorithmIdentifier'{}
- signature % bitstring()
- }).
-
-#'TBSCertList'{
- version, % v2 (if defined)
- signature, % #AlgorithmIdentifier{}
- issuer, % {rdnSequence, [#AttributeTypeAndValue'{}]}
- thisUpdate, % time()
- nextUpdate, % time()
- revokedCertificates, % [#'TBSCertList_revokedCertificates_SEQOF'{}]
- crlExtensions % [#'Extension'{}]
- }).
-
-#'TBSCertList_revokedCertificates_SEQOF'{
- userCertificate, % integer()
- revocationDate, % timer()
- crlEntryExtensions % [#'Extension'{}]
- }).
-
-
-
- CRL Extensions
-
- The CRL extensions OID name atoms and their corresponding value types are as follows:
-
-
-
-
- OID Name |
- Value Type |
-
-
- id-ce-authorityKeyIdentifier |
- #'AuthorityKeyIdentifier{} |
-
-
- id-ce-issuerAltName |
- {rdnSequence, [#AttributeTypeAndValue'{}]} |
-
-
- id-ce-cRLNumber |
- integer() |
-
-
- id-ce-deltaCRLIndicator |
- integer() |
-
-
- id-ce-issuingDistributionPoint |
- #'IssuingDistributionPoint'{} |
-
-
- id-ce-freshestCRL |
- [#'Distributionpoint'{}] |
-
-
- CRL Extensions
-
-
- Here, the data type 'IssuingDistributionPoint' is represented as
- the following Erlang record:
-
-
-#'IssuingDistributionPoint'{
- distributionPoint, % {fullName, [general_name()]} | {nameRelativeToCRLIssuer,
- [#AttributeTypeAndValue'{}]}
- onlyContainsUserCerts, % boolean()
- onlyContainsCACerts, % boolean()
- onlySomeReasons, % [dist_reason()]
- indirectCRL, % boolean()
- onlyContainsAttributeCerts % boolean()
- }).
-
-
-
-
- CRL Entry Extensions
-
- The CRL entry extensions OID name atoms and their corresponding value types are as follows:
-
-
-
- OID Name |
- Value Type |
-
-
- id-ce-cRLReason |
- crl_reason() |
-
-
- id-ce-holdInstructionCode |
- oid() |
-
-
- id-ce-invalidityDate |
- general_time() |
-
-
- id-ce-certificateIssuer |
- general_name() |
-
- CRL Entry Extensions
-
-
-
- Here:
-
- crl_reason()
- - =
unspecified c>
- | keyCompromise
- | cACompromise
- | affiliationChanged
- | superseded
- | cessationOfOperation
- | certificateHold
- | removeFromCRL
- | privilegeWithdrawn
- | aACompromise
-
-
-
-
-
-
-
- PKCS#10 Certification Request
- Erlang representation of a PKCS#10 certification request
- derived from ASN.1 specifications and RFC 5280 are as follows:
-
-#'CertificationRequest'{
- certificationRequestInfo #'CertificationRequestInfo'{},
- signatureAlgorithm #'CertificationRequest_signatureAlgorithm'{}}.
- signature bitstring()
- }
-
-#'CertificationRequestInfo'{
- version atom(),
- subject {rdnSequence, [#AttributeTypeAndValue'{}]} ,
- subjectPKInfo #'CertificationRequestInfo_subjectPKInfo'{},
- attributes [#'AttributePKCS-10' {}]
- }
-
-#'CertificationRequestInfo_subjectPKInfo'{
- algorithm #'CertificationRequestInfo_subjectPKInfo_algorithm'{}
- subjectPublicKey bitstring()
- }
-
-#'CertificationRequestInfo_subjectPKInfo_algorithm'{
- algorithm = oid(),
- parameters = der_encoded()
-}
-
-#'CertificationRequest_signatureAlgorithm'{
- algorithm = oid(),
- parameters = der_encoded()
- }
-
-#'AttributePKCS-10'{
- type = oid(),
- values = [der_encoded()]
-}
-
-
-
-
diff --git a/lib/public_key/doc/src/public_key.xml b/lib/public_key/doc/src/public_key.xml
index ddaa8c2530..3d5c135075 100644
--- a/lib/public_key/doc/src/public_key.xml
+++ b/lib/public_key/doc/src/public_key.xml
@@ -73,8 +73,7 @@
are generated from ASN.1 specifications
and are documented in the User's Guide. See Public-key Records and X.509 Certificate Records .
+ marker="public_key_records">Public-key Records.
Use the following include directive to get access to the
diff --git a/lib/public_key/doc/src/public_key_records.xml b/lib/public_key/doc/src/public_key_records.xml
deleted file mode 100644
index 24f5faf38e..0000000000
--- a/lib/public_key/doc/src/public_key_records.xml
+++ /dev/null
@@ -1,155 +0,0 @@
-
-
-
-
-
-
- 2008
- 2014
- Ericsson AB, All Rights Reserved
-
-
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
-
- The Initial Developer of the Original Code is Ericsson AB.
-
-
- Public-Key Records
- Ingela Anderton Andin
-
-
-
-
- 2008-02-06
- A
- public_key_records.xml
-
-
- This section briefly describes Erlang records derived from ASN.1
- specifications used to handle public and private keys.
- The scope is to describe the data types of each component,
- not the semantics. For information on the
- semantics, refer to the relevant standards and RFCs.
-
- Use the following include directive to get access to the
- records and constant macros described in the following sections:
-
- -include_lib("public_key/include/public_key.hrl").
-
-
- Common Data Types
-
- Common non-standard Erlang
- data types used to describe the record fields in the
- following sections are defined in the public_key Reference Manual .
-
-
-
- The RSA According to PKCS-1 and RFC 3447
- RSA as defined by the PKCS-1 standard and
- RFC 3447 follows:
-
-
-#'RSAPublicKey'{
- modulus, % integer()
- publicExponent % integer()
- }.
-
-#'RSAPrivateKey'{
- version, % two-prime | multi
- modulus, % integer()
- publicExponent, % integer()
- privateExponent, % integer()
- prime1, % integer()
- prime2, % integer()
- exponent1, % integer()
- exponent2, % integer()
- coefficient, % integer()
- otherPrimeInfos % [#OtherPrimeInfo{}] | asn1_NOVALUE
- }.
-
-#'OtherPrimeInfo'{
- prime, % integer()
- exponent, % integer()
- coefficient % integer()
- }.
-
-
-
-
- DSA According to DSS
- The DSA as defined by the
-
- Digital Signature Standard (DSS), NIST FIPS PUB 186-2 follows:
-
-
-#'DSAPrivateKey',{
- version, % integer()
- p, % integer()
- q, % integer()
- g, % integer()
- y, % integer()
- x % integer()
- }.
-
-#'Dss-Parms',{
- p, % integer()
- q, % integer()
- g % integer()
- }.
-
-
-
- ECC According to RFC 5480
- The Elliptic Curve (ECC) as defined by
- RFC 5480 follows:
-
-
-#'ECPrivateKey'{
- version, % integer()
- privateKey, % binary()
- parameters, % der_encoded() - {'EcpkParameters', #'ECParameters'{}} |
- {'EcpkParameters', {namedCurve, oid()}} |
- {'EcpkParameters', 'NULL'} % Inherited by CA
- publicKey % bitstring()
- }.
-
-#'ECParameters'{
- version, % integer()
- fieldID, % #'FieldID'{}
- curve, % #'Curve'{}
- base, % binary()
- order, % integer()
- cofactor % integer()
- }.
-
-#'Curve'{
- a, % binary()
- b, % binary()
- seed % bitstring() - optional
-
- }.
-
-#'FieldID'{
- fieldType, % oid()
- parameters % Depending on fieldType
- }.
-
-#'ECPoint'{
- point % binary() - the public key
- }.
-
-
-
-
-
diff --git a/lib/public_key/doc/src/records.xml b/lib/public_key/doc/src/records.xml
index 75265791af..ac1ecd176c 100644
--- a/lib/public_key/doc/src/records.xml
+++ b/lib/public_key/doc/src/records.xml
@@ -1,7 +1,7 @@
-
+
-
+
2008
@@ -23,25 +23,808 @@
The Initial Developer of the Original Code is Ericsson AB.
- Records
- Tommy MÃ¥nevik
+ Public-Key Records
+ Ingela Anderton Andin
+
- 2015-04-01
-
- records.xml
+
+
+ 2008-02-06
+ A
+ public_key_records.xml
-
- This section describes Erlang records derived from ASN.1 specifications,
- used to handle the following:
-
-
- - Public and private keys
- X509 certificates and CertificationRequest
-
-
+
+ This chapter briefly describes Erlang records derived from ASN.1
+ specifications used to handle public key infrastructure.
+ The scope is to describe the data types of each component,
+ not the semantics. For information on the
+ semantics, refer to the relevant standards and RFCs linked in the sections below.
+
+ Use the following include directive to get access to the
+ records and constant macros described in the following sections:
+
+ -include_lib("public_key/include/public_key.hrl").
+
+
+ Data Types
+
+ Common non-standard Erlang
+ data types used to describe the record fields in the
+ following sections and which are not defined in the public_key Reference Manual
+ follows here:
+
+
+ time()
+ = uct_time() | general_time()
+
+ uct_time()
+ = {utcTime, "YYMMDDHHMMSSZ"}
+
+ general_time()
+ = {generalTime, "YYYYMMDDHHMMSSZ"}
+
+ general_name()
+ - =
{rfc822Name, string()}
+ | {dNSName, string()}
+ | {x400Address, string()}
+ | {directoryName, {rdnSequence, [#AttributeTypeAndValue'{}]}}
+ | {eidPartyName, special_string()}
+ | {eidPartyName, special_string(), special_string()}
+ | {uniformResourceIdentifier, string()}
+ | {ipAddress, string()}
+ | {registeredId, oid()}
+ | {otherName, term()}
+
+
+ special_string()
+ - =
{teletexString, string()}
+ | {printableString, string()}
+ | {universalString, string()}
+ | {utf8String, binary()}
+ | {bmpString, string()}
+
+
+ dist_reason()
+ - =
unused
+ | keyCompromise
+ | cACompromise
+ | affiliationChanged
+ | superseded
+ | cessationOfOperation
+ | certificateHold
+ | privilegeWithdrawn
+ | aACompromise
+
+
+
+
+
+
+ RSA
+ Erlang representation of
+ Rivest-Shamir-Adleman cryptosystem (RSA) keys follows:
+
+
+#'RSAPublicKey'{
+ modulus, % integer()
+ publicExponent % integer()
+ }.
+
+#'RSAPrivateKey'{
+ version, % two-prime | multi
+ modulus, % integer()
+ publicExponent, % integer()
+ privateExponent, % integer()
+ prime1, % integer()
+ prime2, % integer()
+ exponent1, % integer()
+ exponent2, % integer()
+ coefficient, % integer()
+ otherPrimeInfos % [#OtherPrimeInfo{}] | asn1_NOVALUE
+ }.
+
+#'OtherPrimeInfo'{
+ prime, % integer()
+ exponent, % integer()
+ coefficient % integer()
+ }.
+
+
+
+
+ DSA
+ Erlang representation of Digigital Signature Algorithm (DSA) keys
+
+#'DSAPrivateKey',{
+ version, % integer()
+ p, % integer()
+ q, % integer()
+ g, % integer()
+ y, % integer()
+ x % integer()
+ }.
+
+#'Dss-Parms',{
+ p, % integer()
+ q, % integer()
+ g % integer()
+ }.
+
+
+
+
+ ECDSA
+ Erlang representation of Elliptic Curve Digital Signature Algorithm (ECDSA) keys follows:
+
+
+#'ECPrivateKey'{
+ version, % integer()
+ privateKey, % octet_string()
+ parameters, % der_encoded() - {'EcpkParameters', #'ECParameters'{}} |
+ {'EcpkParameters', {namedCurve, oid()}} |
+ {'EcpkParameters', 'NULL'} % Inherited by CA
+ publicKey % bitstring()
+ }.
+
+#'ECParameters'{
+ version, % integer()
+ fieldID, % #'FieldID'{}
+ curve, % #'Curve'{}
+ base, % octet_string()
+ order, % integer()
+ cofactor % integer()
+ }.
+
+#'Curve'{
+ a, % octet_string()
+ b, % octet_string()
+ seed % bitstring() - optional
+
+ }.
+
+#'FieldID'{
+ fieldType, % oid()
+ parameters % Depending on fieldType
+ }.
+
+#'ECPoint'{
+ point % octet_string() - the public key
+ }.
+
+
+
+ PKIX Certificates
+ Erlang representation of PKIX certificates derived from ASN.1
+ specifications see also X509 certificates (RFC 5280) are as follows:
+
+#'Certificate'{
+ tbsCertificate, % #'TBSCertificate'{}
+ signatureAlgorithm, % #'AlgorithmIdentifier'{}
+ signature % {0, binary()} - ASN1 compact bitstring
+ }.
+
+#'TBSCertificate'{
+ version, % v1 | v2 | v3
+ serialNumber, % integer()
+ signature, % #'AlgorithmIdentifier'{}
+ issuer, % {rdnSequence, [#AttributeTypeAndValue'{}]}
+ validity, % #'Validity'{}
+ subject, % {rdnSequence, [#AttributeTypeAndValue'{}]}
+ subjectPublicKeyInfo, % #'SubjectPublicKeyInfo'{}
+ issuerUniqueID, % binary() | asn1_novalue
+ subjectUniqueID, % binary() | asn1_novalue
+ extensions % [#'Extension'{}]
+ }.
+
+#'AlgorithmIdentifier'{
+ algorithm, % oid()
+ parameters % der_encoded()
+ }.
+
+
+#'OTPCertificate'{
+ tbsCertificate, % #'OTPTBSCertificate'{}
+ signatureAlgorithm, % #'SignatureAlgorithm'
+ signature % {0, binary()} - ASN1 compact bitstring
+ }.
+
+#'OTPTBSCertificate'{
+ version, % v1 | v2 | v3
+ serialNumber, % integer()
+ signature, % #'SignatureAlgorithm'
+ issuer, % {rdnSequence, [#AttributeTypeAndValue'{}]}
+ validity, % #'Validity'{}
+ subject, % {rdnSequence, [#AttributeTypeAndValue'{}]}
+ subjectPublicKeyInfo, % #'OTPSubjectPublicKeyInfo'{}
+ issuerUniqueID, % binary() | asn1_novalue
+ subjectUniqueID, % binary() | asn1_novalue
+ extensions % [#'Extension'{}]
+ }.
+
+#'SignatureAlgorithm'{
+ algorithm, % id_signature_algorithm()
+ parameters % asn1_novalue | #'Dss-Parms'{}
+ }.
+
+Here, id_signature_algorithm() = ?OID name, for available OID names, for example
+?id-dsa-with-sha1 . That is, by prepending "?" to the OID name, represented as an Erlang atom.
+The available OID names are as follows:
+
+
+ OID Name |
+
+
+ id-dsa-with-sha1 |
+
+
+ id-dsaWithSHA1 (ISO or OID to above) |
+
+
+ md2WithRSAEncryption |
+
+
+ md5WithRSAEncryption |
+
+
+ sha1WithRSAEncryption |
+
+
+ sha-1WithRSAEncryption (ISO or OID to above) |
+
+
+ sha224WithRSAEncryption |
+
+
+ sha256WithRSAEncryption |
+
+
+ sha512WithRSAEncryption |
+
+
+ ecdsa-with-SHA1 |
+
+ Signature Algorithm OIDs
+
+
+The data type 'AttributeTypeAndValue' , is represented as
+ the following erlang record:
+
+
+#'AttributeTypeAndValue'{
+ type, % id_attributes()
+ value % term()
+ }.
+
+The attribute OID name atoms and their corresponding value types
+are as follows:
+
+
+ OID Name |
+ Value Type |
+
+
+ id-at-name |
+ special_string() |
+
+
+ id-at-surname |
+ special_string() |
+
+
+ id-at-givenName |
+ special_string() |
+
+
+ id-at-initials |
+ special_string() |
+
+
+ id-at-generationQualifier |
+ special_string() |
+
+
+ id-at-commonName |
+ special_string() |
+
+
+ id-at-localityName |
+ special_string() |
+
+
+ id-at-stateOrProvinceName |
+ special_string() |
+
+
+ id-at-organizationName |
+ special_string() |
+
+
+ id-at-title |
+ special_string() |
+
+
+ id-at-dnQualifier |
+ {printableString, string()} |
+
+
+ id-at-countryName |
+ {printableString, string()} |
+
+
+ id-at-serialNumber |
+ {printableString, string()} |
+
+
+ id-at-pseudonym |
+ special_string() |
+
+ Attribute OIDs
+
+
+The data types 'Validity' , 'SubjectPublicKeyInfo' , and
+'SubjectPublicKeyInfoAlgorithm' are represented as the following Erlang records:
+
+
+#'Validity'{
+ notBefore, % time()
+ notAfter % time()
+ }.
+
+#'SubjectPublicKeyInfo'{
+ algorithm, % #AlgorithmIdentifier{}
+ subjectPublicKey % binary()
+ }.
+
+#'SubjectPublicKeyInfoAlgorithm'{
+ algorithm, % id_public_key_algorithm()
+ parameters % public_key_params()
+ }.
+
+The public-key algorithm OID name atoms are as follows:
+
+
+ OID Name |
+
+
+ rsaEncryption |
+
+
+ id-dsa |
+
+
+ dhpublicnumber |
+
+
+ id-keyExchangeAlgorithm |
+
+
+ id-ecPublicKey |
+
+ Public-Key Algorithm OIDs
+
+
+
+#'Extension'{
+ extnID, % id_extensions() | oid()
+ critical, % boolean()
+ extnValue % der_encoded()
+ }.
+
+id_extensions()
+ Standard Certificate Extensions ,
+ Private Internet Extensions ,
+ CRL Extensions and
+ CRL Entry Extensions .
+
+
+
+
+
+
+ Standard Certificate Extensions
+
+ The standard certificate extensions OID name atoms and their
+ corresponding value types are as follows:
+
+
+
+ OID Name |
+ Value Type |
+
+
+ id-ce-authorityKeyIdentifier |
+ #'AuthorityKeyIdentifier'{} |
+
+
+ id-ce-subjectKeyIdentifier |
+ oid() |
+
+
+ id-ce-keyUsage |
+ [key_usage()] |
+
+
+ id-ce-privateKeyUsagePeriod |
+ #'PrivateKeyUsagePeriod'{} |
+
+
+ id-ce-certificatePolicies |
+ #'PolicyInformation'{} |
+
+
+
+ id-ce-policyMappings |
+ #'PolicyMappings_SEQOF'{} |
+
+
+
+ id-ce-subjectAltName |
+ general_name() |
+
+
+
+ id-ce-issuerAltName |
+ general_name() |
+
+
+
+ id-ce-subjectDirectoryAttributes |
+ [#'Attribute'{}] |
+
+
+
+ id-ce-basicConstraints |
+ #'BasicConstraints'{} |
+
+
+ id-ce-nameConstraints |
+ #'NameConstraints'{} |
+
+
+ id-ce-policyConstraints |
+ #'PolicyConstraints'{} |
+
+
+ id-ce-extKeyUsage |
+ [id_key_purpose()] |
+
+
+
+ id-ce-cRLDistributionPoints |
+ [#'DistributionPoint'{}] |
+
+
+
+ id-ce-inhibitAnyPolicy |
+ integer() |
+
+
+
+ id-ce-freshestCRL |
+ [#'DistributionPoint'{}] |
+
+
+
+ Standard Certificate Extensions
+
+
+ Here:
+
+ key_usage()
+ - =
digitalSignature
+ | nonRepudiation
+ | keyEncipherment
+ | dataEncipherment
+ | keyAgreement
+ | keyCertSign
+ | cRLSign
+ | encipherOnly
+ | decipherOnly
+
+
+
+ And for id_key_purpose() :
+
+
+
+ OID Name |
+
+
+ id-kp-serverAuth |
+
+
+ id-kp-clientAuth |
+
+
+ id-kp-codeSigning |
+
+
+ id-kp-emailProtection |
+
+
+ id-kp-timeStamping |
+
+
+ id-kp-OCSPSigning |
+
+ Key Purpose OIDs
+
+
+
+#'AuthorityKeyIdentifier'{
+ keyIdentifier, % oid()
+ authorityCertIssuer, % general_name()
+ authorityCertSerialNumber % integer()
+ }.
+
+#'PrivateKeyUsagePeriod'{
+ notBefore, % general_time()
+ notAfter % general_time()
+ }.
+
+#'PolicyInformation'{
+ policyIdentifier, % oid()
+ policyQualifiers % [#PolicyQualifierInfo{}]
+ }.
+
+#'PolicyQualifierInfo'{
+ policyQualifierId, % oid()
+ qualifier % string() | #'UserNotice'{}
+ }.
+
+#'UserNotice'{
+ noticeRef, % #'NoticeReference'{}
+ explicitText % string()
+ }.
+
+#'NoticeReference'{
+ organization, % string()
+ noticeNumbers % [integer()]
+ }.
+
+#'PolicyMappings_SEQOF'{
+ issuerDomainPolicy, % oid()
+ subjectDomainPolicy % oid()
+ }.
+
+#'Attribute'{
+ type, % oid()
+ values % [der_encoded()]
+ }).
+
+#'BasicConstraints'{
+ cA, % boolean()
+ pathLenConstraint % integer()
+ }).
+
+#'NameConstraints'{
+ permittedSubtrees, % [#'GeneralSubtree'{}]
+ excludedSubtrees % [#'GeneralSubtree'{}]
+ }).
+
+#'GeneralSubtree'{
+ base, % general_name()
+ minimum, % integer()
+ maximum % integer()
+ }).
+
+#'PolicyConstraints'{
+ requireExplicitPolicy, % integer()
+ inhibitPolicyMapping % integer()
+ }).
+
+#'DistributionPoint'{
+ distributionPoint, % {fullName, [general_name()]} | {nameRelativeToCRLIssuer,
+ [#AttributeTypeAndValue{}]}
+ reasons, % [dist_reason()]
+ cRLIssuer % [general_name()]
+ }).
+
+
+
+
+
+ Private Internet Extensions
+
+ The private internet extensions OID name atoms and their corresponding value
+ types are as follows:
+
+
+
+ OID Name |
+ Value Type |
+
+
+ id-pe-authorityInfoAccess |
+ [#'AccessDescription'{}] |
+
+
+ id-pe-subjectInfoAccess |
+ [#'AccessDescription'{}] |
+
+ Private Internet Extensions
+
+
+
+#'AccessDescription'{
+ accessMethod, % oid()
+ accessLocation % general_name()
+ }).
+
+
-
-
+
+ CRL and CRL Extensions Profile
+
+ Erlang representation of CRL and CRL extensions profile
+ derived from ASN.1 specifications and RFC 5280 are as follows:
+
+
+#'CertificateList'{
+ tbsCertList, % #'TBSCertList{}
+ signatureAlgorithm, % #'AlgorithmIdentifier'{}
+ signature % {0, binary()} - ASN1 compact bitstring
+ }).
+
+#'TBSCertList'{
+ version, % v2 (if defined)
+ signature, % #AlgorithmIdentifier{}
+ issuer, % {rdnSequence, [#AttributeTypeAndValue'{}]}
+ thisUpdate, % time()
+ nextUpdate, % time()
+ revokedCertificates, % [#'TBSCertList_revokedCertificates_SEQOF'{}]
+ crlExtensions % [#'Extension'{}]
+ }).
+
+#'TBSCertList_revokedCertificates_SEQOF'{
+ userCertificate, % integer()
+ revocationDate, % timer()
+ crlEntryExtensions % [#'Extension'{}]
+ }).
-
+
+
+ CRL Extensions
+
+ The CRL extensions OID name atoms and their corresponding value types are as follows:
+
+
+
+
+ OID Name |
+ Value Type |
+
+
+ id-ce-authorityKeyIdentifier |
+ #'AuthorityKeyIdentifier{} |
+
+
+ id-ce-issuerAltName |
+ {rdnSequence, [#AttributeTypeAndValue'{}]} |
+
+
+ id-ce-cRLNumber |
+ integer() |
+
+
+ id-ce-deltaCRLIndicator |
+ integer() |
+
+
+ id-ce-issuingDistributionPoint |
+ #'IssuingDistributionPoint'{} |
+
+
+ id-ce-freshestCRL |
+ [#'Distributionpoint'{}] |
+
+
+ CRL Extensions
+
+
+ Here, the data type 'IssuingDistributionPoint' is represented as
+ the following Erlang record:
+
+
+#'IssuingDistributionPoint'{
+ distributionPoint, % {fullName, [general_name()]} | {nameRelativeToCRLIssuer,
+ [#AttributeTypeAndValue'{}]}
+ onlyContainsUserCerts, % boolean()
+ onlyContainsCACerts, % boolean()
+ onlySomeReasons, % [dist_reason()]
+ indirectCRL, % boolean()
+ onlyContainsAttributeCerts % boolean()
+ }).
+
+
+
+
+ CRL Entry Extensions
+
+ The CRL entry extensions OID name atoms and their corresponding value types are as follows:
+
+
+
+ OID Name |
+ Value Type |
+
+
+ id-ce-cRLReason |
+ crl_reason() |
+
+
+ id-ce-holdInstructionCode |
+ oid() |
+
+
+ id-ce-invalidityDate |
+ general_time() |
+
+
+ id-ce-certificateIssuer |
+ general_name() |
+
+ CRL Entry Extensions
+
+
+
+ Here:
+
+ crl_reason()
+ - =
unspecified c>
+ | keyCompromise
+ | cACompromise
+ | affiliationChanged
+ | superseded
+ | cessationOfOperation
+ | certificateHold
+ | removeFromCRL
+ | privilegeWithdrawn
+ | aACompromise
+
+
+
+
+
+
+
+ PKCS#10 Certification Request
+ Erlang representation of a PKCS#10 certification request
+ derived from ASN.1 specifications and RFC 5280 are as follows:
+
+#'CertificationRequest'{
+ certificationRequestInfo #'CertificationRequestInfo'{},
+ signatureAlgorithm #'CertificationRequest_signatureAlgorithm'{}}.
+ signature {0, binary()} - ASN1 compact bitstring
+ }
+
+#'CertificationRequestInfo'{
+ version atom(),
+ subject {rdnSequence, [#AttributeTypeAndValue'{}]} ,
+ subjectPKInfo #'CertificationRequestInfo_subjectPKInfo'{},
+ attributes [#'AttributePKCS-10' {}]
+ }
+
+#'CertificationRequestInfo_subjectPKInfo'{
+ algorithm #'CertificationRequestInfo_subjectPKInfo_algorithm'{}
+ subjectPublicKey {0, binary()} - ASN1 compact bitstring
+ }
+
+#'CertificationRequestInfo_subjectPKInfo_algorithm'{
+ algorithm = oid(),
+ parameters = der_encoded()
+}
+
+#'CertificationRequest_signatureAlgorithm'{
+ algorithm = oid(),
+ parameters = der_encoded()
+ }
+#'AttributePKCS-10'{
+ type = oid(),
+ values = [der_encoded()]
+}
+
+
The
The Public Key application deals with public-key related file
formats, digital signatures, and The The Public Key decode- and encode-functions try to use the NIFs
+ in the ASN.1 compilers runtime modules, if they can be found.
+ Thus, to have the ASN1 application in the
path of your system gives the best performance.
The fun uses the information in the distribution point to access
the latest possible version of the CRL. If this fun is not specified,
-
fun(_DP, CRL) -> CRL end
Common non-standard Erlang
data types used to describe the record fields in the
- following sections and which are not defined in the
Here:
This section describes examples of how to use the
-
Some shell printouts in the following examples @@ -43,14 +43,15 @@
Public-key data (keys, certificates, and so on) can be stored in Privacy Enhanced Mail (PEM) format. The PEM files have the following structure:
- -<text>
- -----BEGIN <SOMETHING>-----
- <Attribute> : <Value>
- <Base64 encoded DER data>
- -----END <SOMETHING>-----
- <text>
-
+
+
+ <text>
+ -----BEGIN <SOMETHING>-----
+ <Attribute> : <Value>
+ <Base64 encoded DER data>
+ -----END <SOMETHING>-----
+ <text>
+
A file can contain several A DSA private key can look as follows: File handling is not done by the File handling is not done by the Public Key application. Suppose you have the followwing private key and a corresponding public key: Suppose you have the following private key and a corresponding public key:1> {ok, PemBin} = file:read_file("dsa.pem").
{ok,<<"-----BEGIN DSA PRIVATE KEY-----\nMIIBuw"...>>}
@@ -364,7 +365,7 @@ ok
Public-key encryption using the private key.
+ See also
Public-key encryption using the public key. See also
Creates a PEM entry that can be feed to
Public-key encryption using the private key.
- See also
Public-key encryption using the public key. See also
#'ECPrivateKey'{
version, % integer()
- privateKey, % octet_string()
+ privateKey, % binary()
parameters, % der_encoded() - {'EcpkParameters', #'ECParameters'{}} |
{'EcpkParameters', {namedCurve, oid()}} |
{'EcpkParameters', 'NULL'} % Inherited by CA
@@ -171,14 +171,14 @@
version, % integer()
fieldID, % #'FieldID'{}
curve, % #'Curve'{}
- base, % octet_string()
+ base, % binary()
order, % integer()
cofactor % integer()
}.
#'Curve'{
- a, % octet_string()
- b, % octet_string()
+ a, % binary()
+ b, % binary()
seed % bitstring() - optional
}.
@@ -189,7 +189,7 @@
}.
#'ECPoint'{
- point % octet_string() - the public key
+ point % binary() - the public key
}.
@@ -201,7 +201,7 @@
#'Certificate'{
tbsCertificate, % #'TBSCertificate'{}
signatureAlgorithm, % #'AlgorithmIdentifier'{}
- signature % {0, binary()} - ASN1 compact bitstring
+ signature % bitstring()
}.
#'TBSCertificate'{
@@ -226,7 +226,7 @@
#'OTPCertificate'{
tbsCertificate, % #'OTPTBSCertificate'{}
signatureAlgorithm, % #'SignatureAlgorithm'
- signature % {0, binary()} - ASN1 compact bitstring
+ signature % bitstring()
}.
#'OTPTBSCertificate'{
@@ -664,7 +664,7 @@ are as follows:
#'CertificateList'{
tbsCertList, % #'TBSCertList{}
signatureAlgorithm, % #'AlgorithmIdentifier'{}
- signature % {0, binary()} - ASN1 compact bitstring
+ signature % bitstring()
}).
#'TBSCertList'{
@@ -796,7 +796,7 @@ are as follows:
#'CertificationRequest'{
certificationRequestInfo #'CertificationRequestInfo'{},
signatureAlgorithm #'CertificationRequest_signatureAlgorithm'{}}.
- signature {0, binary()} - ASN1 compact bitstring
+ signature bitstring()
}
#'CertificationRequestInfo'{
@@ -808,7 +808,7 @@ are as follows:
#'CertificationRequestInfo_subjectPKInfo'{
algorithm #'CertificationRequestInfo_subjectPKInfo_algorithm'{}
- subjectPublicKey {0, binary()} - ASN1 compact bitstring
+ subjectPublicKey bitstring()
}
#'CertificationRequestInfo_subjectPKInfo_algorithm'{
diff --git a/lib/public_key/doc/src/using_public_key.xml b/lib/public_key/doc/src/using_public_key.xml
index aaf802cd34..41a81b6dea 100644
--- a/lib/public_key/doc/src/using_public_key.xml
+++ b/lib/public_key/doc/src/using_public_key.xml
@@ -212,9 +212,8 @@
algorithm = {1,2,840,113549,1,1,5},
parameters = <<5,0>>},
signature =
- {0,
- <<163,186,7,163,216,152,63,47,154,234,139,73,154,96,120,
- 165,2,52,196,195,109,167,192,...>>}}
+ <<163,186,7,163,216,152,63,47,154,234,139,73,154,96,120,
+ 165,2,52,196,195,109,167,192,...>>}
Parts of certificates can be decoded with
This call is equivalent to
5> public_key:pkix_decode_cert(DerCert, plain).
--
cgit v1.2.3
From 631489eb5f989f06de993004ae6db58f07465ccb Mon Sep 17 00:00:00 2001
From: Ingela Anderton Andin
Date: Thu, 7 May 2015 14:09:35 +0200
Subject: public_key: Add clarifications
---
lib/public_key/doc/src/records.xml | 17 ++++++++++++++---
lib/public_key/doc/src/using_public_key.xml | 4 +++-
2 files changed, 17 insertions(+), 4 deletions(-)
(limited to 'lib')
diff --git a/lib/public_key/doc/src/records.xml b/lib/public_key/doc/src/records.xml
index e9e9b231af..9536167839 100644
--- a/lib/public_key/doc/src/records.xml
+++ b/lib/public_key/doc/src/records.xml
@@ -96,6 +96,15 @@
| privilegeWithdrawn
| aACompromise
+
+ OID_macro()
+ - =
?OID_name()
+
+
+ OID_name()
+ - =
atom()
+
+
@@ -196,7 +205,7 @@
PKIX Certificates
Erlang representation of PKIX certificates derived from ASN.1
- specifications see also X509 certificates (RFC 5280) are as follows:
+ specifications see also X509 certificates (RFC 5280) , also referred to as plain type, are as follows:
#'Certificate'{
tbsCertificate, % #'TBSCertificate'{}
@@ -222,6 +231,8 @@
parameters % der_encoded()
}.
+Erlang alternate representation of PKIX certificate, also referred to as otp type
+
#'OTPCertificate'{
tbsCertificate, % #'OTPTBSCertificate'{}
@@ -247,8 +258,8 @@
parameters % asn1_novalue | #'Dss-Parms'{}
}.
-Here, id_signature_algorithm() = ?OID name, for available OID names, for example
-?id-dsa-with-sha1 . That is, by prepending "?" to the OID name, represented as an Erlang atom.
+id_signature_algorithm() = OID_macro()
+
The available OID names are as follows:
diff --git a/lib/public_key/doc/src/using_public_key.xml b/lib/public_key/doc/src/using_public_key.xml
index 41a81b6dea..03e4bedf3d 100644
--- a/lib/public_key/doc/src/using_public_key.xml
+++ b/lib/public_key/doc/src/using_public_key.xml
@@ -381,7 +381,9 @@ Msg = public_key:decrypt_public(RsaEncrypted, PublicKey),
Msg = public_key:decrypt_private(RsaEncrypted, PrivateKey),
You normally do only one of the encrypt or decrypt operations,
- and the peer does the other.
+ and the peer does the other. This normaly used in legacy applications
+ as a primitive digital signature.
+
--
cgit v1.2.3
From e95095457c4d83c02850b811fb28711c0b3d1c23 Mon Sep 17 00:00:00 2001
From: xsipewe
Date: Tue, 14 Apr 2015 23:21:36 +0200
Subject: Update asn1 documentation
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Language cleaned up by the technical writers xsipewe and tmanevik
from Combitech. Proofreading and corrections by Björn Gustavsson.
---
lib/asn1/doc/src/Makefile | 4 +-
lib/asn1/doc/src/asn1_getting_started.xml | 1290 ++++++++++++++++++++++++++
lib/asn1/doc/src/asn1_introduction.xml | 99 ++
lib/asn1/doc/src/asn1_overview.xml | 49 +
lib/asn1/doc/src/asn1_spec.xmlsrc | 521 ++++++-----
lib/asn1/doc/src/asn1_ug.xml | 1417 -----------------------------
lib/asn1/doc/src/asn1ct.xml | 316 +++----
lib/asn1/doc/src/asn1rt.xml | 26 +-
lib/asn1/doc/src/part.xml | 9 +-
lib/asn1/doc/src/ref_man.xml | 6 +-
10 files changed, 1898 insertions(+), 1839 deletions(-)
create mode 100644 lib/asn1/doc/src/asn1_getting_started.xml
create mode 100644 lib/asn1/doc/src/asn1_introduction.xml
create mode 100644 lib/asn1/doc/src/asn1_overview.xml
delete mode 100644 lib/asn1/doc/src/asn1_ug.xml
(limited to 'lib')
diff --git a/lib/asn1/doc/src/Makefile b/lib/asn1/doc/src/Makefile
index 3b3e1bd8f9..f26508295c 100644
--- a/lib/asn1/doc/src/Makefile
+++ b/lib/asn1/doc/src/Makefile
@@ -48,7 +48,9 @@ XML_HTML_FILE = \
notes_history.xml
XML_CHAPTER_FILES = \
- asn1_ug.xml \
+ asn1_introduction.xml \
+ asn1_getting_started.xml \
+ asn1_overview.xml \
asn1_spec.xml \
notes.xml
diff --git a/lib/asn1/doc/src/asn1_getting_started.xml b/lib/asn1/doc/src/asn1_getting_started.xml
new file mode 100644
index 0000000000..1a9c279191
--- /dev/null
+++ b/lib/asn1/doc/src/asn1_getting_started.xml
@@ -0,0 +1,1290 @@
+
+
+
+
+
+
+ 1997 2013
+ Ericsson AB. All Rights Reserved.
+
+
+ The contents of this file are subject to the Erlang Public License,
+ Version 1.1, (the "License"); you may not use this file except in
+ compliance with the License. You should have received a copy of the
+ Erlang Public License along with this software. If not, it can be
+ retrieved online at http://www.erlang.org/.
+
+ Software distributed under the License is distributed on an "AS IS"
+ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ the License for the specific language governing rights and limitations
+ under the License.
+
+
+
+ Getting Started
+ Kenneth Lundin
+
+ 1999-03-25
+ D
+ asn1_getting_started.xml
+
+
+
+ Example
+ The following example demonstrates the basic functionality used to
+ run the Erlang ASN.1 compiler.
+ Create a file named People.asn containing the following:
+
+People DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+ Person ::= SEQUENCE {
+ name PrintableString,
+ location INTEGER {home(0),field(1),roving(2)},
+ age INTEGER OPTIONAL
+ }
+END
+ This file must be compiled before it can be used.
+ The ASN.1 compiler checks that the syntax is correct and that the
+ text represents proper ASN.1 code before generating an abstract
+ syntax tree. The code-generator then uses the abstract syntax
+ tree to generate code.
+ The generated Erlang files are placed in the current directory or
+ in the directory specified with option {outdir,Dir} .
+ The following shows how the compiler
+ can be called from the Erlang shell:
+
+
+1> asn1ct:compile("People", [ber]).
+ok
+2>
+
+ Option verbose can be added to get information
+ about the generated files:
+
+2> asn1ct:compile("People", [ber,verbose]).
+Erlang ASN.1 compiling "People.asn"
+--{generated,"People.asn1db"}--
+--{generated,"People.hrl"}--
+--{generated,"People.erl"}--
+ok
+3>
+
+ ASN.1 module People is now accepted and the
+ abstract syntax tree is saved in file People.asn1db .
+ The generated Erlang code is compiled using the Erlang compiler
+ and loaded into the Erlang runtime system. There is now an API
+ for encode/2 and decode/2 in module
+ People , which is called like:
+ , )]]>
+
+ or
+, )]]>
+
+ Assume that there is a network
+ application that receives instances of the ASN.1 defined
+ type Person , modifies, and sends them back again:
+
+
+receive
+ {Port,{data,Bytes}} ->
+ case 'People':decode('Person',Bytes) of
+ {ok,P} ->
+ {ok,Answer} = 'People':encode('Person',mk_answer(P)),
+ Port ! {self(),{command,Answer}};
+ {error,Reason} ->
+ exit({error,Reason})
+ end
+ end,
+ In this example, a series of bytes is received from an
+ external source and the bytes are then decoded into a valid
+ Erlang term. This was achieved with the call
+ 'People':decode('Person',Bytes) , which returned
+ an Erlang value of the ASN.1 type Person . Then an answer was
+ constructed and encoded using
+ 'People':encode('Person',Answer) , which takes an
+ instance of a defined ASN.1 type and transforms it to a
+ binary according to the BER or PER encoding rules.
+ The encoder and decoder can also be run from the shell:
+
+2> Rockstar = {'Person',"Some Name",roving,50}.
+{'Person',"Some Name",roving,50}
+3> {ok,Bin} = 'People':encode('Person',Rockstar).
+{ok,<<243,17,19,9,83,111,109,101,32,78,97,109,101,2,1,2,
+ 2,1,50>>}
+4> {ok,Person} = 'People':decode('Person',Bin).
+{ok,{'Person',"Some Name",roving,50}}
+5>
+
+
+ Module Dependencies
+ It is common that ASN.1 modules import defined types, values, and
+ other entities from another ASN.1 module.
+ Earlier versions of the ASN.1 compiler required that modules
+ that were imported from had to be compiled before the module
+ that imported. This caused problems when ASN.1 modules had circular
+ dependencies.
+ Referenced modules are now parsed when the compiler finds an
+ entity that is imported. No code is generated for
+ the referenced module. However, the compiled modules rely on
+ that the referenced modules are also compiled.
+
+
+
+
+ ASN.1 Application User Interface
+ The ASN.1 application provides the following two
+ separate user interfaces:
+
+ -
+
The module asn1ct , which provides the compile-time functions
+ (including the compiler)
+
+ -
+
The module asn1rt_nif , which provides the runtime functions
+ for the ASN.1 decoder for the BER back end
+
+
+ The reason for this division of the interfaces into compile-time
+ and runtime
+ is that only runtime modules (asn1rt* ) need to be loaded in
+ an embedded system.
+
+
+
+ Compile-Time Functions
+ The ASN.1 compiler can be started directly from the command line
+ by the erlc program. This is convenient when compiling
+ many ASN.1 files from the command line or when using Makefiles.
+ Some examples of how the erlc command can be used to start
+ the ASN.1 compiler:
+
+erlc Person.asn
+erlc -bper Person.asn
+erlc -bber ../Example.asn
+erlc -o ../asnfiles -I ../asnfiles -I /usr/local/standards/asn1 Person.asn
+ Useful options for the ASN.1 compiler:
+
+ -b[ber | per | uper]
+ -
+
Choice of encoding rules. If omitted, ber is the
+ default.
+
+ -o OutDirectory
+ -
+
Where to put the generated files. Default is the current
+ directory.
+
+ -I IncludeDir
+ -
+
Where to search for .asn1db files and ASN.1
+ source specs to resolve references to other
+ modules. This option can be repeated many times if there
+ are several places to search in. The compiler
+ searches the current directory first.
+
+ +der
+ -
+
DER encoding rule. Only when using option -ber .
+
+ +asn1config
+ -
+
This functionality works together with option
+ ber . It enables the specialized decodes, see Section
+ Specialized Decode .
+
+ +undec_rest
+ -
+
A buffer that holds a message being decoded can also have
+ trailing bytes. If those trailing bytes are important, they
+ can be returned along with the decoded value by compiling
+ the ASN.1 specification with option +undec_rest .
+ The return value from the decoder is
+ {ok,Value,Rest} where Rest is a binary
+ containing the trailing bytes.
+
+ +'Any Erlc Option'
+ -
+
Any option can be added to the Erlang compiler when
+ compiling the generated Erlang files. Any option
+ unrecognized by the ASN.1 compiler is passed to the
+ Erlang compiler.
+
+
+ For a complete description of erlc , see
+ ERTS Reference Manual.
+ The compiler and other compile-time functions can also be started
+ from the Erlang shell. Here follows a brief
+ description of the primary functions. For a
+ complete description of each function, see module asn1ct in
+ the ASN.1 Reference Manual .
+ The compiler is started by asn1ct:compile/1 with
+ default options, or asn1ct:compile/2 if explicit options
+ are given.
+ Example:
+
+asn1ct:compile("H323-MESSAGES.asn1").
+ This equals:
+
+asn1ct:compile("H323-MESSAGES.asn1",[ber]).
+ If PER encoding is wanted:
+
+asn1ct:compile("H323-MESSAGES.asn1",[per]).
+ The generic encode and decode functions can be called
+ as follows:
+
+'H323-MESSAGES':encode('SomeChoiceType',{call,<<"octetstring">>}).
+'H323-MESSAGES':decode('SomeChoiceType',Bytes).
+
+
+
+ Runtime Functions
+ When an ASN.1 specification is compiled with option ber ,
+ the asn1rt_nif module and the NIF library in
+ asn1/priv_dir are needed at runtime.
+ By calling function info/0 in a generated module, you
+ get information about which compiler options were used.
+
+
+
+ Errors
+ Errors detected at
+ compile-time are displayed on the screen together with line
+ numbers indicating where in the source file the respective error
+ was detected. If no errors are found, an Erlang ASN.1 module is
+ created.
+ The runtime encoders and decoders execute within a catch and
+ return {ok, Data} or
+ {error, {asn1, Description}} where
+ Description is
+ an Erlang term describing the error.
+
+
+
+
+
+ Multi-File Compilation
+ There are various reasons for using multi-file compilation:
+
+ - To choose the name for the generated module, for
+ example, because you need to compile the same specs for
+ different encoding rules.
+ - You want only one resulting module.
+
+ Specify which ASN.1 specs to compile in a module with extension
+ .set.asn . Choose a module name and provide the
+ names of the ASN.1 specs. For example, if you have the specs
+ File1.asn , File2.asn , and File3.asn , your
+ module MyModule.set.asn looks as follows:
+
+File1.asn
+File2.asn
+File3.asn
+ If you compile with the following, the result is one merged
+ module MyModule.erl with the generated code from the three
+ ASN.1 specs:
+
+~> erlc MyModule.set.asn
+
+
+
+ Remark about Tags
+
+ Tags used to be important for all users of ASN.1, because it
+ was necessary to add tags manually to certain constructs in order
+ for the ASN.1 specification to be valid. Example of
+ an old-style specification:
+
+
+Tags DEFINITIONS ::=
+BEGIN
+ Afters ::= CHOICE { cheese [0] IA5String,
+ dessert [1] IA5String }
+END
+
+ Without the tags (the numbers in square brackets) the ASN.1
+ compiler refused to compile the file.
+
+ In 1994 the global tagging mode AUTOMATIC TAGS was introduced.
+ By putting AUTOMATIC TAGS in the module header, the ASN.1
+ compiler automatically adds tags when needed. The following is the
+ same specification in AUTOMATIC TAGS mode:
+
+
+Tags DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+ Afters ::= CHOICE { cheese IA5String,
+ dessert IA5String }
+END
+
+ Tags are not mentioned any more in this User's Guide.
+
+
+
+
+ ASN.1 Types
+ This section describes the ASN.1 types including their
+ functionality, purpose, and how values are assigned in Erlang.
+
+ ASN.1 has both primitive and constructed types:
+
+
+
+ Primitive Types |
+ Constructed Types |
+
+
+ BOOLEAN |
+ SEQUENCE |
+
+
+ INTEGER |
+ SET |
+
+
+ REAL |
+ CHOICE |
+
+
+ NULL |
+ SET OF and SEQUENCE OF |
+
+
+ ENUMERATED |
+ ANY |
+
+
+ BIT STRING |
+ ANY DEFINED BY |
+
+
+ OCTET STRING |
+ EXTERNAL |
+
+
+ Character Strings |
+ EMBEDDED PDV |
+
+
+ OBJECT IDENTIFIER |
+ CHARACTER STRING |
+
+
+ Object Descriptor |
+ |
+
+
+ TIME Types |
+ |
+
+ Supported ASN.1 Types
+
+
+
+ The values of each ASN.1 type have their own representation in Erlang, as
+ described in the following sections. Users must provide
+ these values for encoding according to the representation, as shown in the
+ following example:
+
+
+Operational ::= BOOLEAN --ASN.1 definition
+ In Erlang code it can look as follows:
+
+Val = true,
+{ok,Bytes} = MyModule:encode('Operational', Val),
+
+
+
+ BOOLEAN
+ Booleans in ASN.1 express values that can be either
+ TRUE or FALSE .
+ The meanings assigned to TRUE and FALSE are outside the scope
+ of this text.
+ In ASN.1 it is possible to have:
+
+Operational ::= BOOLEAN
+ Assigning a value to type Operational in Erlang is possible by
+ using the following Erlang code:
+
+Myvar1 = true,
+ Thus, in Erlang the atoms true and false are used
+ to encode a boolean value.
+
+
+
+
+ INTEGER
+ ASN.1 itself specifies indefinitely large integers. Erlang
+ systems with version 4.3 and higher support very large
+ integers, in practice indefinitely large integers.
+ The concept of subtyping can be applied to integers and
+ to other ASN.1 types. The details of subtyping are not
+ explained here; for more information, see X.680. Various
+ syntaxes are allowed when defining a type as an integer:
+
+T1 ::= INTEGER
+T2 ::= INTEGER (-2..7)
+T3 ::= INTEGER (0..MAX)
+T4 ::= INTEGER (0<..MAX)
+T5 ::= INTEGER (MIN<..-99)
+T6 ::= INTEGER {red(0),blue(1),white(2)}
+ The Erlang representation of an ASN.1 INTEGER is an integer or
+ an atom if a Named Number List (see T6 in the previous
+ list) is specified.
+ The following is an example of Erlang code that assigns values for the
+ types in the previous list:
+
+T1value = 0,
+T2value = 6,
+T6value1 = blue,
+T6value2 = 0,
+T6value3 = white
+ These Erlang variables are now bound to valid instances of
+ ASN.1 defined types. This style of value can be passed directly
+ to the encoder for transformation into a series of bytes.
+ The decoder returns an atom if the value corresponds to a
+ symbol in the Named Number List .
+
+
+
+
+ REAL
+ The following ASN.1 type is used for real numbers:
+
+R1 ::= REAL
+ It is assigned a value in Erlang as follows:
+
+R1value1 = "2.14",
+R1value2 = {256,10,-2},
+ In the last line, notice that the tuple {256,10,-2} is the real number
+ 2.56 in a special notation, which encodes faster than simply
+ stating the number as "2.56" . The arity three tuple is
+ {Mantissa,Base,Exponent} , that is, Mantissa * Base^Exponent.
+
+
+
+
+ NULL
+ The type NULL is suitable where supply and recognition of a value
+ is important but the actual value is not.
+
+Notype ::= NULL
+ This type is assigned in Erlang as follows:
+
+N1 = 'NULL',
+ The actual value is the quoted atom 'NULL' .
+
+
+
+
+ ENUMERATED
+ The type ENUMERATED can be used when the value you want to
+ describe can only take one of a set of predefined values. Example:
+
+DaysOfTheWeek ::= ENUMERATED {
+ sunday(1),monday(2),tuesday(3),
+ wednesday(4),thursday(5),friday(6),saturday(7) }
+ For example, to assign a weekday value in Erlang, use the same atom
+ as in the Enumerations of the type definition:
+
+Day1 = saturday,
+ The enumerated type is similar to an integer type, when
+ defined with a set of predefined values. The difference is that
+ an enumerated type can only have specified
+ values, whereas an integer can have any value.
+
+
+
+
+ BIT STRING
+ The type BIT STRING can be used to model information that
+ is made up of arbitrary length series of bits. It is intended
+ to be used for selection of flags, not for binary files.
+ In ASN.1, BIT STRING definitions can look as follows:
+
+Bits1 ::= BIT STRING
+Bits2 ::= BIT STRING {foo(0),bar(1),gnu(2),gnome(3),punk(14)}
+ The following two notations are available for representation of BIT
+ STRING values in Erlang and as input to the encode functions:
+
+ - A bitstring. By default, a
BIT STRING with no
+ symbolic names is decoded to an Erlang bitstring.
+ - A list of atoms corresponding to atoms in the
NamedBitList
+ in the BIT STRING definition. A BIT STRING with symbolic
+ names is always decoded to the format shown in the following
+ example:
+
+
+Bits1Val1 = <<0:1,1:1,0:1,1:1,1:1>>,
+Bits2Val1 = [gnu,punk],
+Bits2Val2 = <<2#1110:4>>,
+Bits2Val3 = [bar,gnu,gnome],
+ Bits2Val2 and Bits2Val3 denote the same value.
+ Bits2Val1 is assigned symbolic values. The assignment means
+ that the bits corresponding to gnu and punk , that is, bits
+ 2 and 14 are set to 1, and the rest are set to 0. The symbolic values
+ are shown as a list of values. If a named value, which is not
+ specified in the type definition, is shown, a runtime error occurs.
+ BIT STRING s can also be subtyped with, for example, a SIZE
+ specification:
+
+Bits3 ::= BIT STRING (SIZE(0..31))
+ This means that no bit higher than 31 can be set.
+
+
+ Deprecated Representations for BIT STRING
+ In addition to the representations described earlier, the
+ following deprecated representations are available if the
+ specification has been compiled with option
+ legacy_erlang_types :
+
+ - Aa a list of binary digits (0 or 1). This format is
+ accepted as input to the encode functions, and a
BIT STRING
+ is decoded to this format if option
+ legacy_bit_string is given.
+
+ - As
{Unused,Binary} where Unused denotes
+ how many trailing zero-bits 0-7 that are unused in the
+ least significant byte in Binary . This format is
+ accepted as input to the encode functions, and a BIT
+ STRING is decoded to this format if
+ compact_bit_string has been given.
+
+ - As a hexadecimal number (or an integer). Avoid this
+ as it is easy to misinterpret a
BIT
+ STRING value in this format.
+
+
+
+
+
+
+
+ OCTET STRING
+ OCTET STRING is the simplest of all ASN.1 types. OCTET
+ STRING only moves or transfers, for example, binary files or other
+ unstructured information complying with two rules: the
+ bytes consist of octets and encoding is not required.
+ It is possible to have the following ASN.1 type definitions:
+
+O1 ::= OCTET STRING
+O2 ::= OCTET STRING (SIZE(28))
+ With the following example assignments in Erlang:
+
+O1Val = <<17,13,19,20,0,0,255,254>>,
+O2Val = <<"must be exactly 28 chars....">>,
+ By default, an OCTET STRING is always represented as
+ an Erlang binary. If the specification has been compiled with
+ option legacy_erlang_types , the encode functions
+ accept both lists and binaries, and the decode functions
+ decode an OCTET STRING to a list.
+
+
+
+
+ Character Strings
+ ASN.1 supports a wide variety of character sets. The main difference
+ between an OCTET STRING and a character string is that the
+ OCTET STRING has no imposed semantics on the bytes delivered.
+ However, when using, for example, IA5String (which closely
+ resembles ASCII), byte 65 (in decimal
+ notation) means character 'A'.
+
+ For example, if a defined type is to be a VideotexString and
+ an octet is received with the unsigned integer value X ,
+ the octet is to be interpreted as specified in standard
+ ITU-T T.100, T.101.
+
+ The ASN.1 to Erlang compiler
+ does not determine the correct interpretation of each BER
+ string octet value with different character strings. The
+ application is responsible for interpretation
+ of octets. Therefore, from the BER
+ string point of view, octets are very similar to
+ character strings and are compiled in the same way.
+
+ When PER is
+ used, there is a significant difference in the encoding scheme
+ between OCTET STRING s and other strings. The constraints
+ specified for a type are especially important for PER, where
+ they affect the encoding.
+
+ Examples:
+
+Digs ::= NumericString (SIZE(1..3))
+TextFile ::= IA5String (SIZE(0..64000))
+ The corresponding Erlang assignments:
+
+DigsVal1 = "456",
+DigsVal2 = "123",
+TextFileVal1 = "abc...xyz...",
+TextFileVal2 = [88,76,55,44,99,121 .......... a lot of characters here ....]
+ The Erlang representation for "BMPString" and
+ "UniversalString" is either a list of ASCII values or a list
+ of quadruples. The quadruple representation associates to the
+ Unicode standard representation of characters. The ASCII
+ characters are all represented by quadruples beginning with
+ three zeros like {0,0,0,65} for character 'A'. When
+ decoding a value for these strings, the result is a list of
+ quadruples, or integers when the value is an ASCII character.
+
+ The following example shows how it works. Assume the following
+ specification is in file PrimStrings.asn1 :
+
+PrimStrings DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+ BMP ::= BMPString
+END
+
+ Encoding and decoding some strings:
+
+
+1> asn1ct:compile('PrimStrings', [ber]).
+ok
+2> {ok,Bytes1} = 'PrimStrings':encode('BMP', [{0,0,53,53},{0,0,45,56}]).
+{ok,<<30,4,53,54,45,56>>}
+3> 'PrimStrings':decode('BMP', Bytes1).
+{ok,[{0,0,53,53},{0,0,45,56}]}
+4> {ok,Bytes2} = 'PrimStrings':encode('BMP', [{0,0,53,53},{0,0,0,65}]).
+{ok,<<30,4,53,53,0,65>>}
+5> 'PrimStrings':decode('BMP', Bytes2).
+{ok,[{0,0,53,53},65]}
+6> {ok,Bytes3} = 'PrimStrings':encode('BMP', "BMP string").
+{ok,<<30,20,0,66,0,77,0,80,0,32,0,115,0,116,0,114,0,105,0,110,0,103>>}
+7> 'PrimStrings':decode('BMP', Bytes3).
+{ok,"BMP string"}
+
+ Type UTF8String is represented as a UTF-8 encoded binary in
+ Erlang. Such binaries can be created directly using the binary syntax
+ or by converting from a list of Unicode code points using function
+ unicode:characters_to_binary/1 .
+
+ The following shows examples of how UTF-8 encoded binaries can
+ be created and manipulated:
+
+1> Gs = "Мой маленький Гном".
+[1052,1086,1081,32,1084,1072,1083,1077,1085,1100,1082,1080,
+ 1081,32,1043,1085,1086,1084]
+2> Gbin = unicode:characters_to_binary(Gs).
+<<208,156,208,190,208,185,32,208,188,208,176,208,187,208,
+ 181,208,189,209,140,208,186,208,184,208,185,32,208,147,
+ 208,...>>
+3> Gbin = <<"Мой маленький Гном"/utf8>>.
+<<208,156,208,190,208,185,32,208,188,208,176,208,187,208,
+ 181,208,189,209,140,208,186,208,184,208,185,32,208,147,
+ 208,...>>
+4> Gs = unicode:characters_to_list(Gbin).
+[1052,1086,1081,32,1084,1072,1083,1077,1085,1100,1082,1080,
+ 1081,32,1043,1085,1086,1084]
+
+ For details, see the unicode
+ module in stdlib .
+
+ In the following example, this ASN.1 specification is used:
+
+UTF DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+ UTF ::= UTF8String
+END
+
+ Encoding and decoding a string with Unicode characters:
+
+
+5> asn1ct:compile('UTF', [ber]).
+ok
+6> {ok,Bytes1} = 'UTF':encode('UTF', <<"Гном"/utf8>>).
+{ok,<<12,8,208,147,208,189,208,190,208,188>>}
+7> {ok,Bin1} = 'UTF':decode('UTF', Bytes1).
+{ok,<<208,147,208,189,208,190,208,188>>}
+8> io:format("~ts\n", [Bin1]).
+Гном
+ok
+9> unicode:characters_to_list(Bin1).
+[1043,1085,1086,1084]
+
+
+
+
+ OBJECT IDENTIFIER
+ The type OBJECT IDENTIFIER is used whenever a unique identity is
+ required. An ASN.1 module, a transfer syntax, and so on, is identified
+ with an OBJECT IDENTIFIER . Assume the following example:
+
+Oid ::= OBJECT IDENTIFIER
+ Therefore, the following example is a valid Erlang instance of
+ type 'Oid':
+
+OidVal1 = {1,2,55},
+ The OBJECT IDENTIFIER value is simply a tuple with the
+ consecutive values, which must be integers.
+
+ The first value is limited to the values 0, 1, or 2. The
+ second value must be in the range 0..39 when the first value
+ is 0 or 1.
+
+ The OBJECT IDENTIFIER is an important type and it is
+ widely used within different standards to identify various
+ objects uniquely. Dubuisson: ASN.1 - Communication Between
+ Heterogeneous Systems includes an
+ easy-to-understand description of the use of
+ OBJECT IDENTIFIER .
+
+
+
+
+ Object Descriptor
+ Values of this type can be assigned a value as an ordinary string
+ as follows:
+
+
+ "This is the value of an Object descriptor"
+
+
+
+
+ TIME Types
+ Two time types are defined within ASN.1: Generalized
+ Time and Universal Time Coordinated (UTC). Both are assigned a
+ value as an ordinary string within double quotes, for example,
+ "19820102070533.8".
+ For DER encoding, the compiler does not check the validity
+ of the time values. The DER requirements upon those strings are
+ regarded as a matter for the application to fulfill.
+
+
+
+
+ SEQUENCE
+ The structured types of ASN.1 are constructed from other types
+ in a manner similar to the concepts of array and struct in C.
+ A SEQUENCE in ASN.1 is
+ comparable with a struct in C and a record in Erlang.
+ A SEQUENCE can be defined as follows:
+
+Pdu ::= SEQUENCE {
+ a INTEGER,
+ b REAL,
+ c OBJECT IDENTIFIER,
+ d NULL }
+ This is a 4-component structure called Pdu . The record format
+ is the major format for representation of SEQUENCE in Erlang.
+ For each SEQUENCE and SET in an ASN.1 module an Erlang
+ record declaration is generated. For Pdu , a record
+ like the following is defined:
+
+-record('Pdu',{a, b, c, d}).
+ The record declarations for a module M are placed in a
+ separate M.hrl file.
+ Values can be assigned in Erlang as follows:
+
+MyPdu = #'Pdu'{a=22,b=77.99,c={0,1,2,3,4},d='NULL'}.
+ The decode functions return a record as result when decoding
+ a SEQUENCE or a SET .
+
+ A SEQUENCE and a SET can contain a component
+ with a DEFAULT keyword followed by the actual value, which
+ is the default value. The DEFAULT keyword means that the
+ application doing the encoding can omit encoding of the value, which
+ results in fewer bytes to send to the receiving application.
+
+ An application can use the atom asn1_DEFAULT to indicate
+ that the encoding is to be omitted for that position in
+ the SEQUENCE .
+
+ Depending on the encoding rules, the encoder can also compare
+ the given value to the default value and automatically omit the
+ encoding if the values are equal. How much effort the encoder makes
+ to compare the values depends on the encoding rules. The DER
+ encoding rules forbid encoding a value equal to the default value,
+ so it has a more thorough and time-consuming comparison than the
+ encoders for the other encoding rules.
+
+ In the following example, this ASN.1 specification is used:
+
+File DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+Seq1 ::= SEQUENCE {
+ a INTEGER DEFAULT 1,
+ b Seq2 DEFAULT {aa TRUE, bb 15}
+}
+
+Seq2 ::= SEQUENCE {
+ aa BOOLEAN,
+ bb INTEGER
+}
+
+Seq3 ::= SEQUENCE {
+ bs BIT STRING {a(0), b(1), c(2)} DEFAULT {a, c}
+}
+END
+ Example where the BER encoder is able to omit encoding
+ of the default values:
+
+1> asn1ct:compile('File', [ber]).
+ok
+2> 'File':encode('Seq1', {'Seq1',asn1_DEFAULT,asn1_DEFAULT}).
+{ok,<<48,0>>}
+3> 'File':encode('Seq1', {'Seq1',1,{'Seq2',true,15}}).
+{ok,<<48,0>>}
+
+ Example with a named BIT STRING where the BER
+ encoder does not omit the encoding:
+
+4> 'File':encode('Seq3', {'Seq3',asn1_DEFAULT).
+{ok,<<48,0>>}
+5> 'File':encode('Seq3', {'Seq3',<<16#101:3>>).
+{ok,<<48,4,128,2,5,160>>}
+
+ The DER encoder omits the encoding for the same BIT STRING :
+
+6> asn1ct:compile('File', [ber,der]).
+ok
+7> 'File':encode('Seq3', {'Seq3',asn1_DEFAULT).
+{ok,<<48,0>>}
+8> 'File':encode('Seq3', {'Seq3',<<16#101:3>>).
+{ok,<<48,0>>}
+
+
+
+
+ SET
+ In Erlang, the SET type is used exactly as SEQUENCE .
+ Notice that if BER or DER encoding rules are used, decoding a
+ SET is slower than decoding a SEQUENCE because the
+ components must be sorted.
+
+
+
+ Extensibility for SEQUENCE and SET
+ When a SEQUENCE or SET contains an extension marker
+ and extension components as the following, the type can get more
+ components in newer versions of the ASN.1 spec:
+
+SExt ::= SEQUENCE {
+ a INTEGER,
+ ...,
+ b BOOLEAN }
+ In this case it has got a new
+ component b . Thus, incoming messages that are decoded
+ can have more or fever components than this one.
+
+ The component b is treated as
+ an original component when encoding a message. In this case, as
+ it is not an optional element, it must be encoded.
+
+ During decoding, the b field of the record gets the decoded
+ value of the b
+ component, if present, otherwise the value asn1_NOVALUE .
+
+
+
+
+ CHOICE
+ The type CHOICE is a space saver and is similar to the
+ concept of a 'union' in C.
+ Assume the following:
+
+SomeModuleName DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+T ::= CHOICE {
+ x REAL,
+ y INTEGER,
+ z OBJECT IDENTIFIER }
+END
+ It is then possible to assign values as follows:
+
+TVal1 = {y,17},
+TVal2 = {z,{0,1,2}},
+ A CHOICE value is always represented as the tuple
+ {ChoiceAlternative, Val} where ChoiceAlternative
+ is an atom denoting the selected choice alternative.
+
+
+
+ Extensible CHOICE
+ When a CHOICE contains an extension marker and the
+ decoder detects an unknown alternative of the CHOICE ,
+ the value is represented as follows:
+
+{asn1_ExtAlt, BytesForOpenType}
+ Here BytesForOpenType is a list of bytes constituting the
+ encoding of the "unknown" CHOICE alternative.
+
+
+
+
+
+ SET OF and SEQUENCE OF
+ The types SET OF and SEQUENCE OF correspond
+ to the concept of an array
+ in several programming languages. The Erlang syntax for
+ both types is straightforward, for example:
+
+Arr1 ::= SET SIZE (5) OF INTEGER (4..9)
+Arr2 ::= SEQUENCE OF OCTET STRING
+ In Erlang the following can apply:
+
+Arr1Val = [4,5,6,7,8],
+Arr2Val = ["abc",[14,34,54],"Octets"],
+ Notice that the definition of type SET OF implies that
+ the order of the components is undefined, but in practice there is
+ no difference between SET OF and SEQUENCE OF .
+ The ASN.1 compiler for Erlang does not randomize the order of the
+ SET OF components before encoding.
+ However, for a value of type SET OF , the DER
+ encoding format requires the elements to be sent in ascending
+ order of their encoding, which implies an expensive sorting
+ procedure in runtime. Therefore it is recommended to
+ use SEQUENCE OF instead of SET OF if possible.
+
+
+
+
+ ANY and ANY DEFINED BY
+ The types ANY and ANY DEFINED BY have been removed
+ from the standard since 1994. It is recommended not to use
+ these types any more. They can, however, exist in some old ASN.1
+ modules. The idea with this type was to leave a "hole" in a
+ definition where it was possible to
+ put unspecified data of any kind, even non-ASN.1 data.
+ A value of this type is encoded as an open type .
+ Instead of ANY and ANY DEFINED BY , it is
+ recommended to use
+ information object class , table constraints , and
+ parameterization . In particular the construct
+ TYPE-IDENTIFIER.@Type accomplish the same as the
+ deprecated ANY .
+ See also
+ Information object .
+
+
+
+
+ EXTERNAL, EMBEDDED PDV, and CHARACTER STRING
+ The types EXTERNAL , EMBEDDED PDV , and
+ CHARACTER STRING are used in presentation layer negotiation.
+ They are encoded according to their associated type, see X.680.
+ The type EXTERNAL had a slightly different associated type
+ before 1994. X.691 states that encoding must follow
+ the older associated type. So, generated encode/decode
+ functions convert values of the newer format to the older format
+ before encoding. This implies that it is allowed to use
+ EXTERNAL type values of either format for encoding. Decoded
+ values are always returned in the newer format.
+
+
+
+ Embedded Named Types
+ The structured types previously described can have other named
+ types as their components. The general syntax to assign a value
+ to component C of a named ASN.1 type T in Erlang
+ is the record syntax #'T'{'C'=Value} .
+ Here Value can be a value of yet another type T2 ,
+ for example:
+
+EmbeddedExample DEFINITIONS AUTOMATIC TAGS ::=
+BEGIN
+B ::= SEQUENCE {
+ a Arr1,
+ b T }
+
+Arr1 ::= SET SIZE (5) OF INTEGER (4..9)
+
+T ::= CHOICE {
+ x REAL,
+ y INTEGER,
+ z OBJECT IDENTIFIER }
+ END
+ SEQUENCE b can be encoded as follows in Erlang:
+
+1> 'EmbeddedExample':encode('B', {'B',[4,5,6,7,8],{x,"7.77"}}).
+{ok,<<5,56,0,8,3,55,55,55,46,69,45,50>>}
+
+
+
+
+ Naming of Records in .hrl Files
+ When an ASN.1 specification is compiled, all defined types of type
+ SET or SEQUENCE result in a corresponding record in the
+ generated .hrl file. This is because the values for
+ SET and SEQUENCE are represented as records as
+ mentioned earlier.
+ Some special cases of this functionality are presented in the
+ next section.
+
+
+ Embedded Structured Types
+ In ASN.1 it is also possible to have components that are themselves
+ structured types.
+ For example, it is possible to have the following:
+
+Emb ::= SEQUENCE {
+ a SEQUENCE OF OCTET STRING,
+ b SET {
+ a INTEGER,
+ b INTEGER DEFAULT 66},
+ c CHOICE {
+ a INTEGER,
+ b FooType } }
+
+FooType ::= [3] VisibleString
+ The following records are generated because of type Emb :
+
+-record('Emb,{a, b, c}).
+-record('Emb_b',{a, b = asn1_DEFAULT}). % the embedded SET type
+ Values of type Emb can be assigned as follows:
+
+V = #'Emb'{a=["qqqq",[1,2,255]],
+ b = #'Emb_b'{a=99},
+ c ={b,"Can you see this"}}.
+ For an embedded type of type SEQUENCE /SET in a
+ SEQUENCE /SET , the record name is extended with an
+ underscore and the component name. If the embedded structure is
+ deeper with the SEQUENCE , SET , or CHOICE
+ types in the line, each component name/alternative name is
+ added to the record name.
+ Example:
+
+Seq ::= SEQUENCE{
+ a CHOICE{
+ b SEQUENCE {
+ c INTEGER
+ }
+ }
+}
+ This results in the following record:
+
+-record('Seq_a_b',{c}).
+ If the structured type has a component with an embedded
+ SEQUENCE OF /SET OF which embedded type in turn
+ is a SEQUENCE /SET , it gives a record with the
+ SEQUENCE OF /SET OF
+ addition as in the following example:
+
+Seq ::= SEQUENCE {
+ a SEQUENCE OF SEQUENCE {
+ b
+ }
+ c SET OF SEQUENCE {
+ d
+ }
+}
+ This results in the following records:
+
+-record('Seq_a_SEQOF'{b}).
+-record('Seq_c_SETOF'{d}).
+ A parameterized type is to be considered as an embedded
+ type. Each time such a type is referenced, an instance of it is
+ defined. Thus, in the following example a record with name
+ 'Seq_b' is generated in the .hrl file and is used
+ to hold values:
+
+Seq ::= SEQUENCE {
+ b PType{INTEGER}
+}
+
+PType{T} ::= SEQUENCE{
+ id T
+}
+
+
+
+ Recursive Types
+ Types that refer to themselves are called recursive types.
+ Example:
+
+Rec ::= CHOICE {
+ nothing NULL,
+ something SEQUENCE {
+ a INTEGER,
+ b OCTET STRING,
+ c Rec }}
+ This is allowed in ASN.1 and the ASN.1-to-Erlang compiler
+ supports this recursive type.
+ A value for this type is assigned in Erlang as follows:
+
+V = {something,#'Rec_something'{a = 77,
+ b = "some octets here",
+ c = {nothing,'NULL'}}}.
+
+
+
+
+ ASN.1 Values
+ Values can be assigned to an ASN.1 type within the ASN.1 code
+ itself, as opposed to the actions in the previous section where
+ a value was assigned to an ASN.1 type in Erlang. The full value
+ syntax of ASN.1 is supported and X.680 describes in detail how
+ to assign values in ASN.1. A short example:
+
+TT ::= SEQUENCE {
+ a INTEGER,
+ b SET OF OCTET STRING }
+
+tt TT ::= {a 77,b {"kalle","kula"}}
+ The value defined here can be used in several ways. It can, for
+ example, be used as the value in some DEFAULT component:
+
+SS ::= SET {
+ s OBJECT IDENTIFIER,
+ val TT DEFAULT tt }
+ It can also be used from inside an Erlang program. If this ASN.1
+ code is defined in ASN.1 module Values , the ASN.1 value
+ tt can be reached from Erlang as a function call to
+ 'Values':tt() as in the following example:
+
+1> Val = 'Values':tt().
+{'TT',77,["kalle","kula"]}
+2> {ok,Bytes} = 'Values':encode('TT',Val).
+{ok,<<48,18,128,1,77,161,13,4,5,107,97,108,108,101,4,4,
+ 107,117,108,97>>}
+4> 'Values':decode('TT',Bytes).
+{ok,{'TT',77,["kalle","kula"]}}
+5>
+ This example shows that a function is generated by the compiler
+ that returns a valid Erlang representation of the value, although
+ the value is of a complex type.
+ Furthermore, a macro is generated for each value in the .hrl
+ file. So, the defined value tt can also be extracted by
+ ?tt in application code.
+
+
+
+ Macros
+ The type MACRO is not supported. It is no longer part of
+ the ASN.1 standard.
+
+
+
+
+ ASN.1 Information Objects (X.681)
+ Information Object Classes, Information Objects, and Information
+ Object Sets (in the following called classes, objects, and
+ object sets, respectively) are defined in the standard
+ definition X.681. Only a brief explanation is given here.
+ These constructs makes it possible to define open types, that
+ is, values of that type can be of any ASN.1 type. Also,
+ relationships can be defined between different types and
+ values, as classes can hold types, values, objects, object
+ sets, and other classes in their fields. A class can be
+ defined in ASN.1 as follows:
+
+GENERAL-PROCEDURE ::= CLASS {
+ &Message,
+ &Reply OPTIONAL,
+ &Error OPTIONAL,
+ &id PrintableString UNIQUE
+}
+WITH SYNTAX {
+ NEW MESSAGE &Message
+ [REPLY &Reply]
+ [ERROR &Error]
+ ADDRESS &id
+}
+ An object is an instance of a class. An object set is a set
+ containing objects of a specified class. A definition can look
+ as follows:
+
+object1 GENERAL-PROCEDURE ::= {
+ NEW MESSAGE PrintableString
+ ADDRESS "home"
+}
+
+object2 GENERAL-PROCEDURE ::= {
+ NEW MESSAGE INTEGER
+ ERROR INTEGER
+ ADDRESS "remote"
+}
+ The object object1 is an instance of the class
+ GENERAL-PROCEDURE and has one type field and one
+ fixed type value field. The object object2 has also an
+ optional field ERROR , which is a type field. The field
+ ADDRESS is a UNIQUE field. Objects in an object set
+ must have unique values in their UNIQUE field, as in
+ GENERAL-PROCEDURES :
+
+GENERAL-PROCEDURES GENERAL-PROCEDURE ::= {
+ object1 | object2}
+ You cannot encode a class, object, or object set, only refer to
+ it when defining other ASN.1 entities. Typically you refer to a
+ class as well as to object sets by table constraints and component
+ relation constraints (X.682) in ASN.1 types, as in the following:
+
+StartMessage ::= SEQUENCE {
+ msgId GENERAL-PROCEDURE.&id ({GENERAL-PROCEDURES}),
+ content GENERAL-PROCEDURE.&Message ({GENERAL-PROCEDURES}{@msgId}),
+ }
+ In type StartMessage , the constraint following field
+ content tells that in a value of type
+ StartMessage the value in field content must
+ come from the same object that is chosen by field msgId .
+ So, the value
+ #'StartMessage'{msgId="home",content="Any Printable String"}
+ is legal to encode as a StartMessage value. However, the value
+ #'StartMessage'{msgId="remote", content="Some String"}
+ is illegal as the constraint in StartMessage tells that
+ when you have chosen a value from a specific object in object
+ set GENERAL-PROCEDURES in field
+ msgId , you must choose a value from that same object in
+ the content field too. In this second case, it is to be
+ any INTEGER value.
+ StartMessage can in field content be
+ encoded with a value of any type that an object in object set
+ GENERAL-PROCEDURES has in its NEW MESSAGE field.
+ This field refers to a type field
+ &Message in the class. Field msgId is always
+ encoded as a PrintableString , as the field refers to a
+ fixed type in the class.
+ In practice, object sets are usually declared to be extensible so
+ that more objects can be added to the set later. Extensibility is
+ indicated as follows:
+
+GENERAL-PROCEDURES GENERAL-PROCEDURE ::= {
+ object1 | object2, ...}
+ When decoding a type that uses an extensible set constraint,
+ it is always possible that the value in field UNIQUE
+ is unknown (that is, the type has been encoded with a later
+ version of the ASN.1 specification). The unencoded data is then
+ returned wrapped in a tuple as follows:
+
+
+{asn1_OPENTYPE,Binary}
+
+ Here Binary is an Erlang binary that contains the encoded
+ data. (If option legacy_erlang_types has been given,
+ only the binary is returned.)
+
+
+
+ Parameterization (X.683)
+ Parameterization, which is defined in X.683, can be used when
+ defining types, values, value sets, classes, objects, or object sets.
+ A part of a definition can be supplied as a parameter. For
+ example, if a Type is used in a definition with a certain
+ purpose, you want the type name to express the intention. This
+ can be done with parameterization.
+ When many types (or another ASN.1 entity) only differ in some
+ minor cases, but the structure of the types is similar, only
+ one general type can be defined and the differences can be supplied
+ through parameters.
+ Example of use of parameterization:
+
+General{Type} ::= SEQUENCE
+{
+ number INTEGER,
+ string Type
+}
+
+T1 ::= General{PrintableString}
+
+T2 ::= General{BIT STRING}
+ An example of a value that can be encoded as type T1 is
+ {12,"hello"} .
+ Notice that the compiler does not generate encode/decode functions
+ for parameterized types, only for the instances of the parameterized
+ types. Therefore, if a file contains the types General{} ,
+ T1 , and T2 as in the previous example, encode/decode
+ functions are only generated for T1 and T2 .
+
+
+
+
diff --git a/lib/asn1/doc/src/asn1_introduction.xml b/lib/asn1/doc/src/asn1_introduction.xml
new file mode 100644
index 0000000000..ae0379684a
--- /dev/null
+++ b/lib/asn1/doc/src/asn1_introduction.xml
@@ -0,0 +1,99 @@
+
+
+
+
+
+
+ 1997 2013
+ Ericsson AB. All Rights Reserved.
+
+
+ The contents of this file are subject to the Erlang Public License,
+ Version 1.1, (the "License"); you may not use this file except in
+ compliance with the License. You should have received a copy of the
+ Erlang Public License along with this software. If not, it can be
+ retrieved online at http://www.erlang.org/.
+
+ Software distributed under the License is distributed on an "AS IS"
+ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ the License for the specific language governing rights and limitations
+ under the License.
+
+
+
+ Introduction
+
+
+ 2015-03-31
+ A
+ asn1_introduction.xml
+
+
+ The ASN.1 application provides the following:
+
+
+ - An ASN.1 compiler for Erlang, which generates encode and
+ decode functions to be used by Erlang programs sending and
+ receiving ASN.1 specified data.
+ - Runtime functions used by the generated code.
+ - Support for the following encoding rules:
+
- Basic Encoding Rules (BER)
+ - Distinguished Encoding Rules (DER), a specialized form of
+ BER that is used in security-conscious applications
+ - Packed Encoding Rules (PER), both the aligned and
+ unaligned variant
+
+
+
+
+
+ Scope
+ This application covers all features of ASN.1 up to the 1997
+ edition of the specification. In the 2002 edition,
+ new features were introduced. The following features
+ of the 2002 edition are fully or partly supported:
+
+ -
+
Decimal notation (for example, "1.5e3 ) for REAL values.
+ The NR1, NR2, and NR3 formats as explained in ISO 6093 are
+ supported.
+
+ -
+
The RELATIVE-OID type for relative object identifiers is
+ fully supported.
+
+ -
+
The subtype constraint (CONTAINING /ENCODED BY ) to
+ constrain the content of an octet string or a bit string is
+ parsed when compiling, but no further action is taken. This
+ constraint is not a PER-visible constraint.
+
+ -
+
The subtype constraint by regular expressions (PATTERN )
+ for character string types is parsed when compiling, but no
+ further action is taken. This constraint is not a
+ PER-visible constraint.
+
+ -
+
Multiple-line comments as in C, /* ... */ , are
+ supported.
+
+
+
+
+
+ Prerequisites
+ It is assumed that the reader is familiar with the Erlang
+ programming language, concepts of OTP, and is familiar with the
+ ASN.1 notation. The ASN.1 notation is documented in the standard
+ definition X.680, which is the primary text. It can also be
+ helpful, but not necessary, to read the standard definitions
+ X.681, X.682, X.683, X.690, and X.691.
+ A good book explaining those reference texts is
+ Dubuisson: ASN.1 - Communication Between Heterogeneous Systems,
+ is free to download at
+ http://www.oss.com/asn1/dubuisson.html .
+
+
+
+
diff --git a/lib/asn1/doc/src/asn1_overview.xml b/lib/asn1/doc/src/asn1_overview.xml
new file mode 100644
index 0000000000..4a10819c36
--- /dev/null
+++ b/lib/asn1/doc/src/asn1_overview.xml
@@ -0,0 +1,49 @@
+
+
+
+
+
+
+ 1997 2013
+ Ericsson AB. All Rights Reserved.
+
+
+ The contents of this file are subject to the Erlang Public License,
+ Version 1.1, (the "License"); you may not use this file except in
+ compliance with the License. You should have received a copy of the
+ Erlang Public License along with this software. If not, it can be
+ retrieved online at http://www.erlang.org/.
+
+ Software distributed under the License is distributed on an "AS IS"
+ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ the License for the specific language governing rights and limitations
+ under the License.
+
+
+
+ ASN.1
+ Kenneth Lundin
+
+ 1999-03-25
+ D
+ asn1_overview.xml
+
+
+
+ Introduction
+
+ ASN.1 is a formal language for
+ describing data structures to be exchanged between distributed
+ computer systems. The purpose of ASN.1 is to have a platform
+ and programming language independent notation to express types
+ using a standardized set of rules for the transformation of
+ values of a defined type into a stream of bytes. This stream of
+ bytes can then be sent on any type of communication
+ channel. This way, two applications written in different
+ programming languages running on different computers, and with
+ different internal representation of data, can exchange instances
+ of structured data types.
+
+
+
+
diff --git a/lib/asn1/doc/src/asn1_spec.xmlsrc b/lib/asn1/doc/src/asn1_spec.xmlsrc
index 9001aca65c..5bee9f0075 100644
--- a/lib/asn1/doc/src/asn1_spec.xmlsrc
+++ b/lib/asn1/doc/src/asn1_spec.xmlsrc
@@ -29,94 +29,105 @@
asn1_spec.xml
- When performance is of highest priority and one is interested in
- a limited part of the ASN.1 encoded message, before one decide what
- to do with the rest of it, one may want to decode only this small
- part. The situation may be a server that has to decide to which
- addressee it will send a message. The addressee may be interested in
- the entire message, but the server may be a bottleneck that one want
- to spare any unnecessary load. Instead of making two complete decodes (the normal case of decode), one in the server and one
- in the addressee, it is only necessary to make one specialized decode(in the server) and another complete decode(in the
- addressee). The following specialized decodes exclusive decode and selected decode support to solve this and
- similar problems.
-
+ When performance is of highest priority and you are interested in
+ a limited part of the ASN.1 encoded message before deciding what
+ to do with the rest of it, an option is to decode only this small
+ part. The situation can be a server that has to decide the
+ addressee of a message. The addressee can be interested in
+ the entire message, but the server can be a bottleneck that you want
+ to spare any unnecessary load.
+ Instead of making two complete decodes (the normal case of
+ decode), one in the server and one in the addressee, it is only
+ necessary to make one specialized decode(in the server)
+ and another complete decode(in the addressee). This section
+ describes the following two specialized decodes, which support
+ to solve this and similar problems:
+
+ - Exclusive decode
+ - Selected decode
+
So far this functionality is only provided when using the
- optimized BER_BIN version, that is when compiling with the
- options ber_bin and optimize . It does also work
- using the nif option. We have no intent to make this
- available on the default BER version, but maybe in the PER_BIN
- version (per_bin ).
+ optimized BER_BIN version, that is, when compiling with
+ options ber_bin and optimize . It also works
+ with optionnif . We do not intent to make this functionality
+ available in the default BER version, but possibly in the
+ PER_BIN version (per_bin ).
Exclusive Decode
The basic idea with exclusive
- decode is that you specify which parts of the message you want to
+ decode is to specify which parts of the message you want to
exclude from being decoded. These parts remain encoded and are
- returned in the value structure as binaries. They may be decoded
+ returned in the value structure as binaries. They can be decoded
in turn by passing them to a certain decode_part/2
- function. The performance gain is high when the message is large
- and you can do an exclusive decode and later on one or several
- decodes of the parts or a second complete decode instead of two or
+ function. The performance gain is high for large messages.
+ You can do an exclusive decode and later one or more
+ decodes of the parts, or a second complete decode instead of two or
more complete decodes.
- How To Make It Work
- In order to make exclusive decode work you have to do the
- following:
+
Procedure
+ To perform an exclusive decode:
- - First,decide the name of the function for the exclusive
- decode.
- - Second, write instructions that must consist of the name
- of the exclusive decode function, the name of the ASN.1
- specification and a notation that tells which parts of the
- message structure will be excluded from decode. These
- instructions shall be included in a configuration
- file.
- - Third, compile with the additional option
-
asn1config . The compiler searches for a configuration
- file with the same name as the ASN.1 spec but with the
- extension .asn1config. This configuration file is not the same
- as used for compilation of a set of files. See section
- Writing an Exclusive Decode Instruction.
+ - Step 1: Decide the name of the function for the
+ exclusive decode.
+ Step 2: Include the following instructions in
+ a configuration file:
+
+ - The name of the exclusive decode function
+ - The name of the ASN.1 specification
+ - A notation that tells which parts of the message
+ structure to be excluded from decode
+
+ - Step 3 Compile with the additional option
+
asn1config . The compiler searches for a configuration
+ file with the same name as the ASN.1 specification but with
+ extension .asn1config . This configuration file is not
+ the same as used for compilation of a set of files. See Section
+ Writing an Exclusive Decode
+ Instruction.
User Interface
- The run-time user interface for exclusive decode consists of
- two different functions. First, the function for an exclusive
- decode, whose name the user decides in the configuration
- file. Second, the compiler generates a decode_part/2
- function when exclusive decode is chosen. This function decodes
- the parts that were left undecoded during the exclusive
- decode. Both functions are described below.
-
- If the exclusive decode function has for example got the name
+
The runtime user interface for exclusive decode consists of
+ the following two functions:
+
+ - A function for an exclusive decode, whose name the user
+ decides in the configuration file
+ - The compiler generates a
decode_part/2
+ function when exclusive decode is chosen. This function decodes
+ the parts that were left undecoded during the exclusive
+ decode.
+
+ Both functions are described in the following.
+ If the exclusive decode function has, for example, the name
decode_exclusive and an ASN.1 encoded message
- Bin shall be exclusive decoded, the call is:
+ Bin is to be exclusive decoded, the call is as follows:
{ok,Excl_Message} = 'MyModule':decode_exclusive(Bin)
- The result Excl_Message has the same structure as an
- complete decode would have, except for the parts of the top-type
- that were not decoded. The undecoded parts will be on their place
- in the structure on the format {Type_Key,Undecoded_Value} .
+
The result Excl_Message has the same structure as a
+ complete decode would have, except for the parts of the top type
+ that were not decoded. The undecoded parts are on their places
+ in the structure on format {Type_Key,Undecoded_Value} .
- Each undecoded part that shall be decoded must be fed into the decode_part/2 function,like:
+ Each undecoded part that is to be decoded must be fed into
+ function decode_part/2 as follows:
-{ok,Part_Message} = 'MyModule':decode_part(Type_Key,Undecoded_Value)
+{ok,Part_Message} = 'MyModule':decode_part(Type_Key,Undecoded_Value)
Writing an Exclusive Decode Instruction
- This instruction is written in the configuration file on the
- format:
+ This instruction is written in the configuration file
+ in the following format:
-
Exclusive_Decode_Instruction = {exclusive_decode,{Module_Name,Decode_Instructions}}.
Module_Name = atom()
@@ -137,70 +148,76 @@ Element = {Name,parts} |
Top_Type = atom()
-Name = atom()
-
- Observe that the instruction must be a valid Erlang term ended
- by a dot.
+Name = atom()
+
The instruction must be a valid Erlang term ended by a dot.
- In the Type_List the "path" from the top type to each
- undecoded sub-components is described. The top type of the path is
+
In Type_List the "path" from the top type to each
+ undecoded subcomponents is described. The top type of the path is
an atom, the name of it. The action on each component/type that
- follows will be described by one of {Name,parts}, {Name,undecoded}, {Name,Element_List}
- The use and effect of the actions are:
+ follows is described by one of
+ {Name,parts}, {Name,undecoded}, {Name,Element_List} .
+ The use and effect of the actions are as follows:
- {Name,undecoded} Tells that the element will be
- left undecoded during the exclusive decode. The type of Name may
- be any ASN.1 type. The value of element Name will be returned as a
- tuple,as mentioned above , in the value structure of the top type.
- {Name,parts} The type of Name may be one of
- SEQUENCE OF or SET OF. The action implies that the different
- components of Name will be left undecoded. The value of Name
- will be returned as a tuple, as above , where the second element is a list of
- binaries. That is because the representation of a SEQUENCE OF/
- SET OF in Erlang is a list of its internal type. Any of the
- elements of this list or the entire list can be decoded by the
- decode_part function.
- {Name,Element_List} This action is used when one or
- more of the sub-types of Name will be exclusive decoded.
+ {Name,undecoded} - Tells that the element is left
+ undecoded during the exclusive decode. The type of Name
+ can be any ASN.1 type. The value of element Name is
+ returned as a tuple (as mentioned in the previous section) in
+ the value structure of the top type.
+ {Name,parts} - The type of Name can be one of
+ SEQUENCE OF or SET OF . The action implies that
+ the different components of Name are left undecoded. The
+ value of Name is returned as a tuple (as mentioned in
+ the previous section) where the second element is a list of
+ binaries. This is because the representation of a SEQUENCE OF
+ or a SET OF in Erlang is a list of its internal type. Any
+ of the elements in this list or the entire list can be decoded by
+ function decode_part .
+ {Name,Element_List} - This action is used when one or
+ more of the subtypes of Name is exclusive decoded.
- Name in the actions above may be a component name of a
- SEQUENCE or a SET or a name of an alternative in a CHOICE.
+
Name in these actions can be a component name of a
+ SEQUENCE OF or a SET OF , or a name of an alternative
+ in a CHOICE .
Example
- In the examples below we use the definitions from the following ASN.1 spec:
+ In this examples, the definitions from the following ASN.1
+ specification are used:
- If Button is a top type and we want to exclude
- component number from decode the Type_List in the
- instruction in the configuration file will be
- ['Button',[{number,undecoded}]] . If we call the decode
- function decode_Button_exclusive the Decode_Instruction
- will be
+
If Button is a top type and it is needed to exclude
+ component number from decode, Type_List in the
+ instruction in the configuration file is
+ ['Button',[{number,undecoded}]] . If you call the decode
+ function decode_Button_exclusive , Decode_Instruction is
{decode_Button_exclusive,['Button',[{number,undecoded}]]} .
- We also have another top type Window whose sub
- component actions in type Status and the parts of component
- buttonList shall be left undecoded. For this type we name
- the function decode__Window_exclusive . The whole
- Exclusive_Decode_Instruction configuration is as follows:
+ Another top type is Window whose subcomponent
+ actions in type Status and the parts of component
+ buttonList are to be left undecoded. For this type, the
+ function is named decode__Window_exclusive . The complete
+ Exclusive_Decode_Instruction configuration is as follows:
+ The following figure shows the bytes of a Window:status
+ message. The components buttonList and actions are
+ excluded from decode. Only state and enabled are decoded
+ when decode__Window_exclusive is called.
- Figure symbolizes the bytes of a Window:status message. The components buttonList and actions are excluded from decode. Only state and enabled are decoded when decode__Window_exclusive is called.
+ Bytes of a Window:status Message
- Compiling GUI.asn including the configuration file is done like:
+ Compiling GUI.asn including the configuration file is done
+ as follows:
unix> erlc -bber_bin +optimize +asn1config GUI.asn
-erlang> asn1ct:compile('GUI',[ber_bin,optimize,asn1config]).
- The module can be used like:
+erlang> asn1ct:compile('GUI',[ber_bin,optimize,asn1config]).
+ The module can be used as follows:
-
1> Button_Msg = {'Button',123,true}.
{'Button',123,true}
2> {ok,Button_Bytes} = 'GUI':encode('Button',Button_Msg).
@@ -289,35 +306,39 @@ BoolOpt,{Type_Key_Choice,Val_Choice}}}}=
11> 'GUI':decode_part(Type_Key_SeqOf,hd(Val_SEQOF)).
{ok,{'Button',3,true}}
12> 'GUI':decode_part(Type_Key_Choice,Val_Choice).
-{ok,{possibleActions,[{'Action',16,{'Button',17,true}}]}}
-
+{ok,{possibleActions,[{'Action',16,{'Button',17,true}}]}}
Selective Decode
- This specialized decode decodes one single subtype of a
- constructed value. It is the fastest method to extract one sub
- value. The typical use of this decode is when one want to
- inspect, for instance a version number,to be able to decide what
+
This specialized decode decodes a subtype of a
+ constructed value and is the fastest method to extract a
+ subvalue. This decode is typically used when you want to
+ inspect, for example, a version number, to be able to decide what
to do with the entire value. The result is returned as
{ok,Value} or {error,Reason} .
- How To Make It Work
- The following steps are necessary:
+
Procedure
+ To perform a selective decode:
- - Write instructions in the configuration
- file. Including the name of a user function, the name of the ASN.1
- specification and a notation that tells which part of the type
- will be decoded.
- - Compile with the additional option
-
asn1config . The compiler searches for a configuration file
- with the same name as the ASN.1 spec but with the extension
- .asn1config. In the same file you can provide configuration specs
- for exclusive decode as well. The generated Erlang module has the
+ Step 1: Include the following instructions in
+ the configuration file:
+
+ - The name of the user function
+ - The name of the ASN.1 specification
+ - A notation that tells which part of the type to be
+ decoded
+
+ - Step 2: Compile with the additional option
+
asn1config . The compiler searches for a configuration file
+ with the same name as the ASN.1 specification, but with extension
+ .asn1config . In the same file you can also provide
+ configuration specifications for exclusive decode.
+ The generated Erlang module has the
usual functionality for encode/decode preserved and the
specialized decode functionality added.
@@ -326,21 +347,20 @@ BoolOpt,{Type_Key_Choice,Val_Choice}}}}=
User Interface
The only new user interface function is the one provided by the
- user in the configuration file. You can invoke that function by
+ user in the configuration file. The function is started by
the ModuleName:FunctionName notation.
- So, if you have the following spec
+
For example, if the configuration file includes the specification
{selective_decode,{'ModuleName',[{selected_decode_Window,TypeList}]}}
- in the con-fig file, you do the selective decode by
+ do the selective decode by
{ok,Result}='ModuleName':selected_decode_Window(EncodedBinary).
Writing a Selective Decode Instruction
- It is possible to describe one or many selective decode
- functions in a configuration file, you have to use the following
- notation:
+ One or more selective decode functions can be described in a
+ configuration file. Use the following notation:
Selective_Decode_Instruction = {selective_decode,{Module_Name,Decode_Instructions}}.
@@ -358,37 +378,43 @@ Element_List = Name|List_Selector
Name = atom()
-List_Selector = [integer()]
- Observe that the instruction must be a valid Erlang term ended
- by a dot.
-
- The Module_Name is the same as the name of the ASN.1
- spec, but without the extension. A Decode_Instruction is
- a tuple with your chosen function name and the components from
- the top type that leads to the single type you want to
- decode. Notice that you have to choose a name of your function
- that will not be the same as any of the generated functions. The
- first element of the Type_List is the top type of the
- encoded message. In the Element_List it is followed by
- each of the component names that leads to selected type. Each of
- the names in the Element_List must be constructed types
- except the last name, which can be any type.
+List_Selector = [integer()]
+
The instruction must be a valid Erlang term ended by a dot.
- The List_Selector makes it possible to choose one of the
- encoded components in a SEQUENCE OF/ SET OF. It is also possible
- to go further in that component and pick a sub type of that to
- decode. So in the Type_List : ['Window',status,buttonList,[1],number] the
- component buttonList has to be a SEQUENCE OF or SET OF type. In
- this example component number of the first of the encoded
- elements in the SEQUENCE OF buttonList is selected. This apply on
- the ASN.1 spec above .
+
+ Module_Name is the same as the name of the ASN.1
+ specification, but without the extension.
+ Decode_Instruction is a tuple with your chosen
+ function name and the components from the top type that leads
+ to the single type you want to decode. Ensure to choose a name
+ of your function that is not the same as any of the generated
+ functions.
+ - The first element of
Type_List is the top type of the
+ encoded message. In Element_List , it is followed by
+ each of the component names that leads to selected type.
+ - Each name in
Element_List must be a constructed type
+ except the last name, which can be any type.
+ List_Selector makes it possible to choose one of the
+ encoded components in a a SEQUENCE OF or a SET OF .
+ It is also possible to go further in that component and pick a
+ subtype of that to decode. So, in the Type_List :
+ ['Window',status,buttonList,[1],number] , component
+ buttonList must be of type SEQUENCE OF or
+ SET OF .
+
+
In the example, component number of the first of the encoded
+ elements in the SEQUENCE OF buttonList is selected.
+ This applies on the ASN.1 specification in Section
+ Writing an Exclusive Decode
+ Instruction .
Another Example
- In this example we use the same ASN.1 spec as above . A valid selective decode
- instruction is:
+ In this example, the same ASN.1 specification as in Section
+ Writing an Exclusive Decode Instruction
+ is used. The following is a valid selective decode instruction:
{selective_decode,
{'GUI',
@@ -404,16 +430,17 @@ List_Selector = [integer()]
actions,
possibleActions,
[1],
- handle,number]}]}}.
-
- The first Decode_Instruction ,
+ handle,number]}]}}.
+
The first instruction,
{selected_decode_Window1,['Window',status,buttonList,[1],number]}
- is commented in the previous section. The instruction
- {selected_decode_Action,['Action',handle,number]} picks
- the component number in the handle component of the type
- Action . If we have the value ValAction = {'Action',17,{'Button',4711,false}} the internal value 4711
- should be picked by selected_decode_Action . In an Erlang
- terminal it looks like:
+ is described in the previous section.
+ The second instruction,
+ {selected_decode_Action,['Action',handle,number]} , takes
+ component number in the handle component of type
+ Action . If the value is
+ ValAction = {'Action',17,{'Button',4711,false}} , the internal
+ value 4711 is to be picked by selected_decode_Action . In an
+ Erlang terminal it looks as follows:
ValAction = {'Action',17,{'Button',4711,false}}.
{'Action',17,{'Button',4711,false}}
@@ -423,44 +450,41 @@ ValAction = {'Action',17,{'Button',4711,false}}.
<<48,18,2,1,17,160,13,172,11,171,9,48,7,128,2,18,103,129,1,0>>
9> 'GUI':selected_decode_Action(BinBytes).
{ok,4711}
-10>
+10>
The third instruction,
['Window',status,actions,possibleActions,[1],handle,number] ,
- which is a little more complicated,
+ works as follows:
- - starts with type Window.
- - Picks component status of
Window that is
- of type Status .
- - Then takes component actions of type
+
- Step 1: Starts with type
Window .
+ - Step 2: Takes component
status of Window
+ that is of type Status .
+ - Step 3: Takes actions of type
Status .
- - Then possibleActions of the internal defined
- CHOICE type.
- - Thereafter it goes into the first component of the
- SEQUENCE OF by [1]. That component is of type
-
Action .
- - The instruction next picks component
- handle.
- - And finally component number of the type
+
- Step 4: Takes
possibleActions of the internally
+ defined CHOICE type.
+ - Step 5: Goes into the first component of
+
SEQUENCE OF by [1] . That component is of type
+ Action .
+ - Step 6: Takes component
handle .
+ - Step 7: Takes component
number of type
Button .
- The following figures shows which components are in the
- TypeList
- ['Window',status,actions,possibleActions,[1],handle,number] . And
- which part of a message that will be decoded by
- selected_decode_Window2.
-
+ The following figure shows which components are in TypeList
+ ['Window',status,actions,possibleActions,[1],handle,number] :
- The elements specified in the config file for selective decode of a sub-value in a Window message
+ Elements Specified in Configuration File for Selective Decode of a Subvalue in a Window Message
+ In the following figure, only the marked element is decoded by
+ selected_decode_Window2 :
- Figure symbolizes the bytes of a Window:status message. Only the marked element is decoded when selected_decode_Window2 is called.
+ Bytes of a Window:status Message
- With the following example you can examine that both
+
With the following example, you can examine that both
selected_decode_Window2 and
- selected_decode_Window1 decodes the intended sub-value
- of the value Val
+ selected_decode_Window1 decodes the intended subvalue
+ of value Val :
1> Val = {'Window',{status,{'Status',12,
[{'Button',13,true},
@@ -478,8 +502,8 @@ ValAction = {'Action',17,{'Button',4711,false}}.
4> 'GUI':selected_decode_Window1(Bin).
{ok,13}
5> 'GUI':selected_decode_Window2(Bin).
-{ok,18}
- Observe that the value feed into the selective decode
+{ok,18}
+
Notice that the value fed into the selective decode
functions must be a binary.
@@ -489,19 +513,19 @@ ValAction = {'Action',17,{'Button',4711,false}}.
Performance
To give an indication on the possible performance gain using
the specialized decodes, some measures have been performed. The
- relative figures in the outcome between selective, exclusive and
- complete decode (the normal case) depends on the structure of
- the type, the size of the message and on what level the
+ relative figures in the outcome between selective, exclusive, and
+ complete decode (the normal case) depend on the structure of
+ the type, the size of the message, and on what level the
selective and exclusive decodes are specified.
- ASN.1 Specifications, Messages and Configuration
- The specs GUI and
+
ASN.1 Specifications, Messages, and Configuration
+ The specifications GUI and
MEDIA-GATEWAY-CONTROL
- was used in the test.
+ were used in the test.
- For the GUI spec the configuration looked like:
+ For the GUI specification the configuration was as follows:
{selective_decode,
{'GUI',
@@ -523,9 +547,8 @@ ValAction = {'Action',17,{'Button',4711,false}}.
['Window',
[{status,
[{buttonList,parts},
- {actions,undecoded}]}]]}]}}.
-
- The MEDIA-GATEWAY-CONTROL configuration was:
+ {actions,undecoded}]}]]}]}}.
+ The MEDIA-GATEWAY-CONTROL configuration was as follows:
{exclusive_decode,
{'MEDIA-GATEWAY-CONTROL',
@@ -538,9 +561,8 @@ ValAction = {'Action',17,{'Button',4711,false}}.
{selective_decode,
{'MEDIA-GATEWAY-CONTROL',
[{decode_MegacoMessage_selective,
- ['MegacoMessage',mess,version]}]}}.
-
- The corresponding values were:
+ ['MegacoMessage',mess,version]}]}}.
+ The corresponding values were as follows:
{'Window',{status,{'Status',12,
[{'Button',13,true},
@@ -649,177 +671,178 @@ ValAction = {'Action',17,{'Button',4711,false}}.
{'StatisticsParameter',[0,11,0,3],[[52,53,49,48,48]]},
{'StatisticsParameter',[0,12,0,6],[[48,46,50]]},
{'StatisticsParameter',[0,12,0,7],[[50,48]]},
- {'StatisticsParameter',[0,12,0,8],[[52,48]]}]}]}}}]}]}}}]}}}
-
- The size of the encoded values was 458 bytes for GUI and 464
- bytes for MEDIA-GATEWAY-CONTROL.
+ {'StatisticsParameter',[0,12,0,8],[[52,48]]}]}]}}}]}]}}}]}}}
+
The size of the encoded values was 458 bytes for GUI and 464
+ bytes for MEDIA-GATEWAY-CONTROL .
Results
- The ASN.1 specs in the test are compiled with the options
- ber_bin, optimize, driver and asn1config . If the
- driver option had been omitted there should have been
+
The ASN.1 specifications in the test were compiled with options
+ ber_bin, optimize, driver and asn1config . Omitting
+ option driver gives
higher values for decode and decode_part . These tests have
- not been re-run using nifs, but are expected to perform about 5% better
+ not been rerun using NIFs, but are expected to perform about 5% better
than the linked-in driver.
The test program runs 10000 decodes on the value, resulting
- in a printout with the elapsed time in microseconds for the
+ in an output with the elapsed time in microseconds for the
total number of decodes.
Function |
- Time(microseconds) |
- Kind of Decode |
- ASN.1 spec |
- % of time vs. complete decode |
+ Time (microseconds) |
+ Decode Type |
+ ASN.1 Specification |
+ % of Time versus Complete Decode |
decode_MegacoMessage_selective/1 |
374045 |
- selective |
+ Selective |
MEDIA-GATEWAY-CONTROL |
8.3 |
decode_MegacoMessage_exclusive/1 |
621107 |
- exclusive |
+ Exclusive |
MEDIA-GATEWAY-CONTROL |
13.8 |
decode/2 |
4507457 |
- complete |
+ Complete |
MEDIA-GATEWAY-CONTROL |
100 |
selected_decode_Window1/1 |
449585 |
- selective |
+ Selective |
GUI |
7.6 |
selected_decode_Window2/1 |
890666 |
- selective |
+ Selective |
GUI |
15.1 |
decode_Window_status_exclusive/1 |
1251878 |
- exclusive |
+ Exclusive |
GUI |
21.3 |
decode/2 |
5889197 |
- complete |
+ Complete |
GUI |
100 |
- Results of complete, exclusive and selective decode
+ Results of Complete, Exclusive, and Selective Decode
- Another interesting question is what the relation is between
+
It is also of interest to know the relation is between
a complete decode, an exclusive decode followed by
- decode_part of the excluded parts and a selective decode
- followed by a complete decode. Some situations may be compared to
- this simulation, e.g. inspect a sub-value and later on look at
+ decode_part of the excluded parts, and a selective decode
+ followed by a complete decode. Some situations can be compared to
+ this simulation, for example, inspect a subvalue and later inspect
the entire value. The following table shows figures from this
- test. The number of loops and time unit is the same as in the
+ test. The number of loops and the time unit are the same as in the
previous test.
Actions |
Function |
- Time(microseconds) |
- ASN.1 spec |
- % of time vs. complete decode |
+ Time (microseconds) |
+ ASN.1 Specification |
+ % of Time vs. Complete Decode |
- complete |
+ Complete |
decode/2 |
4507457 |
MEDIA-GATEWAY-CONTROL |
100 |
- selective and complete |
+ Selective and Complete |
decode_MegacoMessage_selective/1 |
4881502 |
MEDIA-GATEWAY-CONTROL |
108.3 |
- exclusive and decode_part |
+ Exclusive and decode_part |
decode_MegacoMessage_exclusive/1 |
5481034 |
MEDIA-GATEWAY-CONTROL |
112.3 |
- complete |
+ Complete |
decode/2 |
5889197 |
GUI |
100 |
- selective and complete |
+ Selective and Complete |
selected_decode_Window1/1 |
6337636 |
GUI |
107.6 |
- selective and complete |
+ Selective and Complete |
selected_decode_Window2/1 |
6795319 |
GUI |
115.4 |
- exclusive and decode_part |
+ Exclusive and decode_part |
decode_Window_status_exclusive/1 |
6249200 |
GUI |
106.1 |
- Results of complete, exclusive + decode_part and selective + complete decodes
+ Results of Complete, Exclusive + decode_part, and Selective + complete decodes
Other ASN.1 types and values can differ much from these
- figures. Therefore it is important that you, in every case where
+ figures. It is therefore important that you, in every case where
you intend to use either of these decodes, perform some tests
- that shows if you will benefit your purpose.
+ that show if you will benefit your purpose.
- Comments
- Generally speaking the gain of selective and exclusive decode
- in advance of complete decode is greater the bigger value and the
- less deep in the structure you have to decode. One should also
- prefer selective decode instead of exclusive decode if you are
- interested in just one single sub-value.
- Another observation is that the exclusive decode followed by
- decode_part decodes is very attractive if the parts will be sent
- to different servers for decoding or if one in some cases not is
- interested in all parts.
- The fastest selective decode are when the decoded type is a
+
Final Remarks
+
+ - The gain of using selective and exclusive decode instead of a
+ complete decode is greater the bigger the value and the
+ less deep in the structure you have to decode.
+ - Use selective decode instead of exclusive decode if you are
+ interested in only a single subvalue.
+ - Exclusive decode followed by
+
decode_part decodes is attractive if the parts are sent
+ to different servers for decoding, or if you in some cases are not
+ interested in all parts.
+ - The fastest selective decode is when the decoded type is a
primitive type and not so deep in the structure of the top
- type. The
selected_decode_Window2 decodes a big constructed
- value, which explains why this operation is relatively slow.
- It may vary from case to case which combination of
- selective/complete decode or exclusive/part decode is the fastest.
+ type. selected_decode_Window2 decodes a high constructed
+ value, which explains why this operation is relatively slow.
+ - It can vary from case to case which combination of
+ selective/complete decode or exclusive/part decode is the fastest.
+
diff --git a/lib/asn1/doc/src/asn1_ug.xml b/lib/asn1/doc/src/asn1_ug.xml
deleted file mode 100644
index 8b33497dd3..0000000000
--- a/lib/asn1/doc/src/asn1_ug.xml
+++ /dev/null
@@ -1,1417 +0,0 @@
-
-
-
-
-
-
- 1997 2013
- Ericsson AB. All Rights Reserved.
-
-
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
-
-
-
- Asn1
- Kenneth Lundin
-
- 1999-03-25
- D
- asn1_ug.xml
-
-
-
- Introduction
-
-
- Features
- The Asn1 application provides:
-
- - An ASN.1 compiler for Erlang, which generates encode and
- decode functions to be used by Erlang programs sending and
- receiving ASN.1 specified data.
- - Run-time functions used by the generated code.
- - Support for the following encoding rules:
-
- -
- Basic Encoding Rules (BER)
-
- -
- Distinguished Encoding Rules (DER), a specialized
- form of BER that is used in security-conscious
- applications.
-
- -
- Packed Encoding Rules (PER); both the aligned and
- unaligned variant.
-
-
-
-
-
-
-
- Overview
- ASN.1 (Abstract Syntax Notation One) is a formal language for
- describing data structures to be exchanged between distributed
- computer systems. The purpose of ASN.1 is to have a platform
- and programming language independent notation to express types
- using a standardized set of rules for the transformation of
- values of a defined type into a stream of bytes. This stream of
- bytes can then be sent on any type of communication
- channel. This way, two applications written in different
- programming languages running on different computers with
- different internal representation of data can exchange instances
- of structured data types.
-
-
-
- Prerequisites
- It is assumed that the reader is familiar with the ASN.1
- notation as documented in the standard definition [] which is the primary text. It may also be
- helpful, but not necessary, to read the standard definitions
- [] [] [] [] [].
- A good book explaining those reference texts is
- [], which is free to download at
- http://www.oss.com/asn1/dubuisson.html .
-
-
-
-
- Capabilities
- This application covers all features of ASN.1 up to the 1997
- edition of the specification. In the 2002 edition of ASN.1 a
- number of new features were introduced. The following features
- of the 2002 edition are fully or partly supported as shown
- below:
-
- -
-
Decimal notation (e.g., "1.5e3") for REAL values. The
- NR1, NR2 and NR3 formats as explained in ISO6093 are
- supported.
-
- -
-
The RELATIVE-OID type for relative object identifiers is
- fully supported.
-
- -
-
The subtype constraint (CONTAINING/ENCODED BY) to
- constrain the content of an octet string or a bit string is
- parsed when compiling, but no further action is taken. This
- constraint is not a PER-visible constraint.
-
- -
-
The subtype constraint by regular expressions (PATTERN)
- for character string types is parsed when compiling, but no
- further action is taken. This constraint is not a
- PER-visible constraint.
-
- -
-
Multiple-line comments as in C, /* ... */ , are
- supported.
-
-
-
-
-
-
-
- Getting Started with Asn1
-
-
- A First Example
- The following example demonstrates the basic functionality used to run
- the Erlang ASN.1 compiler.
- Create a file called People.asn containing the following:
-
-People DEFINITIONS AUTOMATIC TAGS ::=
-BEGIN
- Person ::= SEQUENCE {
- name PrintableString,
- location INTEGER {home(0),field(1),roving(2)},
- age INTEGER OPTIONAL
- }
-END
- This file (People.asn ) must be compiled before it can be
- used.
- The ASN.1 compiler checks that the syntax is correct and that the
- text represents proper ASN.1 code before generating an abstract
- syntax tree. The code-generator then uses the abstract syntax
- tree in order to generate code.
-
- The generated Erlang files will be placed in the current directory or
- in the directory specified with the {outdir,Dir} option.
- The following shows how the compiler
- can be called from the Erlang shell:
-
-1> asn1ct:compile("People", [ber]).
-ok
-2>
-
- The verbose option can be given to have information
- about the generated files printed:
-
-2> asn1ct:compile("People", [ber,verbose]).
-Erlang ASN.1 compiling "People.asn"
---{generated,"People.asn1db"}--
---{generated,"People.hrl"}--
---{generated,"People.erl"}--
-ok
-3>
-
- The ASN.1 module People is now accepted and the
- abstract syntax tree is saved in the People.asn1db file;
- the generated Erlang code is compiled using the Erlang compiler
- and loaded into the Erlang run-time system. Now there is an API
- for encode/2 and decode/2 in the module
- People , which is invoked by:
- , )]]>
-
- or
-, )]]>
-
- Assume there is a network
- application which receives instances of the ASN.1 defined
- type Person, modifies and sends them back again:
-
-receive
- {Port,{data,Bytes}} ->
- case 'People':decode('Person',Bytes) of
- {ok,P} ->
- {ok,Answer} = 'People':encode('Person',mk_answer(P)),
- Port ! {self(),{command,Answer}};
- {error,Reason} ->
- exit({error,Reason})
- end
- end,
- In the example above, a series of bytes is received from an
- external source and the bytes are then decoded into a valid
- Erlang term. This was achieved with the call
- 'People':decode('Person',Bytes) which returned
- an Erlang value of the ASN.1 type Person . Then an answer was
- constructed and encoded using
- 'People':encode('Person',Answer) which takes an
- instance of a defined ASN.1 type and transforms it to a
- binary according to the BER or PER encoding rules.
-
-The encoder and the decoder can also be run from
- the shell.
-
-2> Rockstar = {'Person',"Some Name",roving,50}.
-{'Person',"Some Name",roving,50}
-3> {ok,Bin} = 'People':encode('Person',Rockstar).
-{ok,<<243,17,19,9,83,111,109,101,32,78,97,109,101,2,1,2,
- 2,1,50>>}
-4> {ok,Person} = 'People':decode('Person',Bin).
-{ok,{'Person',"Some Name",roving,50}}
-5>
-
-
-
- Module dependencies
- It is common that ASN.1 modules import defined types, values and
- other entities from another ASN.1 module.
- Earlier versions of the ASN.1 compiler required that modules that
- were imported from had to be compiled before the module that
- imported. This caused problems when ASN.1 modules had circular
- dependencies.
- Referenced modules are now parsed when the compiler finds an
- entity that is imported. There will not be any code generated for
- the referenced module. However, the compiled module rely on
- that the referenced modules also will be compiled.
-
-
-
-
- The Asn1 Application User Interface
- The Asn1 application provides two separate user interfaces:
-
- -
-
The module asn1ct which provides the compile-time functions
- (including the compiler).
-
- -
-
The module asn1rt_nif which provides the run-time functions
- for the ASN.1 decoder for the BER back-end.
-
-
- The reason for the division of the interface into compile-time
- and run-time
- is that only run-time modules (asn1rt* ) need to be loaded in
- an embedded system.
-
-
-
- Compile-time Functions
- The ASN.1 compiler can be invoked directly from the command-line
- by means of the erlc program. This is convenient when compiling
- many ASN.1 files from the command-line or when using Makefiles.
- Here are some examples of how the erlc command can be used to invoke the
- ASN.1 compiler:
-
-erlc Person.asn
-erlc -bper Person.asn
-erlc -bber ../Example.asn
-erlc -o ../asnfiles -I ../asnfiles -I /usr/local/standards/asn1 Person.asn
- The useful options for the ASN.1 compiler are:
-
- -b[ber | per | uper]
- -
-
Choice of encoding rules, if omitted ber is the
- default.
-
- -o OutDirectory
- -
-
Where to put the generated files, default is the current
- directory.
-
- -I IncludeDir
- -
-
Where to search for .asn1db files and ASN.1
- source specs in order to resolve references to other
- modules. This option can be repeated many times if there
- are several places to search in. The compiler will always
- search the current directory first.
-
- +der
- -
-
DER encoding rule. Only when using -ber option.
-
- +asn1config
- -
-
This functionality works together with the
- ber option. It enables the
- specialized decodes, see the Specialized Decode chapter.
-
-
- +undec_rest
- -
-
A buffer that holds a message being decoded may also have
- trailing bytes. If those trailing bytes are important they
- can be returned along with the decoded value by compiling
- the ASN.1 specification with the +undec_rest option.
- The return value from the decoder will be
- {ok,Value,Rest} where Rest is a binary
- containing the trailing bytes.
-
- +'Any Erlc Option'
- -
-
You may add any option to the Erlang compiler when
- compiling the generated Erlang files. Any option
- unrecognized by the ASN.1 compiler will be passed to the
- Erlang compiler.
-
-
- For a complete description of erlc see Erts Reference Manual.
- The compiler and other compile-time functions can also be invoked from
- the Erlang shell. Below follows a brief
- description of the primary functions, for a
- complete description of each function see
- the Asn1 Reference Manual , the
- asn1ct module.
- The compiler is invoked by using asn1ct:compile/1 with
- default options, or asn1ct:compile/2 if explicit options
- are given.
- Example:
-
-asn1ct:compile("H323-MESSAGES.asn1").
- which equals:
-
-asn1ct:compile("H323-MESSAGES.asn1",[ber]).
- If one wants PER encoding:
-
-asn1ct:compile("H323-MESSAGES.asn1",[per]).
- The generic encode and decode functions can be invoked like this:
-
-'H323-MESSAGES':encode('SomeChoiceType',{call,"octetstring"}).
-'H323-MESSAGES':decode('SomeChoiceType',Bytes).
-
-
-
- Run-time Functions
- When an ASN.1 specification is compiled with the ber
- option, the module asn1rt_nif module and the NIF library in
- asn1/priv_dir will be needed at run-time.
- By invoking the function info/0 in a generated module, one
- gets information about which compiler options were used.
-
-
-
- Errors
- Errors detected at
- compile time appear on the screen together with
- a line number indicating where in the source file the error
- was detected. If no errors are found, an Erlang ASN.1 module will
- be created.
- The run-time encoders and decoders execute within a catch and
- returns {ok, Data} or
- {error, {asn1, Description}} where
- Description is
- an Erlang term describing the error.
-
-
-
-
-
- Multi-file Compilation
- There are various reasons for using multi-file compilation:
-
- - You want to choose the name for the generated module,
- perhaps because you need to compile the same specs for
- different encoding rules.
- - You want only one resulting module.
-
- You need to specify which ASN.1 specs you will
- compile in a module that must have the extension
- .set.asn . You chose name of the module and provide the
- names of the ASN.1 specs. For instance, if you have the specs
- File1.asn , File2.asn and File3.asn your
- module MyModule.set.asn will look like:
-
-File1.asn
-File2.asn
-File3.asn
- If you compile with:
-
-~> erlc MyModule.set.asn
- the result will be one merged module MyModule.erl with
- the generated code from the three ASN.1 specs.
-
-
-
-
- A quick note about tags
-
- Tags used to be important for all users of ASN.1, because it
- was necessary to manually add tags to certain constructs in order
- for the ASN.1 specification to be valid. Here is an example of
- an old-style specification:
-
-
-Tags DEFINITIONS ::=
-BEGIN
- Afters ::= CHOICE { cheese [0] IA5String,
- dessert [1] IA5String }
-END
-
- Without the tags (the numbers in square brackets) the ASN.1
- compiler would refuse to compile the file.
-
- In 1994 the global tagging mode AUTOMATIC TAGS was introduced.
- By putting AUTOMATIC TAGS in the module header, the ASN.1 compiler
- will automatically add tags when needed. Here is the same
- specification in AUTOMATIC TAGS mode:
-
-
-Tags DEFINITIONS AUTOMATIC TAGS ::=
-BEGIN
- Afters ::= CHOICE { cheese IA5String,
- dessert IA5String }
-END
-
-
- Tags will not be mentioned any more in this manual.
-
-
-
-
- The ASN.1 Types
- This section describes the ASN.1 types including their
- functionality, purpose and how values are assigned in Erlang.
-
- ASN.1 has both primitive and constructed types:
-
-
-
- Primitive types |
- Constructed types |
-
-
- BOOLEAN |
- SEQUENCE |
-
-
- INTEGER |
- SET |
-
-
- REAL |
- CHOICE |
-
-
- NULL |
- SET OF and SEQUENCE OF |
-
-
- ENUMERATED |
- ANY |
-
-
- BIT STRING |
- ANY DEFINED BY |
-
-
- OCTET STRING |
- EXTERNAL |
-
-
- Character Strings |
- EMBEDDED PDV |
-
-
- OBJECT IDENTIFIER |
- CHARACTER STRING |
-
-
- Object Descriptor |
- |
-
-
- The TIME types |
- |
-
- The supported ASN.1 types
-
-
-
- Values of each ASN.1 type has its own representation in Erlang
- described in the following subsections. Users shall provide
- these values for encoding according to the representation, as
- in the example below.
-
-
-Operational ::= BOOLEAN --ASN.1 definition
- In Erlang code it may look like:
-
-Val = true,
-{ok,Bytes} = MyModule:encode('Operational', Val),
- Below follows a description of how
- values of each type can be represented in Erlang.
-
-
-
-
- BOOLEAN
- Booleans in ASN.1 express values that can be either
- TRUE or FALSE.
- The meanings assigned to TRUE or FALSE is beyond the scope
- of this text.
-
- In ASN.1 it is possible to have:
-
-Operational ::= BOOLEAN
-
- Assigning a value to the type Operational in Erlang is possible by
- using the following Erlang code:
-
-Myvar1 = true,
-
- Thus, in Erlang the atoms true and false are used
- to encode a boolean value.
-
-
-
-
- INTEGER
- ASN.1 itself specifies indefinitely large integers, and the Erlang
- systems with versions 4.3 and higher, support very large
- integers, in practice indefinitely large integers.
- The concept of sub-typing can be applied to integers as well
- as to other ASN.1 types. The details of sub-typing are not
- explained here, for further info see []. A variety
- of syntaxes are allowed when defining a type as an integer:
-
-T1 ::= INTEGER
-T2 ::= INTEGER (-2..7)
-T3 ::= INTEGER (0..MAX)
-T4 ::= INTEGER (0<..MAX)
-T5 ::= INTEGER (MIN<..-99)
-T6 ::= INTEGER {red(0),blue(1),white(2)}
-
- The Erlang representation of an ASN.1 INTEGER is an integer or
- an atom if a so called Named Number List (see T6 above)
- is specified.
- Below is an example of Erlang code which assigns values for the
- above types:
-
-T1value = 0,
-T2value = 6,
-T6value1 = blue,
-T6value2 = 0,
-T6value3 = white
-
- The Erlang variables above are now bound to valid instances of
- ASN.1 defined types. This style of value can be passed directly
- to the encoder for transformation into a series of bytes.
- The decoder will return an atom if the value corresponds to a
- symbol in the Named Number List.
-
-
-
-
- REAL
- The following ASN.1 type is used for real numbers:
-
-R1 ::= REAL
-
- It can be assigned a value in Erlang as:
-
-R1value1 = "2.14",
-R1value2 = {256,10,-2},
-
- In the last line note that the tuple {256,10,-2} is the real number
- 2.56 in a special notation, which will encode faster than simply
- stating the number as "2.56" . The arity three tuple is
- {Mantissa,Base,Exponent} i.e. Mantissa * Base^Exponent.
-
-
-
-
- NULL
- Null is suitable in cases where supply and recognition of a value
- is important but the actual value is not.
-
-Notype ::= NULL
-
- The NULL type can be assigned in Erlang:
-
-N1 = 'NULL',
-
- The actual value is the quoted atom 'NULL'.
-
-
-
-
- ENUMERATED
- The enumerated type can be used, when the value we wish to
- describe, may only take one of a set of predefined values.
-
-DaysOfTheWeek ::= ENUMERATED {
- sunday(1),monday(2),tuesday(3),
- wednesday(4),thursday(5),friday(6),saturday(7) }
-
- For example to assign a weekday value in Erlang use the same atom
- as in the Enumerations of the type definition:
-
-Day1 = saturday,
-
- The enumerated type is very similar to an integer type, when
- defined with a set of predefined values. An enumerated type
- differs from an integer in that it may only have specified
- values, whereas an integer can also have any other value.
-
-
-
-
- BIT STRING
- The BIT STRING type can be used to model information which
- is made up of arbitrary length series of bits. It is intended
- to be used for a selection of flags, not for binary files.
-
- In ASN.1 BIT STRING definitions may look like:
-
-
-Bits1 ::= BIT STRING
-Bits2 ::= BIT STRING {foo(0),bar(1),gnu(2),gnome(3),punk(14)}
-
- There are two notations available for representation of
- BIT STRING values in Erlang and as input to the encode functions.
-
- - A bitstring. By default, a BIT STRING with no
- symbolic names will be decoded to an Erlang bitstring.
- - A list of atoms corresponding to atoms in the
NamedBitList
- in the BIT STRING definition. A BIT STRING with symbolic
- names will always be decoded to this format.
-
- Example:
-
-Bits1Val1 = <<0:1,1:1,0:1,1:1,1:1>>,
-Bits2Val1 = [gnu,punk],
-Bits2Val2 = <<2#1110:4>>,
-Bits2Val3 = [bar,gnu,gnome],
-
- Bits2Val2 and Bits2Val3 above denote the same value.
- Bits2Val1 is assigned symbolic values. The assignment means
- that the bits corresponding to gnu and punk i.e. bits
- 2 and 14 are set to 1 and the rest set to 0. The symbolic values
- appear as a list of values. If a named value appears, which is not
- specified in the type definition, a run-time error will occur.
- BIT STRINGS may also be sub-typed with, for example, a SIZE
- specification:
-
-Bits3 ::= BIT STRING (SIZE(0..31))
- This means that no bit higher than 31 can ever be set.
-
-
- Deprecated representations for BIT STRING
- In addition to the representations described above, the
- following deprecated representations are available if the
- specification has been compiled with the
- legacy_erlang_types option:
-
- - A list of binary digits (0 or 1). This format is
- accepted as input to the encode functions, and a BIT STRING
- will be decoded to this format if the
- legacy_bit_string option has been given.
-
- - As
{Unused,Binary} where Unused denotes
- how many trailing zero-bits 0 to 7 that are unused in the
- least significant byte in Binary . This format is
- accepted as input to the encode functions, and a BIT
- STRING will be decoded to this format if
- compact_bit_string has been given.
-
- - A hexadecimal number (or an integer). This format
- should be avoided, since it is easy to misinterpret a BIT
- STRING value in this format.
-
-
-
-
-
-
-
- OCTET STRING
- The OCTET STRING is the simplest of all ASN.1 types. The
- OCTET STRING only moves or transfers e.g. binary files or other
- unstructured information complying to two rules. Firstly, the
- bytes consist of octets and secondly, encoding is not
- required.
- It is possible to have the following ASN.1 type definitions:
-
-O1 ::= OCTET STRING
-O2 ::= OCTET STRING (SIZE(28))
- With the following example assignments in Erlang:
-
-O1Val = <<17,13,19,20,0,0,255,254>>,
-O2Val = <<"must be exactly 28 chars....">>,
- By default, an OCTET STRING is always represented as
- an Erlang binary. If the specification has been compiled with
- the legacy_erlang_types option, the encode functions
- will accept both lists and binaries, and the decode functions
- will decode an OCTET STRING to a list.
-
-
-
-
- Character Strings
- ASN.1 supports a wide variety of character sets. The main difference
- between OCTET STRINGS and the Character strings is that OCTET
- STRINGS have no imposed semantics on the bytes delivered.
- However, when using for instance the IA5String (which closely
- resembles ASCII) the byte 65 (in decimal
- notation) means the character 'A'.
-
- For example, if a defined type is to be a VideotexString and
- an octet is received with the unsigned integer value X, then
- the octet should be interpreted as specified in the standard
- ITU-T T.100,T.101.
-
- The ASN.1 to Erlang compiler
- will not determine the correct interpretation of each BER
- (Basic Encoding Rules) string octet value with different
- Character strings. Interpretation of octets is the
- responsibility of the application. Therefore, from the BER
- string point of view, octets appear to be very similar to
- character strings and are compiled in the same way.
-
- It should be noted that when PER (Packed Encoding Rules) is
- used, there is a significant difference in the encoding scheme
- between OCTET STRINGS and other strings. The constraints
- specified for a type are especially important for PER, where
- they affect the encoding.
-
- Here are some examples:
-
-Digs ::= NumericString (SIZE(1..3))
-TextFile ::= IA5String (SIZE(0..64000))
- with corresponding Erlang assignments:
-
-DigsVal1 = "456",
-DigsVal2 = "123",
-TextFileVal1 = "abc...xyz...",
-TextFileVal2 = [88,76,55,44,99,121 .......... a lot of characters here ....]
- The Erlang representation for "BMPString" and
- "UniversalString" is either a list of ASCII values or a list
- of quadruples. The quadruple representation associates to the
- Unicode standard representation of characters. The ASCII
- characters are all represented by quadruples beginning with
- three zeros like {0,0,0,65} for the 'A' character. When
- decoding a value for these strings the result is a list of
- quadruples, or integers when the value is an ASCII character.
-
- The following example shows how it works. We have the following
- specification in the file PrimStrings.asn1 .
-
-PrimStrings DEFINITIONS AUTOMATIC TAGS ::=
-BEGIN
- BMP ::= BMPString
-END
-
-
- Encoding and decoding some strings:
-
-
-1> asn1ct:compile('PrimStrings', [ber]).
-ok
-2> {ok,Bytes1} = 'PrimStrings':encode('BMP', [{0,0,53,53},{0,0,45,56}]).
-{ok,<<30,4,53,54,45,56>>}
-3> 'PrimStrings':decode('BMP', Bytes1).
-{ok,[{0,0,53,53},{0,0,45,56}]}
-4> {ok,Bytes2} = 'PrimStrings':encode('BMP', [{0,0,53,53},{0,0,0,65}]).
-{ok,<<30,4,53,53,0,65>>}
-5> 'PrimStrings':decode('BMP', Bytes2).
-{ok,[{0,0,53,53},65]}
-6> {ok,Bytes3} = 'PrimStrings':encode('BMP', "BMP string").
-{ok,<<30,20,0,66,0,77,0,80,0,32,0,115,0,116,0,114,0,105,0,110,0,103>>}
-7> 'PrimStrings':decode('BMP', Bytes3).
-{ok,"BMP string"}
-
- The UTF8String type is represented as a UTF-8 encoded binary in
- Erlang. Such binaries can be created directly using the binary syntax
- or by converting from a list of Unicode code points using the
- unicode:characters_to_binary/1 function.
-
- Here are some examples showing how UTF-8 encoded binaries can
- be created and manipulated:
-
-
-1> Gs = "Мой маленький Гном".
-[1052,1086,1081,32,1084,1072,1083,1077,1085,1100,1082,1080,
- 1081,32,1043,1085,1086,1084]
-2> Gbin = unicode:characters_to_binary(Gs).
-<<208,156,208,190,208,185,32,208,188,208,176,208,187,208,
- 181,208,189,209,140,208,186,208,184,208,185,32,208,147,
- 208,...>>
-3> Gbin = <<"Мой маленький Гном"/utf8>>.
-<<208,156,208,190,208,185,32,208,188,208,176,208,187,208,
- 181,208,189,209,140,208,186,208,184,208,185,32,208,147,
- 208,...>>
-4> Gs = unicode:characters_to_list(Gbin).
-[1052,1086,1081,32,1084,1072,1083,1077,1085,1100,1082,1080,
- 1081,32,1043,1085,1086,1084]
-
-
- See the unicode module
- for more details.
-
- In the following example we will use this ASN.1 specification:
-
-UTF DEFINITIONS AUTOMATIC TAGS ::=
-BEGIN
- UTF ::= UTF8String
-END
-
-
- Encoding and decoding a string with Unicode characters:
-
-
-5> asn1ct:compile('UTF', [ber]).
-ok
-6> {ok,Bytes1} = 'UTF':encode('UTF', <<"Гном"/utf8>>).
-{ok,<<12,8,208,147,208,189,208,190,208,188>>}
-7> {ok,Bin1} = 'UTF':decode('UTF', Bytes1).
-{ok,<<208,147,208,189,208,190,208,188>>}
-8> io:format("~ts\n", [Bin1]).
-Гном
-ok
-9> unicode:characters_to_list(Bin1).
-[1043,1085,1086,1084]
-
-
-
-
-
- OBJECT IDENTIFIER
- The OBJECT IDENTIFIER is used whenever a unique identity is required.
- An ASN.1 module, a transfer syntax, etc. is identified with an
- OBJECT IDENTIFIER. Assume the example below:
-
-Oid ::= OBJECT IDENTIFIER
-
- Therefore, the example below is a valid Erlang instance of the
- type 'Oid'.
-
-OidVal1 = {1,2,55},
-
- The OBJECT IDENTIFIER value is simply a tuple with the
- consecutive values which must be integers.
-
- The first value is limited to the values 0, 1 or 2 and the
- second value must be in the range 0..39 when the first value
- is 0 or 1.
-
- The OBJECT IDENTIFIER is a very important type and it is
- widely used within different standards to uniquely identify
- various objects. In [], there is an
- easy-to-understand description of the usage of
- OBJECT IDENTIFIER.
-
-
-
-
-
- Object Descriptor
- Values of this type can be assigned a value as an ordinary string
- like this:
-
-
- "This is the value of an Object descriptor"
-
-
-
-
- The TIME Types
- Two different time types are defined within ASN.1, Generalized
- Time and UTC (Universal Time Coordinated), both are assigned a
- value as an ordinary string within double quotes i.e.
- "19820102070533.8".
- In case of DER encoding the compiler does not check the validity
- of the time values. The DER requirements upon those strings is
- regarded as a matter for the application to fulfill.
-
-
-
-
- SEQUENCE
- The structured types of ASN.1 are constructed from other types
- in a manner similar to the concepts of array and struct in C.
-
- A SEQUENCE in ASN.1 is
- comparable with a struct in C and a record in Erlang.
- A SEQUENCE may be defined as:
-
-Pdu ::= SEQUENCE {
- a INTEGER,
- b REAL,
- c OBJECT IDENTIFIER,
- d NULL }
- This is a 4-component structure called 'Pdu'. The major format
- for representation of SEQUENCE in Erlang is the record format.
- For each SEQUENCE and SET in an ASN.1 module an Erlang
- record declaration is generated. For Pdu above, a record
- like this is defined:
-
--record('Pdu',{a, b, c, d}).
- The record declarations for a module M are placed in a
- separate M.hrl file.
- Values can be assigned in Erlang as shown below:
-
-MyPdu = #'Pdu'{a=22,b=77.99,c={0,1,2,3,4},d='NULL'}.
- The decode functions will return a record as result when decoding
- a SEQUENCE or a SET .
-
- A SEQUENCE and a SET may contain a component
- with a DEFAULT key word followed by the actual value that
- is the default value. The DEFAULT keyword means that the
- application doing the encoding can omit encoding of the value,
- thus resulting in fewer bytes to send to the receiving
- application.
-
- An application can use the atom asn1_DEFAULT to indicate
- that the encoding should be omitted for that position in
- the SEQUENCE.
-
- Depending on the encoding rules, the encoder may also compare
- the given value to the default value and automatically omit the
- encoding if they are equal. How much effort the encoder makes to
- to compare the values depends on the encoding rules. The DER
- encoding rules forbids encoding a value equal to the default value,
- so it has a more thorough and time-consuming comparison than the
- encoders for the other encoding rules.
-
- In the following example we will use this ASN.1 specification:
-
-File DEFINITIONS AUTOMATIC TAGS ::=
-BEGIN
-Seq1 ::= SEQUENCE {
- a INTEGER DEFAULT 1,
- b Seq2 DEFAULT {aa TRUE, bb 15}
-}
-
-Seq2 ::= SEQUENCE {
- aa BOOLEAN,
- bb INTEGER
-}
-
-Seq3 ::= SEQUENCE {
- bs BIT STRING {a(0), b(1), c(2)} DEFAULT {a, c}
-}
-END
- Here is an example where the BER encoder is able to omit encoding
- of the default values:
-
-1> asn1ct:compile('File', [ber]).
-ok
-2> 'File':encode('Seq1', {'Seq1',asn1_DEFAULT,asn1_DEFAULT}).
-{ok,<<48,0>>}
-3> 'File':encode('Seq1', {'Seq1',1,{'Seq2',true,15}}).
-{ok,<<48,0>>}
-
- And here is an example with a named BIT STRING where the BER
- encoder will not omit the encoding:
-
-4> 'File':encode('Seq3', {'Seq3',asn1_DEFAULT).
-{ok,<<48,0>>}
-5> 'File':encode('Seq3', {'Seq3',<<16#101:3>>).
-{ok,<<48,4,128,2,5,160>>}
-
- The DER encoder will omit the encoding for the same BIT STRING:
-
-6> asn1ct:compile('File', [ber,der]).
-ok
-7> 'File':encode('Seq3', {'Seq3',asn1_DEFAULT).
-{ok,<<48,0>>}
-8> 'File':encode('Seq3', {'Seq3',<<16#101:3>>).
-{ok,<<48,0>>}
-
-
-
-
- SET
- In Erlang, the SET type is used exactly as SEQUENCE. Note
- that if the BER or DER encoding rules are used, decoding a
- SET is slower than decoding a SEQUENCE because the components
- must be sorted.
-
-
-
- Notes about extensibility for SEQUENCE and SET
- When a SEQUENCE or SET contains an extension marker and
- extension components like this:
-
-SExt ::= SEQUENCE {
- a INTEGER,
- ...,
- b BOOLEAN }
-
- It means that the type may get more components in newer
- versions of the ASN.1 spec. In this case it has got a new
- component b . Thus, incoming messages that will be decoded
- may have more or fever components than this one.
-
- The component b will be treated as
- an original component when encoding a message. In this case, as
- it is not an optional element, it must be encoded.
-
- During decoding the b field of the record will get the decoded
- value of the b
- component if present and otherwise the value asn1_NOVALUE .
-
-
-
-
- CHOICE
- The CHOICE type is a space saver and is similar to the concept of a
- 'union' in the C language.
- Assume:
-
-SomeModuleName DEFINITIONS AUTOMATIC TAGS ::=
-BEGIN
-T ::= CHOICE {
- x REAL,
- y INTEGER,
- z OBJECT IDENTIFIER }
-END
- It is then possible to assign values:
-
-TVal1 = {y,17},
-TVal2 = {z,{0,1,2}},
-
- A CHOICE value is always represented as the tuple
- {ChoiceAlternative, Val} where ChoiceAlternative
- is an atom denoting the selected choice alternative.
-
-
-
- Extensible CHOICE
- When a CHOICE contains an extension marker and the decoder detects
- an unknown alternative of the CHOICE the value is represented as:
-
-{asn1_ExtAlt, BytesForOpenType}
-
- Where BytesForOpenType is a list of bytes constituting the
- encoding of the "unknown" CHOICE alternative.
-
-
-
-
-
- SET OF and SEQUENCE OF
- The SET OF and SEQUENCE OF types correspond to the concept of an array
- found in several programming languages. The Erlang syntax for
- both of these types is straight forward. For example:
-
-Arr1 ::= SET SIZE (5) OF INTEGER (4..9)
-Arr2 ::= SEQUENCE OF OCTET STRING
- We may have the following in Erlang:
-
-Arr1Val = [4,5,6,7,8],
-Arr2Val = ["abc",[14,34,54],"Octets"],
- Please note that the definition of the SET OF type implies that
- the order of the components is undefined, but in practice there is
- no difference between SET OF and SEQUENCE OF. The ASN.1 compiler
- for Erlang does not randomize the order of the SET OF components
- before encoding.
- However, in case of a value of the type SET OF , the DER
- encoding format requires the elements to be sent in ascending
- order of their encoding, which implies an expensive sorting
- procedure in run-time. Therefore it is strongly recommended to
- use SEQUENCE OF instead of SET OF if it is possible.
-
-
-
-
- ANY and ANY DEFINED BY
- The types ANY and ANY DEFINED BY have been removed
- from the standard since 1994. It is recommended not to use
- these types any more. They may, however, exist in some old ASN.1
- modules.
- The idea with this type was to leave a "hole" in a definition where
- one could put unspecified data of any kind, even non ASN.1 data.
- A value of this type is encoded as an open type .
- Instead of ANY /ANY DEFINED BY one should use
- information object class , table constraints and
- parameterization . In particular the construct
- TYPE-IDENTIFIER.@Type accomplish the same as the
- deprecated ANY .
- See also Information object
-
-
-
-
- EXTERNAL, EMBEDDED PDV and CHARACTER STRING
- These types are used in presentation layer negotiation. They are
- encoded according to their associated type, see [].
- The EXTERNAL type had a slightly different associated type
- before 1994. [] states that encoding shall follow
- the older associate type. Therefore does generated encode/decode
- functions convert values of the newer format to the older format
- before encoding. This implies that it is allowed to use
- EXTERNAL type values of either format for encoding. Decoded
- values are always returned on the newer format.
-
-
-
- Embedded Named Types
- The structured types previously described may very well have other named types
- as their components. The general syntax to assign a value to the component C
- of a named ASN.1 type T in Erlang is the record syntax
- #'T'{'C'=Value} .
- Where Value may be a value of yet another type T2.
- For example:
-
-EmbeddedExample DEFINITIONS AUTOMATIC TAGS ::=
-BEGIN
-B ::= SEQUENCE {
- a Arr1,
- b T }
-
-Arr1 ::= SET SIZE (5) OF INTEGER (4..9)
-
-T ::= CHOICE {
- x REAL,
- y INTEGER,
- z OBJECT IDENTIFIER }
- END
- The SEQUENCE b can be encoded like this in Erlang:
-
-1> 'EmbeddedExample':encode('B', {'B',[4,5,6,7,8],{x,"7.77"}}).
-{ok,<<5,56,0,8,3,55,55,55,46,69,45,50>>}
-
-
-
-
- Naming of Records in .hrl Files
- When an ASN.1 specification is compiled all defined types of
- type SET or SEQUENCE will result in a corresponding record in the
- generated hrl file. This is because the values for SET/SEQUENCE
- as mentioned in sections above are represented as records.
- Though there are some special cases of this functionality that
- are presented below.
-
-
- Embedded Structured Types
- It is also possible in ASN.1 to have components that are themselves
- structured types.
- For example, it is possible to have:
-
-Emb ::= SEQUENCE {
- a SEQUENCE OF OCTET STRING,
- b SET {
- a INTEGER,
- b INTEGER DEFAULT 66},
- c CHOICE {
- a INTEGER,
- b FooType } }
-
-FooType ::= [3] VisibleString
- The following records are generated because of the type Emb :
-
--record('Emb,{a, b, c}).
--record('Emb_b',{a, b = asn1_DEFAULT}). % the embedded SET type
-
- Values of the Emb type can be assigned like this:
-
-V = #'Emb'{a=["qqqq",[1,2,255]],
- b = #'Emb_b'{a=99},
- c ={b,"Can you see this"}}.
-
- For an embedded type of type SEQUENCE/SET in a SEQUENCE/SET
- the record name is extended with an underscore and the component
- name. If the embedded structure is deeper with SEQUENCE, SET or
- CHOICE types in the line, each component-/alternative-name will
- be added to the record-name.
- For example:
-
-Seq ::= SEQUENCE{
- a CHOICE{
- b SEQUENCE {
- c INTEGER
- }
- }
-}
- will result in the following record:
-
--record('Seq_a_b',{c}).
- If the structured type has a component with an embedded
- SEQUENCE OF/SET OF which embedded type in turn is a
- SEQUENCE/SET it will give a record with the SEQOF/SETOF
- addition as in the following example:
-
-Seq ::= SEQUENCE {
- a SEQUENCE OF SEQUENCE {
- b
- }
- c SET OF SEQUENCE {
- d
- }
-}
- This results in the records:
-
--record('Seq_a_SEQOF'{b}).
--record('Seq_c_SETOF'{d}).
- A parameterized type should be considered as an embedded
- type. Each time a such type is referenced an instance of it is
- defined. Thus in the following example a record with name
- 'Seq_b' is generated in the .hrl file and used to hold
- values.
-
-Seq ::= SEQUENCE {
- b PType{INTEGER}
-}
-
-PType{T} ::= SEQUENCE{
- id T
-}
-
-
-
- Recursive Types
- Types may refer to themselves. Suppose:
-
-Rec ::= CHOICE {
- nothing NULL,
- something SEQUENCE {
- a INTEGER,
- b OCTET STRING,
- c Rec }}
- This type is recursive; that is, it refers to itself. This is allowed
- in ASN.1 and the ASN.1-to-Erlang compiler supports this recursive
- type. A value for this type is assigned in Erlang as shown below:
-
-V = {something,#'Rec_something'{a = 77,
- b = "some octets here",
- c = {nothing,'NULL'}}}.
-
-
-
-
- ASN.1 Values
- Values can be assigned to ASN.1 type within the ASN.1 code
- itself, as opposed to the actions taken in the previous chapter where
- a value was assigned to an ASN.1 type in Erlang. The full value
- syntax of ASN.1 is supported and [X.680] describes in detail how
- to assign values in ASN.1. Below is a short example:
-
-TT ::= SEQUENCE {
- a INTEGER,
- b SET OF OCTET STRING }
-
-tt TT ::= {a 77,b {"kalle","kula"}}
- The value defined here could be used in several ways.
- Firstly, it could be used as the value in some DEFAULT component:
-
-SS ::= SET {
- s OBJECT IDENTIFIER,
- val TT DEFAULT tt }
- It could also be used from inside an Erlang program. If the above ASN.1
- code was defined in ASN.1 module Values , then the ASN.1 value
- tt can be reached from Erlang as
- a function call to 'Values':tt() as in the example below.
-
-1> Val = 'Values':tt().
-{'TT',77,["kalle","kula"]}
-2> {ok,Bytes} = 'Values':encode('TT',Val).
-{ok,<<48,18,128,1,77,161,13,4,5,107,97,108,108,101,4,4,
- 107,117,108,97>>}
-4> 'Values':decode('TT',Bytes).
-{ok,{'TT',77,["kalle","kula"]}}
-5>
-
- The above example shows that a function is generated by the compiler
- that returns a valid Erlang representation of the value, even though
- the value is of a complex type.
- Furthermore, there is a macro generated for each value in the .hrl
- file. So, the defined value tt can also be extracted by
- ?tt in application code.
-
-
-
- Macros
- MACRO is not supported as the the type is no longer part of the
- ASN.1 standard.
-
-
-
-
- ASN.1 Information Objects (X.681)
- Information Object Classes, Information Objects and Information
- Object Sets (in the following called classes, objects and
- object sets respectively) are defined in the standard
- definition []. In the following only a brief
- explanation is given.
- These constructs makes it possible to define open types,
- i.e. values of that type can be of any ASN.1 type. It is also
- possible to define relationships between different types and
- values, since classes can hold types, values, objects, object
- sets and other classes in its fields.
- An Information Object Class may be defined in ASN.1 as:
-
-GENERAL-PROCEDURE ::= CLASS {
- &Message,
- &Reply OPTIONAL,
- &Error OPTIONAL,
- &id PrintableString UNIQUE
-}
-WITH SYNTAX {
- NEW MESSAGE &Message
- [REPLY &Reply]
- [ERROR &Error]
- ADDRESS &id
-}
- An object is an instance of a class and an object set is a set
- containing objects of one specified class. A definition may look like
- below.
- The object object1 is an instance of the CLASS
- GENERAL-PROCEDURE and has one type field and one fixed type value
- field. The object object2 also has an OPTIONAL field ERROR,
- which is a type field.
-
-object1 GENERAL-PROCEDURE ::= {
- NEW MESSAGE PrintableString
- ADDRESS "home"
-}
-
-object2 GENERAL-PROCEDURE ::= {
- NEW MESSAGE INTEGER
- ERROR INTEGER
- ADDRESS "remote"
-}
- The field ADDRESS is a UNIQUE field. Objects in an object set must
- have unique values in their UNIQUE field, as in GENERAL-PROCEDURES:
-
-GENERAL-PROCEDURES GENERAL-PROCEDURE ::= {
- object1 | object2}
- One can not encode a class, object or object set, only referring to
- it when defining other ASN.1 entities. Typically one refers to a
- class and to object sets by table constraints and component
- relation constraints [] in ASN.1 types, as in:
-
-StartMessage ::= SEQUENCE {
- msgId GENERAL-PROCEDURE.&id ({GENERAL-PROCEDURES}),
- content GENERAL-PROCEDURE.&Message ({GENERAL-PROCEDURES}{@msgId}),
- }
- In the type StartMessage the constraint following the
- content field tells that in a value of type
- StartMessage the value in the content field must
- come from the same object that is chosen by the msgId
- field.
- So, the value #'StartMessage'{msgId="home",content="Any Printable String"} is legal to encode as a StartMessage
- value, while the value #'StartMessage'{msgId="remote", content="Some String"} is illegal since the constraint
- in StartMessage tells that when you have chosen a value from a
- specific object in the object set GENERAL-PROCEDURES in the
- msgId field you have to choose a value from that same object in
- the content field too. In this second case it should have been
- any INTEGER value.
- StartMessage can in the content field be
- encoded with a value of any type that an object in the
- GENERAL-PROCEDURES object set has in its NEW MESSAGE field. This field refers to a type field
- &Message in the class. The msgId field is always
- encoded as a PrintableString, since the field refers to a fixed type
- in the class.
- In practice, object sets are usually declared to be extensible so
- so that more objects can be added to the set later. Extensibility is
- indicated like this:
-
-GENERAL-PROCEDURES GENERAL-PROCEDURE ::= {
- object1 | object2, ...}
- When decoding a type that uses an extensible set constraint,
- there is always the possibility that the value in the UNIQUE
- field is unknown (i.e. the type has been encoded with a later
- version of the ASN.1 specification). When that happens, the
- unencoded data will be returned wrapped in a tuple like this:
-
-
-{asn1_OPENTYPE,Binary}
- where Binary is an Erlang binary that contains the encoded
- data. (If the option legacy_erlang_types has been given,
- just the binary will be returned.)
-
-
-
- Parameterization (X.683)
- Parameterization, which is defined in the standard [], can be used when defining types, values, value
- sets, information object classes, information objects or
- information object sets.
- A part of a definition can be supplied as a parameter. For
- instance, if a Type is used in a definition with certain
- purpose, one want the type-name to express the intention. This
- can be done with parameterization.
- When many types (or another ASN.1 entity) only differs in some
- minor cases, but the structure of the types are similar, only
- one general type can be defined and the differences may be supplied
- through parameters.
- One example of use of parameterization is:
-
-General{Type} ::= SEQUENCE
-{
- number INTEGER,
- string Type
-}
-
-T1 ::= General{PrintableString}
-
-T2 ::= General{BIT STRING}
-
- An example of a value that can be encoded as type T1 is {12,"hello"}.
- Note that the compiler does not generate encode/decode functions for
- parameterized types, but only for the instances of the parameterized
- types. Therefore, if a file contains the types General{}, T1 and T2 above,
- encode/decode functions will only be generated for T1 and T2.
-
-
-
-
diff --git a/lib/asn1/doc/src/asn1ct.xml b/lib/asn1/doc/src/asn1ct.xml
index 32ff2d52cf..4e0bf055fc 100644
--- a/lib/asn1/doc/src/asn1ct.xml
+++ b/lib/asn1/doc/src/asn1ct.xml
@@ -35,43 +35,45 @@
ASN.1 compiler and compile-time support functions
The ASN.1 compiler takes an ASN.1 module as input and generates a
- corresponding Erlang module which can encode and decode the data-types
- specified. Alternatively the compiler takes a specification module
- (se below) specifying all input modules and generates one module with
- encode/decode functions. There are also some generic functions which
- can be used in during development of applications which handles ASN.1
- data (encoded as BER or PER).
+ corresponding Erlang module, which can encode and decode the specified
+ data types. Alternatively, the compiler takes a specification module
+ specifying all input modules, and generates a module with
+ encode/decode functions. In addition, some generic functions
+ can be used during development of applications that handles ASN.1
+ data (encoded as BER or PER ).
+
- By default in OTP 17, the representation of the BIT STRING
- and OCTET STRING types as Erlang terms have changed. BIT
- STRING values are now Erlang bitstrings and OCTET STRING values
- are binaries. Also, an undecoded open type will now be wrapped in
- a asn1_OPENTYPE tuple. For details see BIT STRING , OCTET STRING , and
- ASN.1 Information Objects in User's Guide.
- To revert to the old representation of the types, use the
- legacy_erlang_types option.
+ By default in OTP 17, the representation of the BIT STRING
+ and OCTET STRING types as Erlang terms were changed. BIT
+ STRING values are now Erlang bit strings and OCTET STRING
+ values are binaries. Also, an undecoded open type is now wrapped in
+ an asn1_OPENTYPE tuple. For details, see BIT STRING , OCTET STRING , and
+ ASN.1 Information Objects in the User's Guide.
+ To revert to the old representation of the types, use option
+ legacy_erlang_types .
+
- In R16, the options have been simplified. The back-end is chosen
+
In OTP R16, the options were simplified. The back end is chosen
using one of the options ber , per , or uper .
- The options optimize , nif , and driver options
- are no longer necessary (and the ASN.1 compiler will print a
- warning if they are used). The options ber_bin , per_bin ,
- and uper_bin options will still work, but will print a warning.
+ Options optimize , nif , and driver options
+ are no longer necessary (and the ASN.1 compiler generates a
+ warning if they are used). Options ber_bin , per_bin ,
+ and uper_bin options still work, but generates a warning.
- Another change in R16 is that the generated encode/2
- function always returns a binary.
- The encode/2 function for the BER back-end used to return
- an iolist.
+ Another change in OTP R16 is that the generated function
+ encode/2 always returns a binary. Function encode/2
+ for the BER back end used to return an iolist.
+
compile(Asn1module) -> ok | {error, Reason}
compile(Asn1module, Options) -> ok | {error, Reason}
- Compile an ASN.1 module and generate encode/decode functions according to the encoding rules BER or PER.
+ Compiles an ASN.1 module and generates encode/decode functions according to encoding rules BER or PER.
Asn1module = atom() | string()
Options = [Option| OldOption]
@@ -85,79 +87,82 @@
Prefix = string()
- Compiles the ASN.1 module Asn1module and generates an
- Erlang module Asn1module.erl with encode and decode
+
Compiles the ASN.1 module Asn1module and generates
+ an Erlang module Asn1module.erl with encode and decode
functions for the types defined in Asn1module . For each
- ASN.1 value defined in the module an Erlang function which
+ ASN.1 value defined in the module, an Erlang function that
returns the value in Erlang representation is generated.
- If Asn1module is a filename without extension first
- ".asn1" is assumed, then ".asn" and finally
+
If Asn1module is a filename without extension, first
+ ".asn1" is assumed, then ".asn" , and finally
".py" (to be compatible with the old ASN.1 compiler).
- Of course Asn1module can be a full pathname (relative or
+ Asn1module can be a full pathname (relative or
absolute) including filename with (or without) extension.
- If one wishes to compile a set of Asn1 modules into one
- Erlang file with encode/decode functions one has to list all
+
If it is needed to compile a set of ASN.1 modules into an
+ Erlang file with encode/decode functions, ensure to list all
involved files in a configuration file. This configuration
- file must have a double extension ".set.asn", (".asn" can
- alternatively be ".asn1" or ".py"). The input files' names
- must be listed, within quotation marks (""), one at each row
+ file must have a double extension ".set.asn"
+ (".asn" can alternatively be ".asn1" or ".py" ).
+ List the input file names
+ within quotation marks (""), one at each row
in the file. If the input files are File1.asn ,
- File2.asn and File3.asn the configuration file
- shall look like:
+ File2.asn , and File3.asn , the configuration file
+ must look as follows:
File1.asn
File2.asn
-File3.asn
- The output files will in this case get their names from the
- configuration file. If the configuration file has the name
- SetOfFiles.set.asn the name of the output files will be
- SetOfFiles.hrl, SetOfFiles.erl and SetOfFiles.asn1db .
- Sometimes in a system of ASN.1 modules there are different
- default tag modes, e.g. AUTOMATIC, IMPLICIT or EXPLICIT. The
- multi file compilation resolves the default tagging as if
+File3.asn
+
The output files in this case get their names from the
+ configuration file. If the configuration file is named
+ SetOfFiles.set.asn , the names of the output files are
+ SetOfFiles.hrl, SetOfFiles.erl, and SetOfFiles.asn1db .
+ Sometimes in a system of ASN.1 modules, different
+ default tag modes, for example, AUTOMATIC , IMPLICIT ,
+ or EXPLICIT . The
+ multi-file compilation resolves the default tagging as if
the modules were compiled separately.
- Another unwanted effect that may occur in multi file compilation
- is name collisions. The compiler solves this problem in two
- ways: If the definitions are identical then the output module
- keeps only one definition with the original name. But if
- definitions only have same name and differs in the definition,
- then they will be renamed. The new names will be the definition
- name and the original module name concatenated.
- If any name collision have occurred the compiler reports a
- "NOTICE: ..." message that tells if a definition was renamed,
+
Name collisions is another unwanted effect that can occur in
+ multi file-compilation. The compiler solves this problem in one
+ of two ways:
+
+ - If the definitions are identical, the output module
+ keeps only one definition with the original name.
+ - If the definitions have the same name and differs in the
+ definition, they are renamed. The new names are the definition
+ name and the original module name concatenated.
+
+ If a name collision occurs, the compiler reports a
+ "NOTICE: ..." message that tells if a definition was renamed,
and the new name that must be used to encode/decode data.
-
-
- Options is a list with options specific for the asn1
+
Options is a list with options specific for the ASN.1
compiler and options that are applied to the Erlang compiler.
- The latter are those that not is recognized as asn1 specific.
- Available options are:
+ The latter are not recognized as ASN.1 specific. The
+ available options are as follows:
ber | per | uper
-
The encoding rule to be used. The supported encoding rules
- are BER (Basic Encoding Rules),
- PER aligned (Packed Encoding Rules) and PER unaligned.
- If the encoding rule option is omitted ber
+ are Basic Encoding Rules (BER),
+ Packed Encoding Rules (PER) aligned, and PER unaligned.
+ If the encoding rule option is omitted, ber
is the default.
The generated Erlang module always gets the same name
- as the ASN.1 module and as a consequence of this only one
- encoding rule per ASN.1 module can be used at runtime.
+ as the ASN.1 module. Therefore, only one
+ encoding rule per ASN.1 module can be used at runtime.
der
-
- By this option the Distinguished Encoding Rules (DER) is chosen.
+ With this option the Distinguished Encoding Rules (DER) is chosen.
DER is regarded as a specialized variant of the BER encoding
- rule, therefore the der option only makes sense together
- with the ber option.
+ rule. Therefore, this option only makes sense together
+ with option ber .
This option
sometimes adds sorting and value checks when encoding, which
implies a slower encoding. The decoding routines are the same
@@ -167,118 +172,123 @@ File3.asn
compact_bit_string
-
- The BIT STRING type will be decoded to the "compact notation".
+ The BIT STRING type is decoded to "compact notation".
This option is not recommended for new code.
- For details see
-
- BIT STRING type section in the Users Guide
- .
+
For details, see Section
+
+ BIT STRING in the User's Guide.
- This option implies the legacy_erlang_types option.
+ This option implies option legacy_erlang_types .
legacy_bit_string
-
- The BIT STRING type will be decoded to the legacy
- format, i.e. a list of zeroes and ones.
+ The BIT STRING type is decoded to the legacy
+ format, that is, a list of zeroes and ones.
This option is not recommended for new code.
- For details see
-
- BIT STRING type section in the Users Guide
- .
-
This option implies the legacy_erlang_types option.
-
+ For details, see Section
+ BIT STRING
+ in the User's Guide
+ This option implies option legacy_erlang_types .
legacy_erlang_types
-
-
Use the same Erlang types to represent BIT STRING and
- OCTET STRING as in R16. For details see BIT STRING and
- OCTET
- STRING in User's Guide.
- This option is not recommended for
- new code.
+ Use the same Erlang types to represent BIT STRING and
+ OCTET STRING as in OTP R16.
+ For details, see Section BIT STRING and Section
+ OCTET
+ STRING in the User's Guide.
+ This option is not recommended for new code.
{n2n, EnumTypeName}
-
- Tells the compiler to generate functions for conversion between
- names (as atoms) and numbers and vice versa for the EnumTypeName specified. There can be multiple occurrences of this option in order to specify several type names. The type names must be declared as ENUMERATIONS in the ASN.1 spec.
- If the EnumTypeName does not exist in the ASN.1 spec the
- compilation will stop with an error code.
- The generated conversion functions are named
+ Tells the compiler to generate functions for conversion
+ between names (as atoms) and numbers and conversely for
+ the specified EnumTypeName . There can be multiple
+ occurrences of this option to specify several type names.
+ The type names must be declared as ENUMERATIONS in
+ the ASN.1 specification.
+
+ If EnumTypeName does not exist in the ASN.1 specification,
+ the compilation stops with an error code.
+
+ The generated conversion functions are named
name2num_EnumTypeName/1 and
num2name_EnumTypeName/1 .
noobj
-
-
Do not compile (i.e do not produce object code) the generated
- .erl file. If this option is omitted the generated Erlang module
- will be compiled.
+ Do not compile (that is, do not produce object code) the
+ generated .erl file. If this option is omitted, the
+ generated Erlang module is compiled.
{i, IncludeDir}
-
Adds IncludeDir to the search-path for
- .asn1db and asn1 source files. The compiler tries
- to open a .asn1db file when a module imports
- definitions from another ASN.1 module. If no
- .asn1db file is found the asn1 source file is
- parsed. Several {i, IncludeDir} can be given.
+ .asn1db and ASN.1 source files. The compiler
+ tries to open an .asn1db file when a module imports
+ definitions from another ASN.1 module. If no
+ .asn1db file is found, the ASN.1 source file is
+ parsed. Several {i, IncludeDir} can be given.
{outdir, Dir}
-
-
Specifies the directory Dir where all generated files
- shall be placed. If omitted the files are placed in the
- current directory.
+ Specifies directory Dir where all generated files
+ are to be placed. If this option is omitted, the files are
+ placed in the current directory.
asn1config
-
-
When one of the specialized decodes, exclusive or
- selective decode, is wanted one has to give instructions in
- a configuration file. The option asn1config enables
- specialized decodes and takes the configuration file, which
- has the same name as the ASN.1 spec but with extension
- .asn1config , in concern.
+
When using one of the specialized decodes, exclusive or
+ selective decode, instructions must be given in
+ a configuration file. Option asn1config enables
+ specialized decodes and takes the configuration file in
+ concern. The configuration file has
+ the same name as the ASN.1 specification, but with extension
+ .asn1config .
- The instructions for exclusive decode must follow the
- instruction and grammar in the User's Guide .
+
For instructions for exclusive decode, see Section
+ Exclusive
+ Decode in the User's Guide.
- You can also find the instructions for selective decode
- in the
- User's Guide .
+
For instructions for selective decode, see Section
+ Selective
+ Decode in the User's Guide.
undec_rest
-
-
A buffer that holds a message, being decoded may
- also have some following bytes. Now it is possible to get
- those following bytes returned together with the decoded
- value. If an asn1 spec is compiled with this option a tuple
- {ok, Value, Rest} is returned. Rest may be a
+
A buffer that holds a message, being decoded it can also
+ have some following bytes. Those following bytes can now
+ be returned together with the decoded value. If an
+ ASN.1 specification is compiled with this option, a tuple
+ {ok, Value, Rest} is returned. Rest can be a
list or a binary. Earlier versions of the compiler ignored
those following bytes.
no_ok_wrapper
-
-
If this option is given, the generated encode/2
- and decode/2 functions will not wrap a successful
+
With this option, the generated encode/2
+ and decode/2 functions do not wrap a successful
return value in an {ok,...} tuple. If any error
- occurs, there will be an exception.
+ occurs, an exception will be raised.
{macro_name_prefix, Prefix}
-
All macro names generated by the compiler are prefixed with
- Prefix . This is useful when multiple protocols that contains
+ Prefix . This is useful when multiple protocols that contain
macros with identical names are included in a single module.
{record_name_prefix, Prefix}
-
All record names generated by the compiler are prefixed with
- Prefix . This is useful when multiple protocols that contains
+ Prefix . This is useful when multiple protocols that contain
records with identical names are included in a single module.
verbose
@@ -291,27 +301,27 @@ File3.asn
Causes warnings to be treated as errors.
- Any additional option that is applied will be passed to
- the final step when the generated .erl file is compiled.
+
Any more option that is applied is passed to
+ the final step when the generated .erl file is compiled.
The compiler generates the following files:
- -
-
Asn1module.hrl (if any SET or SEQUENCE is defined)
+ Asn1module.hrl (if any SET or SEQUENCE
+ is defined)
- -
-
Asn1module.erl the Erlang module with encode, decode and value functions.
+ Asn1module.erl - Erlang module with encode, decode,
+ and value functions
- -
-
Asn1module.asn1db intermediate format used by the compiler when modules IMPORTS
- definitions from each other.
+ Asn1module.asn1db - Intermediate format used by the
+ compiler when modules IMPORT definitions from each other.
+
encode(Module, Type, Value)-> {ok, Bytes} | {error, Reason}
- Encode an ASN.1 value.
+ Encodes an ASN.1 value.
Module = Type = atom()
Value = term()
@@ -319,11 +329,11 @@ File3.asn
Reason = term()
- Encodes Value of Type defined in the ASN.1 module
- Module . To get as fast execution as possible the
- encode function only performs rudimentary tests that the input
- Value
- is a correct instance of Type . The length of strings is for example
+
Encodes Value of Type defined in the ASN.1 module
+ Module . To get as fast execution as possible, the
+ encode function performs only the rudimentary tests that input
+ Value is a correct instance of Type . So, for example,
+ the length of strings is
not always checked. Returns {ok, Bytes} if successful or
{error, Reason} if an error occurred.
@@ -331,6 +341,7 @@ File3.asn
Use Module:encode(Type, Value) instead.
+
decode(Module, Type, Bytes) -> {ok, Value} | {error, Reason}
Decode from Bytes into an ASN.1 value.
@@ -346,26 +357,28 @@ File3.asn
Use Module:decode(Type, Bytes) instead.
+
value(Module, Type) -> {ok, Value} | {error, Reason}
- Create an ASN.1 value for test purposes.
+ Creates an ASN.1 value for test purposes.
Module = Type = atom()
Value = term()
Reason = term()
- Returns an Erlang term which is an example of a valid Erlang
- representation of a value of the ASN.1 type Type . The value
+
Returns an Erlang term that is an example of a valid Erlang
+ representation of a value of the ASN.1 type Type . The value
is a random value and subsequent calls to this function will for most
types return different values.
+
test(Module) -> ok | {error, Reason}
test(Module, Type | Options) -> ok | {error, Reason}
test(Module, Type, Value | Options) -> ok | {error, Reason}
- Perform a test of encode and decode for types in an ASN.1 module.
+ Performs a test of encode and decode for types in an ASN.1 module.
Module = Type = atom()
Value = term()
@@ -376,9 +389,8 @@ File3.asn
Performs a test of encode and decode of types in Module .
The generated functions are called by this function.
This function is useful during test to secure that the generated
- encode and decode functions and the general runtime support work
- as expected.
-
+ encode and decode functions as well as the general runtime support
+ work as expected.
-
test/1 iterates over all types in Module .
@@ -390,14 +402,12 @@ File3.asn
test/3 tests type Type with Value .
-
- Schematically the following happens for each type in the module:
+ Schematically, the following occurs for each type in the module:
{ok, Value} = asn1ct:value(Module, Type),
{ok, Bytes} = asn1ct:encode(Module, Type, Value),
{ok, Value} = asn1ct:decode(Module, Type, Bytes).
-
- The test functions utilizes the *.asn1db files
+
The test functions use the *.asn1db files
for all included modules. If they are located in a different
directory than the current working directory, use the include
option to add paths. This is only needed when automatically
diff --git a/lib/asn1/doc/src/asn1rt.xml b/lib/asn1/doc/src/asn1rt.xml
index 3cf56b01ca..f5c334c2ac 100644
--- a/lib/asn1/doc/src/asn1rt.xml
+++ b/lib/asn1/doc/src/asn1rt.xml
@@ -46,7 +46,7 @@
decode(Module,Type,Bytes) -> {ok,Value}|{error,Reason}
- Decode from bytes into an ASN.1 value.
+ Decodes from Bytes into an ASN.1 value.
Module = Type = atom()
Value = Reason = term()
@@ -61,7 +61,7 @@
encode(Module,Type,Value)-> {ok,Bytes} | {error,Reason}
- Encode an ASN.1 value.
+ Encodes an ASN.1 value.
Module = Type = atom()
Value = term()
@@ -69,12 +69,12 @@
Reason = term()
- Encodes Value of Type defined in the ASN.1
+
Encodes Value of Type defined in the ASN.1
module Module . Returns a binary if successful. To get
- as fast execution as possible the encode function only
- performs rudimentary tests that the input Value is a
- correct instance of Type . The length of strings is, for
- example, not always checked.
+ as fast execution as possible, the encode function performs
+ only the rudimentary test that input Value is a correct
+ instance of Type . For example, the length of strings is
+ not always checked.
Use Module:encode(Type, Value) instead of this function.
@@ -88,23 +88,23 @@
Reason = term()
- info/1 returns the version of the asn1 compiler that was
+
Returns the version of the ASN.1 compiler that was
used to compile the module. It also returns the compiler options
- that was used.
+ that were used.
Use Module:info() instead of this function.
utf8_binary_to_list(UTF8Binary) -> {ok,UnicodeList} | {error,Reason}
- Transforms an utf8 encoded binary to a unicode list.
+ Transforms an UTF8 encoded binary to a unicode list.
UTF8Binary = binary()
UnicodeList = [integer()]
Reason = term()
- utf8_binary_to_list/1 Transforms a UTF8 encoded binary
+
Transforms a UTF8 encoded binary
to a list of integers, where each integer represents one
character as its unicode value. The function fails if the binary
is not a properly encoded UTF8 string.
@@ -114,14 +114,14 @@
utf8_list_to_binary(UnicodeList) -> {ok,UTF8Binary} | {error,Reason}
- Transforms an unicode list ot an utf8 binary.
+ Transforms an unicode list to a UTF8 binary.
UnicodeList = [integer()]
UTF8Binary = binary()
Reason = term()
- utf8_list_to_binary/1 Transforms a list of integers,
+
Transforms a list of integers,
where each integer represents one character as its unicode
value, to a UTF8 encoded binary.
Use unicode:characters_to_binary/1 instead of this function.
diff --git a/lib/asn1/doc/src/part.xml b/lib/asn1/doc/src/part.xml
index 735ec2e616..104aeb1f34 100644
--- a/lib/asn1/doc/src/part.xml
+++ b/lib/asn1/doc/src/part.xml
@@ -29,11 +29,14 @@
part.sgml
- The Asn1 application
- contains modules with compile-time and run-time support for ASN.1.
+
The ASN.1 application
+ contains modules with compile-time and runtime support for
+ Abstract Syntax Notation One (ASN.1).
-
+
+
+
diff --git a/lib/asn1/doc/src/ref_man.xml b/lib/asn1/doc/src/ref_man.xml
index 0a0ed5416a..e157f542f3 100644
--- a/lib/asn1/doc/src/ref_man.xml
+++ b/lib/asn1/doc/src/ref_man.xml
@@ -21,7 +21,7 @@
- Asn1 Reference Manual
+ ASN.1 Reference Manual
OTP Team
1997-10-04
@@ -29,8 +29,8 @@
application.sgml
- The Asn1 application
- contains modules with compile-time and run-time support for ASN.1.
+ The ASN.1 application
+ contains modules with compile-time and runtime support for ASN.1.
--
cgit v1.2.3
From 5c9cab4be276b09f9c119f5d678f896b8043f015 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?=
Date: Fri, 24 Apr 2015 12:18:31 +0200
Subject: asn1_spec: Correct obsolete details about compiler options
There is now only one BER back-end, and there is no 'optimize'
option.
---
lib/asn1/doc/src/asn1_spec.xmlsrc | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
(limited to 'lib')
diff --git a/lib/asn1/doc/src/asn1_spec.xmlsrc b/lib/asn1/doc/src/asn1_spec.xmlsrc
index 5bee9f0075..e050dff553 100644
--- a/lib/asn1/doc/src/asn1_spec.xmlsrc
+++ b/lib/asn1/doc/src/asn1_spec.xmlsrc
@@ -46,13 +46,8 @@
- Exclusive decode
- Selected decode
- So far this functionality is only provided when using the
- optimized BER_BIN version, that is, when compiling with
- options ber_bin and optimize . It also works
- with optionnif . We do not intent to make this functionality
- available in the default BER version, but possibly in the
- PER_BIN version (per_bin ).
-
+ This functionality is only provided when using BER
+ (option ber ).
Exclusive Decode
@@ -213,9 +208,9 @@ Name = atom()
Compiling GUI.asn including the configuration file is done
as follows:
-unix> erlc -bber_bin +optimize +asn1config GUI.asn
+unix> erlc -bber +asn1config GUI.asn
-erlang> asn1ct:compile('GUI',[ber_bin,optimize,asn1config]).
+erlang> asn1ct:compile('GUI', [ber,asn1config]).
The module can be used as follows:
1> Button_Msg = {'Button',123,true}.
--
cgit v1.2.3
From 1e115b3e972bb8c23504ee75ad8fb2e202a6758a Mon Sep 17 00:00:00 2001
From: Lars Thorsen
Date: Fri, 24 Apr 2015 09:51:50 +0200
Subject: [orber, cos*] Remove usage of erlang:now()
---
lib/cosEvent/src/oe_CosEventComm_PullerS_impl.erl | 5 ++-
lib/cosEventDomain/src/cosEventDomainApp.erl | 34 ++--------------
lib/cosFileTransfer/src/cosFileTransferApp.erl | 7 ++--
lib/cosNotification/src/CosNotification_Common.erl | 47 +++++++++++++++-------
.../src/CosNotification_Definitions.hrl | 6 ++-
lib/cosNotification/src/PullerSupplier_impl.erl | 4 +-
lib/cosNotification/src/cosNotificationApp.erl | 16 +-------
.../src/cosNotification_eventDB.erl | 32 +++++++--------
.../src/CosPropertyService_PropertySetDef_impl.erl | 6 ++-
lib/cosProperty/src/cosProperty.erl | 7 ++--
lib/cosTime/src/CosTime_TimeService_impl.erl | 2 +-
lib/cosTime/src/cosTime.erl | 5 ++-
lib/cosTime/src/cosTimeApp.hrl | 2 +-
.../CosTransactions_TransactionFactory_impl.erl | 6 +--
lib/cosTransactions/src/ETraP_Common.erl | 17 ++++----
lib/cosTransactions/src/ETraP_Server_impl.erl | 5 ++-
.../CosNaming/CosNaming_NamingContextExt_impl.erl | 10 +++--
lib/orber/src/cdr_decode.erl | 8 ++--
lib/orber/src/corba.erl | 6 ++-
lib/orber/src/orber_ifr_utils.erl | 7 ++--
lib/orber/src/orber_objectkeys.erl | 12 +++---
lib/orber/src/orber_socket.erl | 5 +--
lib/orber/src/orber_web_server.erl | 8 ++--
23 files changed, 122 insertions(+), 135 deletions(-)
(limited to 'lib')
diff --git a/lib/cosEvent/src/oe_CosEventComm_PullerS_impl.erl b/lib/cosEvent/src/oe_CosEventComm_PullerS_impl.erl
index 5f2733e72d..9c22eafaab 100644
--- a/lib/cosEvent/src/oe_CosEventComm_PullerS_impl.erl
+++ b/lib/cosEvent/src/oe_CosEventComm_PullerS_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2015. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -251,7 +251,8 @@ send_sync(_OE_This, _OE_From, State, Any) ->
store_event(DB, Max, Event) ->
case ets:info(DB, size) of
CurrentSize when CurrentSize < Max ->
- ets:insert(DB, {now(), Event});
+ ets:insert(DB, {{erlang:system_time(), erlang:unique_integer([positive])},
+ Event});
_ ->
orber:dbg("[~p] oe_CosEventComm_PullerS:store_event(~p); DB full drop event.",
[?LINE, Event], ?DEBUG_LEVEL),
diff --git a/lib/cosEventDomain/src/cosEventDomainApp.erl b/lib/cosEventDomain/src/cosEventDomainApp.erl
index 734e4deccb..86069d9e09 100644
--- a/lib/cosEventDomain/src/cosEventDomainApp.erl
+++ b/lib/cosEventDomain/src/cosEventDomainApp.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2011. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2015. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -36,9 +36,6 @@
%%--------------- EXPORTS ------------------------------------
%% External MISC
-export([get_option/3,
- create_name/2,
- create_name/1,
- create_id/0,
create_id/1,
is_debug_compiled/0,
install/0,
@@ -222,31 +219,10 @@ get_option(Key, OptionList, DefaultList) ->
{error, "Invalid option"}
end
end.
-%%-----------------------------------------------------------%
-%% function : create_name/2
-%% Arguments:
-%% Returns :
-%% Exception:
-%% Effect :
-%%------------------------------------------------------------
-create_name(Name,Type) ->
- {MSec, Sec, USec} = erlang:now(),
- lists:concat(['oe_',node(),'_',Type,'_',Name,'_',MSec, '_', Sec, '_', USec]).
-
-%%-----------------------------------------------------------%
-%% function : create_name/1
-%% Arguments:
-%% Returns :
-%% Exception:
-%% Effect :
-%%------------------------------------------------------------
-create_name(Type) ->
- {MSec, Sec, USec} = erlang:now(),
- lists:concat(['oe_',node(),'_',Type,'_',MSec, '_', Sec, '_', USec]).
%%------------------------------------------------------------
-%% function : create_id/0
-%% Arguments: -
+%% function : create_id/1
+%% Arguments: CosEventDomainAdmin::DomainID (long)
%% Returns : CosEventDomainAdmin::DomainID (long)
%% Exception:
%% Purpose :
@@ -256,10 +232,6 @@ create_id(2147483647) ->
create_id(OldID) ->
OldID+1.
-
-create_id() ->
- {_A,_B,C}=now(),
- C.
%%------------------------------------------------------------
%% function : get_qos
%% Arguments:
diff --git a/lib/cosFileTransfer/src/cosFileTransferApp.erl b/lib/cosFileTransfer/src/cosFileTransferApp.erl
index 443c917a97..bcc9f485a0 100644
--- a/lib/cosFileTransfer/src/cosFileTransferApp.erl
+++ b/lib/cosFileTransfer/src/cosFileTransferApp.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2015. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -208,8 +208,9 @@ type_check(Obj, Mod) ->
%% Effect :
%%------------------------------------------------------------
create_name(Type) ->
- {MSec, Sec, USec} = erlang:now(),
- lists:concat(['oe_',node(),'_',Type,'_',MSec, '_', Sec, '_', USec]).
+ Time = erlang:system_time(),
+ Unique = erlang:unique_integer([positive]),
+ lists:concat(['oe_',node(),'_',Type,'_',Time,'_',Unique]).
%%-----------------------------------------------------------%
diff --git a/lib/cosNotification/src/CosNotification_Common.erl b/lib/cosNotification/src/CosNotification_Common.erl
index af9b2d4368..cdaaeee7f8 100644
--- a/lib/cosNotification/src/CosNotification_Common.erl
+++ b/lib/cosNotification/src/CosNotification_Common.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2015. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -39,8 +39,9 @@
%%--------------- EXPORTS ------------------------------------
%% External MISC
-export([get_option/3,
- create_name/2,
+ create_name/0,
create_name/1,
+ create_name/2,
create_id/0,
create_id/1,
is_debug_compiled/0,
@@ -110,17 +111,20 @@ get_option(Key, OptionList, DefaultList) ->
{error, "Invalid option"}
end
end.
-%%-----------------------------------------------------------%
-%% function : create_name/2
+
+%%------------------------------------------------------------
+%% function : create_name
%% Arguments:
%% Returns :
-%% Exception:
-%% Effect :
+%% Effect : Create a unique name to use when, for eaxmple, starting
+%% a new server.
%%------------------------------------------------------------
-create_name(Name,Type) ->
- {MSec, Sec, USec} = erlang:now(),
- lists:concat(['oe_',node(),'_',Type,'_',Name,'_',MSec, '_', Sec, '_', USec]).
-
+create_name() ->
+ Time = erlang:system_time(),
+ Unique = erlang:unique_integer([positive]),
+ lists:concat(['oe_',node(),'_',Time,'_',Unique]).
+
+
%%-----------------------------------------------------------%
%% function : create_name/1
%% Arguments:
@@ -129,8 +133,21 @@ create_name(Name,Type) ->
%% Effect :
%%------------------------------------------------------------
create_name(Type) ->
- {MSec, Sec, USec} = erlang:now(),
- lists:concat(['oe_',node(),'_',Type,'_',MSec, '_', Sec, '_', USec]).
+ Time = erlang:system_time(),
+ Unique = erlang:unique_integer([positive]),
+ lists:concat(['oe_',node(),'_',Type,'_',Time,'_',Unique]).
+
+%%-----------------------------------------------------------%
+%% function : create_name/2
+%% Arguments:
+%% Returns :
+%% Exception:
+%% Effect :
+%%------------------------------------------------------------
+create_name(Name,Type) ->
+ Time = erlang:system_time(),
+ Unique = erlang:unique_integer([positive]),
+ lists:concat(['oe_',node(),'_',Type,'_',Name,'_',Time,'_',Unique]).
%%------------------------------------------------------------
%% function : create_id/0
@@ -146,16 +163,16 @@ create_name(Type) ->
%%------------------------------------------------------------
create_id(-1) ->
1;
-create_id( 2147483647) ->
+create_id(2147483647) ->
-2147483648;
create_id(OldID) ->
OldID+1.
create_id() ->
- {_A,_B,C}=now(),
+ {_A,_B,C}=erlang:timestamp(),
C.
-%%-----------------------------------------------------------%
+%%------------------------------------------------------------
%% function : type_check
%% Arguments: Obj - objectrefernce to test.
%% Mod - Module which contains typeID/0.
diff --git a/lib/cosNotification/src/CosNotification_Definitions.hrl b/lib/cosNotification/src/CosNotification_Definitions.hrl
index 8325b5aa5e..5db081ec2e 100644
--- a/lib/cosNotification/src/CosNotification_Definitions.hrl
+++ b/lib/cosNotification/src/CosNotification_Definitions.hrl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2015. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -315,7 +315,9 @@
{tty, false},
{logfile, false},
{server_options, []}]).
--define(not_CreateDBKey, term_to_binary({now(), node()})).
+-define(not_CreateDBKey, term_to_binary({{erlang:system_time(),
+ erlang:unique_integer()},
+ node()})).
-define(DEBUG_LEVEL, 3).
diff --git a/lib/cosNotification/src/PullerSupplier_impl.erl b/lib/cosNotification/src/PullerSupplier_impl.erl
index 9f12f9c742..22e8355f3a 100644
--- a/lib/cosNotification/src/PullerSupplier_impl.erl
+++ b/lib/cosNotification/src/PullerSupplier_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2015. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -887,7 +887,7 @@ callAny(_OE_THIS, OE_FROM, State, EventIn, Status) ->
%% Start timers which send a message each time we should push events. Only used
%% when this objects is defined to supply sequences.
start_timer(State) ->
- TS = now(),
+ TS = erlang:timestamp(),
case catch timer:send_after(timer:seconds(?get_PacingInterval(State)),
{pacing, TS}) of
{ok,PacTRef} ->
diff --git a/lib/cosNotification/src/cosNotificationApp.erl b/lib/cosNotification/src/cosNotificationApp.erl
index ba44163272..251779c558 100644
--- a/lib/cosNotification/src/cosNotificationApp.erl
+++ b/lib/cosNotification/src/cosNotificationApp.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2015. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -221,7 +221,7 @@ start_global_factory() ->
start_global_factory(Args) when is_list(Args) ->
SO = 'CosNotification_Common':get_option(server_options, Args, ?not_DEFAULT_SETTINGS),
- Name = create_name(),
+ Name = 'CosNotification_Common':create_name(),
SPEC = ['CosNotifyChannelAdmin_EventChannelFactory',Args,
[{sup_child, true},
{regname, {global, Name}}|SO]],
@@ -432,16 +432,4 @@ init(app_init) ->
'CosNotifyChannelAdmin_EventChannel_impl']}]}}.
-
-%%------------------------------------------------------------
-%% function : create_name
-%% Arguments:
-%% Returns :
-%% Effect : Create a unique name to use when, for eaxmple, starting
-%% a new server.
-%%------------------------------------------------------------
-create_name() ->
- {MSec, Sec, USec} = erlang:now(),
- lists:concat(['oe_',node(),'_',MSec, '_', Sec, '_', USec]).
-
%%--------------- END OF MODULE ------------------------------
diff --git a/lib/cosNotification/src/cosNotification_eventDB.erl b/lib/cosNotification/src/cosNotification_eventDB.erl
index 89332d53f2..f8e2384d15 100644
--- a/lib/cosNotification/src/cosNotification_eventDB.erl
+++ b/lib/cosNotification/src/cosNotification_eventDB.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2015. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -71,10 +71,8 @@
%% that the first and last Key change place. {K1,K2}<->{K2,K1} and
%% {K1,K2,K3}<->{K3,K2,K1}.
%%----------------------------------------------------------------------
-
-module(cosNotification_eventDB).
-
%%--------------- INCLUDES -----------------------------------
-include_lib("orber/include/corba.hrl").
-include_lib("orber/include/ifr_types.hrl").
@@ -221,16 +219,16 @@ gc_events(DBRef, _Priority) when ?is_TimeoutNotUsed(DBRef) ->
gc_events(DBRef, _Priority) when ?is_StopTNotSupported(DBRef) ->
ok;
gc_events(DBRef, Priority) ->
- {M,S,U} = now(),
+ TS = erlang:monotonic_time(),
+ {resolution, TR} = lists:keyfind(resolution, 1, erlang:system_info(os_monotonic_time_source)),
case get(oe_GC_timestamp) of
- Num when {M,S,U} > Num ->
- put(oe_GC_timestamp, {M,S+?get_GCTime(DBRef),U}),
+ Num when TS > Num ->
+ put(oe_GC_timestamp, TS + ?get_GCTime(DBRef) * TR),
spawn_link(?MODULE, gc_start, [DBRef, Priority]);
_->
ok
end.
-
%%------------------------------------------------------------
%% function : gc_start
%% Arguments:
@@ -266,13 +264,13 @@ gc_discard_DB({Key1, Key2, Key3}, DRef) ->
%% Returns :
%%------------------------------------------------------------
create_FIFO_Key() ->
- {M, S, U} = erlang:now(),
+ {M, S, U} = erlang:timestamp(),
-M*1000000000000 - S*1000000 - U.
%%------------------------------------------------------------
%% function : convert_FIFO_Key
%% Arguments:
-%% Returns : A now tuple
+%% Returns : A timestamp tuple
%% Comment : Used when we must reuse a timestamp, i.e., only
%% when we must reorder the DB.
%%------------------------------------------------------------
@@ -322,7 +320,7 @@ extract_start_time(#'CosNotification_StructuredEvent'
_ ->
false
end,
- convert_time(ST, TRef, now());
+ convert_time(ST, TRef, erlang:timestamp());
extract_start_time(_, _, _) ->
false.
@@ -337,12 +335,12 @@ extract_start_time(_, _, _) ->
%% - undefined eq. value needed but no filter associated.
%% Now - used when we want to reuse old TimeStamp which
%% must be done when changing QoS.
-%% Returns : A modified return from now().
+%% Returns : A modified return from erlang:timestamp().
%%------------------------------------------------------------
extract_deadline(_, _, _, _, false) ->
false;
extract_deadline(Event, DefaultT, StopTSupported, TRef, MappingVal) ->
- extract_deadline(Event, DefaultT, StopTSupported, TRef, MappingVal, now()).
+ extract_deadline(Event, DefaultT, StopTSupported, TRef, MappingVal, erlang:timestamp()).
extract_deadline(_, _, _, _, false, _) ->
false;
@@ -403,14 +401,14 @@ get_time_diff(UTC, TRef) ->
UB-LB.
check_deadline(DL) when is_tuple(DL) ->
- {M,S,U} = now(),
+ {M,S,U} = erlang:timestamp(),
DL >= {-M,-S,-U};
check_deadline(_DL) ->
%% This case will cover if no timeout is set.
false.
check_start_time(ST) when is_tuple(ST) ->
- {M,S,U} = now(),
+ {M,S,U} = erlang:timestamp(),
ST >= {-M,-S,-U};
check_start_time(_ST) ->
%% This case will cover if no earliest delivery time is set.
@@ -1139,8 +1137,10 @@ create_db(QoS, GCTime, GCLimit, TimeRef) ->
?is_TimeoutNotUsed(DBRef), ?is_StopTNotSupported(DBRef) ->
ok;
true ->
- {M,S,U} = now(),
- put(oe_GC_timestamp, {M,S+GCTime,U})
+ TS = erlang:monotonic_time(),
+ {resolution, TR} = lists:keyfind(resolution, 1,
+ erlang:system_info(os_monotonic_time_source)),
+ put(oe_GC_timestamp, TS+GCTime*TR)
end,
DBRef.
diff --git a/lib/cosProperty/src/CosPropertyService_PropertySetDef_impl.erl b/lib/cosProperty/src/CosPropertyService_PropertySetDef_impl.erl
index 157b243c53..788518c7bb 100644
--- a/lib/cosProperty/src/CosPropertyService_PropertySetDef_impl.erl
+++ b/lib/cosProperty/src/CosPropertyService_PropertySetDef_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2015. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -128,7 +128,9 @@
%% {stop, Reason}
%%----------------------------------------------------------------------
init({DefMode, AllowedTypes, AllowedProperties, InitProperties, MyType}) ->
- Key = term_to_binary({now(), node()}),
+ Key = term_to_binary({{erlang:system_time(),
+ erlang:unique_integer()},
+ node()}),
_F = ?write_function(#oe_CosPropertyService{key=Key,
properties=InitProperties}),
write_result(mnesia:transaction(_F)),
diff --git a/lib/cosProperty/src/cosProperty.erl b/lib/cosProperty/src/cosProperty.erl
index 2368ee3db6..57c35dedf9 100644
--- a/lib/cosProperty/src/cosProperty.erl
+++ b/lib/cosProperty/src/cosProperty.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2015. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -406,8 +406,9 @@ type_check(Obj, Mod) ->
%% Effect :
%%------------------------------------------------------------
create_name(Type) ->
- {MSec, Sec, USec} = erlang:now(),
- lists:concat(['oe_',node(),'_',Type,'_',MSec, '_', Sec, '_', USec]).
+ Time = erlang:system_time(),
+ Unique = erlang:unique_integer([positive]),
+ lists:concat(['oe_',node(),'_',Type,'_',Time,'_',Unique]).
%%--------------- END OF MODULE ------------------------------
diff --git a/lib/cosTime/src/CosTime_TimeService_impl.erl b/lib/cosTime/src/CosTime_TimeService_impl.erl
index bac4ae087c..f44e7ba2f4 100644
--- a/lib/cosTime/src/CosTime_TimeService_impl.erl
+++ b/lib/cosTime/src/CosTime_TimeService_impl.erl
@@ -166,7 +166,7 @@ new_interval(_, _, _, _) ->
create_universal_time() ->
%% Time is supposed to be #100 nano-secs passed.
%% We add micro secs for a greater precision.
- {MS,S,US} = now(),
+ {MS,S,US} = erlang:timestamp(),
case catch calendar:datetime_to_gregorian_seconds(
calendar:now_to_universal_time({MS,S,US})) of
Secs when is_integer(Secs) ->
diff --git a/lib/cosTime/src/cosTime.erl b/lib/cosTime/src/cosTime.erl
index f7d03650af..45f305df39 100644
--- a/lib/cosTime/src/cosTime.erl
+++ b/lib/cosTime/src/cosTime.erl
@@ -333,8 +333,9 @@ type_check(Obj, Mod) ->
%%------------------------------------------------------------
create_name(Type) ->
- {MSec, Sec, USec} = erlang:now(),
- lists:concat(['oe_',node(),'_',Type,'_',MSec, '_', Sec, '_', USec]).
+ Time = erlang:system_time(),
+ Unique = erlang:unique_integer([positive]),
+ lists:concat(['oe_',node(),'_',Type,'_',Time,'_',Unique]).
%%--------------- END OF MODULE ------------------------------
diff --git a/lib/cosTime/src/cosTimeApp.hrl b/lib/cosTime/src/cosTimeApp.hrl
index f3082816f7..bdf0bf7278 100644
--- a/lib/cosTime/src/cosTimeApp.hrl
+++ b/lib/cosTime/src/cosTimeApp.hrl
@@ -41,7 +41,7 @@
-define(max_TimeT, 18446744073709551616).
%% The calendar module uses year 0 as base for gregorian functions.
-%% 'ABSOULTE_TIME_DIFF' is #seconfs from year 0 until 15 october 1582, 00:00.
+%% 'ABSOULTE_TIME_DIFF' is #seconds from year 0 until 15 october 1582, 00:00.
-define(ABSOLUTE_TIME_DIFF, 49947926400).
%% As above but diff year 0 to 00:00 GMT, January 1, 1970
-define(STANDARD_TIME_DIFF, 62167219200).
diff --git a/lib/cosTransactions/src/CosTransactions_TransactionFactory_impl.erl b/lib/cosTransactions/src/CosTransactions_TransactionFactory_impl.erl
index 36e37e2d5f..3954f04ad3 100644
--- a/lib/cosTransactions/src/CosTransactions_TransactionFactory_impl.erl
+++ b/lib/cosTransactions/src/CosTransactions_TransactionFactory_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2015. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -145,8 +145,8 @@ create(_Self, State, TimeOut) when is_integer(TimeOut) ->
_ ->
if
TimeOut > 0 ->
- {MegaSecs, Secs, _Microsecs} = erlang:now(),
- EState2 = ?tr_set_alarm(EState, MegaSecs*1000000+Secs+TimeOut),
+ TimeStampSec = erlang:monotonic_time(seconds),
+ EState2 = ?tr_set_alarm(EState, TimeStampSec+TimeOut),
EState3 = ?tr_set_timeout(EState2, TimeOut*1000),
ETraP = ?tr_start_child(?SUP_ETRAP(EState3)),
{reply, ETraP, State};
diff --git a/lib/cosTransactions/src/ETraP_Common.erl b/lib/cosTransactions/src/ETraP_Common.erl
index dd68e9b038..dca1c1aaa9 100644
--- a/lib/cosTransactions/src/ETraP_Common.erl
+++ b/lib/cosTransactions/src/ETraP_Common.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2015. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -86,8 +86,9 @@ get_option(Key, OptionList, DefaultList) ->
%%------------------------------------------------------------
create_name(Name,Type) ->
- {MSec, Sec, USec} = erlang:now(),
- lists:concat(['oe_',node(),'_',Type,'_',Name,'_',MSec, '_', Sec, '_', USec]).
+ Time = erlang:system_time(),
+ Unique = erlang:unique_integer([positive]),
+ lists:concat(['oe_',node(),'_',Type,'_',Name,'_',Time,'_',Unique]).
%%------------------------------------------------------------
%% function : create_name/1
@@ -98,8 +99,9 @@ create_name(Name,Type) ->
%%------------------------------------------------------------
create_name(Type) ->
- {MSec, Sec, USec} = erlang:now(),
- lists:concat(['oe_',node(),'_',Type,'_',MSec, '_', Sec, '_', USec]).
+ Time = erlang:system_time(),
+ Unique = erlang:unique_integer([positive]),
+ lists:concat(['oe_',node(),'_',Type,'_',Time,'_',Unique]).
%%------------------------------------------------------------
%% function : try_timeout
@@ -114,10 +116,9 @@ try_timeout(TimeoutAt) ->
infinity ->
false;
_->
- {MegaSecs, Secs, _Microsecs} = erlang:now(),
- Time = MegaSecs*1000000+Secs,
+ TimeSec = erlang:monotonic_time(seconds),
if
- Time < TimeoutAt ->
+ TimeSec < TimeoutAt ->
false;
true ->
true
diff --git a/lib/cosTransactions/src/ETraP_Server_impl.erl b/lib/cosTransactions/src/ETraP_Server_impl.erl
index e2c5d88f9d..db23d6c166 100644
--- a/lib/cosTransactions/src/ETraP_Server_impl.erl
+++ b/lib/cosTransactions/src/ETraP_Server_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2015. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -38,7 +38,8 @@
%% Log files are created in the current directory, which is why the
%% application requires read/write rights for current directory. The
%% file name looks like:
-%% "oe_nonode@nohost_subc_939_383117_295538" (the last part is now())
+%% "oe_nonode@nohost_subc_1429872479809947099_438" (the two last parts are
+%% erlang:system_time() and erlang:unique_integer([positive]))
%% It is equal to what the object is started as, i.e., {regname, {global, X}}.
%%
%% If the application is unable to read the log it will exit and the
diff --git a/lib/orber/COSS/CosNaming/CosNaming_NamingContextExt_impl.erl b/lib/orber/COSS/CosNaming/CosNaming_NamingContextExt_impl.erl
index 84db0b89f8..654a8f4385 100644
--- a/lib/orber/COSS/CosNaming/CosNaming_NamingContextExt_impl.erl
+++ b/lib/orber/COSS/CosNaming/CosNaming_NamingContextExt_impl.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2015. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -533,7 +533,9 @@ unbind(_OE_THIS, _OE_State, []) ->
%% Returns :
%%----------------------------------------------------------------------
new_context(_OE_THIS, OE_State) ->
- DBKey = term_to_binary({now(), node()}),
+ DBKey = term_to_binary({{erlang:system_time(),
+ erlang:unique_integer()},
+ node()}),
%% Create a record in the table and set the key to a newly
{reply,
'CosNaming_NamingContextExt':oe_create(DBKey,
@@ -547,7 +549,9 @@ new_context(_OE_THIS, OE_State) ->
%% Returns :
%%----------------------------------------------------------------------
bind_new_context(OE_THIS, OE_State, N) ->
- DBKey = term_to_binary({now(), node()}),
+ DBKey = term_to_binary({{erlang:system_time(),
+ erlang:unique_integer()},
+ node()}),
%% Create a record in the table and set the key to a newly
%% generated objectkey.
%%?PRINTDEBUG("bind_new_context"),
diff --git a/lib/orber/src/cdr_decode.erl b/lib/orber/src/cdr_decode.erl
index 9aec64892e..796cc2686b 100644
--- a/lib/orber/src/cdr_decode.erl
+++ b/lib/orber/src/cdr_decode.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2010. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2015. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -1110,8 +1110,7 @@ ifrid_to_name(Id, Type) ->
[?LINE, Id, Type], ?DEBUG_LEVEL),
corba:raise(#'MARSHAL'{completion_status=?COMPLETED_MAYBE});
Nodes ->
- {A,B,C} = now(),
- random:seed(A,B,C),
+ random:seed(rlang:monotonic_time(), erlang:current_time_offset(), rlang:unique_integer()),
L = length(Nodes),
IFR = get_ifr_node(Nodes, random:uniform(L), L),
list_to_atom('OrberApp_IFR':get_absolute_name(IFR, Id))
@@ -1260,8 +1259,7 @@ get_user_exception_type(TypeId) ->
completion_status=?COMPLETED_MAYBE})
end;
Nodes ->
- {A,B,C} = now(),
- random:seed(A,B,C),
+ random:seed(rlang:monotonic_time(), erlang:current_time_offset(), rlang:unique_integer()),
L = length(Nodes),
IFR = get_ifr_node(Nodes, random:uniform(L), L),
'OrberApp_IFR':get_user_exception_type(IFR, TypeId)
diff --git a/lib/orber/src/corba.erl b/lib/orber/src/corba.erl
index 586a02d540..f0eeb18c24 100644
--- a/lib/orber/src/corba.erl
+++ b/lib/orber/src/corba.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2015. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -1922,7 +1922,9 @@ mk_passive_objkey(Mod, Module, Flags) ->
{Mod, 'passive', Module, term_to_binary(undefined), 0, Flags}.
make_objkey() ->
- term_to_binary({now(), node()}).
+ term_to_binary({{erlang:system_time(),
+ erlang:unique_integer()},
+ node()}).
objkey_to_string({_Mod, 'registered', 'orber_init', _UserDef, _OrberDef, _Flags}) ->
"INIT";
diff --git a/lib/orber/src/orber_ifr_utils.erl b/lib/orber/src/orber_ifr_utils.erl
index 11e3d1cd3b..35c891ef6e 100644
--- a/lib/orber/src/orber_ifr_utils.erl
+++ b/lib/orber/src/orber_ifr_utils.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2015. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -289,10 +289,9 @@ makeref(Obj) ->
%%% unique tag. I do this because the tuple generated takes a lot of space
%%% when I dump the database. A binary is simply printed as #Bin, which
%%% is much less obtrusive.
-%%% The code has been moved to a macro defined in orber_ifr.hrl, so we
-%%% can use a simpler uniqification code when debugging.
-unique() -> term_to_binary({node(), now()}).
+unique() -> term_to_binary({node(), {erlang:system_time(),
+ erlang:unique_integer()}}).
%%%----------------------------------------------------------------------
%%% Check for an existing object with the Id of the object which is
diff --git a/lib/orber/src/orber_objectkeys.erl b/lib/orber/src/orber_objectkeys.erl
index b0e759187b..f57b1d811f 100644
--- a/lib/orber/src/orber_objectkeys.erl
+++ b/lib/orber/src/orber_objectkeys.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2009. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2015. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -374,11 +374,11 @@ handle_call({register, Objkey, Pid, Type}, _From, State) ->
%% No key exists. Ok to register.
mnesia:write(#orber_objkeys{object_key=Objkey, pid=Pid,
persistent=Type,
- timestamp=now()});
+ timestamp=erlang:monotonic_time(seconds)});
[X] when X#orber_objkeys.persistent==true,
X#orber_objkeys.pid == dead ->
%% A persistent object is being restarted. Update Pid & time.
- mnesia:write(X#orber_objkeys{pid=Pid, timestamp=now()});
+ mnesia:write(X#orber_objkeys{pid=Pid, timestamp=erlang:monotonic_time(seconds)});
[X] when is_pid(X#orber_objkeys.pid) ->
%% Object exists, i.e., trying to create an object with
%% the same name.
@@ -477,7 +477,7 @@ handle_info({'EXIT', Pid, Reason}, State) when is_pid(Pid) ->
Reason /= normal andalso
Reason /= shutdown ->
mnesia:write(X#orber_objkeys{pid=dead,
- timestamp=now()});
+ timestamp=erlang:monotonic_time(seconds)});
[X] when X#orber_objkeys.persistent==true ->
mnesia:delete({orber_objkeys, X#orber_objkeys.object_key});
_->
@@ -503,8 +503,8 @@ code_change(_OldVsn, State, _Extra) ->
%% Internal Functions
%%-----------------------------------------------------------------
-timetest(S, {MeSec, Sec, USec}) ->
- {MeSec, Sec+S, USec} < now().
+timetest(S, TimeStamp) ->
+ TimeStamp+S < erlang:monotonic_time(seconds).
get_key_from_pid(Pid) ->
case mnesia:dirty_match_object({orber_objkeys, '_', Pid,'_','_'}) of
diff --git a/lib/orber/src/orber_socket.erl b/lib/orber/src/orber_socket.erl
index 4507d90cce..8ee1611c65 100644
--- a/lib/orber/src/orber_socket.erl
+++ b/lib/orber/src/orber_socket.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2015. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -167,8 +167,7 @@ multi_connect([CurrentPort|Rest], Retries, ssl, Host, Port, Options, Timeout) ->
get_port_sequence(Min, Max) ->
case orber_env:iiop_out_ports_random() of
true ->
- {A1,A2,A3} = now(),
- random:seed(A1, A2, A3),
+ random:seed(rlang:monotonic_time(), erlang:current_time_offset(), rlang:unique_integer()),
Seq = lists:seq(Min, Max),
random_sequence((Max - Min) + 1, Seq, []);
_ ->
diff --git a/lib/orber/src/orber_web_server.erl b/lib/orber/src/orber_web_server.erl
index 9d2a063a69..1cda862f1b 100644
--- a/lib/orber/src/orber_web_server.erl
+++ b/lib/orber/src/orber_web_server.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2009. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2015. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -46,7 +46,7 @@
-define(DEBUG_LEVEL, 5).
--record(state, {ts}).
+-record(state, {}).
-include("ifr_objects.hrl").
%%----------------------------------------------------------------------
@@ -133,9 +133,7 @@ delete_obj(Env, Input) ->
%% Description:
%%----------------------------------------------------------------------
init(_Arg)->
- {M, S, U} = now(),
- TS = M*1000000000000 + S*1000000 + U,
- {ok, #state{ts = TS}}.
+ {ok, #state{}}.
terminate(_,_State)->
ok.
--
cgit v1.2.3
From 9ca2c2fcc364ee320c61281cf0e89fdd120617c9 Mon Sep 17 00:00:00 2001
From: Lars Thorsen
Date: Tue, 28 Apr 2015 08:12:05 +0200
Subject: [orber, cos*] Bump versions and update dependencies in app file
---
lib/cosEvent/src/cosEvent.app.src | 2 +-
lib/cosEvent/vsn.mk | 3 +--
lib/cosEventDomain/src/cosEventDomain.app.src | 2 +-
lib/cosEventDomain/vsn.mk | 3 +--
lib/cosFileTransfer/src/cosFileTransfer.app.src | 2 +-
lib/cosFileTransfer/vsn.mk | 2 +-
lib/cosNotification/src/cosNotification.app.src | 2 +-
lib/cosNotification/vsn.mk | 2 +-
lib/cosProperty/src/cosProperty.app.src | 2 +-
lib/cosProperty/vsn.mk | 2 +-
lib/cosTime/src/cosTime.app.src | 2 +-
lib/cosTime/vsn.mk | 3 +--
lib/cosTransactions/src/cosTransactions.app.src | 2 +-
lib/cosTransactions/vsn.mk | 2 +-
lib/orber/src/orber.app.src | 2 +-
lib/orber/vsn.mk | 2 +-
16 files changed, 16 insertions(+), 19 deletions(-)
(limited to 'lib')
diff --git a/lib/cosEvent/src/cosEvent.app.src b/lib/cosEvent/src/cosEvent.app.src
index 66b0d2e168..5ffd12bc6b 100644
--- a/lib/cosEvent/src/cosEvent.app.src
+++ b/lib/cosEvent/src/cosEvent.app.src
@@ -39,7 +39,7 @@
{applications, [orber, stdlib, kernel]},
{env, []},
{mod, {cosEventApp, []}},
- {runtime_dependencies, ["stdlib-2.0","orber-3.6.27","kernel-3.0","erts-6.0"]}
+ {runtime_dependencies, ["stdlib-2.0","orber-3.6.27","kernel-3.0","erts-7.0"]}
]}.
diff --git a/lib/cosEvent/vsn.mk b/lib/cosEvent/vsn.mk
index 40bf1ba49d..3149020d7c 100644
--- a/lib/cosEvent/vsn.mk
+++ b/lib/cosEvent/vsn.mk
@@ -1,3 +1,2 @@
-
-COSEVENT_VSN = 2.1.15
+COSEVENT_VSN = 2.2
diff --git a/lib/cosEventDomain/src/cosEventDomain.app.src b/lib/cosEventDomain/src/cosEventDomain.app.src
index 60114b6a91..f218ac853e 100644
--- a/lib/cosEventDomain/src/cosEventDomain.app.src
+++ b/lib/cosEventDomain/src/cosEventDomain.app.src
@@ -28,6 +28,6 @@
{applications, [orber, stdlib, kernel]},
{env, []},
{mod, {cosEventDomainApp, []}},
- {runtime_dependencies, ["stdlib-2.0","orber-3.6.27","kernel-3.0","erts-6.0",
+ {runtime_dependencies, ["stdlib-2.0","orber-3.6.27","kernel-3.0","erts-7.0",
"cosNotification-1.1.21"]}
]}.
diff --git a/lib/cosEventDomain/vsn.mk b/lib/cosEventDomain/vsn.mk
index 6317ed3c22..bdde1f6ab2 100644
--- a/lib/cosEventDomain/vsn.mk
+++ b/lib/cosEventDomain/vsn.mk
@@ -1,3 +1,2 @@
-
-COSEVENTDOMAIN_VSN = 1.1.14
+COSEVENTDOMAIN_VSN = 1.2
diff --git a/lib/cosFileTransfer/src/cosFileTransfer.app.src b/lib/cosFileTransfer/src/cosFileTransfer.app.src
index 21226b0c6b..033eec9700 100644
--- a/lib/cosFileTransfer/src/cosFileTransfer.app.src
+++ b/lib/cosFileTransfer/src/cosFileTransfer.app.src
@@ -38,6 +38,6 @@
{env, []},
{mod, {cosFileTransferApp, []}},
{runtime_dependencies, ["stdlib-2.0","ssl-5.3.4","orber-3.6.27","kernel-3.0",
- "inets-5.10","erts-6.0","cosProperty-1.1.17"]}
+ "inets-5.10","erts-7.0","cosProperty-1.1.17"]}
]}.
diff --git a/lib/cosFileTransfer/vsn.mk b/lib/cosFileTransfer/vsn.mk
index f52a1bd800..00bfdb3087 100644
--- a/lib/cosFileTransfer/vsn.mk
+++ b/lib/cosFileTransfer/vsn.mk
@@ -1 +1 @@
-COSFILETRANSFER_VSN = 1.1.16
+COSFILETRANSFER_VSN = 1.2
diff --git a/lib/cosNotification/src/cosNotification.app.src b/lib/cosNotification/src/cosNotification.app.src
index ad02eb4421..09bf8f01fc 100644
--- a/lib/cosNotification/src/cosNotification.app.src
+++ b/lib/cosNotification/src/cosNotification.app.src
@@ -117,6 +117,6 @@
{applications, [orber, stdlib, kernel]},
{env, []},
{mod, {cosNotificationApp, []}},
- {runtime_dependencies, ["stdlib-2.0","orber-3.6.27","kernel-3.0","erts-6.0",
+ {runtime_dependencies, ["stdlib-2.0","orber-3.6.27","kernel-3.0","erts-7.0",
"cosTime-1.1.14","cosEvent-2.1.15"]}
]}.
diff --git a/lib/cosNotification/vsn.mk b/lib/cosNotification/vsn.mk
index 28d6ec71bf..c1affdf0de 100644
--- a/lib/cosNotification/vsn.mk
+++ b/lib/cosNotification/vsn.mk
@@ -1,2 +1,2 @@
-COSNOTIFICATION_VSN = 1.1.21
+COSNOTIFICATION_VSN = 1.2
diff --git a/lib/cosProperty/src/cosProperty.app.src b/lib/cosProperty/src/cosProperty.app.src
index b977bb5984..7fad7a602a 100644
--- a/lib/cosProperty/src/cosProperty.app.src
+++ b/lib/cosProperty/src/cosProperty.app.src
@@ -43,5 +43,5 @@
{env, []},
{mod, {cosProperty, []}},
{runtime_dependencies, ["stdlib-2.0","orber-3.6.27","mnesia-4.12",
- "kernel-3.0","erts-6.0"]}
+ "kernel-3.0","erts-7.0"]}
]}.
diff --git a/lib/cosProperty/vsn.mk b/lib/cosProperty/vsn.mk
index 0f546a2da8..d96508c2d2 100644
--- a/lib/cosProperty/vsn.mk
+++ b/lib/cosProperty/vsn.mk
@@ -1,2 +1,2 @@
-COSPROPERTY_VSN = 1.1.17
+COSPROPERTY_VSN = 1.2
diff --git a/lib/cosTime/src/cosTime.app.src b/lib/cosTime/src/cosTime.app.src
index cd01de35cb..ac71fe1b29 100644
--- a/lib/cosTime/src/cosTime.app.src
+++ b/lib/cosTime/src/cosTime.app.src
@@ -27,6 +27,6 @@
{applications, [orber, stdlib, kernel]},
{env, []},
{mod, {cosTime, []}},
- {runtime_dependencies, ["stdlib-2.0","orber-3.6.27","kernel-3.0","erts-6.0",
+ {runtime_dependencies, ["stdlib-2.0","orber-3.6.27","kernel-3.0","erts-7.0",
"cosEvent-2.1.15"]}
]}.
diff --git a/lib/cosTime/vsn.mk b/lib/cosTime/vsn.mk
index 9e9e5c0250..32416f0087 100644
--- a/lib/cosTime/vsn.mk
+++ b/lib/cosTime/vsn.mk
@@ -1,3 +1,2 @@
-COSTIME_VSN = 1.1.14
-
+COSTIME_VSN = 1.2
diff --git a/lib/cosTransactions/src/cosTransactions.app.src b/lib/cosTransactions/src/cosTransactions.app.src
index 6b99915ad6..074d82f487 100644
--- a/lib/cosTransactions/src/cosTransactions.app.src
+++ b/lib/cosTransactions/src/cosTransactions.app.src
@@ -40,5 +40,5 @@
{applications, [orber, stdlib, kernel]},
{env, []},
{mod, {cosTransactions, []}},
- {runtime_dependencies, ["stdlib-2.0","orber-3.6.27","kernel-3.0","erts-6.0"]}
+ {runtime_dependencies, ["stdlib-2.0","orber-3.6.27","kernel-3.0","erts-7.0"]}
]}.
diff --git a/lib/cosTransactions/vsn.mk b/lib/cosTransactions/vsn.mk
index 7aed212523..929f8c73d1 100644
--- a/lib/cosTransactions/vsn.mk
+++ b/lib/cosTransactions/vsn.mk
@@ -1 +1 @@
-COSTRANSACTIONS_VSN = 1.2.14
+COSTRANSACTIONS_VSN = 1.3
diff --git a/lib/orber/src/orber.app.src b/lib/orber/src/orber.app.src
index 30bd90347d..5dda63982f 100644
--- a/lib/orber/src/orber.app.src
+++ b/lib/orber/src/orber.app.src
@@ -105,7 +105,7 @@
{env, []},
{mod, {orber, []}},
{runtime_dependencies, ["stdlib-2.0","ssl-5.3.4","mnesia-4.12","kernel-3.0",
- "inets-5.10","erts-6.0"]}
+ "inets-5.10","erts-7.0"]}
]}.
diff --git a/lib/orber/vsn.mk b/lib/orber/vsn.mk
index 28fe9323fb..505c77de18 100644
--- a/lib/orber/vsn.mk
+++ b/lib/orber/vsn.mk
@@ -1 +1 @@
-ORBER_VSN = 3.7.1
+ORBER_VSN = 3.8
--
cgit v1.2.3
From c84295904be29cbcbd3f91d009db91eca94ff158 Mon Sep 17 00:00:00 2001
From: Lars Thorsen
Date: Wed, 29 Apr 2015 07:13:51 +0200
Subject: [orber] Use rand instead of random
---
lib/orber/src/cdr_decode.erl | 8 +++-----
lib/orber/src/orber_socket.erl | 3 +--
2 files changed, 4 insertions(+), 7 deletions(-)
(limited to 'lib')
diff --git a/lib/orber/src/cdr_decode.erl b/lib/orber/src/cdr_decode.erl
index 796cc2686b..00dcf01c56 100644
--- a/lib/orber/src/cdr_decode.erl
+++ b/lib/orber/src/cdr_decode.erl
@@ -1110,9 +1110,8 @@ ifrid_to_name(Id, Type) ->
[?LINE, Id, Type], ?DEBUG_LEVEL),
corba:raise(#'MARSHAL'{completion_status=?COMPLETED_MAYBE});
Nodes ->
- random:seed(rlang:monotonic_time(), erlang:current_time_offset(), rlang:unique_integer()),
L = length(Nodes),
- IFR = get_ifr_node(Nodes, random:uniform(L), L),
+ IFR = get_ifr_node(Nodes, rand:uniform(L), L),
list_to_atom('OrberApp_IFR':get_absolute_name(IFR, Id))
end;
{'EXIT', Other} ->
@@ -1175,7 +1174,7 @@ get_ifr_node(Nodes, N, L) ->
_ ->
%% Not able to commincate with the node. Try next one.
NewL = L-1,
- get_ifr_node(lists:delete(Node, Nodes), random:uniform(NewL), NewL)
+ get_ifr_node(lists:delete(Node, Nodes), rand:uniform(NewL), NewL)
end.
@@ -1259,9 +1258,8 @@ get_user_exception_type(TypeId) ->
completion_status=?COMPLETED_MAYBE})
end;
Nodes ->
- random:seed(rlang:monotonic_time(), erlang:current_time_offset(), rlang:unique_integer()),
L = length(Nodes),
- IFR = get_ifr_node(Nodes, random:uniform(L), L),
+ IFR = get_ifr_node(Nodes, rand:uniform(L), L),
'OrberApp_IFR':get_user_exception_type(IFR, TypeId)
end
end.
diff --git a/lib/orber/src/orber_socket.erl b/lib/orber/src/orber_socket.erl
index 8ee1611c65..4567728693 100644
--- a/lib/orber/src/orber_socket.erl
+++ b/lib/orber/src/orber_socket.erl
@@ -167,7 +167,6 @@ multi_connect([CurrentPort|Rest], Retries, ssl, Host, Port, Options, Timeout) ->
get_port_sequence(Min, Max) ->
case orber_env:iiop_out_ports_random() of
true ->
- random:seed(rlang:monotonic_time(), erlang:current_time_offset(), rlang:unique_integer()),
Seq = lists:seq(Min, Max),
random_sequence((Max - Min) + 1, Seq, []);
_ ->
@@ -177,7 +176,7 @@ get_port_sequence(Min, Max) ->
random_sequence(0, _, Acc) ->
Acc;
random_sequence(Length, Seq, Acc) ->
- Nth = random:uniform(Length),
+ Nth = rand:uniform(Length),
Value = lists:nth(Nth, Seq),
NewSeq = lists:delete(Value, Seq),
random_sequence(Length-1, NewSeq, [Value|Acc]).
--
cgit v1.2.3
From 2a2d6181184ccde3bc929981eeee662203142238 Mon Sep 17 00:00:00 2001
From: Lars Thorsen
Date: Wed, 29 Apr 2015 10:13:39 +0200
Subject: [orber, cos*] Remove usage of erlang:now() in test suites
---
lib/cosFileTransfer/test/fileTransfer_SUITE.erl | 5 +++--
lib/cosNotification/test/notify_test_impl.erl | 4 ++--
lib/orber/test/cdrcoding_10_SUITE.erl | 4 +++-
lib/orber/test/cdrcoding_11_SUITE.erl | 4 +++-
lib/orber/test/cdrcoding_12_SUITE.erl | 4 +++-
lib/orber/test/iop_ior_10_SUITE.erl | 4 +++-
lib/orber/test/iop_ior_11_SUITE.erl | 4 +++-
lib/orber/test/iop_ior_12_SUITE.erl | 4 +++-
lib/orber/test/multi_ORB_SUITE.erl | 4 ++--
lib/orber/test/orber_acl_SUITE.erl | 12 ++++++------
lib/orber/test/orber_test_lib.erl | 2 +-
lib/orber/test/orber_test_server_impl.erl | 12 ++++++------
12 files changed, 38 insertions(+), 25 deletions(-)
(limited to 'lib')
diff --git a/lib/cosFileTransfer/test/fileTransfer_SUITE.erl b/lib/cosFileTransfer/test/fileTransfer_SUITE.erl
index dfe6fabfab..5e75a9919f 100644
--- a/lib/cosFileTransfer/test/fileTransfer_SUITE.erl
+++ b/lib/cosFileTransfer/test/fileTransfer_SUITE.erl
@@ -732,8 +732,9 @@ create_file_on_source_node({'NATIVE', _}, _Config, Host, FileName, Path, Data) -
?match(ok, file:write_file(FileName, list_to_binary(Data))).
create_name(Type) ->
- {MSec, Sec, USec} = erlang:now(),
- lists:concat([Type,'_',MSec, '_', Sec, '_', USec]).
+ Time = erlang:system_time(),
+ Unique = erlang:unique_integer([positive]),
+ lists:concat([Type, '_', Time, '_', Unique]).
diff --git a/lib/cosNotification/test/notify_test_impl.erl b/lib/cosNotification/test/notify_test_impl.erl
index dae7777089..4fe246ef16 100644
--- a/lib/cosNotification/test/notify_test_impl.erl
+++ b/lib/cosNotification/test/notify_test_impl.erl
@@ -289,10 +289,10 @@ disconnect_pull_supplier(_Self, State) ->
%%--------------- LOCAL FUNCTIONS ----------------------------
delay(Obj, Event, Time, Mod, F) ->
- io:format("notify_test:delay(~p) TIME: ~p~n",[Event, now()]),
+ io:format("notify_test:delay(~p) TIME: ~p~n",[Event, erlang:timestamp()]),
timer:sleep(Time),
Mod:F(Obj, Event),
- io:format("notify_test:delay() DONE: ~p~n",[now()]),
+ io:format("notify_test:delay() DONE: ~p~n",[erlang:timestamp()]),
ok.
%%--------------- END OF MODULE ------------------------------
diff --git a/lib/orber/test/cdrcoding_10_SUITE.erl b/lib/orber/test/cdrcoding_10_SUITE.erl
index 54ad92cf7e..d8e57f74e5 100644
--- a/lib/orber/test/cdrcoding_10_SUITE.erl
+++ b/lib/orber/test/cdrcoding_10_SUITE.erl
@@ -622,4 +622,6 @@ corba_fake_mk_objkey(Id, 'registered', RegName) when is_atom(RegName) ->
term_to_binary(undefined), term_to_binary(undefined)}.
make_objkey() ->
- term_to_binary({now(), node()}).
+ term_to_binary({{erlang:system_time(),
+ erlang:unique_integer()},
+ node()}).
diff --git a/lib/orber/test/cdrcoding_11_SUITE.erl b/lib/orber/test/cdrcoding_11_SUITE.erl
index 29b3e33069..bcd2b70446 100644
--- a/lib/orber/test/cdrcoding_11_SUITE.erl
+++ b/lib/orber/test/cdrcoding_11_SUITE.erl
@@ -621,4 +621,6 @@ corba_fake_mk_objkey(Id, 'registered', RegName) when is_atom(RegName) ->
term_to_binary(undefined), term_to_binary(undefined)}.
make_objkey() ->
- term_to_binary({now(), node()}).
+ term_to_binary({{erlang:system_time(),
+ erlang:unique_integer()},
+ node()}).
diff --git a/lib/orber/test/cdrcoding_12_SUITE.erl b/lib/orber/test/cdrcoding_12_SUITE.erl
index dd9b98434d..a58688b654 100644
--- a/lib/orber/test/cdrcoding_12_SUITE.erl
+++ b/lib/orber/test/cdrcoding_12_SUITE.erl
@@ -609,4 +609,6 @@ corba_fake_mk_objkey(Id, 'registered', RegName) when is_atom(RegName) ->
term_to_binary(undefined), term_to_binary(undefined)}.
make_objkey() ->
- term_to_binary({now(), node()}).
+ term_to_binary({{erlang:system_time(),
+ erlang:unique_integer()},
+ node()}).
diff --git a/lib/orber/test/iop_ior_10_SUITE.erl b/lib/orber/test/iop_ior_10_SUITE.erl
index 58dd1b5dba..be3daf6198 100644
--- a/lib/orber/test/iop_ior_10_SUITE.erl
+++ b/lib/orber/test/iop_ior_10_SUITE.erl
@@ -182,4 +182,6 @@ corba_fake_mk_objkey(Id, 'registered', RegName) when is_atom(RegName) ->
make_objkey() ->
- term_to_binary({now(), node()}).
+ term_to_binary({{erlang:system_time(),
+ erlang:unique_integer()},
+ node()}).
diff --git a/lib/orber/test/iop_ior_11_SUITE.erl b/lib/orber/test/iop_ior_11_SUITE.erl
index 24b2f66357..4c4dd4effa 100644
--- a/lib/orber/test/iop_ior_11_SUITE.erl
+++ b/lib/orber/test/iop_ior_11_SUITE.erl
@@ -201,4 +201,6 @@ corba_fake_mk_objkey(Id, 'registered', RegName) when is_atom(RegName) ->
{Id, 'registered', RegName, term_to_binary(undefined), 0, 0}.
make_objkey() ->
- term_to_binary({now(), node()}).
+ term_to_binary({{erlang:system_time(),
+ erlang:unique_integer()},
+ node()}).
diff --git a/lib/orber/test/iop_ior_12_SUITE.erl b/lib/orber/test/iop_ior_12_SUITE.erl
index 4c6e9ddb91..9f50784666 100644
--- a/lib/orber/test/iop_ior_12_SUITE.erl
+++ b/lib/orber/test/iop_ior_12_SUITE.erl
@@ -202,4 +202,6 @@ corba_fake_mk_objkey(Id, 'registered', RegName) when is_atom(RegName) ->
{Id, 'registered', RegName, term_to_binary(undefined), 0, 0}.
make_objkey() ->
- term_to_binary({now(), node()}).
+ term_to_binary({{erlang:system_time(),
+ erlang:unique_integer()},
+ node()}).
diff --git a/lib/orber/test/multi_ORB_SUITE.erl b/lib/orber/test/multi_ORB_SUITE.erl
index 40d8846e0f..3d0132c3e6 100644
--- a/lib/orber/test/multi_ORB_SUITE.erl
+++ b/lib/orber/test/multi_ORB_SUITE.erl
@@ -922,9 +922,9 @@ max_requests(Node, Host, Port) ->
spawn(orber_test_server, pseudo_call_delay, [Obj, 15000]),
%% Wait for a second to be sure that the previous request has been sent
timer:sleep(1000),
- {MegaSecsB, Before, _} = now(),
+ {MegaSecsB, Before, _} = erlang:timestamp(),
pseudo_calls(5, Obj),
- {MegaSecsA, After, _} = now(),
+ {MegaSecsA, After, _} = erlang:timestamp(),
%% Normally we we can perform hundreds of pseudo-calls per second. Hence,
%% if we add 8 seconds to 'Before' it should still be less since we only
%% allow one request at a time to the target ORB.
diff --git a/lib/orber/test/orber_acl_SUITE.erl b/lib/orber/test/orber_acl_SUITE.erl
index ab2c2c872c..05146afded 100644
--- a/lib/orber/test/orber_acl_SUITE.erl
+++ b/lib/orber/test/orber_acl_SUITE.erl
@@ -272,21 +272,21 @@ ipv6_bm(_) ->
bm2(Filters, Family, Ip) ->
{ok, IPTuple} = inet:getaddr(Ip, Family),
orber_acl:init_acl(Filters, Family),
- TimeBefore1 = erlang:now(),
+ TimeBefore1 = erlang:timestamp(),
bm_loop(IPTuple, ?NO_OF_TIMES),
- TimeAfter1 = erlang:now(),
+ TimeAfter1 = erlang:timestamp(),
orber_acl:clear_acl(),
Time1 = computeTime(TimeBefore1, TimeAfter1),
orber_acl:init_acl(Filters, Family),
- TimeBefore2 = erlang:now(),
+ TimeBefore2 = erlang:timestamp(),
bm_loop2(Ip, ?NO_OF_TIMES, Family),
- TimeAfter2 = erlang:now(),
+ TimeAfter2 = erlang:timestamp(),
orber_acl:clear_acl(),
Time2 = computeTime(TimeBefore2, TimeAfter2),
orber_acl:init_acl(Filters, Family),
- TimeBefore3 = erlang:now(),
+ TimeBefore3 = erlang:timestamp(),
bm_loop2(IPTuple, ?NO_OF_TIMES, Family),
- TimeAfter3 = erlang:now(),
+ TimeAfter3 = erlang:timestamp(),
orber_acl:clear_acl(),
Time3 = computeTime(TimeBefore3, TimeAfter3),
{ok, round(?NO_OF_TIMES/Time1), round(?NO_OF_TIMES/Time2), round(?NO_OF_TIMES/Time3)}.
diff --git a/lib/orber/test/orber_test_lib.erl b/lib/orber/test/orber_test_lib.erl
index 46ed26f210..c970600fce 100644
--- a/lib/orber/test/orber_test_lib.erl
+++ b/lib/orber/test/orber_test_lib.erl
@@ -220,7 +220,7 @@ js_node(InitOptions) when is_list(InitOptions) ->
js_node(InitOptions, []).
js_node(InitOptions, StartOptions) when is_list(InitOptions) ->
- {A,B,C} = erlang:now(),
+ {A,B,C} = erlang:timestamp(),
[_, Host] = string:tokens(atom_to_list(node()), [$@]),
_NewInitOptions = check_options(InitOptions),
js_node_helper(Host, 0, lists:concat([A,'_',B,'_',C]),
diff --git a/lib/orber/test/orber_test_server_impl.erl b/lib/orber/test/orber_test_server_impl.erl
index 10a9caf242..9aa12e98fb 100644
--- a/lib/orber/test/orber_test_server_impl.erl
+++ b/lib/orber/test/orber_test_server_impl.erl
@@ -243,22 +243,22 @@ relay_cast(_Self, State, Target) ->
%% Testing pseudo calls.
pseudo_call(_Self, State) ->
- io:format("orber_test_server:pseudo_call( ~p )~n", [now()]),
+ io:format("orber_test_server:pseudo_call( ~p )~n", [erlang:timestamp()]),
{reply, ok, State}.
pseudo_cast(_Self, State) ->
- io:format("orber_test_server:pseudo_cast( ~p )~n", [now()]),
+ io:format("orber_test_server:pseudo_cast( ~p )~n", [erlang:timestamp()]),
{noreply, State}.
pseudo_call_delay(_Self, State, Time) ->
- io:format("orber_test_server:pseudo_call_delay( ~p )~n", [now()]),
+ io:format("orber_test_server:pseudo_call_delay( ~p )~n", [erlang:timestamp()]),
timer:sleep(Time),
- io:format("orber_test_server:pseudo_call_delay( ~p )~n", [now()]),
+ io:format("orber_test_server:pseudo_call_delay( ~p )~n", [erlang:timestamp()]),
{reply, {ok, Time}, State}.
pseudo_cast_delay(_Self, State, Time) ->
- io:format("orber_test_server:pseudo_cast_delay( ~p )~n", [now()]),
+ io:format("orber_test_server:pseudo_cast_delay( ~p )~n", [erlang:timestamp()]),
timer:sleep(Time),
- io:format("orber_test_server:pseudo_cast_delay( ~p )~n", [now()]),
+ io:format("orber_test_server:pseudo_cast_delay( ~p )~n", [erlang:timestamp()]),
{noreply, State}.
pseudo_call_raise_exc(_Self, State, 1) ->
--
cgit v1.2.3
From e44c3bcfea153cfecb5d096be6fad8f830f91198 Mon Sep 17 00:00:00 2001
From: Hans Bolinder
Date: Thu, 7 May 2015 15:38:08 +0200
Subject: dialyzer: document the type identifier()
---
lib/hipe/cerl/erl_types.erl | 13 -------------
1 file changed, 13 deletions(-)
(limited to 'lib')
diff --git a/lib/hipe/cerl/erl_types.erl b/lib/hipe/cerl/erl_types.erl
index 798212d5f9..14335cf635 100644
--- a/lib/hipe/cerl/erl_types.erl
+++ b/lib/hipe/cerl/erl_types.erl
@@ -67,7 +67,6 @@
t_cons/2,
t_cons_hd/1, t_cons_hd/2,
t_cons_tl/1, t_cons_tl/2,
- t_constant/0,
t_contains_opaque/1, t_contains_opaque/2,
t_decorate_with_opaque/3,
t_elements/1,
@@ -118,7 +117,6 @@
%% t_is_byte/1,
%% t_is_char/1,
t_is_cons/1, t_is_cons/2,
- t_is_constant/1,
t_is_equal/2,
t_is_fixnum/1,
t_is_float/1, t_is_float/2,
@@ -1748,17 +1746,6 @@ is_tuple1(_) -> false.
t_bitstrlist() ->
t_iolist(1, t_bitstr()).
-%% XXX. To be removed.
--spec t_constant() -> erl_type().
-
-t_constant() ->
- t_sup([t_number(), t_identifier(), t_atom(), t_fun(), t_binary()]).
-
--spec t_is_constant(erl_type()) -> boolean().
-
-t_is_constant(X) ->
- t_is_subtype(X, t_constant()).
-
-spec t_arity() -> erl_type().
t_arity() ->
--
cgit v1.2.3
From 0124b550307dbc2830669fb113860d90b33b10c4 Mon Sep 17 00:00:00 2001
From: Michael Klishin
Date: Fri, 27 Mar 2015 04:43:35 +0300
Subject: Fix a typo
---
lib/kernel/src/heart.erl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'lib')
diff --git a/lib/kernel/src/heart.erl b/lib/kernel/src/heart.erl
index daed6dd488..77cd5433de 100644
--- a/lib/kernel/src/heart.erl
+++ b/lib/kernel/src/heart.erl
@@ -25,7 +25,7 @@
%%%--------------------------------------------------------------------
%%% This is a rewrite of pre_heart from BS.3.
%%%
-%%% The purpose of this process-module is to act as an supervisor
+%%% The purpose of this process-module is to act as a supervisor
%%% of the entire erlang-system. This 'heart' beats with a frequence
%%% satisfying an external port program *not* reboot the entire
%%% system. If however the erlang-emulator would hang, a reboot is
--
cgit v1.2.3
From 9958f2864502385766753f8f4a7d140aa7a582b5 Mon Sep 17 00:00:00 2001
From: Derek Brown
Date: Sun, 5 Apr 2015 20:19:35 -0400
Subject: Add mention of ?assertNotMatch and ?assertNotEqual
These two macros are defined in eunit.hrl, but are missing in this
documentation.
---
lib/eunit/doc/overview.edoc | 6 ++++++
1 file changed, 6 insertions(+)
(limited to 'lib')
diff --git a/lib/eunit/doc/overview.edoc b/lib/eunit/doc/overview.edoc
index 872a017440..df716cdeea 100644
--- a/lib/eunit/doc/overview.edoc
+++ b/lib/eunit/doc/overview.edoc
@@ -569,6 +569,9 @@ Examples:
```?assertMatch({found, {fred, _}}, lookup(bloggs, Table))'''
```?assertMatch([X|_] when X > 0, binary_to_list(B))'''
+`assertNotMatch(GuardedPattern, Expr)'
+The inverse case of assertMatch, for convenience.
+
`assertEqual(Expect, Expr)'
Evaluates the expressions `Expect' and `Expr' and compares the
results for equality, if testing is enabled. If the values are not
@@ -583,6 +586,9 @@ Examples:
```?assertEqual("b" ++ "a", lists:reverse("ab"))'''
```?assertEqual(foo(X), bar(Y))'''
+`assertNotEqual(Unexpected, Expr)'
+The inverse case of assertEqual, for convenience.
+
`assertException(ClassPattern, TermPattern, Expr)'
`assertError(TermPattern, Expr)'
`assertExit(TermPattern, Expr)'
--
cgit v1.2.3
From fd8d054c22a5ee81015d5e0add297ba7144a0840 Mon Sep 17 00:00:00 2001
From: Hans Bolinder
Date: Fri, 8 May 2015 12:28:25 +0200
Subject: typer: Properly extract annotations
The addition of the erl_anno module, OTP-12195, also modified v3_core
so that functions with line number zero are regarded as compiler
generated.
---
lib/typer/src/typer.erl | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
(limited to 'lib')
diff --git a/lib/typer/src/typer.erl b/lib/typer/src/typer.erl
index cbad05081e..f8070e04c1 100644
--- a/lib/typer/src/typer.erl
+++ b/lib/typer/src/typer.erl
@@ -2,7 +2,7 @@
%%-----------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2015. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -931,7 +931,9 @@ analyze_one_function({Var, FunBody} = Function, Acc) ->
A = cerl:fname_arity(Var),
TmpDialyzerObj = {{Acc#tmpAcc.module, F, A}, Function},
NewDialyzerObj = Acc#tmpAcc.dialyzerObj ++ [TmpDialyzerObj],
- [_, LineNo, {file, FileName}] = cerl:get_ann(FunBody),
+ Anno = cerl:get_ann(FunBody),
+ LineNo = get_line(Anno),
+ FileName = get_file(Anno),
BaseName = filename:basename(FileName),
FuncInfo = {LineNo, F, A},
OriginalName = Acc#tmpAcc.file,
@@ -951,6 +953,14 @@ analyze_one_function({Var, FunBody} = Function, Acc) ->
incFuncAcc = IncFuncAcc,
dialyzerObj = NewDialyzerObj}.
+get_line([Line|_]) when is_integer(Line) -> Line;
+get_line([_|T]) -> get_line(T);
+get_line([]) -> none.
+
+get_file([{file,File}|_]) -> File;
+get_file([_|T]) -> get_file(T);
+get_file([]) -> "no_file". % should not happen
+
-spec get_dialyzer_plt(analysis()) -> plt().
get_dialyzer_plt(#analysis{plt = PltFile0}) ->
--
cgit v1.2.3
From 9b2988b5409dbd629ce57bf89fa1c3bad69b2a42 Mon Sep 17 00:00:00 2001
From: Andras Horvath
Date: Tue, 7 Apr 2015 13:23:10 +0100
Subject: Delete superfluous comma from `filtermap' example
The code explaining the behaviour of `filtermap/2` had a syntax error and wouldn't compile
---
lib/stdlib/doc/src/lists.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'lib')
diff --git a/lib/stdlib/doc/src/lists.xml b/lib/stdlib/doc/src/lists.xml
index ee3c51c62c..dcc08d008b 100644
--- a/lib/stdlib/doc/src/lists.xml
+++ b/lib/stdlib/doc/src/lists.xml
@@ -176,7 +176,7 @@ filtermap(Fun, List1) ->
false -> Acc;
true -> [Elem|Acc];
{true,Value} -> [Value|Acc]
- end,
+ end
end, [], List1).
Example:
--
cgit v1.2.3
From 5c192ac2faf510c24a4f9c9936dd580d5d304183 Mon Sep 17 00:00:00 2001
From: Bruce Yinhe
Date: Fri, 20 Mar 2015 15:25:00 +0100
Subject: Fixed a typo in Maps doc
---
lib/stdlib/doc/src/maps.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'lib')
diff --git a/lib/stdlib/doc/src/maps.xml b/lib/stdlib/doc/src/maps.xml
index 59c26d9896..e46068230a 100644
--- a/lib/stdlib/doc/src/maps.xml
+++ b/lib/stdlib/doc/src/maps.xml
@@ -339,7 +339,7 @@ false
- Returns a complete list of values, in arbitrary order, contained in map M .
+ Returns a complete list of values, in arbitrary order, contained in map Map .
The call will fail with a {badmap,Map} exception if Map is not a map.
--
cgit v1.2.3
From 0ca698b01fc2f90cf7a14995cb76ccf8e26a9913 Mon Sep 17 00:00:00 2001
From: David Kubecka
Date: Sun, 5 Apr 2015 13:29:28 +0200
Subject: digraph: export label type
Together with vertex and edge, label is a core type of digraph module
according to documentation and therefore should be exported as well.
---
lib/stdlib/src/digraph.erl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'lib')
diff --git a/lib/stdlib/src/digraph.erl b/lib/stdlib/src/digraph.erl
index 0c21271529..1f8caa88a4 100644
--- a/lib/stdlib/src/digraph.erl
+++ b/lib/stdlib/src/digraph.erl
@@ -36,7 +36,7 @@
-export([get_short_path/3, get_short_cycle/2]).
--export_type([graph/0, d_type/0, vertex/0, edge/0]).
+-export_type([graph/0, d_type/0, vertex/0, edge/0, label/0]).
-record(digraph, {vtab = notable :: ets:tab(),
etab = notable :: ets:tab(),
--
cgit v1.2.3
From 1dbb97809d0d4cafab45cf0f0281f88ed777cae3 Mon Sep 17 00:00:00 2001
From: Hans Nilsson
Date: Fri, 8 May 2015 15:39:38 +0200
Subject: ssh: Check e and f parameters in kexdh
rfc 4253 says in section 8 that:
"Values of 'e' or 'f' that are not in the range [1, p-1] MUST NOT be
sent or accepted by either side. If this condition is violated, the
key exchange fails."
This commit implements the reception check.
---
lib/ssh/src/ssh_transport.erl | 50 +++++++++++++++++++++++++++++--------------
1 file changed, 34 insertions(+), 16 deletions(-)
(limited to 'lib')
diff --git a/lib/ssh/src/ssh_transport.erl b/lib/ssh/src/ssh_transport.erl
index 8669be570e..d6414bab6c 100644
--- a/lib/ssh/src/ssh_transport.erl
+++ b/lib/ssh/src/ssh_transport.erl
@@ -240,20 +240,30 @@ key_exchange_first_msg('diffie-hellman-group-exchange-sha1', Ssh0) ->
handle_kexdh_init(#ssh_msg_kexdh_init{e = E}, Ssh0) ->
{G, P} = dh_group1(),
- {Private, Public} = dh_gen_key(G, P, 1024),
- K = ssh_math:ipow(E, Private, P),
- Key = get_host_key(Ssh0),
- H = kex_h(Ssh0, Key, E, Public, K),
- H_SIG = sign_host_key(Ssh0, Key, H),
- {SshPacket, Ssh1} = ssh_packet(#ssh_msg_kexdh_reply{public_host_key = Key,
- f = Public,
- h_sig = H_SIG
- }, Ssh0),
-
- {ok, SshPacket, Ssh1#ssh{keyex_key = {{Private, Public}, {G, P}},
- shared_secret = K,
- exchanged_hash = H,
- session_id = sid(Ssh1, H)}}.
+ if
+ 1=
+ {Private, Public} = dh_gen_key(G, P, 1024),
+ K = ssh_math:ipow(E, Private, P),
+ Key = get_host_key(Ssh0),
+ H = kex_h(Ssh0, Key, E, Public, K),
+ H_SIG = sign_host_key(Ssh0, Key, H),
+ {SshPacket, Ssh1} = ssh_packet(#ssh_msg_kexdh_reply{public_host_key = Key,
+ f = Public,
+ h_sig = H_SIG
+ }, Ssh0),
+
+ {ok, SshPacket, Ssh1#ssh{keyex_key = {{Private, Public}, {G, P}},
+ shared_secret = K,
+ exchanged_hash = H,
+ session_id = sid(Ssh1, H)}};
+ true ->
+ Error = {error,bad_e_from_peer},
+ Disconnect = #ssh_msg_disconnect{
+ code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED,
+ description = "Key exchange failed, 'f' out of bounds",
+ language = "en"},
+ throw({Error, Disconnect})
+ end.
handle_kex_dh_gex_group(#ssh_msg_kex_dh_gex_group{p = P, g = G}, Ssh0) ->
{Private, Public} = dh_gen_key(G,P,1024),
@@ -277,7 +287,7 @@ handle_new_keys(#ssh_msg_newkeys{}, Ssh0) ->
%% %% Select algorithms
handle_kexdh_reply(#ssh_msg_kexdh_reply{public_host_key = HostKey, f = F,
h_sig = H_SIG},
- #ssh{keyex_key = {{Private, Public}, {_G, P}}} = Ssh0) ->
+ #ssh{keyex_key = {{Private, Public}, {_G, P}}} = Ssh0) when 1=
K = ssh_math:ipow(F, Private, P),
H = kex_h(Ssh0, HostKey, Public, F, K),
@@ -293,7 +303,15 @@ handle_kexdh_reply(#ssh_msg_kexdh_reply{public_host_key = HostKey, f = F,
description = "Key exchange failed",
language = "en"},
throw({Error, Disconnect})
- end.
+ end;
+handle_kexdh_reply(#ssh_msg_kexdh_reply{}, _SSH) ->
+ Error = {error,bad_f_from_peer},
+ Disconnect = #ssh_msg_disconnect{
+ code = ?SSH_DISCONNECT_KEY_EXCHANGE_FAILED,
+ description = "Key exchange failed, 'f' out of bounds",
+ language = "en"},
+ throw({Error, Disconnect}).
+
handle_kex_dh_gex_request(#ssh_msg_kex_dh_gex_request{min = _Min,
n = _NBits,
--
cgit v1.2.3
From 603ffe32e1947e2c9550eabe15c477c343cbaba1 Mon Sep 17 00:00:00 2001
From: Peter Andersson
Date: Fri, 8 May 2015 17:50:59 +0200
Subject: Update version numbers and app dependencies
---
lib/common_test/src/common_test.app.src | 11 ++++++-----
lib/common_test/vsn.mk | 2 +-
lib/test_server/src/test_server.app.src | 6 +++---
lib/test_server/vsn.mk | 2 +-
4 files changed, 11 insertions(+), 10 deletions(-)
(limited to 'lib')
diff --git a/lib/common_test/src/common_test.app.src b/lib/common_test/src/common_test.app.src
index 580d5dbd7b..0be1466fc9 100644
--- a/lib/common_test/src/common_test.app.src
+++ b/lib/common_test/src/common_test.app.src
@@ -63,9 +63,10 @@
ct_master_logs]},
{applications, [kernel,stdlib]},
{env, []},
- {runtime_dependencies,["xmerl-1.3.7","webtool-0.8.10","tools-2.6.14",
- "test_server-3.7.1","stdlib-2.0","ssh-3.0.1",
- "snmp-4.25.1","sasl-2.4","runtime_tools-1.8.14",
- "kernel-3.0","inets-5.10","erts-6.0",
- "debugger-4.0","crypto-3.3","compiler-5.0"]}]}.
+ {runtime_dependencies,["xmerl-1.3.8","tools-2.8",
+ "test_server-3.9","stdlib-2.5","ssh-4.0",
+ "snmp-5.1.2","sasl-2.4.2","runtime_tools-1.8.16",
+ "kernel-4.0","inets-6.0","erts-7.0",
+ "debugger-4.1","crypto-3.6","compiler-6.0",
+ "observer-2.1"]}]}.
diff --git a/lib/common_test/vsn.mk b/lib/common_test/vsn.mk
index e2d921729c..ff2bd20ab3 100644
--- a/lib/common_test/vsn.mk
+++ b/lib/common_test/vsn.mk
@@ -1 +1 @@
-COMMON_TEST_VSN = 1.10.1
+COMMON_TEST_VSN = 1.11
diff --git a/lib/test_server/src/test_server.app.src b/lib/test_server/src/test_server.app.src
index 5538e8b851..bdd9d28444 100644
--- a/lib/test_server/src/test_server.app.src
+++ b/lib/test_server/src/test_server.app.src
@@ -32,7 +32,7 @@
test_server_break_process]},
{applications, [kernel,stdlib]},
{env, []},
- {runtime_dependencies, ["tools-2.6.14","stdlib-2.0","runtime_tools-1.8.14",
- "observer-2.0","kernel-3.0","inets-5.10",
- "syntax_tools-1.6.16","erts-7.0"]}]}.
+ {runtime_dependencies, ["tools-2.8","stdlib-2.5","runtime_tools-1.8.16",
+ "observer-2.1","kernel-4.0","inets-6.0",
+ "syntax_tools-1.7","erts-7.0"]}]}.
diff --git a/lib/test_server/vsn.mk b/lib/test_server/vsn.mk
index 2a2ed2b3b0..fd9e4e6d74 100644
--- a/lib/test_server/vsn.mk
+++ b/lib/test_server/vsn.mk
@@ -1 +1 @@
-TEST_SERVER_VSN = 3.8.1
+TEST_SERVER_VSN = 3.9
--
cgit v1.2.3
From 7a671f9cc3b0db983cb368eaefc12f148aefb542 Mon Sep 17 00:00:00 2001
From: Peter Andersson
Date: Sat, 9 May 2015 00:29:50 +0200
Subject: Fix remaining issues in source code parser
---
lib/test_server/src/erl2html2.erl | 30 ++++++++++++++----------------
1 file changed, 14 insertions(+), 16 deletions(-)
(limited to 'lib')
diff --git a/lib/test_server/src/erl2html2.erl b/lib/test_server/src/erl2html2.erl
index 2e443c7b8b..9101212852 100644
--- a/lib/test_server/src/erl2html2.erl
+++ b/lib/test_server/src/erl2html2.erl
@@ -109,27 +109,26 @@ parse_file(File, InclPath) ->
Error
end.
-parse_preprocessed_file(Epp,File,InCorrectFile) ->
+parse_preprocessed_file(Epp, File, InCorrectFile) ->
case epp:parse_erl_form(Epp) of
{ok,Form} ->
case Form of
{attribute,_,file,{File,_}} ->
- parse_preprocessed_file(Epp,File,true);
+ parse_preprocessed_file(Epp, File, true);
{attribute,_,file,{_OtherFile,_}} ->
- parse_preprocessed_file(Epp,File,false);
+ parse_preprocessed_file(Epp, File, false);
{function,L,F,A,Cs} when InCorrectFile ->
{CLs,LastCL} = find_clause_lines(Cs, []),
- Clauses = [{clause,get_line(CL)} ||
- {clause,CL,_,_,_} <- tl(CLs)],
- [{atom_to_list(F),A,get_line(L),get_line(LastCL)} | Clauses] ++
- parse_preprocessed_file(Epp,File,true);
+ %% tl(CLs) cause we know the start line already
+ [{atom_to_list(F),A,get_line(L),LastCL} | tl(CLs)] ++
+ parse_preprocessed_file(Epp, File, true);
_ ->
- parse_preprocessed_file(Epp,File,InCorrectFile)
+ parse_preprocessed_file(Epp, File, InCorrectFile)
end;
{error,Reason={_L,epp,{undefined,_Macro,none}}} ->
throw({error,Reason,InCorrectFile});
{error,_Reason} ->
- parse_preprocessed_file(Epp,File,InCorrectFile);
+ parse_preprocessed_file(Epp, File, InCorrectFile);
{eof,_Location} ->
[]
end.
@@ -150,9 +149,8 @@ parse_non_preprocessed_file(Epp, File, Location) ->
try erl_syntax:revert(Tree) of
{function,L,F,A,Cs} ->
{CLs,LastCL} = find_clause_lines(Cs, []),
- Clauses = [{clause,get_line(CL)} ||
- {clause,CL,_,_,_} <- tl(CLs)],
- [{atom_to_list(F),A,get_line(L),get_line(LastCL)} | Clauses] ++
+ %% tl(CLs) cause we know the start line already
+ [{atom_to_list(F),A,get_line(L),LastCL} | tl(CLs)] ++
parse_non_preprocessed_file(Epp, File, Location1);
_ ->
parse_non_preprocessed_file(Epp, File, Location1)
@@ -173,16 +171,16 @@ get_line(Anno) ->
find_clause_lines([{clause,CL,_Params,_Op,Exprs}], CLs) -> % last clause
try tuple_to_list(lists:last(Exprs)) of
[_Type,ExprLine | _] ->
- {lists:reverse([{clause,CL}|CLs]), ExprLine};
+ {lists:reverse([{clause,get_line(CL)}|CLs]), get_line(ExprLine)};
_ ->
- {lists:reverse([{clause,CL}|CLs]), CL}
+ {lists:reverse([{clause,get_line(CL)}|CLs]), get_line(CL)}
catch
_:_ ->
- {lists:reverse([{clause,CL}|CLs]), CL}
+ {lists:reverse([{clause,get_line(CL)}|CLs]), get_line(CL)}
end;
find_clause_lines([{clause,CL,_Params,_Op,_Exprs} | Cs], CLs) ->
- find_clause_lines(Cs, [{clause,CL}|CLs]).
+ find_clause_lines(Cs, [{clause,get_line(CL)}|CLs]).
%%%-----------------------------------------------------------------
%%% Add a link target for each line and one for each function definition.
--
cgit v1.2.3
From 493772276f90e2a880cdc1e0091848a7088d247f Mon Sep 17 00:00:00 2001
From: Peter Andersson
Date: Sat, 9 May 2015 02:02:14 +0200
Subject: Fix problem with OTP benchmark tests failing to run
---
lib/test_server/src/ts.erl | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
(limited to 'lib')
diff --git a/lib/test_server/src/ts.erl b/lib/test_server/src/ts.erl
index 469593e947..85f97656ff 100644
--- a/lib/test_server/src/ts.erl
+++ b/lib/test_server/src/ts.erl
@@ -262,18 +262,28 @@ run_all(_Vars) ->
run_some([], _Opts) ->
ok;
-run_some([{App,Mod}|Apps], Opts) ->
+run_some(Apps, Opts) ->
+ case proplists:get_value(test_category, Opts) of
+ bench ->
+ check_and_run(fun(Vars) -> ts_benchmark:run(Apps, Opts, Vars) end);
+ _Other ->
+ run_some1(Apps, Opts)
+ end.
+
+run_some1([], _Opts) ->
+ ok;
+run_some1([{App,Mod}|Apps], Opts) ->
case run(App, Mod, Opts) of
ok -> ok;
Error -> io:format("~p: ~p~n",[{App,Mod},Error])
end,
- run_some(Apps, Opts);
-run_some([App|Apps], Opts) ->
+ run_some1(Apps, Opts);
+run_some1([App|Apps], Opts) ->
case run(App, Opts) of
ok -> ok;
Error -> io:format("~p: ~p~n",[App,Error])
end,
- run_some(Apps, Opts).
+ run_some1(Apps, Opts).
%% This can be used from command line. Both App and
%% TestCategory must be specified. App may be 'all'
--
cgit v1.2.3
From 42d25222fa7395ad9fb58de2c964afa4caefb5b1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jos=C3=A9=20Valim?=
Date: Fri, 9 May 2014 18:07:07 +0200
Subject: Send format and args on process exit to error_logger
Previously, the emulator would generate a whole string
with values and call the error_logger passing "~s~n".
This commit changes it to a format string containing ~p
with the respective values as arguments.
---
lib/kernel/test/error_logger_SUITE.erl | 22 ++++++++--------------
1 file changed, 8 insertions(+), 14 deletions(-)
(limited to 'lib')
diff --git a/lib/kernel/test/error_logger_SUITE.erl b/lib/kernel/test/error_logger_SUITE.erl
index 05bf5aae18..1c2e56f083 100644
--- a/lib/kernel/test/error_logger_SUITE.erl
+++ b/lib/kernel/test/error_logger_SUITE.erl
@@ -32,7 +32,7 @@
error_report/1, info_report/1, error/1, info/1,
emulator/1, tty/1, logfile/1, add/1, delete/1]).
--export([generate_error/0]).
+-export([generate_error/2]).
-export([init/1,
handle_event/2, handle_call/2, handle_info/2,
@@ -210,13 +210,16 @@ emulator(suite) -> [];
emulator(doc) -> [];
emulator(Config) when is_list(Config) ->
?line error_logger:add_report_handler(?MODULE, self()),
- spawn(?MODULE, generate_error, []),
- reported(emulator),
+ Msg = "Error in process ~p on node ~p with exit value:~n~p~n",
+ Error = {badmatch,4},
+ Stack = [{module, function, 2, []}],
+ Pid = spawn(?MODULE, generate_error, [Error, Stack]),
+ reported(error, Msg, [Pid, node(), {Error, Stack}]),
?line my_yes = error_logger:delete_report_handler(?MODULE),
ok.
-generate_error() ->
- erlang:error({badmatch,4}).
+generate_error(Error, Stack) ->
+ erlang:raise(error, Error, Stack).
%%-----------------------------------------------------------------
%% We don't enables or disables tty error logging here. We do not
@@ -283,15 +286,6 @@ reported(Tag, Type, Report) ->
test_server:fail(no_report_received)
end.
-reported(emulator) ->
- receive
- {error, "~s~n", String} when is_list(String) ->
- test_server:messages_get(),
- ok
- after 1000 ->
- test_server:fail(no_report_received)
- end.
-
%%-----------------------------------------------------------------
%% The error_logger handler (gen_event behaviour).
%% Sends a notification to the Tester process about the events
--
cgit v1.2.3
From 0f2d15c95f98e7b271111c9311210a808c624adb Mon Sep 17 00:00:00 2001
From: Ingela Anderton Andin
Date: Fri, 8 May 2015 15:57:15 +0200
Subject: public_key, ssl: Align public_key and ssl doc
Make sure that links from ssl to public_key work.
OTP-12670 - Ignoring 1.2 extension in 1.0 or TLS-1.1
solved by 5edda23ee854038c9d4bcddd0d676ee0ffd20da5
is mentioned here to make the release scripts happy,
as the branch solving this accidently had a name ending 1267
instead of 12670
---
lib/public_key/doc/src/Makefile | 2 +-
lib/public_key/doc/src/part.xml | 2 +-
lib/public_key/doc/src/public_key_records.xml | 841 ++++++++++++++++++++++++++
lib/public_key/doc/src/records.xml | 841 --------------------------
lib/ssl/doc/src/ssl.xml | 8 +-
lib/ssl/doc/src/ssl_crl_cache_api.xml | 4 +-
6 files changed, 849 insertions(+), 849 deletions(-)
create mode 100644 lib/public_key/doc/src/public_key_records.xml
delete mode 100644 lib/public_key/doc/src/records.xml
(limited to 'lib')
diff --git a/lib/public_key/doc/src/Makefile b/lib/public_key/doc/src/Makefile
index 2adc13a5cf..d04819b5aa 100644
--- a/lib/public_key/doc/src/Makefile
+++ b/lib/public_key/doc/src/Makefile
@@ -42,7 +42,7 @@ XML_REF6_FILES =
XML_PART_FILES = part.xml part_notes.xml
XML_CHAPTER_FILES = \
introduction.xml \
- records.xml \
+ public_key_records.xml \
using_public_key.xml \
notes.xml
diff --git a/lib/public_key/doc/src/part.xml b/lib/public_key/doc/src/part.xml
index d3cc9303bd..465f311946 100644
--- a/lib/public_key/doc/src/part.xml
+++ b/lib/public_key/doc/src/part.xml
@@ -38,7 +38,7 @@
PKCS standard.
-
+
diff --git a/lib/public_key/doc/src/public_key_records.xml b/lib/public_key/doc/src/public_key_records.xml
new file mode 100644
index 0000000000..9536167839
--- /dev/null
+++ b/lib/public_key/doc/src/public_key_records.xml
@@ -0,0 +1,841 @@
+
+
+
+
+
+
+ 2008
+ 2015
+ Ericsson AB, All Rights Reserved
+
+
+ The contents of this file are subject to the Erlang Public License,
+ Version 1.1, (the "License"); you may not use this file except in
+ compliance with the License. You should have received a copy of the
+ Erlang Public License along with this software. If not, it can be
+ retrieved online at http://www.erlang.org/.
+
+ Software distributed under the License is distributed on an "AS IS"
+ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+ the License for the specific language governing rights and limitations
+ under the License.
+
+ The Initial Developer of the Original Code is Ericsson AB.
+
+
+ Public-Key Records
+ Ingela Anderton Andin
+
+
+
+
+ 2008-02-06
+ A
+ public_key_records.xml
+
+
+ This chapter briefly describes Erlang records derived from ASN.1
+ specifications used to handle public key infrastructure.
+ The scope is to describe the data types of each component,
+ not the semantics. For information on the
+ semantics, refer to the relevant standards and RFCs linked in the sections below.
+
+ Use the following include directive to get access to the
+ records and constant macros described in the following sections:
+
+ -include_lib("public_key/include/public_key.hrl").
+
+
+ Data Types
+
+ Common non-standard Erlang
+ data types used to describe the record fields in the
+ following sections and which are not defined in the Public Key Reference Manual
+ follows here:
+
+
+ time()
+ = uct_time() | general_time()
+
+ uct_time()
+ = {utcTime, "YYMMDDHHMMSSZ"}
+
+ general_time()
+ = {generalTime, "YYYYMMDDHHMMSSZ"}
+
+ general_name()
+ - =
{rfc822Name, string()}
+ | {dNSName, string()}
+ | {x400Address, string()}
+ | {directoryName, {rdnSequence, [#AttributeTypeAndValue'{}]}}
+ | {eidPartyName, special_string()}
+ | {eidPartyName, special_string(), special_string()}
+ | {uniformResourceIdentifier, string()}
+ | {ipAddress, string()}
+ | {registeredId, oid()}
+ | {otherName, term()}
+
+
+ special_string()
+ - =
{teletexString, string()}
+ | {printableString, string()}
+ | {universalString, string()}
+ | {utf8String, binary()}
+ | {bmpString, string()}
+
+
+ dist_reason()
+ - =
unused
+ | keyCompromise
+ | cACompromise
+ | affiliationChanged
+ | superseded
+ | cessationOfOperation
+ | certificateHold
+ | privilegeWithdrawn
+ | aACompromise
+
+
+ OID_macro()
+ - =
?OID_name()
+
+
+ OID_name()
+ - =
atom()
+
+
+
+
+
+
+
+ RSA
+ Erlang representation of
+ Rivest-Shamir-Adleman cryptosystem (RSA) keys follows:
+
+
+#'RSAPublicKey'{
+ modulus, % integer()
+ publicExponent % integer()
+ }.
+
+#'RSAPrivateKey'{
+ version, % two-prime | multi
+ modulus, % integer()
+ publicExponent, % integer()
+ privateExponent, % integer()
+ prime1, % integer()
+ prime2, % integer()
+ exponent1, % integer()
+ exponent2, % integer()
+ coefficient, % integer()
+ otherPrimeInfos % [#OtherPrimeInfo{}] | asn1_NOVALUE
+ }.
+
+#'OtherPrimeInfo'{
+ prime, % integer()
+ exponent, % integer()
+ coefficient % integer()
+ }.
+
+
+
+
+ DSA
+ Erlang representation of Digigital Signature Algorithm (DSA) keys
+
+#'DSAPrivateKey',{
+ version, % integer()
+ p, % integer()
+ q, % integer()
+ g, % integer()
+ y, % integer()
+ x % integer()
+ }.
+
+#'Dss-Parms',{
+ p, % integer()
+ q, % integer()
+ g % integer()
+ }.
+
+
+
+
+ ECDSA
+ Erlang representation of Elliptic Curve Digital Signature Algorithm (ECDSA) keys follows:
+
+
+#'ECPrivateKey'{
+ version, % integer()
+ privateKey, % binary()
+ parameters, % der_encoded() - {'EcpkParameters', #'ECParameters'{}} |
+ {'EcpkParameters', {namedCurve, oid()}} |
+ {'EcpkParameters', 'NULL'} % Inherited by CA
+ publicKey % bitstring()
+ }.
+
+#'ECParameters'{
+ version, % integer()
+ fieldID, % #'FieldID'{}
+ curve, % #'Curve'{}
+ base, % binary()
+ order, % integer()
+ cofactor % integer()
+ }.
+
+#'Curve'{
+ a, % binary()
+ b, % binary()
+ seed % bitstring() - optional
+
+ }.
+
+#'FieldID'{
+ fieldType, % oid()
+ parameters % Depending on fieldType
+ }.
+
+#'ECPoint'{
+ point % binary() - the public key
+ }.
+
+
+
+ PKIX Certificates
+ Erlang representation of PKIX certificates derived from ASN.1
+ specifications see also X509 certificates (RFC 5280) , also referred to as plain type, are as follows:
+
+#'Certificate'{
+ tbsCertificate, % #'TBSCertificate'{}
+ signatureAlgorithm, % #'AlgorithmIdentifier'{}
+ signature % bitstring()
+ }.
+
+#'TBSCertificate'{
+ version, % v1 | v2 | v3
+ serialNumber, % integer()
+ signature, % #'AlgorithmIdentifier'{}
+ issuer, % {rdnSequence, [#AttributeTypeAndValue'{}]}
+ validity, % #'Validity'{}
+ subject, % {rdnSequence, [#AttributeTypeAndValue'{}]}
+ subjectPublicKeyInfo, % #'SubjectPublicKeyInfo'{}
+ issuerUniqueID, % binary() | asn1_novalue
+ subjectUniqueID, % binary() | asn1_novalue
+ extensions % [#'Extension'{}]
+ }.
+
+#'AlgorithmIdentifier'{
+ algorithm, % oid()
+ parameters % der_encoded()
+ }.
+
+Erlang alternate representation of PKIX certificate, also referred to as otp type
+
+
+#'OTPCertificate'{
+ tbsCertificate, % #'OTPTBSCertificate'{}
+ signatureAlgorithm, % #'SignatureAlgorithm'
+ signature % bitstring()
+ }.
+
+#'OTPTBSCertificate'{
+ version, % v1 | v2 | v3
+ serialNumber, % integer()
+ signature, % #'SignatureAlgorithm'
+ issuer, % {rdnSequence, [#AttributeTypeAndValue'{}]}
+ validity, % #'Validity'{}
+ subject, % {rdnSequence, [#AttributeTypeAndValue'{}]}
+ subjectPublicKeyInfo, % #'OTPSubjectPublicKeyInfo'{}
+ issuerUniqueID, % binary() | asn1_novalue
+ subjectUniqueID, % binary() | asn1_novalue
+ extensions % [#'Extension'{}]
+ }.
+
+#'SignatureAlgorithm'{
+ algorithm, % id_signature_algorithm()
+ parameters % asn1_novalue | #'Dss-Parms'{}
+ }.
+
+id_signature_algorithm() = OID_macro()
+
+The available OID names are as follows:
+
+
+ OID Name |
+
+
+ id-dsa-with-sha1 |
+
+
+ id-dsaWithSHA1 (ISO or OID to above) |
+
+
+ md2WithRSAEncryption |
+
+
+ md5WithRSAEncryption |
+
+
+ sha1WithRSAEncryption |
+
+
+ sha-1WithRSAEncryption (ISO or OID to above) |
+
+
+ sha224WithRSAEncryption |
+
+
+ sha256WithRSAEncryption |
+
+
+ sha512WithRSAEncryption |
+
+
+ ecdsa-with-SHA1 |
+
+ Signature Algorithm OIDs
+
+
+The data type 'AttributeTypeAndValue' , is represented as
+ the following erlang record:
+
+
+#'AttributeTypeAndValue'{
+ type, % id_attributes()
+ value % term()
+ }.
+
+The attribute OID name atoms and their corresponding value types
+are as follows:
+
+
+ OID Name |
+ Value Type |
+
+
+ id-at-name |
+ special_string() |
+
+
+ id-at-surname |
+ special_string() |
+
+
+ id-at-givenName |
+ special_string() |
+
+
+ id-at-initials |
+ special_string() |
+
+
+ id-at-generationQualifier |
+ special_string() |
+
+
+ id-at-commonName |
+ special_string() |
+
+
+ id-at-localityName |
+ special_string() |
+
+
+ id-at-stateOrProvinceName |
+ special_string() |
+
+
+ id-at-organizationName |
+ special_string() |
+
+
+ id-at-title |
+ special_string() |
+
+
+ id-at-dnQualifier |
+ {printableString, string()} |
+
+
+ id-at-countryName |
+ {printableString, string()} |
+
+
+ id-at-serialNumber |
+ {printableString, string()} |
+
+
+ id-at-pseudonym |
+ special_string() |
+
+ Attribute OIDs
+
+
+The data types 'Validity' , 'SubjectPublicKeyInfo' , and
+'SubjectPublicKeyInfoAlgorithm' are represented as the following Erlang records:
+
+
+#'Validity'{
+ notBefore, % time()
+ notAfter % time()
+ }.
+
+#'SubjectPublicKeyInfo'{
+ algorithm, % #AlgorithmIdentifier{}
+ subjectPublicKey % binary()
+ }.
+
+#'SubjectPublicKeyInfoAlgorithm'{
+ algorithm, % id_public_key_algorithm()
+ parameters % public_key_params()
+ }.
+
+The public-key algorithm OID name atoms are as follows:
+
+
+ OID Name |
+
+
+ rsaEncryption |
+
+
+ id-dsa |
+
+
+ dhpublicnumber |
+
+
+ id-keyExchangeAlgorithm |
+
+
+ id-ecPublicKey |
+
+ Public-Key Algorithm OIDs
+
+
+
+#'Extension'{
+ extnID, % id_extensions() | oid()
+ critical, % boolean()
+ extnValue % der_encoded()
+ }.
+
+id_extensions()
+ Standard Certificate Extensions ,
+ Private Internet Extensions ,
+ CRL Extensions and
+ CRL Entry Extensions .
+
+
+
+
+
+
+ Standard Certificate Extensions
+
+ The standard certificate extensions OID name atoms and their
+ corresponding value types are as follows:
+
+
+
+ OID Name |
+ Value Type |
+
+
+ id-ce-authorityKeyIdentifier |
+ #'AuthorityKeyIdentifier'{} |
+
+
+ id-ce-subjectKeyIdentifier |
+ oid() |
+
+
+ id-ce-keyUsage |
+ [key_usage()] |
+
+
+ id-ce-privateKeyUsagePeriod |
+ #'PrivateKeyUsagePeriod'{} |
+
+
+ id-ce-certificatePolicies |
+ #'PolicyInformation'{} |
+
+
+
+ id-ce-policyMappings |
+ #'PolicyMappings_SEQOF'{} |
+
+
+
+ id-ce-subjectAltName |
+ general_name() |
+
+
+
+ id-ce-issuerAltName |
+ general_name() |
+
+
+
+ id-ce-subjectDirectoryAttributes |
+ [#'Attribute'{}] |
+
+
+
+ id-ce-basicConstraints |
+ #'BasicConstraints'{} |
+
+
+ id-ce-nameConstraints |
+ #'NameConstraints'{} |
+
+
+ id-ce-policyConstraints |
+ #'PolicyConstraints'{} |
+
+
+ id-ce-extKeyUsage |
+ [id_key_purpose()] |
+
+
+
+ id-ce-cRLDistributionPoints |
+ [#'DistributionPoint'{}] |
+
+
+
+ id-ce-inhibitAnyPolicy |
+ integer() |
+
+
+
+ id-ce-freshestCRL |
+ [#'DistributionPoint'{}] |
+
+
+
+ Standard Certificate Extensions
+
+
+ Here:
+
+ key_usage()
+ - =
digitalSignature
+ | nonRepudiation
+ | keyEncipherment
+ | dataEncipherment
+ | keyAgreement
+ | keyCertSign
+ | cRLSign
+ | encipherOnly
+ | decipherOnly
+
+
+
+ And for id_key_purpose() :
+
+
+
+ OID Name |
+
+
+ id-kp-serverAuth |
+
+
+ id-kp-clientAuth |
+
+
+ id-kp-codeSigning |
+
+
+ id-kp-emailProtection |
+
+
+ id-kp-timeStamping |
+
+
+ id-kp-OCSPSigning |
+
+ Key Purpose OIDs
+
+
+
+#'AuthorityKeyIdentifier'{
+ keyIdentifier, % oid()
+ authorityCertIssuer, % general_name()
+ authorityCertSerialNumber % integer()
+ }.
+
+#'PrivateKeyUsagePeriod'{
+ notBefore, % general_time()
+ notAfter % general_time()
+ }.
+
+#'PolicyInformation'{
+ policyIdentifier, % oid()
+ policyQualifiers % [#PolicyQualifierInfo{}]
+ }.
+
+#'PolicyQualifierInfo'{
+ policyQualifierId, % oid()
+ qualifier % string() | #'UserNotice'{}
+ }.
+
+#'UserNotice'{
+ noticeRef, % #'NoticeReference'{}
+ explicitText % string()
+ }.
+
+#'NoticeReference'{
+ organization, % string()
+ noticeNumbers % [integer()]
+ }.
+
+#'PolicyMappings_SEQOF'{
+ issuerDomainPolicy, % oid()
+ subjectDomainPolicy % oid()
+ }.
+
+#'Attribute'{
+ type, % oid()
+ values % [der_encoded()]
+ }).
+
+#'BasicConstraints'{
+ cA, % boolean()
+ pathLenConstraint % integer()
+ }).
+
+#'NameConstraints'{
+ permittedSubtrees, % [#'GeneralSubtree'{}]
+ excludedSubtrees % [#'GeneralSubtree'{}]
+ }).
+
+#'GeneralSubtree'{
+ base, % general_name()
+ minimum, % integer()
+ maximum % integer()
+ }).
+
+#'PolicyConstraints'{
+ requireExplicitPolicy, % integer()
+ inhibitPolicyMapping % integer()
+ }).
+
+#'DistributionPoint'{
+ distributionPoint, % {fullName, [general_name()]} | {nameRelativeToCRLIssuer,
+ [#AttributeTypeAndValue{}]}
+ reasons, % [dist_reason()]
+ cRLIssuer % [general_name()]
+ }).
+
+
+
+
+
+ Private Internet Extensions
+
+ The private internet extensions OID name atoms and their corresponding value
+ types are as follows:
+
+
+
+ OID Name |
+ Value Type |
+
+
+ id-pe-authorityInfoAccess |
+ [#'AccessDescription'{}] |
+
+
+ id-pe-subjectInfoAccess |
+ [#'AccessDescription'{}] |
+
+ Private Internet Extensions
+
+
+
+#'AccessDescription'{
+ accessMethod, % oid()
+ accessLocation % general_name()
+ }).
+
+
+
+
+ CRL and CRL Extensions Profile
+
+ Erlang representation of CRL and CRL extensions profile
+ derived from ASN.1 specifications and RFC 5280 are as follows:
+
+
+#'CertificateList'{
+ tbsCertList, % #'TBSCertList{}
+ signatureAlgorithm, % #'AlgorithmIdentifier'{}
+ signature % bitstring()
+ }).
+
+#'TBSCertList'{
+ version, % v2 (if defined)
+ signature, % #AlgorithmIdentifier{}
+ issuer, % {rdnSequence, [#AttributeTypeAndValue'{}]}
+ thisUpdate, % time()
+ nextUpdate, % time()
+ revokedCertificates, % [#'TBSCertList_revokedCertificates_SEQOF'{}]
+ crlExtensions % [#'Extension'{}]
+ }).
+
+#'TBSCertList_revokedCertificates_SEQOF'{
+ userCertificate, % integer()
+ revocationDate, % timer()
+ crlEntryExtensions % [#'Extension'{}]
+ }).
+
+
+
+ CRL Extensions
+
+ The CRL extensions OID name atoms and their corresponding value types are as follows:
+
+
+
+
+ OID Name |
+ Value Type |
+
+
+ id-ce-authorityKeyIdentifier |
+ #'AuthorityKeyIdentifier{} |
+
+
+ id-ce-issuerAltName |
+ {rdnSequence, [#AttributeTypeAndValue'{}]} |
+
+
+ id-ce-cRLNumber |
+ integer() |
+
+
+ id-ce-deltaCRLIndicator |
+ integer() |
+
+
+ id-ce-issuingDistributionPoint |
+ #'IssuingDistributionPoint'{} |
+
+
+ id-ce-freshestCRL |
+ [#'Distributionpoint'{}] |
+
+
+ CRL Extensions
+
+
+ Here, the data type 'IssuingDistributionPoint' is represented as
+ the following Erlang record:
+
+
+#'IssuingDistributionPoint'{
+ distributionPoint, % {fullName, [general_name()]} | {nameRelativeToCRLIssuer,
+ [#AttributeTypeAndValue'{}]}
+ onlyContainsUserCerts, % boolean()
+ onlyContainsCACerts, % boolean()
+ onlySomeReasons, % [dist_reason()]
+ indirectCRL, % boolean()
+ onlyContainsAttributeCerts % boolean()
+ }).
+
+
+
+
+ CRL Entry Extensions
+
+ The CRL entry extensions OID name atoms and their corresponding value types are as follows:
+
+
+
+ OID Name |
+ Value Type |
+
+
+ id-ce-cRLReason |
+ crl_reason() |
+
+
+ id-ce-holdInstructionCode |
+ oid() |
+
+
+ id-ce-invalidityDate |
+ general_time() |
+
+
+ id-ce-certificateIssuer |
+ general_name() |
+
+ CRL Entry Extensions
+
+
+
+ Here:
+
+ crl_reason()
+ - =
unspecified
+ | keyCompromise
+ | cACompromise
+ | affiliationChanged
+ | superseded
+ | cessationOfOperation
+ | certificateHold
+ | removeFromCRL
+ | privilegeWithdrawn
+ | aACompromise
+
+
+
+
+
+
+
+ PKCS#10 Certification Request
+ Erlang representation of a PKCS#10 certification request
+ derived from ASN.1 specifications and RFC 5280 are as follows:
+
+#'CertificationRequest'{
+ certificationRequestInfo #'CertificationRequestInfo'{},
+ signatureAlgorithm #'CertificationRequest_signatureAlgorithm'{}}.
+ signature bitstring()
+ }
+
+#'CertificationRequestInfo'{
+ version atom(),
+ subject {rdnSequence, [#AttributeTypeAndValue'{}]} ,
+ subjectPKInfo #'CertificationRequestInfo_subjectPKInfo'{},
+ attributes [#'AttributePKCS-10' {}]
+ }
+
+#'CertificationRequestInfo_subjectPKInfo'{
+ algorithm #'CertificationRequestInfo_subjectPKInfo_algorithm'{}
+ subjectPublicKey bitstring()
+ }
+
+#'CertificationRequestInfo_subjectPKInfo_algorithm'{
+ algorithm = oid(),
+ parameters = der_encoded()
+}
+
+#'CertificationRequest_signatureAlgorithm'{
+ algorithm = oid(),
+ parameters = der_encoded()
+ }
+
+#'AttributePKCS-10'{
+ type = oid(),
+ values = [der_encoded()]
+}
+
+
+
diff --git a/lib/public_key/doc/src/records.xml b/lib/public_key/doc/src/records.xml
deleted file mode 100644
index 9536167839..0000000000
--- a/lib/public_key/doc/src/records.xml
+++ /dev/null
@@ -1,841 +0,0 @@
-
-
-
-
-
-
- 2008
- 2015
- Ericsson AB, All Rights Reserved
-
-
- The contents of this file are subject to the Erlang Public License,
- Version 1.1, (the "License"); you may not use this file except in
- compliance with the License. You should have received a copy of the
- Erlang Public License along with this software. If not, it can be
- retrieved online at http://www.erlang.org/.
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- the License for the specific language governing rights and limitations
- under the License.
-
- The Initial Developer of the Original Code is Ericsson AB.
-
-
- Public-Key Records
- Ingela Anderton Andin
-
-
-
-
- 2008-02-06
- A
- public_key_records.xml
-
-
- This chapter briefly describes Erlang records derived from ASN.1
- specifications used to handle public key infrastructure.
- The scope is to describe the data types of each component,
- not the semantics. For information on the
- semantics, refer to the relevant standards and RFCs linked in the sections below.
-
- Use the following include directive to get access to the
- records and constant macros described in the following sections:
-
- -include_lib("public_key/include/public_key.hrl").
-
-
- Data Types
-
- Common non-standard Erlang
- data types used to describe the record fields in the
- following sections and which are not defined in the Public Key Reference Manual
- follows here:
-
-
- time()
- = uct_time() | general_time()
-
- uct_time()
- = {utcTime, "YYMMDDHHMMSSZ"}
-
- general_time()
- = {generalTime, "YYYYMMDDHHMMSSZ"}
-
- general_name()
- - =
{rfc822Name, string()}
- | {dNSName, string()}
- | {x400Address, string()}
- | {directoryName, {rdnSequence, [#AttributeTypeAndValue'{}]}}
- | {eidPartyName, special_string()}
- | {eidPartyName, special_string(), special_string()}
- | {uniformResourceIdentifier, string()}
- | {ipAddress, string()}
- | {registeredId, oid()}
- | {otherName, term()}
-
-
- special_string()
- - =
{teletexString, string()}
- | {printableString, string()}
- | {universalString, string()}
- | {utf8String, binary()}
- | {bmpString, string()}
-
-
- dist_reason()
- - =
unused
- | keyCompromise
- | cACompromise
- | affiliationChanged
- | superseded
- | cessationOfOperation
- | certificateHold
- | privilegeWithdrawn
- | aACompromise
-
-
- OID_macro()
- - =
?OID_name()
-
-
- OID_name()
- - =
atom()
-
-
-
-
-
-
-
- RSA
- Erlang representation of
- Rivest-Shamir-Adleman cryptosystem (RSA) keys follows:
-
-
-#'RSAPublicKey'{
- modulus, % integer()
- publicExponent % integer()
- }.
-
-#'RSAPrivateKey'{
- version, % two-prime | multi
- modulus, % integer()
- publicExponent, % integer()
- privateExponent, % integer()
- prime1, % integer()
- prime2, % integer()
- exponent1, % integer()
- exponent2, % integer()
- coefficient, % integer()
- otherPrimeInfos % [#OtherPrimeInfo{}] | asn1_NOVALUE
- }.
-
-#'OtherPrimeInfo'{
- prime, % integer()
- exponent, % integer()
- coefficient % integer()
- }.
-
-
-
-
- DSA
- Erlang representation of Digigital Signature Algorithm (DSA) keys
-
-#'DSAPrivateKey',{
- version, % integer()
- p, % integer()
- q, % integer()
- g, % integer()
- y, % integer()
- x % integer()
- }.
-
-#'Dss-Parms',{
- p, % integer()
- q, % integer()
- g % integer()
- }.
-
-
-
-
- ECDSA
- Erlang representation of Elliptic Curve Digital Signature Algorithm (ECDSA) keys follows:
-
-
-#'ECPrivateKey'{
- version, % integer()
- privateKey, % binary()
- parameters, % der_encoded() - {'EcpkParameters', #'ECParameters'{}} |
- {'EcpkParameters', {namedCurve, oid()}} |
- {'EcpkParameters', 'NULL'} % Inherited by CA
- publicKey % bitstring()
- }.
-
-#'ECParameters'{
- version, % integer()
- fieldID, % #'FieldID'{}
- curve, % #'Curve'{}
- base, % binary()
- order, % integer()
- cofactor % integer()
- }.
-
-#'Curve'{
- a, % binary()
- b, % binary()
- seed % bitstring() - optional
-
- }.
-
-#'FieldID'{
- fieldType, % oid()
- parameters % Depending on fieldType
- }.
-
-#'ECPoint'{
- point % binary() - the public key
- }.
-
-
-
- PKIX Certificates
- Erlang representation of PKIX certificates derived from ASN.1
- specifications see also X509 certificates (RFC 5280) , also referred to as plain type, are as follows:
-
-#'Certificate'{
- tbsCertificate, % #'TBSCertificate'{}
- signatureAlgorithm, % #'AlgorithmIdentifier'{}
- signature % bitstring()
- }.
-
-#'TBSCertificate'{
- version, % v1 | v2 | v3
- serialNumber, % integer()
- signature, % #'AlgorithmIdentifier'{}
- issuer, % {rdnSequence, [#AttributeTypeAndValue'{}]}
- validity, % #'Validity'{}
- subject, % {rdnSequence, [#AttributeTypeAndValue'{}]}
- subjectPublicKeyInfo, % #'SubjectPublicKeyInfo'{}
- issuerUniqueID, % binary() | asn1_novalue
- subjectUniqueID, % binary() | asn1_novalue
- extensions % [#'Extension'{}]
- }.
-
-#'AlgorithmIdentifier'{
- algorithm, % oid()
- parameters % der_encoded()
- }.
-
-Erlang alternate representation of PKIX certificate, also referred to as otp type
-
-
-#'OTPCertificate'{
- tbsCertificate, % #'OTPTBSCertificate'{}
- signatureAlgorithm, % #'SignatureAlgorithm'
- signature % bitstring()
- }.
-
-#'OTPTBSCertificate'{
- version, % v1 | v2 | v3
- serialNumber, % integer()
- signature, % #'SignatureAlgorithm'
- issuer, % {rdnSequence, [#AttributeTypeAndValue'{}]}
- validity, % #'Validity'{}
- subject, % {rdnSequence, [#AttributeTypeAndValue'{}]}
- subjectPublicKeyInfo, % #'OTPSubjectPublicKeyInfo'{}
- issuerUniqueID, % binary() | asn1_novalue
- subjectUniqueID, % binary() | asn1_novalue
- extensions % [#'Extension'{}]
- }.
-
-#'SignatureAlgorithm'{
- algorithm, % id_signature_algorithm()
- parameters % asn1_novalue | #'Dss-Parms'{}
- }.
-
-id_signature_algorithm() = OID_macro()
-
-The available OID names are as follows:
-
-
- OID Name |
-
-
- id-dsa-with-sha1 |
-
-
- id-dsaWithSHA1 (ISO or OID to above) |
-
-
- md2WithRSAEncryption |
-
-
- md5WithRSAEncryption |
-
-
- sha1WithRSAEncryption |
-
-
- sha-1WithRSAEncryption (ISO or OID to above) |
-
-
- sha224WithRSAEncryption |
-
-
- sha256WithRSAEncryption |
-
-
- sha512WithRSAEncryption |
-
-
- ecdsa-with-SHA1 |
-
- Signature Algorithm OIDs
-
-
-The data type 'AttributeTypeAndValue' , is represented as
- the following erlang record:
-
-
-#'AttributeTypeAndValue'{
- type, % id_attributes()
- value % term()
- }.
-
-The attribute OID name atoms and their corresponding value types
-are as follows:
-
-
- OID Name |
- Value Type |
-
-
- id-at-name |
- special_string() |
-
-
- id-at-surname |
- special_string() |
-
-
- id-at-givenName |
- special_string() |
-
-
- id-at-initials |
- special_string() |
-
-
- id-at-generationQualifier |
- special_string() |
-
-
- id-at-commonName |
- special_string() |
-
-
- id-at-localityName |
- special_string() |
-
-
- id-at-stateOrProvinceName |
- special_string() |
-
-
- id-at-organizationName |
- special_string() |
-
-
- id-at-title |
- special_string() |
-
-
- id-at-dnQualifier |
- {printableString, string()} |
-
-
- id-at-countryName |
- {printableString, string()} |
-
-
- id-at-serialNumber |
- {printableString, string()} |
-
-
- id-at-pseudonym |
- special_string() |
-
- Attribute OIDs
-
-
-The data types 'Validity' , 'SubjectPublicKeyInfo' , and
-'SubjectPublicKeyInfoAlgorithm' are represented as the following Erlang records:
-
-
-#'Validity'{
- notBefore, % time()
- notAfter % time()
- }.
-
-#'SubjectPublicKeyInfo'{
- algorithm, % #AlgorithmIdentifier{}
- subjectPublicKey % binary()
- }.
-
-#'SubjectPublicKeyInfoAlgorithm'{
- algorithm, % id_public_key_algorithm()
- parameters % public_key_params()
- }.
-
-The public-key algorithm OID name atoms are as follows:
-
-
- OID Name |
-
-
- rsaEncryption |
-
-
- id-dsa |
-
-
- dhpublicnumber |
-
-
- id-keyExchangeAlgorithm |
-
-
- id-ecPublicKey |
-
- Public-Key Algorithm OIDs
-
-
-
-#'Extension'{
- extnID, % id_extensions() | oid()
- critical, % boolean()
- extnValue % der_encoded()
- }.
-
-id_extensions()
- Standard Certificate Extensions ,
- Private Internet Extensions ,
- CRL Extensions and
- CRL Entry Extensions .
-
-
-
-
-
-
- Standard Certificate Extensions
-
- The standard certificate extensions OID name atoms and their
- corresponding value types are as follows:
-
-
-
- OID Name |
- Value Type |
-
-
- id-ce-authorityKeyIdentifier |
- #'AuthorityKeyIdentifier'{} |
-
-
- id-ce-subjectKeyIdentifier |
- oid() |
-
-
- id-ce-keyUsage |
- [key_usage()] |
-
-
- id-ce-privateKeyUsagePeriod |
- #'PrivateKeyUsagePeriod'{} |
-
-
- id-ce-certificatePolicies |
- #'PolicyInformation'{} |
-
-
-
- id-ce-policyMappings |
- #'PolicyMappings_SEQOF'{} |
-
-
-
- id-ce-subjectAltName |
- general_name() |
-
-
-
- id-ce-issuerAltName |
- general_name() |
-
-
-
- id-ce-subjectDirectoryAttributes |
- [#'Attribute'{}] |
-
-
-
- id-ce-basicConstraints |
- #'BasicConstraints'{} |
-
-
- id-ce-nameConstraints |
- #'NameConstraints'{} |
-
-
- id-ce-policyConstraints |
- #'PolicyConstraints'{} |
-
-
- id-ce-extKeyUsage |
- [id_key_purpose()] |
-
-
-
- id-ce-cRLDistributionPoints |
- [#'DistributionPoint'{}] |
-
-
-
- id-ce-inhibitAnyPolicy |
- integer() |
-
-
-
- id-ce-freshestCRL |
- [#'DistributionPoint'{}] |
-
-
-
- Standard Certificate Extensions
-
-
- Here:
-
- key_usage()
- - =
digitalSignature
- | nonRepudiation
- | keyEncipherment
- | dataEncipherment
- | keyAgreement
- | keyCertSign
- | cRLSign
- | encipherOnly
- | decipherOnly
-
-
-
- And for id_key_purpose() :
-
-
-
- OID Name |
-
-
- id-kp-serverAuth |
-
-
- id-kp-clientAuth |
-
-
- id-kp-codeSigning |
-
-
- id-kp-emailProtection |
-
-
- id-kp-timeStamping |
-
-
- id-kp-OCSPSigning |
-
- Key Purpose OIDs
-
-
-
-#'AuthorityKeyIdentifier'{
- keyIdentifier, % oid()
- authorityCertIssuer, % general_name()
- authorityCertSerialNumber % integer()
- }.
-
-#'PrivateKeyUsagePeriod'{
- notBefore, % general_time()
- notAfter % general_time()
- }.
-
-#'PolicyInformation'{
- policyIdentifier, % oid()
- policyQualifiers % [#PolicyQualifierInfo{}]
- }.
-
-#'PolicyQualifierInfo'{
- policyQualifierId, % oid()
- qualifier % string() | #'UserNotice'{}
- }.
-
-#'UserNotice'{
- noticeRef, % #'NoticeReference'{}
- explicitText % string()
- }.
-
-#'NoticeReference'{
- organization, % string()
- noticeNumbers % [integer()]
- }.
-
-#'PolicyMappings_SEQOF'{
- issuerDomainPolicy, % oid()
- subjectDomainPolicy % oid()
- }.
-
-#'Attribute'{
- type, % oid()
- values % [der_encoded()]
- }).
-
-#'BasicConstraints'{
- cA, % boolean()
- pathLenConstraint % integer()
- }).
-
-#'NameConstraints'{
- permittedSubtrees, % [#'GeneralSubtree'{}]
- excludedSubtrees % [#'GeneralSubtree'{}]
- }).
-
-#'GeneralSubtree'{
- base, % general_name()
- minimum, % integer()
- maximum % integer()
- }).
-
-#'PolicyConstraints'{
- requireExplicitPolicy, % integer()
- inhibitPolicyMapping % integer()
- }).
-
-#'DistributionPoint'{
- distributionPoint, % {fullName, [general_name()]} | {nameRelativeToCRLIssuer,
- [#AttributeTypeAndValue{}]}
- reasons, % [dist_reason()]
- cRLIssuer % [general_name()]
- }).
-
-
-
-
-
- Private Internet Extensions
-
- The private internet extensions OID name atoms and their corresponding value
- types are as follows:
-
-
-
- OID Name |
- Value Type |
-
-
- id-pe-authorityInfoAccess |
- [#'AccessDescription'{}] |
-
-
- id-pe-subjectInfoAccess |
- [#'AccessDescription'{}] |
-
- Private Internet Extensions
-
-
-
-#'AccessDescription'{
- accessMethod, % oid()
- accessLocation % general_name()
- }).
-
-
-
-
- CRL and CRL Extensions Profile
-
- Erlang representation of CRL and CRL extensions profile
- derived from ASN.1 specifications and RFC 5280 are as follows:
-
-
-#'CertificateList'{
- tbsCertList, % #'TBSCertList{}
- signatureAlgorithm, % #'AlgorithmIdentifier'{}
- signature % bitstring()
- }).
-
-#'TBSCertList'{
- version, % v2 (if defined)
- signature, % #AlgorithmIdentifier{}
- issuer, % {rdnSequence, [#AttributeTypeAndValue'{}]}
- thisUpdate, % time()
- nextUpdate, % time()
- revokedCertificates, % [#'TBSCertList_revokedCertificates_SEQOF'{}]
- crlExtensions % [#'Extension'{}]
- }).
-
-#'TBSCertList_revokedCertificates_SEQOF'{
- userCertificate, % integer()
- revocationDate, % timer()
- crlEntryExtensions % [#'Extension'{}]
- }).
-
-
-
- CRL Extensions
-
- The CRL extensions OID name atoms and their corresponding value types are as follows:
-
-
-
-
- OID Name |
- Value Type |
-
-
- id-ce-authorityKeyIdentifier |
- #'AuthorityKeyIdentifier{} |
-
-
- id-ce-issuerAltName |
- {rdnSequence, [#AttributeTypeAndValue'{}]} |
-
-
- id-ce-cRLNumber |
- integer() |
-
-
- id-ce-deltaCRLIndicator |
- integer() |
-
-
- id-ce-issuingDistributionPoint |
- #'IssuingDistributionPoint'{} |
-
-
- id-ce-freshestCRL |
- [#'Distributionpoint'{}] |
-
-
- CRL Extensions
-
-
- Here, the data type 'IssuingDistributionPoint' is represented as
- the following Erlang record:
-
-
-#'IssuingDistributionPoint'{
- distributionPoint, % {fullName, [general_name()]} | {nameRelativeToCRLIssuer,
- [#AttributeTypeAndValue'{}]}
- onlyContainsUserCerts, % boolean()
- onlyContainsCACerts, % boolean()
- onlySomeReasons, % [dist_reason()]
- indirectCRL, % boolean()
- onlyContainsAttributeCerts % boolean()
- }).
-
-
-
-
- CRL Entry Extensions
-
- The CRL entry extensions OID name atoms and their corresponding value types are as follows:
-
-
-
- OID Name |
- Value Type |
-
-
- id-ce-cRLReason |
- crl_reason() |
-
-
- id-ce-holdInstructionCode |
- oid() |
-
-
- id-ce-invalidityDate |
- general_time() |
-
-
- id-ce-certificateIssuer |
- general_name() |
-
- CRL Entry Extensions
-
-
-
- Here:
-
- crl_reason()
- - =
unspecified
- | keyCompromise
- | cACompromise
- | affiliationChanged
- | superseded
- | cessationOfOperation
- | certificateHold
- | removeFromCRL
- | privilegeWithdrawn
- | aACompromise
-
-
-
-
-
-
-
- PKCS#10 Certification Request
- Erlang representation of a PKCS#10 certification request
- derived from ASN.1 specifications and RFC 5280 are as follows:
-
-#'CertificationRequest'{
- certificationRequestInfo #'CertificationRequestInfo'{},
- signatureAlgorithm #'CertificationRequest_signatureAlgorithm'{}}.
- signature bitstring()
- }
-
-#'CertificationRequestInfo'{
- version atom(),
- subject {rdnSequence, [#AttributeTypeAndValue'{}]} ,
- subjectPKInfo #'CertificationRequestInfo_subjectPKInfo'{},
- attributes [#'AttributePKCS-10' {}]
- }
-
-#'CertificationRequestInfo_subjectPKInfo'{
- algorithm #'CertificationRequestInfo_subjectPKInfo_algorithm'{}
- subjectPublicKey bitstring()
- }
-
-#'CertificationRequestInfo_subjectPKInfo_algorithm'{
- algorithm = oid(),
- parameters = der_encoded()
-}
-
-#'CertificationRequest_signatureAlgorithm'{
- algorithm = oid(),
- parameters = der_encoded()
- }
-
-#'AttributePKCS-10'{
- type = oid(),
- values = [der_encoded()]
-}
-
-
-
diff --git a/lib/ssl/doc/src/ssl.xml b/lib/ssl/doc/src/ssl.xml
index cdf6870c25..46dc93e343 100644
--- a/lib/ssl/doc/src/ssl.xml
+++ b/lib/ssl/doc/src/ssl.xml
@@ -268,7 +268,7 @@ atom()}} |
application. It differentiates between the peer
certificate and the CA certificates by using valid_peer or
valid as second argument to the verification fun. See the
- public_key User's
+ public_key User's
Guide for definition of #'OTPCertificate'{} and
#'Extension'{} .
@@ -364,10 +364,10 @@ marker="public_key:public_key#pkix_path_validation-3">public_key:pkix_path_valid
empty argument list. The following arguments may be specified for the internal cache.
{http, timeout()}
- -
+
Enables fetching of CRLs specified as http URIs in X509 cerificate extensions.
- Requires the OTP inets application.
+ marker="public_key:public_key_records"> X509 cerificate extensions.
+ Requires the OTP inets application.
diff --git a/lib/ssl/doc/src/ssl_crl_cache_api.xml b/lib/ssl/doc/src/ssl_crl_cache_api.xml
index 1d9353a2cc..90aa895aff 100644
--- a/lib/ssl/doc/src/ssl_crl_cache_api.xml
+++ b/lib/ssl/doc/src/ssl_crl_cache_api.xml
@@ -50,8 +50,8 @@
cache_ref()
- = opaque()
dist_point()
- - = #'DistributionPoint'{} see
X509 certificates records
+ = #'DistributionPoint'{} see X509 certificates records
--
cgit v1.2.3
From 05efdc8e2db3d7d3d845166424d71e4b061049e5 Mon Sep 17 00:00:00 2001
From: Hans Nilsson
Date: Mon, 11 May 2015 13:33:39 +0200
Subject: eldap: Remove doc man.3 warning
---
lib/eldap/doc/src/eldap.xml | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
(limited to 'lib')
diff --git a/lib/eldap/doc/src/eldap.xml b/lib/eldap/doc/src/eldap.xml
index ed35ee3a9c..a6fad8a857 100644
--- a/lib/eldap/doc/src/eldap.xml
+++ b/lib/eldap/doc/src/eldap.xml
@@ -403,7 +403,11 @@ filter() See present/1, substrings/2,
OptionalAttrs = [Attr]
Attr = {matchingRule,string()} | {type,string()} | {dnAttributes,boolean()}
- Creates an extensible match filter. For example, eldap:extensibleMatch("Bar",[{type,"sn"},{matchingRule,"caseExactMatch"}])) creates a filter which performs a caseExactMatch on the attribute sn and matches with the value "Bar" . The default value of dnAttributes is false .
+ Creates an extensible match filter. For example,
+
+ eldap:extensibleMatch("Bar", [{type,"sn"}, {matchingRule,"caseExactMatch"}]))
+
+ creates a filter which performs a caseExactMatch on the attribute sn and matches with the value "Bar" . The default value of dnAttributes is false .
'and'([Filter]) -> filter()
--
cgit v1.2.3
From f630482b4e54b53b78434c6bfc11591ddfdcfbe7 Mon Sep 17 00:00:00 2001
From: Ingela Anderton Andin
Date: Mon, 11 May 2015 16:27:20 +0200
Subject: public_key: Align "=" sign in type declarations to decided policy
---
lib/public_key/doc/src/public_key.xml | 157 +++++++++++++-------------
lib/public_key/doc/src/public_key_records.xml | 32 +++---
2 files changed, 97 insertions(+), 92 deletions(-)
(limited to 'lib')
diff --git a/lib/public_key/doc/src/public_key.xml b/lib/public_key/doc/src/public_key.xml
index 6d220c9b69..883c52393f 100644
--- a/lib/public_key/doc/src/public_key.xml
+++ b/lib/public_key/doc/src/public_key.xml
@@ -87,104 +87,109 @@
oid()
Object identifier, a tuple of integers as generated by the ASN.1 compiler.
- boolean()
- = true | false
-
- string()
- = [bytes()]
-
- der_encoded()
- = binary()
-
- pki_asn1_type()
- - =
'Certificate'
- | 'RSAPrivateKey'
- | 'RSAPublicKey'
- | 'DSAPrivateKey'
- | 'DSAPublicKey'
- | 'DHParameter'
- | 'SubjectPublicKeyInfo'
- | 'PrivateKeyInfo'
- | 'CertificationRequest'
- | 'ECPrivateKey'
- | 'EcpkParameters'
-
- pem_entry ()
- = {pki_asn1_type(), binary(), %% DER or encrypted DER not_encrypted
- | cipher_info()}
+ boolean() =
+ true | false
+
+ string() =
+ [bytes()]
+
+ der_encoded() =
+ binary()
+
+ pki_asn1_type() =
+ -
+
'Certificate'
+ | 'RSAPrivateKey'
+ | 'RSAPublicKey'
+ | 'DSAPrivateKey'
+ | 'DSAPublicKey'
+ | 'DHParameter'
+ | 'SubjectPublicKeyInfo'
+ | 'PrivateKeyInfo'
+ | 'CertificationRequest'
+ | 'ECPrivateKey'
+ | 'EcpkParameters'
+
- cipher_info()
- = {"RC2-CBC" | "DES-CBC" | "DES-EDE3-CBC", crypto:rand_bytes(8)
+ pem_entry () =
+ {pki_asn1_type(), binary(), %% DER or encrypted DER not_encrypted
+ | cipher_info()}
+
+ cipher_info() =
+ {"RC2-CBC" | "DES-CBC" | "DES-EDE3-CBC", crypto:rand_bytes(8)
| {#'PBEParameter{}, digest_type()} | #'PBES2-params'{}}
- public_key()
- = rsa_public_key() | dsa_public_key() | ec_public_key()
-
- private_key()
- = rsa_private_key() | dsa_private_key() | ec_private_key()
+ public_key() =
+ rsa_public_key() | dsa_public_key() | ec_public_key()
+
+ private_key() =
+ rsa_private_key() | dsa_private_key() | ec_private_key()
- rsa_public_key()
- = #'RSAPublicKey'{}
+ rsa_public_key() =
+ #'RSAPublicKey'{}
- rsa_private_key()
- = #'RSAPrivateKey'{}
+ rsa_private_key() =
+ #'RSAPrivateKey'{}
- dsa_public_key()
- = {integer(), #'Dss-Parms'{}}
+ dsa_public_key() =
+ {integer(), #'Dss-Parms'{}}
- dsa_private_key()
- = #'DSAPrivateKey'{}
+ dsa_private_key() =
+ #'DSAPrivateKey'{}
ec_public_key()
= {#'ECPoint'{}, #'EcpkParameters'{} | {namedCurve, oid()}}
- ec_private_key()
- = #'ECPrivateKey'{}
+ ec_private_key() =
+ #'ECPrivateKey'{}
- public_crypt_options()
- = [{rsa_pad, rsa_padding()}]
+ public_crypt_options() =
+ [{rsa_pad, rsa_padding()}]
- rsa_padding()
- = 'rsa_pkcs1_padding'
- | 'rsa_pkcs1_oaep_padding'
- | 'rsa_no_padding'
+ rsa_padding() =
+ -
+
'rsa_pkcs1_padding'
+ | 'rsa_pkcs1_oaep_padding'
+ | 'rsa_no_padding'
- digest_type()
+ digest_type() =
Union of rsa_digest_type() , dss_digest_type() ,
and ecdsa_digest_type() .
- rsa_digest_type()
- = 'md5' | 'sha' | 'sha224' | 'sha256' | 'sha384' | 'sha512'
-
- dss_digest_type()
- = 'sha'
-
- ecdsa_digest_type()
- = 'sha'| 'sha224' | 'sha256' | 'sha384' | 'sha512'
-
- crl_reason()
- = unspecified
- | keyCompromise
- | cACompromise
- | affiliationChanged
- | superseded
- | cessationOfOperation
- | certificateHold
- | privilegeWithdrawn
- | aACompromise
-
+ rsa_digest_type() =
+ 'md5' | 'sha' | 'sha224' | 'sha256' | 'sha384' | 'sha512'
+
+ dss_digest_type() =
+ 'sha'
- issuer_name()
- = {rdnSequence,[#'AttributeTypeAndValue'{}]}
+ ecdsa_digest_type() =
+ 'sha'| 'sha224' | 'sha256' | 'sha384' | 'sha512'
+
+ crl_reason() =
+ -
+
unspecified
+ | keyCompromise
+ | cACompromise
+ | affiliationChanged
+ | superseded
+ | cessationOfOperation
+ | certificateHold
+ | privilegeWithdrawn
+ | aACompromise
- ssh_file()
- = openssh_public_key
- | rfc4716_public_key
- | known_hosts
- | auth_keys
+ issuer_name() =
+ {rdnSequence,[#'AttributeTypeAndValue'{}]}
+
+
+ ssh_file() =
+ -
+
openssh_public_key
+ | rfc4716_public_key
+ | known_hosts
+ | auth_keys
diff --git a/lib/public_key/doc/src/public_key_records.xml b/lib/public_key/doc/src/public_key_records.xml
index 9536167839..fc2a74a353 100644
--- a/lib/public_key/doc/src/public_key_records.xml
+++ b/lib/public_key/doc/src/public_key_records.xml
@@ -55,17 +55,17 @@
follows here:
- time()
- = uct_time() | general_time()
+ time() =
+ uct_time() | general_time()
- uct_time()
- = {utcTime, "YYMMDDHHMMSSZ"}
+ uct_time() =
+ {utcTime, "YYMMDDHHMMSSZ"}
- general_time()
- = {generalTime, "YYYYMMDDHHMMSSZ"}
+ general_time() =
+ {generalTime, "YYYYMMDDHHMMSSZ"}
- general_name()
- - =
{rfc822Name, string()}
+ general_name() =
+ {rfc822Name, string()}
| {dNSName, string()}
| {x400Address, string()}
| {directoryName, {rdnSequence, [#AttributeTypeAndValue'{}]}}
@@ -77,16 +77,16 @@
| {otherName, term()}
- special_string()
- - =
{teletexString, string()}
+ special_string() =
+ {teletexString, string()}
| {printableString, string()}
| {universalString, string()}
| {utf8String, binary()}
| {bmpString, string()}
- dist_reason()
- - =
unused
+ dist_reason() =
+ unused
| keyCompromise
| cACompromise
| affiliationChanged
@@ -97,12 +97,12 @@
| aACompromise
- OID_macro()
- - =
?OID_name()
+ OID_macro() =
+ ?OID_name()
- OID_name()
- - =
atom()
+ OID_name() =
+ atom()
--
cgit v1.2.3
From be5abeec807ab642881898033a3d23503ec91ce3 Mon Sep 17 00:00:00 2001
From: Ingela Anderton Andin
Date: Mon, 11 May 2015 16:54:05 +0200
Subject: ssl: Align "=" sign in type declarations to decided policy
---
lib/ssl/doc/src/ssl.xml | 124 ++++++++++++++++++++++++------------------------
1 file changed, 63 insertions(+), 61 deletions(-)
(limited to 'lib')
diff --git a/lib/ssl/doc/src/ssl.xml b/lib/ssl/doc/src/ssl.xml
index 46dc93e343..c4651d051c 100644
--- a/lib/ssl/doc/src/ssl.xml
+++ b/lib/ssl/doc/src/ssl.xml
@@ -67,15 +67,15 @@
- boolean()
- = true | false
+ boolean() =
+ true | false
- option()
- = socketoption() | ssloption() | transportoption()
+ option() =
+ socketoption() | ssloption() | transportoption()
- socketoption()
- = proplists:property()
+ socketoption() =
+ proplists:property()
The default socket options are
[{mode,list},{packet, 0},{header, 0},{active, true}] .
For valid options, see the
@@ -83,32 +83,34 @@
gen_tcp(3) manual pages
in Kernel.
- ssloption()
- = {verify, verify_type()}
- | {verify_fun, {fun(), term()}}
- | {fail_if_no_peer_cert, boolean()} {depth, integer()}
- | {cert, public_key:der_encoded()}
- | {certfile, path()}
- | {key, {'RSAPrivateKey'| 'DSAPrivateKey' | 'ECPrivateKey'
- | 'PrivateKeyInfo', public_key:der_encoded()}}
- | {keyfile, path()}
- | {password, string()}
- | {cacerts, [public_key:der_encoded()]}
- | {cacertfile, path()}
- | {dh, public_key:der_encoded()}
- | {dhfile, path()}
- | {ciphers, ciphers()}
- | {user_lookup_fun, {fun(), term()}}, {psk_identity, string()},
- {srp_identity, {string(), string()}}
- | {reuse_sessions, boolean()}
- | {reuse_session, fun()} {next_protocols_advertised, [binary()]}
- | {client_preferred_next_protocols, {client | server,
- [binary()]} | {client | server, [binary()], binary()}}
- | {log_alert, boolean()}
- | {server_name_indication, hostname() | disable}
-
- transportoption()
- = {cb_info, {CallbackModule::atom(), DataTag::atom(),
+ ssloption() =
+ -
+
{verify, verify_type()}
+ | {verify_fun, {fun(), term()}}
+ | {fail_if_no_peer_cert, boolean()} {depth, integer()}
+ | {cert, public_key:der_encoded()}
+ | {certfile, path()}
+ | {key, {'RSAPrivateKey'| 'DSAPrivateKey' | 'ECPrivateKey'
+ | 'PrivateKeyInfo', public_key:der_encoded()}}
+ | {keyfile, path()}
+ | {password, string()}
+ | {cacerts, [public_key:der_encoded()]}
+ | {cacertfile, path()}
+ | {dh, public_key:der_encoded()}
+ | {dhfile, path()}
+ | {ciphers, ciphers()}
+ | {user_lookup_fun, {fun(), term()}}, {psk_identity, string()},
+ {srp_identity, {string(), string()}}
+ | {reuse_sessions, boolean()}
+ | {reuse_session, fun()} {next_protocols_advertised, [binary()]}
+ | {client_preferred_next_protocols, {client | server,
+ [binary()]} | {client | server, [binary()], binary()}}
+ | {log_alert, boolean()}
+ | {server_name_indication, hostname() | disable}
+
+
+ transportoption() =
+ {cb_info, {CallbackModule::atom(), DataTag::atom(),
ClosedTag::atom(), ErrTag:atom()}}
Defaults to {gen_tcp, tcp, tcp_closed, tcp_error} . Can be used
to customize the transport layer. The callback module must implement a
@@ -129,57 +131,57 @@
- verify_type()
- = verify_none | verify_peer
+ verify_type() =
+ verify_none | verify_peer
- path()
- = string()
+ path() =
+ string()
Represents a file path.
- public_key:der_encoded()
- = binary()
+ public_key:der_encoded() =
+ binary()
ASN.1 DER-encoded entity as an Erlang binary.
- host()
- = hostname() | ipaddress()
+ host() =
+ hostname() | ipaddress()
- hostname()
- = string()
+ hostname() =
+ string()
- ip_address()
- = {N1,N2,N3,N4} % IPv4 | {K1,K2,K3,K4,K5,K6,K7,K8} % IPv6
+ ip_address() =
+ {N1,N2,N3,N4} % IPv4 | {K1,K2,K3,K4,K5,K6,K7,K8} % IPv6
- sslsocket()
- Opaque to the user.
+ sslsocket() =
+ opaque()
- protocol()
- = sslv3 | tlsv1 | 'tlsv1.1' | 'tlsv1.2'
+ protocol() =
+ sslv3 | tlsv1 | 'tlsv1.1' | 'tlsv1.2'
- ciphers()
+ ciphers() =
= [ciphersuite()] | string()
According to old API.
- ciphersuite()
- = {key_exchange(), cipher(), hash()}
+ ciphersuite() =
+ {key_exchange(), cipher(), hash()}
- key_exchange()
- = rsa | dhe_dss | dhe_rsa | dh_anon | psk | dhe_psk
+ key_exchange()=
+ rsa | dhe_dss | dhe_rsa | dh_anon | psk | dhe_psk
| rsa_psk | srp_anon | srp_dss | srp_rsa | ecdh_anon | ecdh_ecdsa
| ecdhe_ecdsa | ecdh_rsa | ecdhe_rsa
- cipher()
- = rc4_128 | des_cbc | '3des_ede_cbc'
+ cipher() =
+ rc4_128 | des_cbc | '3des_ede_cbc'
| aes_128_cbc | aes_256_cbc | aes_128_gcm | aes_256_gcm
- hash()
- = md5 | sha
+ hash() =
+ md5 | sha
- prf_random()
- = client_random | server_random
+ prf_random() =
+ client_random | server_random
- srp_param_type()
- = srp_1024 | srp_1536 | srp_2048 | srp_3072
+ srp_param_type() =
+ srp_1024 | srp_1536 | srp_2048 | srp_3072
| srp_4096 | srp_6144 | srp_8192
--
cgit v1.2.3
From 878bd624d65515b68106bbed23a1bb9c09688034 Mon Sep 17 00:00:00 2001
From: Sverker Eriksson
Date: Mon, 11 May 2015 18:00:28 +0200
Subject: crypto: Fix bug in generate_key(ecdh,...)
that could cause VM crash on faulty input.
---
lib/crypto/c_src/crypto.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'lib')
diff --git a/lib/crypto/c_src/crypto.c b/lib/crypto/c_src/crypto.c
index 22c430bcd3..adacdcbc73 100644
--- a/lib/crypto/c_src/crypto.c
+++ b/lib/crypto/c_src/crypto.c
@@ -3749,7 +3749,7 @@ out:
static ERL_NIF_TERM ec_key_generate(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{
#if defined(HAVE_EC)
- EC_KEY *key;
+ EC_KEY *key = NULL;
const EC_GROUP *group;
const EC_POINT *public_key;
ERL_NIF_TERM priv_key;
--
cgit v1.2.3
From c93009b92f05ee65cf88ad7d9a40d60ffa9a99dd Mon Sep 17 00:00:00 2001
From: Peter Andersson
Date: Mon, 11 May 2015 23:33:52 +0200
Subject: Update webtool version
---
lib/webtool/vsn.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'lib')
diff --git a/lib/webtool/vsn.mk b/lib/webtool/vsn.mk
index a79c273d9f..4a701ae6e0 100644
--- a/lib/webtool/vsn.mk
+++ b/lib/webtool/vsn.mk
@@ -1 +1 @@
-WEBTOOL_VSN=0.8.10
+WEBTOOL_VSN=0.9
--
cgit v1.2.3
From 86e95abae56c8999feccff42321db60f0c0362e3 Mon Sep 17 00:00:00 2001
From: Vlad Dumitrescu
Date: Tue, 12 May 2015 08:20:49 +0200
Subject: Remove extra @param in javadoc
This gives an error when building the docs.
---
lib/jinterface/java_src/com/ericsson/otp/erlang/OtpSelf.java | 3 ---
1 file changed, 3 deletions(-)
(limited to 'lib')
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpSelf.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpSelf.java
index 5b9d13ad81..74afbbcca6 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpSelf.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpSelf.java
@@ -153,9 +153,6 @@ public class OtpSelf extends OtpLocalNode {
* the port number you wish to use for incoming connections.
* Specifying 0 lets the system choose an available port.
*
- * @param transportFactory
- * the transport factory to use when creating connections.
- *
* @exception IOException
* in case of server transport failure
*/
--
cgit v1.2.3
From 4dde4fa2ac753223404a24bdb6a9e7323f04489e Mon Sep 17 00:00:00 2001
From: Ingela Anderton Andin
Date: Fri, 8 May 2015 17:12:26 +0200
Subject: ssh: Fix typo
Option height was misspelled in the code. Fix code but recognize
the mispellt option for backwards compatible reasons.
---
lib/ssh/src/ssh_connection.erl | 18 ++++++++++++++----
lib/ssh/test/ssh_connection_SUITE.erl | 2 +-
2 files changed, 15 insertions(+), 5 deletions(-)
(limited to 'lib')
diff --git a/lib/ssh/src/ssh_connection.erl b/lib/ssh/src/ssh_connection.erl
index 388c080d99..d532d41009 100644
--- a/lib/ssh/src/ssh_connection.erl
+++ b/lib/ssh/src/ssh_connection.erl
@@ -196,15 +196,16 @@ reply_request(_,false, _, _) ->
%%--------------------------------------------------------------------
ptty_alloc(ConnectionHandler, Channel, Options) ->
ptty_alloc(ConnectionHandler, Channel, Options, infinity).
-ptty_alloc(ConnectionHandler, Channel, Options, TimeOut) ->
+ptty_alloc(ConnectionHandler, Channel, Options0, TimeOut) ->
+ Options = backwards_compatible(Options0, []),
{Width, PixWidth} = pty_default_dimensions(width, Options),
- {Hight, PixHight} = pty_default_dimensions(hight, Options),
+ {Height, PixHeight} = pty_default_dimensions(height, Options),
pty_req(ConnectionHandler, Channel,
proplists:get_value(term, Options, os:getenv("TERM", ?DEFAULT_TERMINAL)),
proplists:get_value(width, Options, Width),
- proplists:get_value(hight, Options, Hight),
+ proplists:get_value(height, Options, Height),
proplists:get_value(pixel_widh, Options, PixWidth),
- proplists:get_value(pixel_hight, Options, PixHight),
+ proplists:get_value(pixel_height, Options, PixHeight),
proplists:get_value(pty_opts, Options, []), TimeOut
).
%%--------------------------------------------------------------------
@@ -1339,3 +1340,12 @@ decode_ip(Addr) when is_binary(Addr) ->
{error,_} -> Addr;
{ok,A} -> A
end.
+
+backwards_compatible([], Acc) ->
+ Acc;
+backwards_compatible([{hight, Value} | Rest], Acc) ->
+ backwards_compatible(Rest, [{height, Value} | Acc]);
+backwards_compatible([{pixel_hight, Value} | Rest], Acc) ->
+ backwards_compatible(Rest, [{height, Value} | Acc]);
+backwards_compatible([Value| Rest], Acc) ->
+ backwards_compatible(Rest, [ Value | Acc]).
diff --git a/lib/ssh/test/ssh_connection_SUITE.erl b/lib/ssh/test/ssh_connection_SUITE.erl
index 6fc09876ad..db51f65509 100644
--- a/lib/ssh/test/ssh_connection_SUITE.erl
+++ b/lib/ssh/test/ssh_connection_SUITE.erl
@@ -271,7 +271,7 @@ ptty_alloc(Config) when is_list(Config) ->
{user_interaction, false}]),
{ok, ChannelId} = ssh_connection:session_channel(ConnectionRef, infinity),
success = ssh_connection:ptty_alloc(ConnectionRef, ChannelId,
- [{term, os:getenv("TERM", ?DEFAULT_TERMINAL)}, {width, 70}, {high, 20}]),
+ [{term, os:getenv("TERM", ?DEFAULT_TERMINAL)}, {width, 70}, {height, 20}]),
ssh:close(ConnectionRef).
--
cgit v1.2.3
From e85487d4c50ace315292e8d6ab6f1b0b1cf800ca Mon Sep 17 00:00:00 2001
From: Hans Nilsson
Date: Thu, 7 May 2015 21:03:36 +0200
Subject: ssh: Fix ssh_basic_SUITE.erl to work on Windows hosts
The test cases
id_string_no_opt_client
id_string_own_string_client
id_string_random_client
didn't work on MS Windows. This commit adds {packet,line} to get the
whole version exchange line in one packet on all architectures. It
also adds timeouts to speed up failures in those test cases.
---
lib/ssh/test/ssh_basic_SUITE.erl | 31 +++++++++++++++++++------------
1 file changed, 19 insertions(+), 12 deletions(-)
(limited to 'lib')
diff --git a/lib/ssh/test/ssh_basic_SUITE.erl b/lib/ssh/test/ssh_basic_SUITE.erl
index bd029ad420..d55d09f2a2 100644
--- a/lib/ssh/test/ssh_basic_SUITE.erl
+++ b/lib/ssh/test/ssh_basic_SUITE.erl
@@ -823,56 +823,62 @@ ssh_daemon_minimal_remote_max_packet_size_option(Config) ->
%%--------------------------------------------------------------------
id_string_no_opt_client(Config) ->
- {Server, Host, Port} = fake_daemon(Config),
- {error,_} = ssh:connect(Host, Port, []),
+ {Server, _Host, Port} = fake_daemon(Config),
+ {error,_} = ssh:connect("localhost", Port, [], 1000),
receive
{id,Server,"SSH-2.0-Erlang/"++Vsn} ->
true = expected_ssh_vsn(Vsn);
{id,Server,Other} ->
ct:fail("Unexpected id: ~s.",[Other])
+ after 5000 ->
+ {fail,timeout}
end.
%%--------------------------------------------------------------------
id_string_own_string_client(Config) ->
- {Server, Host, Port} = fake_daemon(Config),
- {error,_} = ssh:connect(Host, Port, [{id_string,"Pelle"}]),
+ {Server, _Host, Port} = fake_daemon(Config),
+ {error,_} = ssh:connect("localhost", Port, [{id_string,"Pelle"}], 1000),
receive
{id,Server,"SSH-2.0-Pelle\r\n"} ->
ok;
{id,Server,Other} ->
ct:fail("Unexpected id: ~s.",[Other])
+ after 5000 ->
+ {fail,timeout}
end.
%%--------------------------------------------------------------------
id_string_random_client(Config) ->
- {Server, Host, Port} = fake_daemon(Config),
- {error,_} = ssh:connect(Host, Port, [{id_string,random}]),
+ {Server, _Host, Port} = fake_daemon(Config),
+ {error,_} = ssh:connect("localhost", Port, [{id_string,random}], 1000),
receive
{id,Server,Id="SSH-2.0-Erlang"++_} ->
ct:fail("Unexpected id: ~s.",[Id]);
{id,Server,Rnd="SSH-2.0-"++_} ->
- ct:log("Got ~s.",[Rnd]);
+ ct:log("Got correct ~s",[Rnd]);
{id,Server,Id} ->
ct:fail("Unexpected id: ~s.",[Id])
+ after 5000 ->
+ {fail,timeout}
end.
%%--------------------------------------------------------------------
id_string_no_opt_server(Config) ->
{_Server, Host, Port} = std_daemon(Config, []),
- {ok,S1}=gen_tcp:connect(Host,Port,[{active,false}]),
+ {ok,S1}=gen_tcp:connect(Host,Port,[{active,false},{packet,line}]),
{ok,"SSH-2.0-Erlang/"++Vsn} = gen_tcp:recv(S1, 0, 2000),
true = expected_ssh_vsn(Vsn).
%%--------------------------------------------------------------------
id_string_own_string_server(Config) ->
{_Server, Host, Port} = std_daemon(Config, [{id_string,"Olle"}]),
- {ok,S1}=gen_tcp:connect(Host,Port,[{active,false}]),
+ {ok,S1}=gen_tcp:connect(Host,Port,[{active,false},{packet,line}]),
{ok,"SSH-2.0-Olle\r\n"} = gen_tcp:recv(S1, 0, 2000).
%%--------------------------------------------------------------------
id_string_random_server(Config) ->
{_Server, Host, Port} = std_daemon(Config, [{id_string,random}]),
- {ok,S1}=gen_tcp:connect(Host,Port,[{active,false}]),
+ {ok,S1}=gen_tcp:connect(Host,Port,[{active,false},{packet,line}]),
{ok,"SSH-2.0-"++Rnd} = gen_tcp:recv(S1, 0, 2000),
case Rnd of
"Erlang"++_ -> ct:log("Id=~p",[Rnd]),
@@ -1183,13 +1189,14 @@ expected_ssh_vsn(Str) ->
_:_ -> true %% ssh not started so we dont't know
end.
-
+
fake_daemon(_Config) ->
Parent = self(),
%% start the server
Server = spawn(fun() ->
- {ok,Sl} = gen_tcp:listen(0,[]),
+ {ok,Sl} = gen_tcp:listen(0,[{packet,line}]),
{ok,{Host,Port}} = inet:sockname(Sl),
+ ct:log("fake_daemon listening on ~p:~p~n",[Host,Port]),
Parent ! {sockname,self(),Host,Port},
Rsa = gen_tcp:accept(Sl),
ct:log("Server gen_tcp:accept got ~p",[Rsa]),
--
cgit v1.2.3
From 6e24ffab6c682383a1c284fc066e59c680c4c62e Mon Sep 17 00:00:00 2001
From: Richard Carlsson
Date: Mon, 20 Apr 2015 09:51:49 +0200
Subject: Add uptime() shell command
---
lib/stdlib/doc/src/c.xml | 8 ++++++++
lib/stdlib/src/c.erl | 23 ++++++++++++++++++++++-
lib/stdlib/src/shell_default.erl | 3 ++-
3 files changed, 32 insertions(+), 2 deletions(-)
(limited to 'lib')
diff --git a/lib/stdlib/doc/src/c.xml b/lib/stdlib/doc/src/c.xml
index b49fa6ad67..b43d4786ae 100644
--- a/lib/stdlib/doc/src/c.xml
+++ b/lib/stdlib/doc/src/c.xml
@@ -231,6 +231,14 @@ compile:file(File , Options ++ [report_errors, report_w
in the network.
+
+
+ Print node uptime
+
+ Prints the node uptime (as given by
+ erlang:statistics(wall_clock) ), in human-readable form.
+
+
xm(ModSpec) -> void()
Cross reference check a module
diff --git a/lib/stdlib/src/c.erl b/lib/stdlib/src/c.erl
index 9860adf04d..d5b24d3c32 100644
--- a/lib/stdlib/src/c.erl
+++ b/lib/stdlib/src/c.erl
@@ -27,7 +27,7 @@
lc_batch/0, lc_batch/1,
i/3,pid/3,m/0,m/1,
bt/1, q/0,
- erlangrc/0,erlangrc/1,bi/1, flush/0, regs/0,
+ erlangrc/0,erlangrc/1,bi/1, flush/0, regs/0, uptime/0,
nregs/0,pwd/0,ls/0,ls/1,cd/1,memory/1,memory/0, xm/1]).
-export([display_info/1]).
@@ -65,6 +65,7 @@ help() ->
"q() -- quit - shorthand for init:stop()\n"
"regs() -- information about registered processes\n"
"nregs() -- information about all registered processes\n"
+ "uptime() -- print node uptime\n"
"xm(M) -- cross reference check a module\n"
"y(File) -- generate a Yecc parser\n">>).
@@ -773,6 +774,26 @@ memory() -> erlang:memory().
memory(TypeSpec) -> erlang:memory(TypeSpec).
+%%
+%% uptime/0
+%%
+
+-spec uptime() -> 'ok'.
+
+uptime() ->
+ io:format("~s~n", [uptime(get_uptime())]).
+
+uptime({D, {H, M, S}}) ->
+ lists:flatten(
+ [[ io_lib:format("~p days, ", [D]) || D > 0 ],
+ [ io_lib:format("~p hours, ", [H]) || D+H > 0 ],
+ [ io_lib:format("~p minutes and ", [M]) || D+H+M > 0 ],
+ io_lib:format("~p seconds", [S])]).
+
+get_uptime() ->
+ {UpTime, _} = erlang:statistics(wall_clock),
+ calendar:seconds_to_daystime(UpTime div 1000).
+
%%
%% Cross Reference Check
%%
diff --git a/lib/stdlib/src/shell_default.erl b/lib/stdlib/src/shell_default.erl
index 3fe359af0e..0fca7ff8c7 100644
--- a/lib/stdlib/src/shell_default.erl
+++ b/lib/stdlib/src/shell_default.erl
@@ -23,7 +23,7 @@
-module(shell_default).
-export([help/0,lc/1,c/1,c/2,nc/1,nl/1,l/1,i/0,pid/3,i/3,m/0,m/1,
- memory/0,memory/1,
+ memory/0,memory/1,uptime/0,
erlangrc/1,bi/1, regs/0, flush/0,pwd/0,ls/0,ls/1,cd/1,
y/1, y/2,
xm/1, bt/1, q/0,
@@ -92,6 +92,7 @@ pid(X,Y,Z) -> c:pid(X,Y,Z).
pwd() -> c:pwd().
q() -> c:q().
regs() -> c:regs().
+uptime() -> c:uptime().
xm(Mod) -> c:xm(Mod).
y(File) -> c:y(File).
y(File, Opts) -> c:y(File, Opts).
--
cgit v1.2.3
From 66c06dc602594b263225b5481d2abba653a3b5e8 Mon Sep 17 00:00:00 2001
From: Ingela Anderton Andin
Date: Tue, 12 May 2015 11:21:20 +0200
Subject: ssh: Align "=" sign in type declarations to decided policy
---
lib/ssh/doc/src/ssh.xml | 43 +++++++++++++++++-----------------
lib/ssh/doc/src/ssh_channel.xml | 32 ++++++++++++-------------
lib/ssh/doc/src/ssh_client_key_api.xml | 20 ++++++++--------
lib/ssh/doc/src/ssh_connection.xml | 42 ++++++++++++++++-----------------
lib/ssh/doc/src/ssh_server_key_api.xml | 24 +++++++++----------
lib/ssh/doc/src/ssh_sftp.xml | 4 ++--
lib/ssh/doc/src/ssh_sftpd.xml | 16 ++++++-------
7 files changed, 90 insertions(+), 91 deletions(-)
(limited to 'lib')
diff --git a/lib/ssh/doc/src/ssh.xml b/lib/ssh/doc/src/ssh.xml
index d49d3ac2a7..7cca84432e 100644
--- a/lib/ssh/doc/src/ssh.xml
+++ b/lib/ssh/doc/src/ssh.xml
@@ -57,29 +57,28 @@
this module, or abstractions to indicate the intended use of the data
type, or both:
- boolean()
- = true | false
- string()
- = [byte()]
- ssh_daemon_ref()
- Opaque to the user,
- returned by ssh:daemon/[1,2,3]
- ssh_connection_ref()
- Opaque to the user,
- returned by ssh:connect/3
- ip_address()
+ boolean() =
+ true | false
+ string() =
+ [byte()]
+ ssh_daemon_ref() =
+ opaque() -
+ as returned by ssh:daemon/[1,2,3]
+ ssh_connection_ref() =
+ opaque() - as returned by ssh:connect/3
+ ip_address() =
inet::ip_address
- subsystem_spec()
- = {subsystem_name(),
- {channel_callback(), channel_init_args()}}
- subsystem_name()
- = string()
- channel_callback()
- = atom() - Name of the Erlang module
- implementing the subsystem using the ssh_channel behavior, see
- ssh_channel(3)
- channel_init_args()
- = list()
+ subsystem_spec() =
+ {subsystem_name(),
+ {channel_callback(), channel_init_args()}}
+ subsystem_name() =
+ string()
+ channel_callback() =
+ atom() - Name of the Erlang module
+ implementing the subsystem using the ssh_channel behavior, see
+ ssh_channel(3)
+ channel_init_args() =
+ list()
diff --git a/lib/ssh/doc/src/ssh_channel.xml b/lib/ssh/doc/src/ssh_channel.xml
index b8a03c350a..2fdecf9072 100644
--- a/lib/ssh/doc/src/ssh_channel.xml
+++ b/lib/ssh/doc/src/ssh_channel.xml
@@ -62,22 +62,22 @@
type, or both:
- boolean()
- = true | false
- string()
- = list of ASCII characters
- timeout()
- = infinity | integer() in milliseconds
- ssh_connection_ref()
- Opaque to the user, returned by
- ssh:connect/3 or sent to an SSH channel process
- ssh_channel_id()
- = integer()
- ssh_data_type_code()
- = 1 ("stderr") | 0 ("normal") are
- the valid values,
- see RFC 4254
- Section 5.2
+ boolean() =
+ true | false
+ string() =
+ list of ASCII characters
+ timeout() =
+ infinity | integer() in milliseconds
+ ssh_connection_ref() =
+ opaque() -as returned by
+ ssh:connect/3 or sent to an SSH channel process
+ ssh_channel_id() =
+ integer()
+ ssh_data_type_code() =
+ 1 ("stderr") | 0 ("normal") are
+ the valid values,
+ see RFC 4254
+ Section 5.2
diff --git a/lib/ssh/doc/src/ssh_client_key_api.xml b/lib/ssh/doc/src/ssh_client_key_api.xml
index a8dda042c9..9a892d71fd 100644
--- a/lib/ssh/doc/src/ssh_client_key_api.xml
+++ b/lib/ssh/doc/src/ssh_client_key_api.xml
@@ -50,16 +50,16 @@
public_key user's guide:
- boolean()
- = true | false
- string()
- = [byte()]
- public_key()
- = #'RSAPublicKey'{}| {integer(), #'Dss-Parms'{}}| term()
- private_key()
- = #'RSAPrivateKey'{} | #'DSAPrivateKey'{} | term()
- public_key_algorithm()
- = 'ssh-rsa'| 'ssh-dss' | atom()
+ boolean() =
+ true | false
+ string() =
+ [byte()]
+ public_key() =
+ #'RSAPublicKey'{}| {integer(), #'Dss-Parms'{}}| term()
+ private_key() =
+ #'RSAPrivateKey'{} | #'DSAPrivateKey'{} | term()
+ public_key_algorithm() =
+ 'ssh-rsa'| 'ssh-dss' | atom()
diff --git a/lib/ssh/doc/src/ssh_connection.xml b/lib/ssh/doc/src/ssh_connection.xml
index 669a361db9..5422633dc3 100644
--- a/lib/ssh/doc/src/ssh_connection.xml
+++ b/lib/ssh/doc/src/ssh_connection.xml
@@ -56,29 +56,29 @@
type, or both:
- boolean()
- = true | false
- string()
- = list of ASCII characters
- timeout()
- = infinity | integer() in milliseconds
- ssh_connection_ref()
- Opaque to the user, returned by
- ssh:connect/3 or sent to an SSH channel processes
- ssh_channel_id()
- = integer()
- ssh_data_type_code()
- = 1 ("stderr") | 0 ("normal") are
+ boolean() =
+ true | false
+ string() =
+ list of ASCII characters
+ timeout() =
+ infinity | integer() in milliseconds
+ ssh_connection_ref() =
+ opaque() -as returned by
+ ssh:connect/3 or sent to an SSH channel processes
+ ssh_channel_id() =
+ integer()
+ ssh_data_type_code() =
+ 1 ("stderr") | 0 ("normal") are
valid values, see
RFC 4254 Section 5.2.
- ssh_request_status() ssh_request_status()
- = success | failure
- event()
- = {ssh_cm, ssh_connection_ref(), ssh_event_msg()}
- ssh_event_msg()
- = data_events() | status_events() | terminal_events()
- reason()
- = timeout | closed
+ ssh_request_status() =
+ success | failure
+ event() =
+ {ssh_cm, ssh_connection_ref(), ssh_event_msg()}
+ ssh_event_msg() =
+ data_events() | status_events() | terminal_events()
+ reason() =
+ timeout | closed
diff --git a/lib/ssh/doc/src/ssh_server_key_api.xml b/lib/ssh/doc/src/ssh_server_key_api.xml
index 34ce7f7660..73dd90c962 100644
--- a/lib/ssh/doc/src/ssh_server_key_api.xml
+++ b/lib/ssh/doc/src/ssh_server_key_api.xml
@@ -50,20 +50,20 @@
public_key user's guide .
-
- boolean()
- = true | false
- string()
- = [byte()]
- public_key()
- = #'RSAPublicKey'{}| {integer(), #'Dss-Parms'{}}| term()
- private_key()
- = #'RSAPrivateKey'{} | #'DSAPrivateKey'{} | term()
- public_key_algorithm()
- = 'ssh-rsa'| 'ssh-dss' | atom()
+
+ boolean() =
+ true | false
+ string() =
+ [byte()]
+ public_key() =
+ #'RSAPublicKey'{}| {integer(), #'Dss-Parms'{}}| term()
+ private_key() =
+ #'RSAPrivateKey'{} | #'DSAPrivateKey'{} | term()
+ public_key_algorithm() =
+ 'ssh-rsa'| 'ssh-dss' | atom()
-
+
Module:host_key(Algorithm, DaemonOptions) ->
diff --git a/lib/ssh/doc/src/ssh_sftp.xml b/lib/ssh/doc/src/ssh_sftp.xml
index 643130fe6b..fc418bc934 100644
--- a/lib/ssh/doc/src/ssh_sftp.xml
+++ b/lib/ssh/doc/src/ssh_sftp.xml
@@ -43,8 +43,8 @@
- ssh_connection_ref()
- Opaque to the user, returned by ssh:connect/3
+ ssh_connection_ref() =
+ opaque() - as returned by ssh:connect/3
timeout()
= infinity | integer() in milliseconds. Default infinity.
diff --git a/lib/ssh/doc/src/ssh_sftpd.xml b/lib/ssh/doc/src/ssh_sftpd.xml
index bc2660f595..8b2497e6a3 100644
--- a/lib/ssh/doc/src/ssh_sftpd.xml
+++ b/lib/ssh/doc/src/ssh_sftpd.xml
@@ -37,16 +37,16 @@
DATA TYPES
- subsystem_spec()
- = {subsystem_name(), {channel_callback(), channel_init_args()}}
- subsystem_name()
- = "sftp"
- channel_callback()
- = atom() - Name of the Erlang module implementing the subsystem using the
+ subsystem_spec() =
+ {subsystem_name(), {channel_callback(), channel_init_args()}}
+ subsystem_name() =
+ "sftp"
+ channel_callback() =
+ atom() - Name of the Erlang module implementing the subsystem using the
ssh_channel behavior, see the
ssh_channel(3) manual page.
- channel_init_args()
- = list() - The one given as argument to function subsystem_spec/1 .
+ channel_init_args() =
+ list() - The one given as argument to function subsystem_spec/1 .
--
cgit v1.2.3
From 4fe38c4b8b2c8024afb60990e598ff823743fd54 Mon Sep 17 00:00:00 2001
From: Qijiang Fan
Date: Tue, 30 Dec 2014 22:40:28 +0800
Subject: ssl: add SNI server support
---
lib/ssl/src/ssl.erl | 15 +++++++++++++--
lib/ssl/src/ssl_connection.erl | 16 ++++++++++++++--
lib/ssl/src/ssl_connection.hrl | 3 ++-
lib/ssl/src/ssl_internal.hrl | 1 +
lib/ssl/src/tls_connection.erl | 42 +++++++++++++++++++++++++++++++++++++++++-
5 files changed, 71 insertions(+), 6 deletions(-)
(limited to 'lib')
diff --git a/lib/ssl/src/ssl.erl b/lib/ssl/src/ssl.erl
index 6461f64c1c..54cc5e71b6 100644
--- a/lib/ssl/src/ssl.erl
+++ b/lib/ssl/src/ssl.erl
@@ -40,7 +40,7 @@
connection_info/1, versions/0, session_info/1, format_error/1,
renegotiate/1, prf/5, negotiated_protocol/1, negotiated_next_protocol/1]).
%% Misc
--export([random_bytes/1]).
+-export([random_bytes/1, handle_options/2]).
-deprecated({negotiated_next_protocol, 1, next_major_release}).
@@ -671,6 +671,7 @@ handle_options(Opts0) ->
handle_option(client_preferred_next_protocols, Opts, undefined)),
log_alert = handle_option(log_alert, Opts, true),
server_name_indication = handle_option(server_name_indication, Opts, undefined),
+ sni_hosts = handle_option(sni_hosts, Opts, []),
honor_cipher_order = handle_option(honor_cipher_order, Opts, false),
protocol = proplists:get_value(protocol, Opts, tls),
padding_check = proplists:get_value(padding_check, Opts, true),
@@ -687,7 +688,7 @@ handle_options(Opts0) ->
user_lookup_fun, psk_identity, srp_identity, ciphers,
reuse_session, reuse_sessions, ssl_imp,
cb_info, renegotiate_at, secure_renegotiate, hibernate_after,
- erl_dist, alpn_advertised_protocols,
+ erl_dist, alpn_advertised_protocols, sni_hosts,
alpn_preferred_protocols, next_protocols_advertised,
client_preferred_next_protocols, log_alert,
server_name_indication, honor_cipher_order, padding_check, crl_check, crl_cache,
@@ -881,6 +882,10 @@ validate_option(server_name_indication, disable) ->
disable;
validate_option(server_name_indication, undefined) ->
undefined;
+validate_option(sni_hosts, []) ->
+ [];
+validate_option(sni_hosts, [{Hostname, SSLOptions} | Tail]) when is_list(Hostname) ->
+ [{Hostname, validate_options(SSLOptions)} | validate_option(sni_hosts, Tail)];
validate_option(honor_cipher_order, Value) when is_boolean(Value) ->
Value;
validate_option(padding_check, Value) when is_boolean(Value) ->
@@ -896,6 +901,12 @@ validate_option(crl_cache, {Cb, {_Handle, Options}} = Value) when is_atom(Cb) an
validate_option(Opt, Value) ->
throw({error, {options, {Opt, Value}}}).
+
+validate_options([]) ->
+ [];
+validate_options([{Opt, Value} | Tail]) ->
+ [{Opt, validate_option(Opt, Value)} | validate_options(Tail)].
+
validate_npn_ordering(client) ->
ok;
validate_npn_ordering(server) ->
diff --git a/lib/ssl/src/ssl_connection.erl b/lib/ssl/src/ssl_connection.erl
index 4a839872a6..2c0b1b6257 100644
--- a/lib/ssl/src/ssl_connection.erl
+++ b/lib/ssl/src/ssl_connection.erl
@@ -42,7 +42,8 @@
%% User Events
-export([send/2, recv/3, close/1, shutdown/2,
new_user/2, get_opts/2, set_opts/2, info/1, session_info/1,
- peer_certificate/1, renegotiation/1, negotiated_protocol/1, prf/5
+ peer_certificate/1, renegotiation/1, negotiated_protocol/1, prf/5,
+ sni_hostname/1
]).
-export([handle_session/7]).
@@ -160,6 +161,14 @@ send(Pid, Data) ->
recv(Pid, Length, Timeout) ->
sync_send_all_state_event(Pid, {recv, Length, Timeout}).
+%%--------------------------------------------------------------------
+-spec sni_hostname(pid()) -> undefined | string().
+%%
+%% Description: Get the SNI hostname
+%%--------------------------------------------------------------------
+sni_hostname(Pid) when is_pid(Pid) ->
+ sync_send_all_state_event(Pid, sni_hostname).
+
%%--------------------------------------------------------------------
-spec close(pid()) -> ok | {error, reason()}.
%%
@@ -845,7 +854,10 @@ handle_sync_event(session_info, _, StateName,
handle_sync_event(peer_certificate, _, StateName,
#state{session = #session{peer_certificate = Cert}}
= State) ->
- {reply, {ok, Cert}, StateName, State, get_timeout(State)}.
+ {reply, {ok, Cert}, StateName, State, get_timeout(State)};
+handle_sync_event(sni_hostname, _, StateName, #state{sni_hostname = SNIHostname} = State) ->
+ {reply, SNIHostname, StateName, State}.
+
handle_info({ErrorTag, Socket, econnaborted}, StateName,
#state{socket = Socket, transport_cb = Transport,
diff --git a/lib/ssl/src/ssl_connection.hrl b/lib/ssl/src/ssl_connection.hrl
index e569d706af..d95b51132a 100644
--- a/lib/ssl/src/ssl_connection.hrl
+++ b/lib/ssl/src/ssl_connection.hrl
@@ -80,7 +80,8 @@
expecting_finished = false ::boolean(),
negotiated_protocol = undefined :: undefined | binary(),
client_ecc, % {Curves, PointFmt}
- tracker :: pid() %% Tracker process for listen socket
+ tracker :: pid(), %% Tracker process for listen socket
+ sni_hostname = undefined
}).
-define(DEFAULT_DIFFIE_HELLMAN_PARAMS,
diff --git a/lib/ssl/src/ssl_internal.hrl b/lib/ssl/src/ssl_internal.hrl
index 90f8b8a412..e285f48202 100644
--- a/lib/ssl/src/ssl_internal.hrl
+++ b/lib/ssl/src/ssl_internal.hrl
@@ -122,6 +122,7 @@
next_protocol_selector = undefined, %% fun([binary()]) -> binary())
log_alert :: boolean(),
server_name_indication = undefined,
+ sni_hosts :: [{inet:hostname(), [tuple()]}],
%% Should the server prefer its own cipher order over the one provided by
%% the client?
honor_cipher_order = false :: boolean(),
diff --git a/lib/ssl/src/tls_connection.erl b/lib/ssl/src/tls_connection.erl
index 0577222980..d804d7ad37 100644
--- a/lib/ssl/src/tls_connection.erl
+++ b/lib/ssl/src/tls_connection.erl
@@ -398,6 +398,15 @@ initial_state(Role, Host, Port, Socket, {SSLOptions, SocketOptions, Tracker}, Us
tracker = Tracker
}.
+
+update_ssl_options_from_sni(OrigSSLOptions, SNIHostname) ->
+ case proplists:get_value(SNIHostname, OrigSSLOptions#ssl_options.sni_hosts) of
+ undefined ->
+ undefined;
+ SSLOption ->
+ ssl:handle_options(SSLOption, OrigSSLOptions)
+ end.
+
next_state(Current,_, #alert{} = Alert, #state{negotiated_version = Version} = State) ->
handle_own_alert(Alert, Version, Current, State);
@@ -439,7 +448,38 @@ next_state(Current, Next, #ssl_tls{type = ?HANDSHAKE, fragment = Data},
end,
try
{Packets, Buf} = tls_handshake:get_tls_handshake(Version,Data,Buf0),
- State = State0#state{protocol_buffers =
+ State1 = case Packets of
+ [{#client_hello{extensions=HelloExtensions} = ClientHello, _}] ->
+ case HelloExtensions#hello_extensions.sni of
+ undefined ->
+ State0;
+ #sni{hostname = Hostname} ->
+ OrigSSLOptions = State0#state.ssl_options,
+ NewOptions = update_ssl_options_from_sni(State0#state.ssl_options, Hostname),
+ case NewOptions of
+ undefined ->
+ State0;
+ _ ->
+ {ok, Ref, CertDbHandle, FileRefHandle, CacheHandle, CRLDbHandle, OwnCert, Key, DHParams} =
+ ssl_config:init(NewOptions, State0#state.role),
+ State0#state{
+ session = State0#state.session#session{own_certificate = OwnCert},
+ file_ref_db = FileRefHandle,
+ cert_db_ref = Ref,
+ cert_db = CertDbHandle,
+ crl_db = CRLDbHandle,
+ session_cache = CacheHandle,
+ private_key = Key,
+ diffie_hellman_params = DHParams,
+ ssl_options = NewOptions,
+ sni_hostname = Hostname
+ }
+ end
+ end;
+ _ ->
+ State0
+ end,
+ State = State1#state{protocol_buffers =
Buffers#protocol_buffers{tls_packets = Packets,
tls_handshake_buffer = Buf}},
handle_tls_handshake(Handle, Next, State)
--
cgit v1.2.3
From 1e2569973101aaccdbb0c552948134cb1a58a7fd Mon Sep 17 00:00:00 2001
From: Qijiang Fan
Date: Tue, 30 Dec 2014 22:51:33 +0800
Subject: ssl: deny recursively defined sni_hosts
---
lib/ssl/src/ssl.erl | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
(limited to 'lib')
diff --git a/lib/ssl/src/ssl.erl b/lib/ssl/src/ssl.erl
index 54cc5e71b6..cebfb9e5ce 100644
--- a/lib/ssl/src/ssl.erl
+++ b/lib/ssl/src/ssl.erl
@@ -885,7 +885,13 @@ validate_option(server_name_indication, undefined) ->
validate_option(sni_hosts, []) ->
[];
validate_option(sni_hosts, [{Hostname, SSLOptions} | Tail]) when is_list(Hostname) ->
- [{Hostname, validate_options(SSLOptions)} | validate_option(sni_hosts, Tail)];
+ RecursiveSNIOptions = proplists:get_value(sni_hosts, SSLOptions, undefined),
+ case RecursiveSNIOptions of
+ undefined ->
+ [{Hostname, validate_options(SSLOptions)} | validate_option(sni_hosts, Tail)];
+ _ ->
+ throw({error, {options, {sni_hosts, RecursiveSNIOptions}}})
+ end;
validate_option(honor_cipher_order, Value) when is_boolean(Value) ->
Value;
validate_option(padding_check, Value) when is_boolean(Value) ->
--
cgit v1.2.3
From 9fe3bc8eb1e982ecd4680d9f354dc6ba3f066904 Mon Sep 17 00:00:00 2001
From: Qijiang Fan
Date: Wed, 28 Jan 2015 15:20:21 +0800
Subject: ssl: add ssl:connection_information/[1,2]
This commit adds a new function, ssl:connection_information/[1,2]
to retrive the connection information from a SSLSocket.
And also, this deprecates a function ssl:connection_info/1, and
reimplements connection_info/1 with the new function.
---
lib/ssl/src/ssl.erl | 38 +++++++++++++++++++++++++++++++++-----
lib/ssl/src/ssl_connection.erl | 29 +++++++----------------------
lib/stdlib/src/otp_internal.erl | 3 +++
3 files changed, 43 insertions(+), 27 deletions(-)
(limited to 'lib')
diff --git a/lib/ssl/src/ssl.erl b/lib/ssl/src/ssl.erl
index cebfb9e5ce..956c699c45 100644
--- a/lib/ssl/src/ssl.erl
+++ b/lib/ssl/src/ssl.erl
@@ -38,11 +38,13 @@
%% SSL/TLS protocol handling
-export([cipher_suites/0, cipher_suites/1, suite_definition/1,
connection_info/1, versions/0, session_info/1, format_error/1,
- renegotiate/1, prf/5, negotiated_protocol/1, negotiated_next_protocol/1]).
+ renegotiate/1, prf/5, negotiated_protocol/1, negotiated_next_protocol/1,
+ connection_information/1, connection_information/2]).
%% Misc
-export([random_bytes/1, handle_options/2]).
-deprecated({negotiated_next_protocol, 1, next_major_release}).
+-deprecated({connection_info, 1, next_major_release}).
-include("ssl_api.hrl").
-include("ssl_internal.hrl").
@@ -286,16 +288,42 @@ controlling_process(#sslsocket{pid = {Listen,
is_pid(NewOwner) ->
Transport:controlling_process(Listen, NewOwner).
+
+%%--------------------------------------------------------------------
+-spec connection_information(#sslsocket{}) -> {ok, list()} | {error, reason()}.
+%%
+%% Description: Return SSL information for the connection
+%%--------------------------------------------------------------------
+connection_information(#sslsocket{pid = Pid}) when is_pid(Pid) -> ssl_connection:connection_information(Pid);
+connection_information(#sslsocket{pid = {Listen, _}}) when is_port(Listen) -> {error, enotconn}.
+
+
+%%--------------------------------------------------------------------
+-spec connection_information(#sslsocket{}, [atom]) -> {ok, list()} | {error, reason()}.
+%%
+%% Description: Return SSL information for the connection
+%%--------------------------------------------------------------------
+connection_information(#sslsocket{} = SSLSocket, Items) ->
+ case connection_information(SSLSocket) of
+ {ok, I} ->
+ {ok, lists:filter(fun({K, _}) -> lists:foldl(fun(K1, Acc) when K1 =:= K -> Acc + 1; (_, Acc) -> Acc end, 0, Items) > 0 end, I)};
+ E ->
+ E
+ end.
+
%%--------------------------------------------------------------------
-spec connection_info(#sslsocket{}) -> {ok, {tls_record:tls_atom_version(), ssl_cipher:erl_cipher_suite()}} |
{error, reason()}.
%%
%% Description: Returns ssl protocol and cipher used for the connection
%%--------------------------------------------------------------------
-connection_info(#sslsocket{pid = Pid}) when is_pid(Pid) ->
- ssl_connection:info(Pid);
-connection_info(#sslsocket{pid = {Listen, _}}) when is_port(Listen) ->
- {error, enotconn}.
+connection_info(#sslsocket{} = SSLSocket) ->
+ case connection_information(SSLSocket) of
+ {ok, Result} ->
+ {ok, {proplists:get_value(protocol, Result), proplists:get_value(cipher_suite, Result)}};
+ Error ->
+ Error
+ end.
%%--------------------------------------------------------------------
-spec peername(#sslsocket{}) -> {ok, {inet:ip_address(), inet:port_number()}} | {error, reason()}.
diff --git a/lib/ssl/src/ssl_connection.erl b/lib/ssl/src/ssl_connection.erl
index 2c0b1b6257..64fa7bab0d 100644
--- a/lib/ssl/src/ssl_connection.erl
+++ b/lib/ssl/src/ssl_connection.erl
@@ -41,9 +41,9 @@
%% User Events
-export([send/2, recv/3, close/1, shutdown/2,
- new_user/2, get_opts/2, set_opts/2, info/1, session_info/1,
+ new_user/2, get_opts/2, set_opts/2, session_info/1,
peer_certificate/1, renegotiation/1, negotiated_protocol/1, prf/5,
- sni_hostname/1
+ connection_information/1
]).
-export([handle_session/7]).
@@ -162,12 +162,12 @@ recv(Pid, Length, Timeout) ->
sync_send_all_state_event(Pid, {recv, Length, Timeout}).
%%--------------------------------------------------------------------
--spec sni_hostname(pid()) -> undefined | string().
+-spec connection_information(pid()) -> {ok, list()} | {error, reason()}.
%%
%% Description: Get the SNI hostname
%%--------------------------------------------------------------------
-sni_hostname(Pid) when is_pid(Pid) ->
- sync_send_all_state_event(Pid, sni_hostname).
+connection_information(Pid) when is_pid(Pid) ->
+ sync_send_all_state_event(Pid, connection_information).
%%--------------------------------------------------------------------
-spec close(pid()) -> ok | {error, reason()}.
@@ -222,14 +222,6 @@ get_opts(ConnectionPid, OptTags) ->
set_opts(ConnectionPid, Options) ->
sync_send_all_state_event(ConnectionPid, {set_opts, Options}).
-%%--------------------------------------------------------------------
--spec info(pid()) -> {ok, {atom(), tuple()}} | {error, reason()}.
-%%
-%% Description: Returns ssl protocol and cipher used for the connection
-%%--------------------------------------------------------------------
-info(ConnectionPid) ->
- sync_send_all_state_event(ConnectionPid, info).
-
%%--------------------------------------------------------------------
-spec session_info(pid()) -> {ok, list()} | {error, reason()}.
%%
@@ -838,13 +830,6 @@ handle_sync_event({prf, Secret, Label, Seed, WantedLength}, _, StateName,
error:Reason -> {error, Reason}
end,
{reply, Reply, StateName, State, get_timeout(State)};
-handle_sync_event(info, _, StateName,
- #state{negotiated_version = Version,
- session = #session{cipher_suite = Suite}} = State) ->
-
- AtomVersion = tls_record:protocol_version(Version),
- {reply, {ok, {AtomVersion, ssl:suite_definition(Suite)}},
- StateName, State, get_timeout(State)};
handle_sync_event(session_info, _, StateName,
#state{session = #session{session_id = Id,
cipher_suite = Suite}} = State) ->
@@ -855,8 +840,8 @@ handle_sync_event(peer_certificate, _, StateName,
#state{session = #session{peer_certificate = Cert}}
= State) ->
{reply, {ok, Cert}, StateName, State, get_timeout(State)};
-handle_sync_event(sni_hostname, _, StateName, #state{sni_hostname = SNIHostname} = State) ->
- {reply, SNIHostname, StateName, State}.
+handle_sync_event(connection_information, _, StateName, #state{sni_hostname = SNIHostname, session = #session{cipher_suite = CipherSuite}, negotiated_version = Version} = State) ->
+ {reply, {ok, [{protocol, tls_record:protocol_version(Version)}, {cipher_suite, ssl:suite_definition(CipherSuite)}, {sni_hostname, SNIHostname}]}, StateName, State, get_timeout(State)}.
handle_info({ErrorTag, Socket, econnaborted}, StateName,
diff --git a/lib/stdlib/src/otp_internal.erl b/lib/stdlib/src/otp_internal.erl
index 24721da187..0340015c35 100644
--- a/lib/stdlib/src/otp_internal.erl
+++ b/lib/stdlib/src/otp_internal.erl
@@ -631,6 +631,9 @@ obsolete_1(erl_lint, modify_line, 2) ->
obsolete_1(ssl, negotiated_next_protocol, 1) ->
{deprecated,{ssl,negotiated_protocol,1}};
+obsolete_1(ssl, connection_info, 1) ->
+ {deprecated, "deprecated; use connection_information/[1,2] instead"};
+
obsolete_1(_, _, _) ->
no.
--
cgit v1.2.3
From 53ae813221c2dee502e2c114e68c2674c96b89cd Mon Sep 17 00:00:00 2001
From: Qijiang Fan
Date: Tue, 30 Dec 2014 22:44:20 +0800
Subject: ssl: docs: SNI server, connection_information/1,2
---
lib/ssl/doc/src/ssl.xml | 47 +++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 45 insertions(+), 2 deletions(-)
(limited to 'lib')
diff --git a/lib/ssl/doc/src/ssl.xml b/lib/ssl/doc/src/ssl.xml
index c4651d051c..77f63dcecf 100644
--- a/lib/ssl/doc/src/ssl.xml
+++ b/lib/ssl/doc/src/ssl.xml
@@ -106,7 +106,8 @@
| {client_preferred_next_protocols, {client | server,
[binary()]} | {client | server, [binary()], binary()}}
| {log_alert, boolean()}
- | {server_name_indication, hostname() | disable}
+ | {server_name_indication, hostname() | disable}
+ | {sni_hosts, [{hostname(), ssloptions()}]}
transportoption() =
@@ -626,7 +627,10 @@ fun(srp, Username :: string(), UserState :: term()) ->
selection. If set to false (the default), use the client
preference.
-
+ {sni_hosts, [{hostname(), ssloptions()}]}
+ If the server receives a SNI (Server Name Indication) from the client
+ matching a host listed in the sni_hosts option, the speicific options for
+ that host will override previously specified options.
@@ -753,6 +757,45 @@ fun(srp, Username :: string(), UserState :: term()) ->
+
+ connection_information(SslSocket) ->
+ {ok, Info} | {error, Reason}
+ Returns all the connection information.
+
+
+ Info = [InfoTuple]
+ InfoTuple = {protocol, Protocol} | {cipher_suite, CipherSuite} | {sni_hostname, SNIHostname}
+ CipherSuite = ciphersuite()
+ ProtocolVersion = protocol()
+ SNIHostname = string()
+ Reason = term()
+
+ Return all the connection information containing negotiated protocol version, cipher suite, and the hostname of SNI extension.
+ Info will be a proplists containing all the connection information on success, otherwise {error, Reason} will be returned.
+
+
+
+
+ connection_information(SslSocket, Items) ->
+ {ok, Info} | {error, Reason}
+ Returns the requested connection information.
+
+
+ Items = [Item]
+ Item = protocol | cipher_suite | sni_hostname
+ Info = [InfoTuple]
+ InfoTuple = {protocol, Protocol} | {cipher_suite, CipherSuite} | {sni_hostname, SNIHostname}
+ CipherSuite = ciphersuite()
+ ProtocolVersion = protocol()
+ SNIHostname = string()
+ Reason = term()
+
+ Returns the connection information you requested. The connection information you can request contains protocol, cipher_suite, and sni_hostname.
+ {ok, Info} will be returned if it executes sucessfully. The Info is a proplists containing the information you requested.
+ Otherwise, {error, Reason} will be returned.
+
+
+
format_error(Reason) -> string()
Returns an error string.
--
cgit v1.2.3
From 181ceb12675b59de9bd7a881fe9b58995d03bac0 Mon Sep 17 00:00:00 2001
From: Qijiang Fan
Date: Sat, 14 Mar 2015 16:58:30 +0800
Subject: ssl: add tests for SNI server support
This commit adds tests for SNI server support in:
* ssl_sni_SUITE.erl
* ssl_to_openssl_SUITE.erl
And some more modifications:
* make_certs also makes two certs for SNI, and adds
extra options for SNI.
---
lib/ssl/test/Makefile | 1 +
lib/ssl/test/make_certs.erl | 2 +-
lib/ssl/test/ssl_sni_SUITE.erl | 136 ++++++++++++++++++++++++++++++++++
lib/ssl/test/ssl_test_lib.erl | 17 ++++-
lib/ssl/test/ssl_to_openssl_SUITE.erl | 93 ++++++++++++++++++++++-
5 files changed, 244 insertions(+), 5 deletions(-)
create mode 100644 lib/ssl/test/ssl_sni_SUITE.erl
(limited to 'lib')
diff --git a/lib/ssl/test/Makefile b/lib/ssl/test/Makefile
index 8c45a788a4..886cc7726b 100644
--- a/lib/ssl/test/Makefile
+++ b/lib/ssl/test/Makefile
@@ -53,6 +53,7 @@ MODULES = \
ssl_to_openssl_SUITE \
ssl_ECC_SUITE \
ssl_upgrade_SUITE\
+ ssl_sni_SUITE \
make_certs\
erl_make_certs
diff --git a/lib/ssl/test/make_certs.erl b/lib/ssl/test/make_certs.erl
index 77631f62d3..4a193d48fe 100644
--- a/lib/ssl/test/make_certs.erl
+++ b/lib/ssl/test/make_certs.erl
@@ -81,7 +81,7 @@ all(DataDir, PrivDir, C = #config{}) ->
create_rnd(DataDir, PrivDir), % For all requests
rootCA(PrivDir, "erlangCA", C),
intermediateCA(PrivDir, "otpCA", "erlangCA", C),
- endusers(PrivDir, "otpCA", ["client", "server", "revoked"], C),
+ endusers(PrivDir, "otpCA", ["client", "server", "revoked", "a.server", "b.server"], C),
endusers(PrivDir, "erlangCA", ["localhost"], C),
%% Create keycert files
SDir = filename:join([PrivDir, "server"]),
diff --git a/lib/ssl/test/ssl_sni_SUITE.erl b/lib/ssl/test/ssl_sni_SUITE.erl
new file mode 100644
index 0000000000..134e508b10
--- /dev/null
+++ b/lib/ssl/test/ssl_sni_SUITE.erl
@@ -0,0 +1,136 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2008-2015. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+%%
+
+-module(ssl_sni_SUITE).
+
+-compile(export_all).
+
+-include_lib("common_test/include/ct.hrl").
+-include_lib("public_key/include/public_key.hrl").
+
+%%--------------------------------------------------------------------
+%% Common Test interface functions -----------------------------------
+%%--------------------------------------------------------------------
+suite() -> [{ct_hooks,[ts_install_cth]}].
+
+all() -> [no_sni_header, sni_match, sni_no_match].
+
+init_per_suite(Config0) ->
+ catch crypto:stop(),
+ try crypto:start() of
+ ok ->
+ ssl:start(),
+ Result =
+ (catch make_certs:all(?config(data_dir, Config0),
+ ?config(priv_dir, Config0))),
+ ct:log("Make certs ~p~n", [Result]),
+ ssl_test_lib:cert_options(Config0)
+ catch _:_ ->
+ {skip, "Crypto did not start"}
+ end.
+
+end_per_suite(_) ->
+ ssl:stop(),
+ application:stop(crypto).
+
+%%--------------------------------------------------------------------
+%% Test Cases --------------------------------------------------------
+%%--------------------------------------------------------------------
+no_sni_header(Config) ->
+ run_handshake(Config, undefined, undefined, "server").
+
+sni_match(Config) ->
+ run_handshake(Config, "a.server", "a.server", "a.server").
+
+sni_no_match(Config) ->
+ run_handshake(Config, "c.server", undefined, "server").
+
+
+
+%%--------------------------------------------------------------------
+%% Internal Functions ------------------------------------------------
+%%--------------------------------------------------------------------
+
+
+ssl_recv(SSLSocket, Expect) ->
+ ssl_recv(SSLSocket, "", Expect).
+
+ssl_recv(SSLSocket, CurrentData, ExpectedData) ->
+ receive
+ {ssl, SSLSocket, Data} ->
+ NeweData = CurrentData ++ Data,
+ case NeweData of
+ ExpectedData ->
+ ok;
+ _ ->
+ ssl_recv(SSLSocket, NeweData, ExpectedData)
+ end;
+ Other ->
+ ct:fail({unexpected_message, Other})
+ after 4000 ->
+ ct:fail({timeout, CurrentData, ExpectedData})
+ end.
+
+
+
+send_and_hostname(SSLSocket) ->
+ ssl:send(SSLSocket, "OK"),
+ {ok, [{sni_hostname, Hostname}]} = ssl:connection_information(SSLSocket, [sni_hostname]),
+ Hostname.
+
+rdnPart([[#'AttributeTypeAndValue'{type=Type, value=Value} | _] | _], Type) -> Value;
+rdnPart([_ | Tail], Type) -> rdnPart(Tail, Type);
+rdnPart([], _) -> unknown.
+
+rdn_to_string({utf8String, Binary}) ->
+ erlang:binary_to_list(Binary);
+rdn_to_string({printableString, String}) ->
+ String.
+
+recv_and_certificate(SSLSocket) ->
+ ssl_recv(SSLSocket, "OK"),
+ {ok, PeerCert} = ssl:peercert(SSLSocket),
+ #'OTPCertificate'{tbsCertificate = #'OTPTBSCertificate'{subject = {rdnSequence, Subject}}} = public_key:pkix_decode_cert(PeerCert, otp),
+ ct:log("Subject of certificate received from server: ~p", [Subject]),
+ rdn_to_string(rdnPart(Subject, ?'id-at-commonName')).
+
+
+run_handshake(Config, SNIHostname, ExpectedSNIHostname, ExpectedCN) ->
+ ct:log("Start running handshake, Config: ~p, SNIHostname: ~p, ExpectedSNIHostname: ~p, ExpectedCN: ~p", [Config, SNIHostname, ExpectedSNIHostname, ExpectedCN]),
+ ServerOptions = ?config(sni_server_opts, Config) ++ ?config(server_opts, Config),
+ ClientOptions =
+ case SNIHostname of
+ undefined ->
+ ?config(client_opts, Config);
+ _ ->
+ [{server_name_indication, SNIHostname}] ++ ?config(client_opts, Config)
+ end,
+ ct:log("Options: ~p", [[ServerOptions, ClientOptions]]),
+ {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
+ Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0},
+ {from, self()}, {mfa, {?MODULE, send_and_hostname, []}},
+ {options, ServerOptions}]),
+ Port = ssl_test_lib:inet_port(Server),
+ Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port},
+ {host, Hostname}, {from, self()},
+ {mfa, {?MODULE, recv_and_certificate, []}},
+ {options, ClientOptions}]),
+ ssl_test_lib:check_result(Server, ExpectedSNIHostname, Client, ExpectedCN).
diff --git a/lib/ssl/test/ssl_test_lib.erl b/lib/ssl/test/ssl_test_lib.erl
index d19e3b7fdb..8b98e6f16b 100644
--- a/lib/ssl/test/ssl_test_lib.erl
+++ b/lib/ssl/test/ssl_test_lib.erl
@@ -354,6 +354,11 @@ cert_options(Config) ->
BadKeyFile = filename:join([?config(priv_dir, Config),
"badkey.pem"]),
PskSharedSecret = <<1,2,3,4,5,6,7,8,9,10,11,12,13,14,15>>,
+
+ SNIServerACertFile = filename:join([?config(priv_dir, Config), "a.server", "cert.pem"]),
+ SNIServerAKeyFile = filename:join([?config(priv_dir, Config), "a.server", "key.pem"]),
+ SNIServerBCertFile = filename:join([?config(priv_dir, Config), "b.server", "cert.pem"]),
+ SNIServerBKeyFile = filename:join([?config(priv_dir, Config), "b.server", "key.pem"]),
[{client_opts, [{ssl_imp, new},{reuseaddr, true}]},
{client_verification_opts, [{cacertfile, ClientCaCertFile},
{certfile, ClientCertFile},
@@ -414,7 +419,17 @@ cert_options(Config) ->
{server_bad_cert, [{ssl_imp, new},{cacertfile, ServerCaCertFile},
{certfile, BadCertFile}, {keyfile, ServerKeyFile}]},
{server_bad_key, [{ssl_imp, new},{cacertfile, ServerCaCertFile},
- {certfile, ServerCertFile}, {keyfile, BadKeyFile}]}
+ {certfile, ServerCertFile}, {keyfile, BadKeyFile}]},
+ {sni_server_opts, [{sni_hosts, [
+ {"a.server", [
+ {certfile, SNIServerACertFile},
+ {keyfile, SNIServerAKeyFile}
+ ]},
+ {"b.server", [
+ {certfile, SNIServerBCertFile},
+ {keyfile, SNIServerBKeyFile}
+ ]}
+ ]}]}
| Config].
diff --git a/lib/ssl/test/ssl_to_openssl_SUITE.erl b/lib/ssl/test/ssl_to_openssl_SUITE.erl
index 94426a3061..3807a9983c 100644
--- a/lib/ssl/test/ssl_to_openssl_SUITE.erl
+++ b/lib/ssl/test/ssl_to_openssl_SUITE.erl
@@ -50,9 +50,9 @@ all() ->
groups() ->
[{basic, [], basic_tests()},
- {'tlsv1.2', [], all_versions_tests() ++ alpn_tests() ++ npn_tests()},
- {'tlsv1.1', [], all_versions_tests() ++ alpn_tests() ++ npn_tests()},
- {'tlsv1', [], all_versions_tests()++ alpn_tests() ++ npn_tests()},
+ {'tlsv1.2', [], all_versions_tests() ++ alpn_tests() ++ npn_tests() ++ sni_server_tests()},
+ {'tlsv1.1', [], all_versions_tests() ++ alpn_tests() ++ npn_tests() ++ sni_server_tests()},
+ {'tlsv1', [], all_versions_tests()++ alpn_tests() ++ npn_tests() ++ sni_server_tests()},
{'sslv3', [], all_versions_tests()}].
basic_tests() ->
@@ -101,6 +101,11 @@ npn_tests() ->
erlang_client_openssl_server_npn_only_client,
erlang_client_openssl_server_npn_only_server].
+sni_server_tests() ->
+ [erlang_server_oepnssl_client_sni_match,
+ erlang_server_openssl_client_sni_no_match,
+ erlang_server_openssl_client_sni_no_header].
+
init_per_suite(Config0) ->
Dog = ct:timetrap(?LONG_TIMEOUT *2),
@@ -222,6 +227,12 @@ special_init(TestCase, Config)
check_openssl_npn_support(Config)
end;
+special_init(TestCase, Config)
+ when TestCase == erlang_server_openssl_client_sni_match;
+ TestCase == erlang_server_openssl_client_sni_no_match;
+ TestCase == erlang_server_openssl_client_sni_no_header ->
+ check_openssl_sni_support(Config);
+
special_init(_, Config) ->
Config.
@@ -1181,6 +1192,16 @@ erlang_server_openssl_client_npn_only_client(Config) when is_list(Config) ->
ssl_test_lib:check_result(Server, ok)
end),
ok.
+%--------------------------------------------------------------------------
+erlang_server_openssl_client_sni_no_header(Config) when is_list(Config) ->
+ erlang_server_openssl_client_sni_test(Config, undefined, undefined, "server").
+
+erlang_server_openssl_client_sni_match(Config) when is_list(Config) ->
+ erlang_server_openssl_client_sni_test(Config, "a.server", "a.server", "a.server").
+
+erlang_server_openssl_client_sni_no_match(Config) when is_list(Config) ->
+ erlang_server_openssl_client_sni_test(Config, "c.server", undefined, "server").
+
%%--------------------------------------------------------------------
%% Internal functions ------------------------------------------------
@@ -1207,6 +1228,64 @@ run_suites(Ciphers, Version, Config, Type) ->
ct:fail(cipher_suite_failed_see_test_case_log)
end.
+client_read_check([], _NewData) -> ok;
+client_read_check([Hd | T], NewData) ->
+ case binary:match(NewData, list_to_binary(Hd)) of
+ nomatch ->
+ nomatch;
+ _ ->
+ client_read_check(T, NewData)
+ end.
+client_read_bulk(Port, DataExpected, DataReceived) ->
+ receive
+ {Port, {data, TheData}} ->
+ Data = list_to_binary(TheData),
+ NewData = <>,
+ ct:log("New Data: ~p", [NewData]),
+ case client_read_check(DataExpected, NewData) of
+ ok ->
+ ok;
+ _ ->
+ client_read_bulk(Port, DataExpected, NewData)
+ end;
+ _ ->
+ ct:fail("unexpected_message")
+ after 4000 ->
+ ct:fail("timeout")
+ end.
+client_read_bulk(Port, DataExpected) ->
+ client_read_bulk(Port, DataExpected, <<"">>).
+
+send_and_hostname(SSLSocket) ->
+ ssl:send(SSLSocket, "OK"),
+ {ok, [{sni_hostname, Hostname}]} = ssl:connection_information(SSLSocket, [sni_hostname]),
+ Hostname.
+
+erlang_server_openssl_client_sni_test(Config, SNIHostname, ExpectedSNIHostname, ExpectedCN) ->
+ ct:log("Start running handshake, Config: ~p, SNIHostname: ~p, ExpectedSNIHostname: ~p, ExpectedCN: ~p", [Config, SNIHostname, ExpectedSNIHostname, ExpectedCN]),
+ ServerOptions = ?config(sni_server_opts, Config) ++ ?config(server_opts, Config),
+ {_, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
+ Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0},
+ {from, self()}, {mfa, {?MODULE, send_and_hostname, []}},
+ {options, ServerOptions}]),
+ Port = ssl_test_lib:inet_port(Server),
+ ClientCommand = case SNIHostname of
+ undefined ->
+ "openssl s_client -connect " ++ Hostname ++ ":" ++ integer_to_list(Port);
+ _ ->
+ "openssl s_client -connect " ++ Hostname ++ ":" ++ integer_to_list(Port) ++ " -servername " ++ SNIHostname
+ end,
+ ct:log("Options: ~p", [[ServerOptions, ClientCommand]]),
+ ClientPort = open_port({spawn, ClientCommand}, [stderr_to_stdout]),
+ ssl_test_lib:check_result(Server, ExpectedSNIHostname),
+ ExpectedClientOutput = ["OK", "/CN=" ++ ExpectedCN ++ "/"],
+ ok = client_read_bulk(ClientPort, ExpectedClientOutput),
+ ssl_test_lib:close_port(ClientPort),
+ ssl_test_lib:close(Server),
+ ok.
+
+
+
cipher(CipherSuite, Version, Config, ClientOpts, ServerOpts) ->
process_flag(trap_exit, true),
ct:log("Testing CipherSuite ~p~n", [CipherSuite]),
@@ -1588,6 +1667,14 @@ server_sent_garbage(Socket) ->
end.
+check_openssl_sni_support(Config) ->
+ HelpText = os:cmd("openssl s_client --help"),
+ case string:str(HelpText, "-servername") of
+ 0 ->
+ {skip, "Current openssl doesn't support SNI"};
+ _ ->
+ Config
+ end.
check_openssl_npn_support(Config) ->
HelpText = os:cmd("openssl s_client --help"),
--
cgit v1.2.3
From db509dd5debcd72d7f1d024d289315274f9b788b Mon Sep 17 00:00:00 2001
From: Qijiang Fan
Date: Thu, 16 Apr 2015 22:25:57 +0800
Subject: ssl: add option sni_fun
The newly added function sni_fun allows dynamic update of SSL options
like keys and certificates depending on different SNI hostname, rather
than a predefined rules of SSL options.
---
lib/ssl/doc/src/ssl.xml | 21 +++++++++++++++-
lib/ssl/src/ssl.erl | 19 ++++++++++++++-
lib/ssl/src/ssl_internal.hrl | 1 +
lib/ssl/src/tls_connection.erl | 20 +++++++++------
lib/ssl/test/ssl_sni_SUITE.erl | 34 +++++++++++++++++++++++++-
lib/ssl/test/ssl_to_openssl_SUITE.erl | 46 ++++++++++++++++++++++++++++++++---
6 files changed, 128 insertions(+), 13 deletions(-)
(limited to 'lib')
diff --git a/lib/ssl/doc/src/ssl.xml b/lib/ssl/doc/src/ssl.xml
index 77f63dcecf..8a0bf69be4 100644
--- a/lib/ssl/doc/src/ssl.xml
+++ b/lib/ssl/doc/src/ssl.xml
@@ -108,10 +108,12 @@
| {log_alert, boolean()}
| {server_name_indication, hostname() | disable}
| {sni_hosts, [{hostname(), ssloptions()}]}
+ | {sni_fun, SNIfun::fun()}
transportoption() =
{cb_info, {CallbackModule::atom(), DataTag::atom(),
+
ClosedTag::atom(), ErrTag:atom()}}
Defaults to {gen_tcp, tcp, tcp_closed, tcp_error} . Can be used
to customize the transport layer. The callback module must implement a
@@ -185,6 +187,9 @@
srp_1024 | srp_1536 | srp_2048 | srp_3072
| srp_4096 | srp_6144 | srp_8192
+ SNIfun::fun()
+ = fun(ServerName :: string()) -> ssloptions()
+
@@ -630,7 +635,21 @@ fun(srp, Username :: string(), UserState :: term()) ->
{sni_hosts, [{hostname(), ssloptions()}]}
If the server receives a SNI (Server Name Indication) from the client
matching a host listed in the sni_hosts option, the speicific options for
- that host will override previously specified options.
+ that host will override previously specified options.
+
+ The option sni_fun , and sni_hosts are mutually exclusive.
+
+ {sni_fun, SNIfun::fun()}
+ If the server receives a SNI (Server Name Indication) from the client,
+ the given function will be called to retrive ssloptions() for indicated server.
+ These options will be merged into predefined ssloptions() .
+
+ The function should be defined as:
+ fun(ServerName :: string()) -> ssloptions()
+ and can be specified as a fun or as named fun module:function/1
+
+ The option sni_fun , and sni_hosts are mutually exclusive.
+
diff --git a/lib/ssl/src/ssl.erl b/lib/ssl/src/ssl.erl
index 956c699c45..9f76612ee3 100644
--- a/lib/ssl/src/ssl.erl
+++ b/lib/ssl/src/ssl.erl
@@ -700,6 +700,7 @@ handle_options(Opts0) ->
log_alert = handle_option(log_alert, Opts, true),
server_name_indication = handle_option(server_name_indication, Opts, undefined),
sni_hosts = handle_option(sni_hosts, Opts, []),
+ sni_fun = handle_option(sni_fun, Opts, {}),
honor_cipher_order = handle_option(honor_cipher_order, Opts, false),
protocol = proplists:get_value(protocol, Opts, tls),
padding_check = proplists:get_value(padding_check, Opts, true),
@@ -716,7 +717,7 @@ handle_options(Opts0) ->
user_lookup_fun, psk_identity, srp_identity, ciphers,
reuse_session, reuse_sessions, ssl_imp,
cb_info, renegotiate_at, secure_renegotiate, hibernate_after,
- erl_dist, alpn_advertised_protocols, sni_hosts,
+ erl_dist, alpn_advertised_protocols, sni_hosts, sni_fun,
alpn_preferred_protocols, next_protocols_advertised,
client_preferred_next_protocols, log_alert,
server_name_indication, honor_cipher_order, padding_check, crl_check, crl_cache,
@@ -733,6 +734,18 @@ handle_options(Opts0) ->
inet_user = SockOpts, transport_info = CbInfo, connection_cb = ConnetionCb
}}.
+handle_option(sni_fun, Opts, Default) ->
+ OptFun = validate_option(sni_fun,
+ proplists:get_value(sni_fun, Opts, Default)),
+ OptHosts = proplists:get_value(sni_hosts, Opts, undefined),
+ case {OptFun, OptHosts} of
+ {Default, _} ->
+ Default;
+ {_, undefined} ->
+ OptFun;
+ _ ->
+ throw({error, {conflict_options, [sni_fun, sni_hosts]}})
+ end;
handle_option(OptionName, Opts, Default) ->
validate_option(OptionName,
proplists:get_value(OptionName, Opts, Default)).
@@ -920,6 +933,10 @@ validate_option(sni_hosts, [{Hostname, SSLOptions} | Tail]) when is_list(Hostnam
_ ->
throw({error, {options, {sni_hosts, RecursiveSNIOptions}}})
end;
+validate_option(sni_fun, {}) ->
+ {};
+validate_option(sni_fun, Fun) when is_function(Fun) ->
+ Fun;
validate_option(honor_cipher_order, Value) when is_boolean(Value) ->
Value;
validate_option(padding_check, Value) when is_boolean(Value) ->
diff --git a/lib/ssl/src/ssl_internal.hrl b/lib/ssl/src/ssl_internal.hrl
index e285f48202..b6b4fc44df 100644
--- a/lib/ssl/src/ssl_internal.hrl
+++ b/lib/ssl/src/ssl_internal.hrl
@@ -123,6 +123,7 @@
log_alert :: boolean(),
server_name_indication = undefined,
sni_hosts :: [{inet:hostname(), [tuple()]}],
+ sni_fun :: function(),
%% Should the server prefer its own cipher order over the one provided by
%% the client?
honor_cipher_order = false :: boolean(),
diff --git a/lib/ssl/src/tls_connection.erl b/lib/ssl/src/tls_connection.erl
index d804d7ad37..1ee47f28b1 100644
--- a/lib/ssl/src/tls_connection.erl
+++ b/lib/ssl/src/tls_connection.erl
@@ -400,12 +400,19 @@ initial_state(Role, Host, Port, Socket, {SSLOptions, SocketOptions, Tracker}, Us
update_ssl_options_from_sni(OrigSSLOptions, SNIHostname) ->
- case proplists:get_value(SNIHostname, OrigSSLOptions#ssl_options.sni_hosts) of
- undefined ->
- undefined;
- SSLOption ->
- ssl:handle_options(SSLOption, OrigSSLOptions)
- end.
+ SSLOption =
+ case OrigSSLOptions#ssl_options.sni_fun of
+ {} ->
+ proplists:get_value(SNIHostname, OrigSSLOptions#ssl_options.sni_hosts);
+ SNIFun ->
+ SNIFun(SNIHostname)
+ end,
+ case SSLOption of
+ undefined ->
+ undefined;
+ _ ->
+ ssl:handle_options(SSLOption, OrigSSLOptions)
+ end.
next_state(Current,_, #alert{} = Alert, #state{negotiated_version = Version} = State) ->
handle_own_alert(Alert, Version, Current, State);
@@ -454,7 +461,6 @@ next_state(Current, Next, #ssl_tls{type = ?HANDSHAKE, fragment = Data},
undefined ->
State0;
#sni{hostname = Hostname} ->
- OrigSSLOptions = State0#state.ssl_options,
NewOptions = update_ssl_options_from_sni(State0#state.ssl_options, Hostname),
case NewOptions of
undefined ->
diff --git a/lib/ssl/test/ssl_sni_SUITE.erl b/lib/ssl/test/ssl_sni_SUITE.erl
index 134e508b10..46cd644e4d 100644
--- a/lib/ssl/test/ssl_sni_SUITE.erl
+++ b/lib/ssl/test/ssl_sni_SUITE.erl
@@ -31,7 +31,7 @@
%%--------------------------------------------------------------------
suite() -> [{ct_hooks,[ts_install_cth]}].
-all() -> [no_sni_header, sni_match, sni_no_match].
+all() -> [no_sni_header, sni_match, sni_no_match] ++ [no_sni_header_fun, sni_match_fun, sni_no_match_fun].
init_per_suite(Config0) ->
catch crypto:stop(),
@@ -57,12 +57,20 @@ end_per_suite(_) ->
no_sni_header(Config) ->
run_handshake(Config, undefined, undefined, "server").
+no_sni_header_fun(Config) ->
+ run_sni_fun_handshake(Config, undefined, undefined, "server").
+
sni_match(Config) ->
run_handshake(Config, "a.server", "a.server", "a.server").
+sni_match_fun(Config) ->
+ run_sni_fun_handshake(Config, "a.server", "a.server", "a.server").
+
sni_no_match(Config) ->
run_handshake(Config, "c.server", undefined, "server").
+sni_no_match_fun(Config) ->
+ run_sni_fun_handshake(Config, "c.server", undefined, "server").
%%--------------------------------------------------------------------
@@ -112,6 +120,30 @@ recv_and_certificate(SSLSocket) ->
ct:log("Subject of certificate received from server: ~p", [Subject]),
rdn_to_string(rdnPart(Subject, ?'id-at-commonName')).
+run_sni_fun_handshake(Config, SNIHostname, ExpectedSNIHostname, ExpectedCN) ->
+ ct:log("Start running handshake for sni_fun, Config: ~p, SNIHostname: ~p, ExpectedSNIHostname: ~p, ExpectedCN: ~p", [Config, SNIHostname, ExpectedSNIHostname, ExpectedCN]),
+ [{sni_hosts, ServerSNIConf}] = ?config(sni_server_opts, Config),
+ SNIFun = fun(Domain) -> proplists:get_value(Domain, ServerSNIConf, undefined) end,
+ ServerOptions = ?config(server_opts, Config) ++ [{sni_fun, SNIFun}],
+ ClientOptions =
+ case SNIHostname of
+ undefined ->
+ ?config(client_opts, Config);
+ _ ->
+ [{server_name_indication, SNIHostname}] ++ ?config(client_opts, Config)
+ end,
+ ct:log("Options: ~p", [[ServerOptions, ClientOptions]]),
+ {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
+ Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0},
+ {from, self()}, {mfa, {?MODULE, send_and_hostname, []}},
+ {options, ServerOptions}]),
+ Port = ssl_test_lib:inet_port(Server),
+ Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port},
+ {host, Hostname}, {from, self()},
+ {mfa, {?MODULE, recv_and_certificate, []}},
+ {options, ClientOptions}]),
+ ssl_test_lib:check_result(Server, ExpectedSNIHostname, Client, ExpectedCN).
+
run_handshake(Config, SNIHostname, ExpectedSNIHostname, ExpectedCN) ->
ct:log("Start running handshake, Config: ~p, SNIHostname: ~p, ExpectedSNIHostname: ~p, ExpectedCN: ~p", [Config, SNIHostname, ExpectedSNIHostname, ExpectedCN]),
diff --git a/lib/ssl/test/ssl_to_openssl_SUITE.erl b/lib/ssl/test/ssl_to_openssl_SUITE.erl
index 3807a9983c..0413415e49 100644
--- a/lib/ssl/test/ssl_to_openssl_SUITE.erl
+++ b/lib/ssl/test/ssl_to_openssl_SUITE.erl
@@ -102,9 +102,12 @@ npn_tests() ->
erlang_client_openssl_server_npn_only_server].
sni_server_tests() ->
- [erlang_server_oepnssl_client_sni_match,
+ [erlang_server_openssl_client_sni_match,
+ erlang_server_openssl_client_sni_match_fun,
erlang_server_openssl_client_sni_no_match,
- erlang_server_openssl_client_sni_no_header].
+ erlang_server_openssl_client_sni_no_match_fun,
+ erlang_server_openssl_client_sni_no_header,
+ erlang_server_openssl_client_sni_no_header_fun].
init_per_suite(Config0) ->
@@ -230,7 +233,10 @@ special_init(TestCase, Config)
special_init(TestCase, Config)
when TestCase == erlang_server_openssl_client_sni_match;
TestCase == erlang_server_openssl_client_sni_no_match;
- TestCase == erlang_server_openssl_client_sni_no_header ->
+ TestCase == erlang_server_openssl_client_sni_no_header;
+ TestCase == erlang_server_openssl_client_sni_match_fun;
+ TestCase == erlang_server_openssl_client_sni_no_match_fun;
+ TestCase == erlang_server_openssl_client_sni_no_header_fun ->
check_openssl_sni_support(Config);
special_init(_, Config) ->
@@ -1196,12 +1202,21 @@ erlang_server_openssl_client_npn_only_client(Config) when is_list(Config) ->
erlang_server_openssl_client_sni_no_header(Config) when is_list(Config) ->
erlang_server_openssl_client_sni_test(Config, undefined, undefined, "server").
+erlang_server_openssl_client_sni_no_header_fun(Config) when is_list(Config) ->
+ erlang_server_openssl_client_sni_test_sni_fun(Config, undefined, undefined, "server").
+
erlang_server_openssl_client_sni_match(Config) when is_list(Config) ->
erlang_server_openssl_client_sni_test(Config, "a.server", "a.server", "a.server").
+erlang_server_openssl_client_sni_match_fun(Config) when is_list(Config) ->
+ erlang_server_openssl_client_sni_test_sni_fun(Config, "a.server", "a.server", "a.server").
+
erlang_server_openssl_client_sni_no_match(Config) when is_list(Config) ->
erlang_server_openssl_client_sni_test(Config, "c.server", undefined, "server").
+erlang_server_openssl_client_sni_no_match_fun(Config) when is_list(Config) ->
+ erlang_server_openssl_client_sni_test_sni_fun(Config, "c.server", undefined, "server").
+
%%--------------------------------------------------------------------
%% Internal functions ------------------------------------------------
@@ -1285,6 +1300,31 @@ erlang_server_openssl_client_sni_test(Config, SNIHostname, ExpectedSNIHostname,
ok.
+erlang_server_openssl_client_sni_test_sni_fun(Config, SNIHostname, ExpectedSNIHostname, ExpectedCN) ->
+ ct:log("Start running handshake for sni_fun, Config: ~p, SNIHostname: ~p, ExpectedSNIHostname: ~p, ExpectedCN: ~p", [Config, SNIHostname, ExpectedSNIHostname, ExpectedCN]),
+ [{sni_hosts, ServerSNIConf}] = ?config(sni_server_opts, Config),
+ SNIFun = fun(Domain) -> proplists:get_value(Domain, ServerSNIConf, undefined) end,
+ ServerOptions = ?config(server_opts, Config) ++ [{sni_fun, SNIFun}],
+ {_, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
+ Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0},
+ {from, self()}, {mfa, {?MODULE, send_and_hostname, []}},
+ {options, ServerOptions}]),
+ Port = ssl_test_lib:inet_port(Server),
+ ClientCommand = case SNIHostname of
+ undefined ->
+ "openssl s_client -connect " ++ Hostname ++ ":" ++ integer_to_list(Port);
+ _ ->
+ "openssl s_client -connect " ++ Hostname ++ ":" ++ integer_to_list(Port) ++ " -servername " ++ SNIHostname
+ end,
+ ct:log("Options: ~p", [[ServerOptions, ClientCommand]]),
+ ClientPort = open_port({spawn, ClientCommand}, [stderr_to_stdout]),
+ ssl_test_lib:check_result(Server, ExpectedSNIHostname),
+ ExpectedClientOutput = ["OK", "/CN=" ++ ExpectedCN ++ "/"],
+ ok = client_read_bulk(ClientPort, ExpectedClientOutput),
+ ssl_test_lib:close_port(ClientPort),
+ ssl_test_lib:close(Server),
+ ok.
+
cipher(CipherSuite, Version, Config, ClientOpts, ServerOpts) ->
process_flag(trap_exit, true),
--
cgit v1.2.3
From ff2400d7b5b1b090e128bc537d7bdd94c6aad97e Mon Sep 17 00:00:00 2001
From: Ingela Anderton Andin
Date: Tue, 5 May 2015 16:03:18 +0200
Subject: ssl: Refactored and corrected sni_fun handling
Dialyzer warned about the incorrect match of Packets. Code
was refactored and the problem avoided in the process.
Dialyzer warned that the empty tuple is not a function as the contract
said it should be. Changed the handling of the sni_fun default value to be
undefined and added it to the contract.
---
lib/ssl/src/ssl.erl | 6 +--
lib/ssl/src/ssl_internal.hrl | 2 +-
lib/ssl/src/tls_connection.erl | 86 +++++++++++++++++++++---------------------
3 files changed, 48 insertions(+), 46 deletions(-)
(limited to 'lib')
diff --git a/lib/ssl/src/ssl.erl b/lib/ssl/src/ssl.erl
index 9f76612ee3..225a9be66f 100644
--- a/lib/ssl/src/ssl.erl
+++ b/lib/ssl/src/ssl.erl
@@ -700,7 +700,7 @@ handle_options(Opts0) ->
log_alert = handle_option(log_alert, Opts, true),
server_name_indication = handle_option(server_name_indication, Opts, undefined),
sni_hosts = handle_option(sni_hosts, Opts, []),
- sni_fun = handle_option(sni_fun, Opts, {}),
+ sni_fun = handle_option(sni_fun, Opts, undefined),
honor_cipher_order = handle_option(honor_cipher_order, Opts, false),
protocol = proplists:get_value(protocol, Opts, tls),
padding_check = proplists:get_value(padding_check, Opts, true),
@@ -933,8 +933,8 @@ validate_option(sni_hosts, [{Hostname, SSLOptions} | Tail]) when is_list(Hostnam
_ ->
throw({error, {options, {sni_hosts, RecursiveSNIOptions}}})
end;
-validate_option(sni_fun, {}) ->
- {};
+validate_option(sni_fun, undefined) ->
+ undefined;
validate_option(sni_fun, Fun) when is_function(Fun) ->
Fun;
validate_option(honor_cipher_order, Value) when is_boolean(Value) ->
diff --git a/lib/ssl/src/ssl_internal.hrl b/lib/ssl/src/ssl_internal.hrl
index b6b4fc44df..baeae68bc4 100644
--- a/lib/ssl/src/ssl_internal.hrl
+++ b/lib/ssl/src/ssl_internal.hrl
@@ -123,7 +123,7 @@
log_alert :: boolean(),
server_name_indication = undefined,
sni_hosts :: [{inet:hostname(), [tuple()]}],
- sni_fun :: function(),
+ sni_fun :: function() | undefined,
%% Should the server prefer its own cipher order over the one provided by
%% the client?
honor_cipher_order = false :: boolean(),
diff --git a/lib/ssl/src/tls_connection.erl b/lib/ssl/src/tls_connection.erl
index 1ee47f28b1..3304ffcddb 100644
--- a/lib/ssl/src/tls_connection.erl
+++ b/lib/ssl/src/tls_connection.erl
@@ -401,12 +401,13 @@ initial_state(Role, Host, Port, Socket, {SSLOptions, SocketOptions, Tracker}, Us
update_ssl_options_from_sni(OrigSSLOptions, SNIHostname) ->
SSLOption =
- case OrigSSLOptions#ssl_options.sni_fun of
- {} ->
- proplists:get_value(SNIHostname, OrigSSLOptions#ssl_options.sni_hosts);
- SNIFun ->
- SNIFun(SNIHostname)
- end,
+ case OrigSSLOptions#ssl_options.sni_fun of
+ undefined ->
+ proplists:get_value(SNIHostname,
+ OrigSSLOptions#ssl_options.sni_hosts);
+ SNIFun ->
+ SNIFun(SNIHostname)
+ end,
case SSLOption of
undefined ->
undefined;
@@ -442,50 +443,22 @@ next_state(Current, Next, #ssl_tls{type = ?HANDSHAKE, fragment = Data},
%% This message should not be included in handshake
%% message hashes. Already in negotiation so it will be ignored!
?MODULE:SName(Packet, State);
- ({#client_hello{} = Packet, Raw}, {next_state, connection = SName, State}) ->
+ ({#client_hello{} = Packet, Raw}, {next_state, connection = SName, HState0}) ->
+ HState = handle_sni_extension(Packet, HState0),
Version = Packet#client_hello.client_version,
Hs0 = ssl_handshake:init_handshake_history(),
Hs1 = ssl_handshake:update_handshake_history(Hs0, Raw),
- ?MODULE:SName(Packet, State#state{tls_handshake_history=Hs1,
- renegotiation = {true, peer}});
- ({Packet, Raw}, {next_state, SName, State = #state{tls_handshake_history=Hs0}}) ->
+ ?MODULE:SName(Packet, HState#state{tls_handshake_history=Hs1,
+ renegotiation = {true, peer}});
+ ({Packet, Raw}, {next_state, SName, HState0 = #state{tls_handshake_history=Hs0}}) ->
+ HState = handle_sni_extension(Packet, HState0),
Hs1 = ssl_handshake:update_handshake_history(Hs0, Raw),
- ?MODULE:SName(Packet, State#state{tls_handshake_history=Hs1});
+ ?MODULE:SName(Packet, HState#state{tls_handshake_history=Hs1});
(_, StopState) -> StopState
end,
try
{Packets, Buf} = tls_handshake:get_tls_handshake(Version,Data,Buf0),
- State1 = case Packets of
- [{#client_hello{extensions=HelloExtensions} = ClientHello, _}] ->
- case HelloExtensions#hello_extensions.sni of
- undefined ->
- State0;
- #sni{hostname = Hostname} ->
- NewOptions = update_ssl_options_from_sni(State0#state.ssl_options, Hostname),
- case NewOptions of
- undefined ->
- State0;
- _ ->
- {ok, Ref, CertDbHandle, FileRefHandle, CacheHandle, CRLDbHandle, OwnCert, Key, DHParams} =
- ssl_config:init(NewOptions, State0#state.role),
- State0#state{
- session = State0#state.session#session{own_certificate = OwnCert},
- file_ref_db = FileRefHandle,
- cert_db_ref = Ref,
- cert_db = CertDbHandle,
- crl_db = CRLDbHandle,
- session_cache = CacheHandle,
- private_key = Key,
- diffie_hellman_params = DHParams,
- ssl_options = NewOptions,
- sni_hostname = Hostname
- }
- end
- end;
- _ ->
- State0
- end,
- State = State1#state{protocol_buffers =
+ State = State0#state{protocol_buffers =
Buffers#protocol_buffers{tls_packets = Packets,
tls_handshake_buffer = Buf}},
handle_tls_handshake(Handle, Next, State)
@@ -1027,3 +1000,32 @@ convert_options_partial_chain(Options, up) ->
list_to_tuple(Head ++ [{partial_chain, fun(_) -> unknown_ca end}] ++ Tail);
convert_options_partial_chain(Options, down) ->
list_to_tuple(proplists:delete(partial_chain, tuple_to_list(Options))).
+
+handle_sni_extension(#client_hello{extensions = HelloExtensions}, State0) ->
+ case HelloExtensions#hello_extensions.sni of
+ undefined ->
+ State0;
+ #sni{hostname = Hostname} ->
+ NewOptions = update_ssl_options_from_sni(State0#state.ssl_options, Hostname),
+ case NewOptions of
+ undefined ->
+ State0;
+ _ ->
+ {ok, Ref, CertDbHandle, FileRefHandle, CacheHandle, CRLDbHandle, OwnCert, Key, DHParams} =
+ ssl_config:init(NewOptions, State0#state.role),
+ State0#state{
+ session = State0#state.session#session{own_certificate = OwnCert},
+ file_ref_db = FileRefHandle,
+ cert_db_ref = Ref,
+ cert_db = CertDbHandle,
+ crl_db = CRLDbHandle,
+ session_cache = CacheHandle,
+ private_key = Key,
+ diffie_hellman_params = DHParams,
+ ssl_options = NewOptions,
+ sni_hostname = Hostname
+ }
+ end
+ end;
+handle_sni_extension(_, State0) ->
+ State0.
--
cgit v1.2.3
From b1e1dd967a4f929a239f8d26829304c03d43dcf9 Mon Sep 17 00:00:00 2001
From: Hans Nilsson
Date: Tue, 12 May 2015 17:41:26 +0200
Subject: inets: reject negative content-length
---
lib/inets/src/http_server/httpd_request.erl | 8 ++++++--
lib/inets/vsn.mk | 2 +-
2 files changed, 7 insertions(+), 3 deletions(-)
(limited to 'lib')
diff --git a/lib/inets/src/http_server/httpd_request.erl b/lib/inets/src/http_server/httpd_request.erl
index 6985065c3e..3ff07616f9 100644
--- a/lib/inets/src/http_server/httpd_request.erl
+++ b/lib/inets/src/http_server/httpd_request.erl
@@ -417,8 +417,12 @@ check_header({"content-length", Value}, Maxsizes) ->
case length(Value) =< MaxLen of
true ->
try
- _ = list_to_integer(Value),
- ok
+ list_to_integer(Value)
+ of
+ I when I>= 0 ->
+ ok;
+ _ ->
+ {error, {size_error, Max, 411, "negative content-length"}}
catch _:_ ->
{error, {size_error, Max, 411, "content-length not an integer"}}
end;
diff --git a/lib/inets/vsn.mk b/lib/inets/vsn.mk
index e9ecb2632a..ecb84e447c 100644
--- a/lib/inets/vsn.mk
+++ b/lib/inets/vsn.mk
@@ -18,6 +18,6 @@
# %CopyrightEnd%
APPLICATION = inets
-INETS_VSN = 5.10.7
+INETS_VSN = 5.10.8
PRE_VSN =
APP_VSN = "$(APPLICATION)-$(INETS_VSN)$(PRE_VSN)"
--
cgit v1.2.3
From e09dd66dc4d89c62ddfd8c19791f9678d5d787c6 Mon Sep 17 00:00:00 2001
From: Erlang/OTP
Date: Tue, 12 May 2015 18:18:55 +0200
Subject: Prepare release
---
lib/asn1/doc/src/notes.xml | 17 +++
lib/asn1/vsn.mk | 2 +-
lib/common_test/doc/src/notes.xml | 73 ++++++++++++
lib/compiler/doc/src/notes.xml | 88 ++++++++++++++
lib/compiler/vsn.mk | 2 +-
lib/cosEvent/doc/src/notes.xml | 18 ++-
lib/cosEventDomain/doc/src/notes.xml | 18 ++-
lib/cosFileTransfer/doc/src/notes.xml | 18 ++-
lib/cosNotification/doc/src/notes.xml | 18 ++-
lib/cosProperty/doc/src/notes.xml | 18 ++-
lib/cosTime/doc/src/notes.xml | 18 ++-
lib/cosTransactions/doc/src/notes.xml | 18 ++-
lib/crypto/doc/src/notes.xml | 43 +++++++
lib/crypto/vsn.mk | 2 +-
lib/debugger/doc/src/notes.xml | 18 +++
lib/debugger/vsn.mk | 2 +-
lib/dialyzer/doc/src/notes.xml | 86 ++++++++++++++
lib/dialyzer/vsn.mk | 2 +-
lib/edoc/doc/src/notes.xml | 15 +++
lib/edoc/vsn.mk | 2 +-
lib/eldap/doc/src/notes.xml | 16 +++
lib/eunit/doc/src/notes.xml | 14 +++
lib/eunit/vsn.mk | 2 +-
lib/hipe/doc/src/notes.xml | 36 ++++++
lib/hipe/vsn.mk | 2 +-
lib/inets/doc/src/notes.xml | 21 +++-
lib/inets/vsn.mk | 2 +-
lib/jinterface/doc/src/notes.xml | 53 +++++++++
lib/jinterface/vsn.mk | 2 +-
lib/kernel/doc/src/notes.xml | 73 ++++++++++++
lib/kernel/vsn.mk | 2 +-
lib/mnesia/doc/src/notes.xml | 32 ++++-
lib/mnesia/vsn.mk | 2 +-
lib/observer/doc/src/notes.xml | 22 ++++
lib/observer/vsn.mk | 2 +-
lib/orber/doc/src/notes.xml | 18 ++-
lib/os_mon/doc/src/notes.xml | 19 +++
lib/os_mon/vsn.mk | 2 +-
lib/parsetools/doc/src/notes.xml | 15 +++
lib/parsetools/vsn.mk | 2 +-
lib/percept/doc/src/notes.xml | 15 +++
lib/percept/vsn.mk | 2 +-
lib/public_key/doc/src/notes.xml | 31 +++++
lib/sasl/doc/src/notes.xml | 24 ++++
lib/sasl/vsn.mk | 2 +-
lib/ssh/doc/src/notes.xml | 66 ++++++++++
lib/ssl/doc/src/notes.xml | 63 +++++++++-
lib/stdlib/doc/src/notes.xml | 218 ++++++++++++++++++++++++++++++++++
lib/stdlib/vsn.mk | 2 +-
lib/syntax_tools/doc/src/notes.xml | 14 +++
lib/syntax_tools/vsn.mk | 2 +-
lib/test_server/doc/src/notes.xml | 49 ++++++++
lib/tools/doc/src/notes.xml | 59 +++++++++
lib/tools/vsn.mk | 2 +-
lib/typer/doc/src/notes.xml | 14 +++
lib/typer/vsn.mk | 2 +-
lib/webtool/doc/src/notes.xml | 17 +++
lib/wx/doc/src/notes.xml | 49 ++++++++
lib/wx/vsn.mk | 2 +-
lib/xmerl/doc/src/notes.xml | 14 +++
60 files changed, 1429 insertions(+), 33 deletions(-)
(limited to 'lib')
diff --git a/lib/asn1/doc/src/notes.xml b/lib/asn1/doc/src/notes.xml
index 9feb673c04..f73d21b9e3 100644
--- a/lib/asn1/doc/src/notes.xml
+++ b/lib/asn1/doc/src/notes.xml
@@ -31,6 +31,23 @@
This document describes the changes made to the asn1 application.
+Asn1 4.0
+
+ Fixed Bugs and Malfunctions
+
+ -
+
+ Many bugs have been eliminated in the the ASN.1 compiler
+ so that it can now successfully compile many more ASN.1
+ specifications. Error messages have also been improved.
+
+ Own Id: OTP-12395
+
+
+
+
+
+
Asn1 3.0.4
Fixed Bugs and Malfunctions
diff --git a/lib/asn1/vsn.mk b/lib/asn1/vsn.mk
index c909c908d6..d4c46863a3 100644
--- a/lib/asn1/vsn.mk
+++ b/lib/asn1/vsn.mk
@@ -1 +1 @@
-ASN1_VSN = 3.0.4
+ASN1_VSN = 4.0
diff --git a/lib/common_test/doc/src/notes.xml b/lib/common_test/doc/src/notes.xml
index 472e3b7833..218f76d403 100644
--- a/lib/common_test/doc/src/notes.xml
+++ b/lib/common_test/doc/src/notes.xml
@@ -32,6 +32,79 @@
notes.xml
+Common_Test 1.11
+
+ Fixed Bugs and Malfunctions
+
+ -
+
+ The status of an aborted test due to test suite
+ compilation error has changed from 'auto_skipped' to
+ 'failed'. This affects both the textual log file, event
+ handling and CT hook callbacks. The logging of
+ compilation failures has also been improved, especially
+ in the case of multiple test suites failing compilation.
+
+ Own Id: OTP-10816
+
+
+
+
+
+ Improvements and New Features
+
+ -
+
+ Earlier there was no way to add optional parameters like
+ default-operation to an edit-config request sent with
+ ct_netconfc:edit_config/3,4, you had to use
+ ct_netconfc:send_rpc/2,3. For simplicity and completion,
+ a new optional argument, OptParams, is now added to the
+ edit_config function.
+
+ Own Id: OTP-10446 Aux Id: kunagi-266 [177]
+
+ -
+
+ When running OTP tests using the ts interface, it is now
+ possible to specify so called test categories per OTP
+ application. A test category is represented by a CT test
+ specification and defines an arbitrary subset of existing
+ test suites, groups and cases. Examples of test
+ categories are 'smoke' (smoke tests) and 'bench'
+ (benchmarks). (Call ts:help() for more info). Also,
+ functions for reading terms from the current test
+ specification during test, ct:get_testspec_terms/0 and
+ ct:get_testspec_terms/1, have been implemented.
+
+ Own Id: OTP-11962
+
+ -
+
+ Obsolete scripts and make file operations have been
+ removed and the installation chapter in the Common Test
+ User's Guide has been updated.
+
+ Own Id: OTP-12421
+
+ -
+
+ The 'keep_alive' interval has been reduced to 8 seconds,
+ which is two seconds shorter than the default
+ 'idle_timeout' value for ct_telnet:expect/3. This way,
+ the telnet server receives a NOP message (which might
+ trigger an action) before the operation times out. Also
+ the TCP option 'nodelay' has been enabled per default for
+ all telnet connections, in order to reduce the risk for
+ communication timeouts.
+
+ Own Id: OTP-12678 Aux Id: seq12818
+
+
+
+
+
+
Common_Test 1.10.1
Fixed Bugs and Malfunctions
diff --git a/lib/compiler/doc/src/notes.xml b/lib/compiler/doc/src/notes.xml
index 9b5b44f3e1..0654738247 100644
--- a/lib/compiler/doc/src/notes.xml
+++ b/lib/compiler/doc/src/notes.xml
@@ -31,6 +31,94 @@
This document describes the changes made to the Compiler
application.
+Compiler 6.0
+
+ Fixed Bugs and Malfunctions
+
+ -
+
+ The compiler optimizes away building of terms that are
+ never actually used. As a result, the compiler in OTP 18
+ may produce more warnings for terms that are built but
+ not used than the compiler in OTP 17.
+
+ Own Id: OTP-12453
+
+ -
+
+ Using a map could incorrectly suppress warnings for
+ unused variables.
+
+ Own Id: OTP-12515
+
+ -
+
+ The compiler now properly reports unknown parse
+ transforms. That is, undef exceptions coming from
+ the parse transform itself is reported differently from
+ the absence of the parse transform.
+
+ Own Id: OTP-12723
+
+
+
+
+
+ Improvements and New Features
+
+ -
+
+ The cerl and cerl_trees modules in the
+ compiler application are now documented.
+
+ Own Id: OTP-11978
+
+ -
+
+ The deprecated 'asm ' option has been removed.
+
+ *** POTENTIAL INCOMPATIBILITY ***
+
+ Own Id: OTP-12100
+
+ -
+
+ Support variables as Map keys in expressions and patterns
+ Erlang will accept any expression as keys in Map
+ expressions and it will accept literals or bound
+ variables as keys in Map patterns.
+
+ Own Id: OTP-12218
+
+ -
+
+ Infer Map type information in beam_type compiler
+ optimization pass.
+
+ Own Id: OTP-12253
+
+ -
+
+ Compiler optimizations have been improved.
+
+ Own Id: OTP-12393
+
+ -
+
+ Five undocumented functions in the module core_lib
+ have been deprecated and will be removed in the next
+ major release. The functions are: get_anno/{1,2} ,
+ is_literal/1 , is_literal_list/1 , and
+ literal_value . Use the appropriate functions in
+ the cerl module instead.
+
+ Own Id: OTP-12497
+
+
+
+
+
+
Compiler 5.0.4
Fixed Bugs and Malfunctions
diff --git a/lib/compiler/vsn.mk b/lib/compiler/vsn.mk
index 05e682c893..69f71ba5dd 100644
--- a/lib/compiler/vsn.mk
+++ b/lib/compiler/vsn.mk
@@ -1 +1 @@
-COMPILER_VSN = 5.0.4
+COMPILER_VSN = 6.0
diff --git a/lib/cosEvent/doc/src/notes.xml b/lib/cosEvent/doc/src/notes.xml
index 8f519447fc..229e0c9945 100644
--- a/lib/cosEvent/doc/src/notes.xml
+++ b/lib/cosEvent/doc/src/notes.xml
@@ -32,7 +32,23 @@
notes.xml
- cosEvent 2.1.15
+ cosEvent 2.2
+
+ Improvements and New Features
+
+ -
+
Remove the usage of erlang:now() from all Corba
+ applications and use the new rand module instead of
+ random.
+
+ Own Id: OTP-12687
+
+
+
+
+
+
+cosEvent 2.1.15
Improvements and New Features
diff --git a/lib/cosEventDomain/doc/src/notes.xml b/lib/cosEventDomain/doc/src/notes.xml
index 2c3bf16411..72408b52f4 100644
--- a/lib/cosEventDomain/doc/src/notes.xml
+++ b/lib/cosEventDomain/doc/src/notes.xml
@@ -31,7 +31,23 @@
notes.xml
- cosEventDomain 1.1.14
+ cosEventDomain 1.2
+
+ Improvements and New Features
+
+ -
+
Remove the usage of erlang:now() from all Corba
+ applications and use the new rand module instead of
+ random.
+
+ Own Id: OTP-12687
+
+
+
+
+
+
+cosEventDomain 1.1.14
Improvements and New Features
diff --git a/lib/cosFileTransfer/doc/src/notes.xml b/lib/cosFileTransfer/doc/src/notes.xml
index 1d0c826d40..a3cce2a7d8 100644
--- a/lib/cosFileTransfer/doc/src/notes.xml
+++ b/lib/cosFileTransfer/doc/src/notes.xml
@@ -30,7 +30,23 @@
notes.xml
- cosFileTransfer 1.1.16
+ cosFileTransfer 1.2
+
+ Improvements and New Features
+
+ -
+
Remove the usage of erlang:now() from all Corba
+ applications and use the new rand module instead of
+ random.
+
+ Own Id: OTP-12687
+
+
+
+
+
+
+cosFileTransfer 1.1.16
Improvements and New Features
diff --git a/lib/cosNotification/doc/src/notes.xml b/lib/cosNotification/doc/src/notes.xml
index 2e4f922142..b16571a1cf 100644
--- a/lib/cosNotification/doc/src/notes.xml
+++ b/lib/cosNotification/doc/src/notes.xml
@@ -31,7 +31,23 @@
notes.xml
- cosNotification 1.1.21
+ cosNotification 1.2
+
+ Improvements and New Features
+
+ -
+
Remove the usage of erlang:now() from all Corba
+ applications and use the new rand module instead of
+ random.
+
+ Own Id: OTP-12687
+
+
+
+
+
+
+cosNotification 1.1.21
Improvements and New Features
diff --git a/lib/cosProperty/doc/src/notes.xml b/lib/cosProperty/doc/src/notes.xml
index 739f41617f..1885a8fd6b 100644
--- a/lib/cosProperty/doc/src/notes.xml
+++ b/lib/cosProperty/doc/src/notes.xml
@@ -31,7 +31,23 @@
notes.xml
- cosProperty 1.1.17
+ cosProperty 1.2
+
+ Improvements and New Features
+
+ -
+
Remove the usage of erlang:now() from all Corba
+ applications and use the new rand module instead of
+ random.
+
+ Own Id: OTP-12687
+
+
+
+
+
+
+cosProperty 1.1.17
Improvements and New Features
diff --git a/lib/cosTime/doc/src/notes.xml b/lib/cosTime/doc/src/notes.xml
index f218f19a6b..6c948c8c2b 100644
--- a/lib/cosTime/doc/src/notes.xml
+++ b/lib/cosTime/doc/src/notes.xml
@@ -32,7 +32,23 @@
notes.xml
- cosTime 1.1.14
+ cosTime 1.2
+
+ Improvements and New Features
+
+ -
+
Remove the usage of erlang:now() from all Corba
+ applications and use the new rand module instead of
+ random.
+
+ Own Id: OTP-12687
+
+
+
+
+
+
+cosTime 1.1.14
Improvements and New Features
diff --git a/lib/cosTransactions/doc/src/notes.xml b/lib/cosTransactions/doc/src/notes.xml
index 4b20f23efb..ae3b9eb6f2 100644
--- a/lib/cosTransactions/doc/src/notes.xml
+++ b/lib/cosTransactions/doc/src/notes.xml
@@ -32,7 +32,23 @@
notes.xml
- cosTransactions 1.2.14
+ cosTransactions 1.3
+
+ Improvements and New Features
+
+ -
+
Remove the usage of erlang:now() from all Corba
+ applications and use the new rand module instead of
+ random.
+
+ Own Id: OTP-12687
+
+
+
+
+
+
+cosTransactions 1.2.14
Improvements and New Features
diff --git a/lib/crypto/doc/src/notes.xml b/lib/crypto/doc/src/notes.xml
index a0ebc4b3dd..6ab109e349 100644
--- a/lib/crypto/doc/src/notes.xml
+++ b/lib/crypto/doc/src/notes.xml
@@ -30,6 +30,49 @@
This document describes the changes made to the Crypto application.
+Crypto 3.6
+
+ Fixed Bugs and Malfunctions
+
+ -
+
+ Enhance crypto:generate_key to calculate ECC public keys
+ from private key.
+
+ Own Id: OTP-12394
+
+ -
+
+ Fix bug in crypto:generate_key for ecdh
+ that could cause VM crash for faulty input.
+
+ Own Id: OTP-12733
+
+
+
+
+
+ Improvements and New Features
+
+ -
+
+ Use the EVP API for AES-CBC crypto to enables the use of
+ hardware acceleration for AES-CBC crypto on newer Intel
+ CPUs (AES-NI), among other platforms.
+
+ Own Id: OTP-12380
+
+ -
+
+ Add AES ECB block encryption.
+
+ Own Id: OTP-12403
+
+
+
+
+
+
Crypto 3.5
Improvements and New Features
diff --git a/lib/crypto/vsn.mk b/lib/crypto/vsn.mk
index 8489b59562..55b1b3e8c4 100644
--- a/lib/crypto/vsn.mk
+++ b/lib/crypto/vsn.mk
@@ -1 +1 @@
-CRYPTO_VSN = 3.5
+CRYPTO_VSN = 3.6
diff --git a/lib/debugger/doc/src/notes.xml b/lib/debugger/doc/src/notes.xml
index 7384189a6f..2bf80597b5 100644
--- a/lib/debugger/doc/src/notes.xml
+++ b/lib/debugger/doc/src/notes.xml
@@ -32,6 +32,24 @@
This document describes the changes made to the Debugger
application.
+Debugger 4.1
+
+ Improvements and New Features
+
+ -
+
+ Support variables as Map keys in expressions and patterns
+ Erlang will accept any expression as keys in Map
+ expressions and it will accept literals or bound
+ variables as keys in Map patterns.
+
+ Own Id: OTP-12218
+
+
+
+
+
+
Debugger 4.0.3
Fixed Bugs and Malfunctions
diff --git a/lib/debugger/vsn.mk b/lib/debugger/vsn.mk
index b82f0f4e37..b6fd4e8e44 100644
--- a/lib/debugger/vsn.mk
+++ b/lib/debugger/vsn.mk
@@ -1 +1 @@
-DEBUGGER_VSN = 4.0.3
+DEBUGGER_VSN = 4.1
diff --git a/lib/dialyzer/doc/src/notes.xml b/lib/dialyzer/doc/src/notes.xml
index 8976679c1d..d30882b5b9 100644
--- a/lib/dialyzer/doc/src/notes.xml
+++ b/lib/dialyzer/doc/src/notes.xml
@@ -31,6 +31,92 @@
This document describes the changes made to the Dialyzer
application.
+Dialyzer 2.8
+
+ Fixed Bugs and Malfunctions
+
+ -
+
The translation of Erlang forms to the type
+ representation used by Dialyzer has been improved in
+ several ways. The most important change is that deeply
+ nested records can be handled.
+
+ Own Id: OTP-12350
+
+ -
+
Update the PLT properly when a module is changed.
+ (Thanks to James Fish for the bug report, and to Stavros
+ Aronis for fixing the bug.)
+
+ Own Id: OTP-12637
+
+ -
+
+ An argument of '*'/2 is not constraind if the other
+ operand can be zero.
+
+ Own Id: OTP-12725
+
+
+
+
+
+ Improvements and New Features
+
+ -
+
The -dialyzer() attribute can be used for
+ suppressing warnings in a module by specifying functions
+ or warning options. It can also be used for requesting
+ warnings in a module.
+
+ Own Id: OTP-10280
+
+ -
+
The pre-defined types array() , dict() ,
+ digraph() , gb_set() , gb_tree() ,
+ queue() , set() , and tid() have been
+ removed.
+
+ Own Id: OTP-11445 Aux Id: OTP-10342, OTP-9352
+
+ -
+
A few type names that have been used for representing
+ certain predefined types can now be used for user-defined
+ types. This affects the types product/_ ,
+ union/_ , and range/2 as well as
+ tuple/N (N > 0), map/N (N > 0),
+ atom/1 , integer/1 , binary/2 ,
+ record/_, and 'fun'/_ . A consequence is
+ that, for example, it is no longer possible to refer to a
+ record type with record(r) ; instead the usual
+ record notation, #r{} , is to be used.
+
+ *** POTENTIAL INCOMPATIBILITY ***
+
+ Own Id: OTP-11851
+
+ -
+
When implementing user-defined behaviours it is now
+ possible to specify optional callback functions. See OTP
+ Design Principles User's Guide, Sys and Proc_Lib,
+ User-Defined Behaviours, for details.
+
+ Own Id: OTP-11861
+
+ -
+
Add two options to the Dialyzer:
+ no_missing_calls suppresses warnings about calls
+ to missing or unexported functions; unknown lets
+ warnings about unknown functions or types affect the exit
+ status. See also dialyzer(3).
+
+ Own Id: OTP-12682
+
+
+
+
+
+
Dialyzer 2.7.4
Fixed Bugs and Malfunctions
diff --git a/lib/dialyzer/vsn.mk b/lib/dialyzer/vsn.mk
index 527afaf4ef..48e0830109 100644
--- a/lib/dialyzer/vsn.mk
+++ b/lib/dialyzer/vsn.mk
@@ -1 +1 @@
-DIALYZER_VSN = 2.7.4
+DIALYZER_VSN = 2.8
diff --git a/lib/edoc/doc/src/notes.xml b/lib/edoc/doc/src/notes.xml
index e350adb540..48bb415ab3 100644
--- a/lib/edoc/doc/src/notes.xml
+++ b/lib/edoc/doc/src/notes.xml
@@ -31,6 +31,21 @@
This document describes the changes made to the EDoc
application.
+Edoc 0.7.17
+
+ Improvements and New Features
+
+ -
+
+ Remove functionality related to packages
+
+ Own Id: OTP-12431
+
+
+
+
+
+
Edoc 0.7.16
Fixed Bugs and Malfunctions
diff --git a/lib/edoc/vsn.mk b/lib/edoc/vsn.mk
index 24cfbf16d5..49a73331c6 100644
--- a/lib/edoc/vsn.mk
+++ b/lib/edoc/vsn.mk
@@ -1 +1 @@
-EDOC_VSN = 0.7.16
+EDOC_VSN = 0.7.17
diff --git a/lib/eldap/doc/src/notes.xml b/lib/eldap/doc/src/notes.xml
index e76101c30e..a7aefefb4a 100644
--- a/lib/eldap/doc/src/notes.xml
+++ b/lib/eldap/doc/src/notes.xml
@@ -30,6 +30,22 @@
This document describes the changes made to the Eldap application.
+Eldap 1.2
+
+ Improvements and New Features
+
+ -
+
+ Support added for LDAP Password Modify Extended Operation
+ (RFC 3062). Thanks to danielwhite.
+
+ Own Id: OTP-12282
+
+
+
+
+
+
Eldap 1.1.1
Fixed Bugs and Malfunctions
diff --git a/lib/eunit/doc/src/notes.xml b/lib/eunit/doc/src/notes.xml
index 6b76e097b6..3c6daf142e 100644
--- a/lib/eunit/doc/src/notes.xml
+++ b/lib/eunit/doc/src/notes.xml
@@ -32,6 +32,20 @@
This document describes the changes made to the EUnit application.
+Eunit 2.2.10
+
+ Fixed Bugs and Malfunctions
+
+ -
+
The eunit application is now unicode safe.
+
+ Own Id: OTP-11660
+
+
+
+
+
+
Eunit 2.2.9
Fixed Bugs and Malfunctions
diff --git a/lib/eunit/vsn.mk b/lib/eunit/vsn.mk
index dca8b3ece0..8b489bdc04 100644
--- a/lib/eunit/vsn.mk
+++ b/lib/eunit/vsn.mk
@@ -1 +1 @@
-EUNIT_VSN = 2.2.9
+EUNIT_VSN = 2.2.10
diff --git a/lib/hipe/doc/src/notes.xml b/lib/hipe/doc/src/notes.xml
index 8d3358533b..1cc8558fe8 100644
--- a/lib/hipe/doc/src/notes.xml
+++ b/lib/hipe/doc/src/notes.xml
@@ -30,6 +30,42 @@
This document describes the changes made to HiPE.
+Hipe 3.12
+
+ Fixed Bugs and Malfunctions
+
+ -
+
Fix a minor bug in the handling of opaque types.
+
+ Own Id: OTP-12666
+
+ -
+
+ Fix hipe bug when matching a "writable" binary. The bug
+ has been seen to sometimes cause a failed binary matching
+ of a correct utf8 character, but other symptoms are also
+ possible.
+
+ Own Id: OTP-12667
+
+
+
+
+
+ Improvements and New Features
+
+ -
+
+ Improved error handling when memory allocation for HiPE
+ code fails.
+
+ Own Id: OTP-12448
+
+
+
+
+
+
Hipe 3.11.3
Fixed Bugs and Malfunctions
diff --git a/lib/hipe/vsn.mk b/lib/hipe/vsn.mk
index 60b4e0559b..e507ae933f 100644
--- a/lib/hipe/vsn.mk
+++ b/lib/hipe/vsn.mk
@@ -1 +1 @@
-HIPE_VSN = 3.11.3
+HIPE_VSN = 3.12
diff --git a/lib/inets/doc/src/notes.xml b/lib/inets/doc/src/notes.xml
index 12bbc2b736..7939787601 100644
--- a/lib/inets/doc/src/notes.xml
+++ b/lib/inets/doc/src/notes.xml
@@ -32,7 +32,26 @@
notes.xml
- Inets 5.10.7
+ Inets 6.0
+
+ Improvements and New Features
+
+ -
+
+ Remove Server Side Include support from inets, as this is
+ an old technic that has security issues and was not well
+ tested.
+
+ *** POTENTIAL INCOMPATIBILITY ***
+
+ Own Id: OTP-12156
+
+
+
+
+
+
+Inets 5.10.7
Improvements and New Features
diff --git a/lib/inets/vsn.mk b/lib/inets/vsn.mk
index e9ecb2632a..d5cb460404 100644
--- a/lib/inets/vsn.mk
+++ b/lib/inets/vsn.mk
@@ -18,6 +18,6 @@
# %CopyrightEnd%
APPLICATION = inets
-INETS_VSN = 5.10.7
+INETS_VSN = 6.0
PRE_VSN =
APP_VSN = "$(APPLICATION)-$(INETS_VSN)$(PRE_VSN)"
diff --git a/lib/jinterface/doc/src/notes.xml b/lib/jinterface/doc/src/notes.xml
index fc5f8be53e..f854fa1f3a 100644
--- a/lib/jinterface/doc/src/notes.xml
+++ b/lib/jinterface/doc/src/notes.xml
@@ -30,6 +30,59 @@
This document describes the changes made to the Jinterface application.
+Jinterface 1.6
+
+ Fixed Bugs and Malfunctions
+
+ -
+
+ Reformat the sources for JInterface uniformly and
+ according to the standard Java style guidelines. Provide
+ description of the rules applied in Eclipse format (for
+ other editors one can check the settings against these).
+
+ In short, the formatting style is: * indentation uses
+ only spaces; each level is 4 positions * no trailing
+ whitespace * mostly default Java style formatting (any
+ difference is minor) * always use {} blocks * use 'final'
+ as much as possible
+
+ Own Id: OTP-12333
+
+
+
+
+
+ Improvements and New Features
+
+ -
+
+ Add basic transport factory implementation. This makes
+ possible creating connections between nodes using ssh
+ channels for example.
+
+ Own Id: OTP-12686
+
+ -
+
+ Add Jinterface generic match and bind methods to provide
+ low level interface base methods sufficient for variety
+ of higher level pattern matching/variable binding
+ implementations.
+
+ Own Id: OTP-12691
+
+ -
+
+ Minimal Java version is now 1.6
+
+ Own Id: OTP-12718
+
+
+
+
+
+
Jinterface 1.5.12
Fixed Bugs and Malfunctions
diff --git a/lib/jinterface/vsn.mk b/lib/jinterface/vsn.mk
index 72ad316333..4df01d1151 100644
--- a/lib/jinterface/vsn.mk
+++ b/lib/jinterface/vsn.mk
@@ -1 +1 @@
-JINTERFACE_VSN = 1.5.12
+JINTERFACE_VSN = 1.6
diff --git a/lib/kernel/doc/src/notes.xml b/lib/kernel/doc/src/notes.xml
index 6f7f18a8e7..0bd9a067ca 100644
--- a/lib/kernel/doc/src/notes.xml
+++ b/lib/kernel/doc/src/notes.xml
@@ -30,6 +30,79 @@
This document describes the changes made to the Kernel application.
+Kernel 4.0
+
+ Fixed Bugs and Malfunctions
+
+ -
+
+ Fix error handling in file:read_line/1 for Unicode
+ contents.
+
+ Own Id: OTP-12144
+
+ -
+
+ Introduce os:getenv/2 which is similar to
+ os:getenv/1 but returns the passed default value
+ if the required environment variable is undefined.
+
+ Own Id: OTP-12342
+
+ -
+
+ It is now possible to paste text in JCL mode (using
+ Ctrl-Y) that has been copied in the previous shell
+ session. Also a bug that caused the JCL mode to crash
+ when pasting text has been fixed.
+
+ Own Id: OTP-12673
+
+
+
+
+
+ Improvements and New Features
+
+ -
+
+ New BIF: erlang:get_keys/0 , lists all keys
+ associated with the process dictionary. Note:
+ erlang:get_keys/0 is auto-imported.
+
+ *** POTENTIAL INCOMPATIBILITY ***
+
+ Own Id: OTP-12151 Aux Id: seq12521
+
+ -
+
+ The internal group to user_drv protocol has been changed
+ to be synchronous in order to guarantee that output sent
+ to a process implementing the user_drv protocol is
+ printed before replying. This protocol is used by the
+ standard_output device and the ssh application when
+ acting as a client.
+
+ This change changes the previous unlimited buffer when
+ printing to standard_io and other devices that end up in
+ user_drv to 1KB.
+
+ *** POTENTIAL INCOMPATIBILITY ***
+
+ Own Id: OTP-12240
+
+ -
+
The inflateInit/2 and deflateInit/6
+ functions now accepts a WindowBits argument equal to 8
+ and -8.
+
+ Own Id: OTP-12564
+
+
+
+
+
+
Kernel 3.2
Fixed Bugs and Malfunctions
diff --git a/lib/kernel/vsn.mk b/lib/kernel/vsn.mk
index e1d447a465..c912da0091 100644
--- a/lib/kernel/vsn.mk
+++ b/lib/kernel/vsn.mk
@@ -1 +1 @@
-KERNEL_VSN = 3.2
+KERNEL_VSN = 4.0
diff --git a/lib/mnesia/doc/src/notes.xml b/lib/mnesia/doc/src/notes.xml
index dc98efbff3..7f6ff1e655 100644
--- a/lib/mnesia/doc/src/notes.xml
+++ b/lib/mnesia/doc/src/notes.xml
@@ -38,7 +38,37 @@
thus constitutes one section in this document. The title of each
section is the version number of Mnesia.
- Mnesia 4.12.5
+ Mnesia 4.13
+
+ Fixed Bugs and Malfunctions
+
+ -
+
+ Mnesia's dirty functions did not always exit with
+ {aborted, Reason} as documented when an error
+ occurred.
+
+ Own Id: OTP-12714
+
+
+
+
+
+ Improvements and New Features
+
+ -
+
+ Make Mnesia DCD dump behavior at start up optional, when
+ turned off mnesia loads large disc_copies tables faster.
+
+ Own Id: OTP-12481
+
+
+
+
+
+
+Mnesia 4.12.5
Fixed Bugs and Malfunctions
diff --git a/lib/mnesia/vsn.mk b/lib/mnesia/vsn.mk
index b23339e408..79dd495c4b 100644
--- a/lib/mnesia/vsn.mk
+++ b/lib/mnesia/vsn.mk
@@ -1 +1 @@
-MNESIA_VSN = 4.12.5
+MNESIA_VSN = 4.13
diff --git a/lib/observer/doc/src/notes.xml b/lib/observer/doc/src/notes.xml
index a9ec68fc9e..338708db43 100644
--- a/lib/observer/doc/src/notes.xml
+++ b/lib/observer/doc/src/notes.xml
@@ -31,6 +31,28 @@
This document describes the changes made to the Observer
application.
+Observer 2.1
+
+ Improvements and New Features
+
+ -
+
+ Added the possibility to view sasl log entries for
+ processes.
+
+ Own Id: OTP-12504
+
+ -
+
+ Add memory allocator usage and utilization graphs.
+
+ Own Id: OTP-12631
+
+
+
+
+
+
Observer 2.0.4
Fixed Bugs and Malfunctions
diff --git a/lib/observer/vsn.mk b/lib/observer/vsn.mk
index 10ed3bdfe5..7e7e32099b 100644
--- a/lib/observer/vsn.mk
+++ b/lib/observer/vsn.mk
@@ -1 +1 @@
-OBSERVER_VSN = 2.0.4
+OBSERVER_VSN = 2.1
diff --git a/lib/orber/doc/src/notes.xml b/lib/orber/doc/src/notes.xml
index 2167a43eee..1ffd86a1fb 100644
--- a/lib/orber/doc/src/notes.xml
+++ b/lib/orber/doc/src/notes.xml
@@ -33,7 +33,23 @@
- Orber 3.7.1
+ Orber 3.8
+
+ Improvements and New Features
+
+ -
+
Remove the usage of erlang:now() from all Corba
+ applications and use the new rand module instead of
+ random.
+
+ Own Id: OTP-12687
+
+
+
+
+
+
+Orber 3.7.1
Fixed Bugs and Malfunctions
diff --git a/lib/os_mon/doc/src/notes.xml b/lib/os_mon/doc/src/notes.xml
index d3acc1effc..bd4206d748 100644
--- a/lib/os_mon/doc/src/notes.xml
+++ b/lib/os_mon/doc/src/notes.xml
@@ -30,6 +30,25 @@
This document describes the changes made to the OS_Mon application.
+Os_Mon 2.4
+
+ Improvements and New Features
+
+ -
+
+ cpu_sup should use native sysctl/libkvm calls on BSD
+
+ This avoids forking off with os:cmd every time we just
+ want to collect the load averages. riak does this every
+ second, which results in a lot of unnecessary load.
+
+ Own Id: OTP-12730
+
+
+
+
+
+
Os_Mon 2.3.1
Fixed Bugs and Malfunctions
diff --git a/lib/os_mon/vsn.mk b/lib/os_mon/vsn.mk
index 833e855e0e..7f2667e40a 100644
--- a/lib/os_mon/vsn.mk
+++ b/lib/os_mon/vsn.mk
@@ -1 +1 @@
-OS_MON_VSN = 2.3.1
+OS_MON_VSN = 2.4
diff --git a/lib/parsetools/doc/src/notes.xml b/lib/parsetools/doc/src/notes.xml
index c8cb70b6d2..1751238d20 100644
--- a/lib/parsetools/doc/src/notes.xml
+++ b/lib/parsetools/doc/src/notes.xml
@@ -30,6 +30,21 @@
This document describes the changes made to the Parsetools application.
+Parsetools 2.1
+
+ Improvements and New Features
+
+ -
+
The new -dialyzer() attribute is used for
+ suppressing Dialyzer warnings in generated code.
+
+ Own Id: OTP-12271
+
+
+
+
+
+
Parsetools 2.0.12
Fixed Bugs and Malfunctions
diff --git a/lib/parsetools/vsn.mk b/lib/parsetools/vsn.mk
index dd9cc2991c..b99b3bb713 100644
--- a/lib/parsetools/vsn.mk
+++ b/lib/parsetools/vsn.mk
@@ -1 +1 @@
-PARSETOOLS_VSN = 2.0.12
+PARSETOOLS_VSN = 2.1
diff --git a/lib/percept/doc/src/notes.xml b/lib/percept/doc/src/notes.xml
index b51c8fcb4d..19d6cd6d01 100644
--- a/lib/percept/doc/src/notes.xml
+++ b/lib/percept/doc/src/notes.xml
@@ -32,6 +32,21 @@
This document describes the changes made to the Percept application.
+Percept 0.8.11
+
+ Fixed Bugs and Malfunctions
+
+ -
+
+ Fix http server configuration
+
+ Own Id: OTP-12662
+
+
+
+
+
+
Percept 0.8.10
Fixed Bugs and Malfunctions
diff --git a/lib/percept/vsn.mk b/lib/percept/vsn.mk
index 4451354e21..833ab35aa5 100644
--- a/lib/percept/vsn.mk
+++ b/lib/percept/vsn.mk
@@ -1 +1 @@
-PERCEPT_VSN = 0.8.10
+PERCEPT_VSN = 0.8.11
diff --git a/lib/public_key/doc/src/notes.xml b/lib/public_key/doc/src/notes.xml
index f241a91eb0..df65ad7004 100644
--- a/lib/public_key/doc/src/notes.xml
+++ b/lib/public_key/doc/src/notes.xml
@@ -34,6 +34,37 @@
notes.xml
+Public_Key 1.0
+
+ Improvements and New Features
+
+ -
+
+ public_key: Remove legacy switch compact_bit_string
+
+ E.i bitstrings will not be decode as {Unused, Binary},
+ they are now Erlang bitstrings.
+
+ Also the compact_bit_string implies the
+ legacy_erlang_types switch So removing the switch will
+ also make OCTET STRING values be represented as binaries.
+
+ Undecoded open type will now be wrapped in a
+ asn1_OPENTYPE tuple.
+
+ This will change some values in records returned by the
+ public_key API making this change a potentiall
+ incompatibility.
+
+ *** POTENTIAL INCOMPATIBILITY ***
+
+ Own Id: OTP-12110
+
+
+
+
+
+
Public_Key 0.23
Improvements and New Features
diff --git a/lib/sasl/doc/src/notes.xml b/lib/sasl/doc/src/notes.xml
index 95d7c6fa50..c0ac0cf79c 100644
--- a/lib/sasl/doc/src/notes.xml
+++ b/lib/sasl/doc/src/notes.xml
@@ -30,6 +30,30 @@
This document describes the changes made to the SASL application.
+SASL 2.4.2
+
+ Fixed Bugs and Malfunctions
+
+ -
+
+ The undocumented upgrade instruction
+ {remove_module,PrePurge,PostPurge,DepMods} is
+ removed. This instruction was added for symmetry reasons
+ in OTP R7B, but was never documented or tested.
+
+ The existing instruction {add_module,Mod,DepMods}
+ is now documented, and the complementing instruction
+ {delete_module,Mod,DepMods} is added.
+
+ *** POTENTIAL INCOMPATIBILITY ***
+
+ Own Id: OTP-11540
+
+
+
+
+
+
SASL 2.4.1
Fixed Bugs and Malfunctions
diff --git a/lib/sasl/vsn.mk b/lib/sasl/vsn.mk
index 4259a2d76c..8d1a043410 100644
--- a/lib/sasl/vsn.mk
+++ b/lib/sasl/vsn.mk
@@ -1 +1 @@
-SASL_VSN = 2.4.1
+SASL_VSN = 2.4.2
diff --git a/lib/ssh/doc/src/notes.xml b/lib/ssh/doc/src/notes.xml
index 41885c684c..af5b78bff2 100644
--- a/lib/ssh/doc/src/notes.xml
+++ b/lib/ssh/doc/src/notes.xml
@@ -29,6 +29,72 @@
notes.xml
+Ssh 4.0
+
+ Fixed Bugs and Malfunctions
+
+ -
+
+ Included test of the 'e' and 'f' parameters in dh key
+ exchange as specified in rfc 4253 section 8.
+
+ Own Id: OTP-12649
+
+ -
+
+ Fixes the bug that once the rekey_limit bytes (by
+ default, 1GB) had been transmitted the connection was
+ rekeyed every minute, not after the next 'rekey_limit'.
+
+ Thanks to Simon Cornish for the report and the fix!
+
+ Own Id: OTP-12692
+
+ -
+
+ Fixes a bug that causes an SFTP connection to always fail
+ when {timeout, Timeout} option is used with
+ ssh_sftp:start_channel.
+
+ Thanks to Simon Cornish
+
+ Own Id: OTP-12708
+
+
+
+
+
+ Improvements and New Features
+
+ -
+
+ The internal group to user_drv protocol has been changed
+ to be synchronous in order to guarantee that output sent
+ to a process implementing the user_drv protocol is
+ printed before replying. This protocol is used by the
+ standard_output device and the ssh application when
+ acting as a client.
+
+ This change changes the previous unlimited buffer when
+ printing to standard_io and other devices that end up in
+ user_drv to 1KB.
+
+ *** POTENTIAL INCOMPATIBILITY ***
+
+ Own Id: OTP-12240
+
+ -
+
+ If ssh_connection:subsystem/4 fails we do not want to
+ crash but rather terminate gracefully.
+
+ Own Id: OTP-12648 Aux Id: seq12834
+
+
+
+
+
+
Ssh 3.2.2
Improvements and New Features
diff --git a/lib/ssl/doc/src/notes.xml b/lib/ssl/doc/src/notes.xml
index 352563700b..e0992d317c 100644
--- a/lib/ssl/doc/src/notes.xml
+++ b/lib/ssl/doc/src/notes.xml
@@ -25,7 +25,68 @@
notes.xml
This document describes the changes made to the SSL application.
- SSL 6.0
+ SSL 7.0
+
+ Fixed Bugs and Malfunctions
+
+ -
+
+ Ignore signature_algorithm (TLS 1.2 extension) sent to
+ TLS 1.0 or TLS 1.1 server
+
+ Own Id: OTP-12670
+
+
+
+
+
+ Improvements and New Features
+
+ -
+
+ Add new API functions to handle CRL-verification
+
+ Own Id: OTP-10362 Aux Id: kunagi-215 [126]
+
+ -
+
+ Remove default support for SSL-3.0, due to Poodle
+ vunrability in protocol specification.
+
+ Add padding check for TLS-1.0 to remove Poodle
+ vunrability from TLS 1.0, also add the option
+ padding_check. This option only affects TLS-1.0
+ connections and if set to false it disables the block
+ cipher padding check to be able to interoperate with
+ legacy software.
+
+ Remove default support for RC4 cipher suites, as they are
+ consider too weak.
+
+ *** POTENTIAL INCOMPATIBILITY ***
+
+ Own Id: OTP-12390
+
+ -
+
+ Add support for TLS ALPN (Application-Layer Protocol
+ Negotiation) extension.
+
+ Own Id: OTP-12580
+
+ -
+
+ Add SNI (Server Name Indication) support for the server
+ side.
+
+ Own Id: OTP-12736
+
+
+
+
+
+
+SSL 6.0
Fixed Bugs and Malfunctions
diff --git a/lib/stdlib/doc/src/notes.xml b/lib/stdlib/doc/src/notes.xml
index 301a5ee2e8..3914a9bc0e 100644
--- a/lib/stdlib/doc/src/notes.xml
+++ b/lib/stdlib/doc/src/notes.xml
@@ -30,6 +30,224 @@
This document describes the changes made to the STDLIB application.
+STDLIB 2.5
+
+ Fixed Bugs and Malfunctions
+
+ -
+
+ Fix handling of single dot in filename:join/2
+
+ The reference manual says that filename:join(A,B) is
+ equivalent to filename:join([A,B]). In some rare cases
+ this turns out not to be true. For example:
+
+ filename:join("/a/.","b") -> "/a/./b" vs
+ filename:join(["/a/.","b"]) -> "/a/b" .
+
+ This has been corrected. A single dot is now only kept if
+ it occurs at the very beginning or the very end of the
+ resulting path.
+
+ *** POTENTIAL INCOMPATIBILITY ***
+
+ Own Id: OTP-12158
+
+ -
+
+ The undocumented option generic_debug for
+ gen_server has been removed.
+
+ Own Id: OTP-12183
+
+ -
+
+ erl_lint:icrt_export/4 has been rewritten to make the
+ code really follow the scoping rules of Erlang, and not
+ just in most situations by accident.
+
+ Own Id: OTP-12186
+
+ -
+
+ Add 'trim_all' option to binary:split/3
+
+ This option can be set to remove _ALL_ empty parts of the
+ result of a call to binary:split/3.
+
+ Own Id: OTP-12301
+
+ -
+
Correct orddict(3) regarding evaluation order of
+ fold() and map() .
+
+ Own Id: OTP-12651 Aux Id: seq12832
+
+ -
+
+ Correct maps module error exceptions
+
+ Bad input to maps module function will now yield the
+ following exceptions: - {badmap,NotMap}
+ or,
- badarg
+
+ Own Id: OTP-12657
+
+ -
+
+ It is now possible to paste text in JCL mode (using
+ Ctrl-Y) that has been copied in the previous shell
+ session. Also a bug that caused the JCL mode to crash
+ when pasting text has been fixed.
+
+ Own Id: OTP-12673
+
+
+
+
+
+ Improvements and New Features
+
+ -
+
+ Allow maps for supervisor flags and child specs
+
+ Earlier, supervisor flags and child specs were given as
+ tuples. While this is kept for backwards compatibility,
+ it is now also allowed to give these parameters as maps,
+ see sup_flags
+ and child_spec .
+
+ Own Id: OTP-11043
+
+ -
+
+ A new system message, terminate , is added. This
+ can be sent with sys:terminate/2,3 . If the
+ receiving process handles system messages properly it
+ will terminate shortly after receiving this message.
+
+ The new function proc_lib:stop/1,3 utilizes this
+ new system message and monitors the receiving process in
+ order to facilitate a synchronous stop mechanism for
+ 'special processes'.
+
+ proc_lib:stop/1,3 is used by the following
+ functions:
+
+ gen_server:stop/1,3 (new)
+ gen_fsm:stop/1,3 (new)
+ gen_event:stop/1,3 (modified to be
+ synchronous) wx_object:stop/1,3
+ (new)
+
+ Own Id: OTP-11173 Aux Id: seq12353
+
+ -
+
+ Remove the pg module, which has been deprecated
+ through OTP-17, is now removed from the STDLIB
+ application. This module has been marked experimental for
+ more than 15 years, and has largely been superseded by
+ the pg2 module from the Kernel application.
+
+ Own Id: OTP-11907
+
+ -
+
+ New BIF: erlang:get_keys/0 , lists all keys
+ associated with the process dictionary. Note:
+ erlang:get_keys/0 is auto-imported.
+
+ *** POTENTIAL INCOMPATIBILITY ***
+
+ Own Id: OTP-12151 Aux Id: seq12521
+
+ -
+
Add three new functions to io_lib --
+ scan_format/2 , unscan_format/1 , and
+ build_text/1 -- which expose the parsed form of the
+ format control sequences to make it possible to easily
+ modify or filter the input to io_lib:format/2 .
+ This can e.g. be used in order to replace unbounded-size
+ control sequences like ~w or ~p with
+ corresponding depth-limited ~W and ~P
+ before doing the actual formatting.
+
+ Own Id: OTP-12167
+
+ -
+
Introduce the erl_anno module, an abstraction
+ of the second element of tokens and tuples in the
+ abstract format.
+
+ Own Id: OTP-12195
+
+ -
+
+ Support variables as Map keys in expressions and patterns
+ Erlang will accept any expression as keys in Map
+ expressions and it will accept literals or bound
+ variables as keys in Map patterns.
+
+ Own Id: OTP-12218
+
+ -
+
The last traces of Mnemosyne Rules have been removed.
+
+
+ Own Id: OTP-12257
+
+ -
+
+ Properly support maps in match_specs
+
+ Own Id: OTP-12270
+
+ -
+
+ New function ets:take/2 . Works the same as
+ ets:delete/2 but also returns the deleted
+ object(s).
+
+ Own Id: OTP-12309
+
+ -
+
string:tokens/2 is somewhat faster, especially
+ if the list of separators only contains one separator
+ character.
+
+ Own Id: OTP-12422 Aux Id: seq12774
+
+ -
+
+ Prevent zip:zip_open/[12] from leaking file descriptors
+ if parent process dies.
+
+ Own Id: OTP-12566
+
+ -
+
+ Add a new random number generator, see rand
+ module. It have better characteristics and an improved
+ interface.
+
+ Own Id: OTP-12586 Aux Id: OTP-12501, OTP-12502
+
+ -
+
filename:split/1 when given an empty binary
+ will now return an empty list, to make it consistent with
+ return value when given an empty list.
+
+ Own Id: OTP-12716
+
+
+
+
+
+
STDLIB 2.4
Fixed Bugs and Malfunctions
diff --git a/lib/stdlib/vsn.mk b/lib/stdlib/vsn.mk
index f57f31c8de..a1f2a946b1 100644
--- a/lib/stdlib/vsn.mk
+++ b/lib/stdlib/vsn.mk
@@ -1 +1 @@
-STDLIB_VSN = 2.4
+STDLIB_VSN = 2.5
diff --git a/lib/syntax_tools/doc/src/notes.xml b/lib/syntax_tools/doc/src/notes.xml
index 408f6d5bac..8f245083c4 100644
--- a/lib/syntax_tools/doc/src/notes.xml
+++ b/lib/syntax_tools/doc/src/notes.xml
@@ -31,6 +31,20 @@
This document describes the changes made to the Syntax_Tools
application.
+Syntax_Tools 1.7
+
+ Improvements and New Features
+
+ -
+
Use the new erl_anno module.
+
+ Own Id: OTP-12732
+
+
+
+
+
+
Syntax_Tools 1.6.18
Fixed Bugs and Malfunctions
diff --git a/lib/syntax_tools/vsn.mk b/lib/syntax_tools/vsn.mk
index 1c42ef0ddb..403e90196e 100644
--- a/lib/syntax_tools/vsn.mk
+++ b/lib/syntax_tools/vsn.mk
@@ -1 +1 @@
-SYNTAX_TOOLS_VSN = 1.6.18
+SYNTAX_TOOLS_VSN = 1.7
diff --git a/lib/test_server/doc/src/notes.xml b/lib/test_server/doc/src/notes.xml
index e996d2b4a3..6cf7a2b52d 100644
--- a/lib/test_server/doc/src/notes.xml
+++ b/lib/test_server/doc/src/notes.xml
@@ -32,6 +32,55 @@
notes.xml
+Test_Server 3.9
+
+ Fixed Bugs and Malfunctions
+
+ -
+
+ The status of an aborted test due to test suite
+ compilation error has changed from 'auto_skipped' to
+ 'failed'. This affects both the textual log file, event
+ handling and CT hook callbacks. The logging of
+ compilation failures has also been improved, especially
+ in the case of multiple test suites failing compilation.
+
+ Own Id: OTP-10816
+
+
+
+
+
+ Improvements and New Features
+
+ -
+
+ The Test Server application has been marked as obsolete
+ and will be removed from OTP in the next major release
+ (OTP 19.0).
+
+ Own Id: OTP-10923 Aux Id: OTP-12705
+
+ -
+
+ When running OTP tests using the ts interface, it is now
+ possible to specify so called test categories per OTP
+ application. A test category is represented by a CT test
+ specification and defines an arbitrary subset of existing
+ test suites, groups and cases. Examples of test
+ categories are 'smoke' (smoke tests) and 'bench'
+ (benchmarks). (Call ts:help() for more info). Also,
+ functions for reading terms from the current test
+ specification during test, ct:get_testspec_terms/0 and
+ ct:get_testspec_terms/1, have been implemented.
+
+ Own Id: OTP-11962
+
+
+
+
+
+
Test_Server 3.8.1
Fixed Bugs and Malfunctions
diff --git a/lib/tools/doc/src/notes.xml b/lib/tools/doc/src/notes.xml
index 38b57b73a9..85610d623a 100644
--- a/lib/tools/doc/src/notes.xml
+++ b/lib/tools/doc/src/notes.xml
@@ -30,6 +30,65 @@
This document describes the changes made to the Tools application.
+Tools 2.8
+
+ Fixed Bugs and Malfunctions
+
+ -
+
+ In order to improve performance of the cover tool, new
+ functions are added for cover compilation and analysis on
+ multiple files. This allows for more parallelisation.
+
+ Some improvements of the data base access is also done in
+ order to improve the performance when analysing and
+ resetting cover data.
+
+ Minor incompatibility: An error reason from
+ analyse_to_file is changed from no_source_code_found to
+ {no_source_code_found,Module}.
+
+ *** POTENTIAL INCOMPATIBILITY ***
+
+ Own Id: OTP-12330 Aux Id: seq12757
+
+
+
+
+
+ Improvements and New Features
+
+ -
+
+ Allow maps for supervisor flags and child specs
+
+ Earlier, supervisor flags and child specs were given as
+ tuples. While this is kept for backwards compatibility,
+ it is now also allowed to give these parameters as maps,
+ see sup_flags
+ and child_spec .
+
+ Own Id: OTP-11043
+
+ -
+
+ Remove Mnemosyne rules support.
+
+ Own Id: OTP-12511
+
+ -
+
+ Add printout of total number of calls and time in eprof
+
+ Own Id: OTP-12681
+
+
+
+
+
+
Tools 2.7.2
Fixed Bugs and Malfunctions
diff --git a/lib/tools/vsn.mk b/lib/tools/vsn.mk
index 3b3202d38b..68c3f6e29c 100644
--- a/lib/tools/vsn.mk
+++ b/lib/tools/vsn.mk
@@ -1 +1 @@
-TOOLS_VSN = 2.7.2
+TOOLS_VSN = 2.8
diff --git a/lib/typer/doc/src/notes.xml b/lib/typer/doc/src/notes.xml
index 23e22759d6..045b55ffe4 100644
--- a/lib/typer/doc/src/notes.xml
+++ b/lib/typer/doc/src/notes.xml
@@ -30,6 +30,20 @@
This document describes the changes made to TypEr.
+TypEr 0.9.9
+
+ Fixed Bugs and Malfunctions
+
+ -
+
Properly extract annotations from core code.
+
+ Own Id: OTP-12727
+
+
+
+
+
+
TypEr 0.9.8
Fixed Bugs and Malfunctions
diff --git a/lib/typer/vsn.mk b/lib/typer/vsn.mk
index ce658e257b..74c0ccfc59 100644
--- a/lib/typer/vsn.mk
+++ b/lib/typer/vsn.mk
@@ -1 +1 @@
-TYPER_VSN = 0.9.8
+TYPER_VSN = 0.9.9
diff --git a/lib/webtool/doc/src/notes.xml b/lib/webtool/doc/src/notes.xml
index e571668c91..4800dd6df4 100644
--- a/lib/webtool/doc/src/notes.xml
+++ b/lib/webtool/doc/src/notes.xml
@@ -31,6 +31,23 @@
This document describes the changes made to the Webtool
application.
+WebTool 0.9
+
+ Improvements and New Features
+
+ -
+
+ The Webtool application has been marked as obsolete and
+ will be removed from OTP in the next major release (OTP
+ 19.0).
+
+ Own Id: OTP-10922 Aux Id: OTP-12705
+
+
+
+
+
+
WebTool 0.8.10
Fixed Bugs and Malfunctions
diff --git a/lib/wx/doc/src/notes.xml b/lib/wx/doc/src/notes.xml
index 682ab48ca0..d31e927458 100644
--- a/lib/wx/doc/src/notes.xml
+++ b/lib/wx/doc/src/notes.xml
@@ -31,6 +31,55 @@
This document describes the changes made to the wxErlang
application.
+Wx 1.4
+
+ Fixed Bugs and Malfunctions
+
+ -
+
+ The undocumented option generic_debug for
+ gen_server has been removed.
+
+ Own Id: OTP-12183
+
+
+
+
+
+ Improvements and New Features
+
+ -
+
+ Use wxWidgets-3.0, if found, as default backend on
+ windows.
+
+ Own Id: OTP-12632
+
+ -
+
+ Add missing fields in some events records. May require a
+ recompilation of user applications.
+
+ Own Id: OTP-12660
+
+
+
+
+
+ Known Bugs and Problems
+
+ -
+
+ Remove raise condition where wx could crash during
+ emulator stoppage.
+
+ Own Id: OTP-12734
+
+
+
+
+
+
Wx 1.3.3
Fixed Bugs and Malfunctions
diff --git a/lib/wx/vsn.mk b/lib/wx/vsn.mk
index 942d4c0d6f..09fb9f384c 100644
--- a/lib/wx/vsn.mk
+++ b/lib/wx/vsn.mk
@@ -1 +1 @@
-WX_VSN = 1.3.3
+WX_VSN = 1.4
diff --git a/lib/xmerl/doc/src/notes.xml b/lib/xmerl/doc/src/notes.xml
index 3fa1f01a79..b9cc2bd329 100644
--- a/lib/xmerl/doc/src/notes.xml
+++ b/lib/xmerl/doc/src/notes.xml
@@ -31,6 +31,20 @@
This document describes the changes made to the Xmerl application.
+Xmerl 1.3.8
+
+ Fixed Bugs and Malfunctions
+
+ -
+
Remove compiler warnings in xmerl.
+
+ Own Id: OTP-12689
+
+
+
+
+
+
Xmerl 1.3.7
Fixed Bugs and Malfunctions
--
cgit v1.2.3
From 9a81b28598fadc44bf506354c9227e41aac786f6 Mon Sep 17 00:00:00 2001
From: Henrik Nord
Date: Wed, 13 May 2015 09:40:16 +0200
Subject: Revert "Prepare release"
This reverts commit e09dd66dc4d89c62ddfd8c19791f9678d5d787c6.
---
lib/asn1/doc/src/notes.xml | 17 ---
lib/asn1/vsn.mk | 2 +-
lib/common_test/doc/src/notes.xml | 73 ------------
lib/compiler/doc/src/notes.xml | 88 --------------
lib/compiler/vsn.mk | 2 +-
lib/cosEvent/doc/src/notes.xml | 18 +--
lib/cosEventDomain/doc/src/notes.xml | 18 +--
lib/cosFileTransfer/doc/src/notes.xml | 18 +--
lib/cosNotification/doc/src/notes.xml | 18 +--
lib/cosProperty/doc/src/notes.xml | 18 +--
lib/cosTime/doc/src/notes.xml | 18 +--
lib/cosTransactions/doc/src/notes.xml | 18 +--
lib/crypto/doc/src/notes.xml | 43 -------
lib/crypto/vsn.mk | 2 +-
lib/debugger/doc/src/notes.xml | 18 ---
lib/debugger/vsn.mk | 2 +-
lib/dialyzer/doc/src/notes.xml | 86 --------------
lib/dialyzer/vsn.mk | 2 +-
lib/edoc/doc/src/notes.xml | 15 ---
lib/edoc/vsn.mk | 2 +-
lib/eldap/doc/src/notes.xml | 16 ---
lib/eunit/doc/src/notes.xml | 14 ---
lib/eunit/vsn.mk | 2 +-
lib/hipe/doc/src/notes.xml | 36 ------
lib/hipe/vsn.mk | 2 +-
lib/inets/doc/src/notes.xml | 21 +---
lib/inets/vsn.mk | 2 +-
lib/jinterface/doc/src/notes.xml | 53 ---------
lib/jinterface/vsn.mk | 2 +-
lib/kernel/doc/src/notes.xml | 73 ------------
lib/kernel/vsn.mk | 2 +-
lib/mnesia/doc/src/notes.xml | 32 +----
lib/mnesia/vsn.mk | 2 +-
lib/observer/doc/src/notes.xml | 22 ----
lib/observer/vsn.mk | 2 +-
lib/orber/doc/src/notes.xml | 18 +--
lib/os_mon/doc/src/notes.xml | 19 ---
lib/os_mon/vsn.mk | 2 +-
lib/parsetools/doc/src/notes.xml | 15 ---
lib/parsetools/vsn.mk | 2 +-
lib/percept/doc/src/notes.xml | 15 ---
lib/percept/vsn.mk | 2 +-
lib/public_key/doc/src/notes.xml | 31 -----
lib/sasl/doc/src/notes.xml | 24 ----
lib/sasl/vsn.mk | 2 +-
lib/ssh/doc/src/notes.xml | 66 ----------
lib/ssl/doc/src/notes.xml | 63 +---------
lib/stdlib/doc/src/notes.xml | 218 ----------------------------------
lib/stdlib/vsn.mk | 2 +-
lib/syntax_tools/doc/src/notes.xml | 14 ---
lib/syntax_tools/vsn.mk | 2 +-
lib/test_server/doc/src/notes.xml | 49 --------
lib/tools/doc/src/notes.xml | 59 ---------
lib/tools/vsn.mk | 2 +-
lib/typer/doc/src/notes.xml | 14 ---
lib/typer/vsn.mk | 2 +-
lib/webtool/doc/src/notes.xml | 17 ---
lib/wx/doc/src/notes.xml | 49 --------
lib/wx/vsn.mk | 2 +-
lib/xmerl/doc/src/notes.xml | 14 ---
60 files changed, 33 insertions(+), 1429 deletions(-)
(limited to 'lib')
diff --git a/lib/asn1/doc/src/notes.xml b/lib/asn1/doc/src/notes.xml
index f73d21b9e3..9feb673c04 100644
--- a/lib/asn1/doc/src/notes.xml
+++ b/lib/asn1/doc/src/notes.xml
@@ -31,23 +31,6 @@
This document describes the changes made to the asn1 application.
-Asn1 4.0
-
- Fixed Bugs and Malfunctions
-
- -
-
- Many bugs have been eliminated in the the ASN.1 compiler
- so that it can now successfully compile many more ASN.1
- specifications. Error messages have also been improved.
-
- Own Id: OTP-12395
-
-
-
-
-
-
Asn1 3.0.4
Fixed Bugs and Malfunctions
diff --git a/lib/asn1/vsn.mk b/lib/asn1/vsn.mk
index d4c46863a3..c909c908d6 100644
--- a/lib/asn1/vsn.mk
+++ b/lib/asn1/vsn.mk
@@ -1 +1 @@
-ASN1_VSN = 4.0
+ASN1_VSN = 3.0.4
diff --git a/lib/common_test/doc/src/notes.xml b/lib/common_test/doc/src/notes.xml
index 218f76d403..472e3b7833 100644
--- a/lib/common_test/doc/src/notes.xml
+++ b/lib/common_test/doc/src/notes.xml
@@ -32,79 +32,6 @@
notes.xml
-Common_Test 1.11
-
- Fixed Bugs and Malfunctions
-
- -
-
- The status of an aborted test due to test suite
- compilation error has changed from 'auto_skipped' to
- 'failed'. This affects both the textual log file, event
- handling and CT hook callbacks. The logging of
- compilation failures has also been improved, especially
- in the case of multiple test suites failing compilation.
-
- Own Id: OTP-10816
-
-
-
-
-
- Improvements and New Features
-
- -
-
- Earlier there was no way to add optional parameters like
- default-operation to an edit-config request sent with
- ct_netconfc:edit_config/3,4, you had to use
- ct_netconfc:send_rpc/2,3. For simplicity and completion,
- a new optional argument, OptParams, is now added to the
- edit_config function.
-
- Own Id: OTP-10446 Aux Id: kunagi-266 [177]
-
- -
-
- When running OTP tests using the ts interface, it is now
- possible to specify so called test categories per OTP
- application. A test category is represented by a CT test
- specification and defines an arbitrary subset of existing
- test suites, groups and cases. Examples of test
- categories are 'smoke' (smoke tests) and 'bench'
- (benchmarks). (Call ts:help() for more info). Also,
- functions for reading terms from the current test
- specification during test, ct:get_testspec_terms/0 and
- ct:get_testspec_terms/1, have been implemented.
-
- Own Id: OTP-11962
-
- -
-
- Obsolete scripts and make file operations have been
- removed and the installation chapter in the Common Test
- User's Guide has been updated.
-
- Own Id: OTP-12421
-
- -
-
- The 'keep_alive' interval has been reduced to 8 seconds,
- which is two seconds shorter than the default
- 'idle_timeout' value for ct_telnet:expect/3. This way,
- the telnet server receives a NOP message (which might
- trigger an action) before the operation times out. Also
- the TCP option 'nodelay' has been enabled per default for
- all telnet connections, in order to reduce the risk for
- communication timeouts.
-
- Own Id: OTP-12678 Aux Id: seq12818
-
-
-
-
-
-
Common_Test 1.10.1
Fixed Bugs and Malfunctions
diff --git a/lib/compiler/doc/src/notes.xml b/lib/compiler/doc/src/notes.xml
index 0654738247..9b5b44f3e1 100644
--- a/lib/compiler/doc/src/notes.xml
+++ b/lib/compiler/doc/src/notes.xml
@@ -31,94 +31,6 @@
This document describes the changes made to the Compiler
application.
-Compiler 6.0
-
- Fixed Bugs and Malfunctions
-
- -
-
- The compiler optimizes away building of terms that are
- never actually used. As a result, the compiler in OTP 18
- may produce more warnings for terms that are built but
- not used than the compiler in OTP 17.
-
- Own Id: OTP-12453
-
- -
-
- Using a map could incorrectly suppress warnings for
- unused variables.
-
- Own Id: OTP-12515
-
- -
-
- The compiler now properly reports unknown parse
- transforms. That is, undef exceptions coming from
- the parse transform itself is reported differently from
- the absence of the parse transform.
-
- Own Id: OTP-12723
-
-
-
-
-
- Improvements and New Features
-
- -
-
- The cerl and cerl_trees modules in the
- compiler application are now documented.
-
- Own Id: OTP-11978
-
- -
-
- The deprecated 'asm ' option has been removed.
-
- *** POTENTIAL INCOMPATIBILITY ***
-
- Own Id: OTP-12100
-
- -
-
- Support variables as Map keys in expressions and patterns
- Erlang will accept any expression as keys in Map
- expressions and it will accept literals or bound
- variables as keys in Map patterns.
-
- Own Id: OTP-12218
-
- -
-
- Infer Map type information in beam_type compiler
- optimization pass.
-
- Own Id: OTP-12253
-
- -
-
- Compiler optimizations have been improved.
-
- Own Id: OTP-12393
-
- -
-
- Five undocumented functions in the module core_lib
- have been deprecated and will be removed in the next
- major release. The functions are: get_anno/{1,2} ,
- is_literal/1 , is_literal_list/1 , and
- literal_value . Use the appropriate functions in
- the cerl module instead.
-
- Own Id: OTP-12497
-
-
-
-
-
-
Compiler 5.0.4
Fixed Bugs and Malfunctions
diff --git a/lib/compiler/vsn.mk b/lib/compiler/vsn.mk
index 69f71ba5dd..05e682c893 100644
--- a/lib/compiler/vsn.mk
+++ b/lib/compiler/vsn.mk
@@ -1 +1 @@
-COMPILER_VSN = 6.0
+COMPILER_VSN = 5.0.4
diff --git a/lib/cosEvent/doc/src/notes.xml b/lib/cosEvent/doc/src/notes.xml
index 229e0c9945..8f519447fc 100644
--- a/lib/cosEvent/doc/src/notes.xml
+++ b/lib/cosEvent/doc/src/notes.xml
@@ -32,23 +32,7 @@
notes.xml
- cosEvent 2.2
-
- Improvements and New Features
-
- -
-
Remove the usage of erlang:now() from all Corba
- applications and use the new rand module instead of
- random.
-
- Own Id: OTP-12687
-
-
-
-
-
-
-cosEvent 2.1.15
+ cosEvent 2.1.15
Improvements and New Features
diff --git a/lib/cosEventDomain/doc/src/notes.xml b/lib/cosEventDomain/doc/src/notes.xml
index 72408b52f4..2c3bf16411 100644
--- a/lib/cosEventDomain/doc/src/notes.xml
+++ b/lib/cosEventDomain/doc/src/notes.xml
@@ -31,23 +31,7 @@
notes.xml
- cosEventDomain 1.2
-
- Improvements and New Features
-
- -
-
Remove the usage of erlang:now() from all Corba
- applications and use the new rand module instead of
- random.
-
- Own Id: OTP-12687
-
-
-
-
-
-
-cosEventDomain 1.1.14
+ cosEventDomain 1.1.14
Improvements and New Features
diff --git a/lib/cosFileTransfer/doc/src/notes.xml b/lib/cosFileTransfer/doc/src/notes.xml
index a3cce2a7d8..1d0c826d40 100644
--- a/lib/cosFileTransfer/doc/src/notes.xml
+++ b/lib/cosFileTransfer/doc/src/notes.xml
@@ -30,23 +30,7 @@
notes.xml
- cosFileTransfer 1.2
-
- Improvements and New Features
-
- -
-
Remove the usage of erlang:now() from all Corba
- applications and use the new rand module instead of
- random.
-
- Own Id: OTP-12687
-
-
-
-
-
-
-cosFileTransfer 1.1.16
+ cosFileTransfer 1.1.16
Improvements and New Features
diff --git a/lib/cosNotification/doc/src/notes.xml b/lib/cosNotification/doc/src/notes.xml
index b16571a1cf..2e4f922142 100644
--- a/lib/cosNotification/doc/src/notes.xml
+++ b/lib/cosNotification/doc/src/notes.xml
@@ -31,23 +31,7 @@
notes.xml
- cosNotification 1.2
-
- Improvements and New Features
-
- -
-
Remove the usage of erlang:now() from all Corba
- applications and use the new rand module instead of
- random.
-
- Own Id: OTP-12687
-
-
-
-
-
-
-cosNotification 1.1.21
+ cosNotification 1.1.21
Improvements and New Features
diff --git a/lib/cosProperty/doc/src/notes.xml b/lib/cosProperty/doc/src/notes.xml
index 1885a8fd6b..739f41617f 100644
--- a/lib/cosProperty/doc/src/notes.xml
+++ b/lib/cosProperty/doc/src/notes.xml
@@ -31,23 +31,7 @@
notes.xml
- cosProperty 1.2
-
- Improvements and New Features
-
- -
-
Remove the usage of erlang:now() from all Corba
- applications and use the new rand module instead of
- random.
-
- Own Id: OTP-12687
-
-
-
-
-
-
-cosProperty 1.1.17
+ cosProperty 1.1.17
Improvements and New Features
diff --git a/lib/cosTime/doc/src/notes.xml b/lib/cosTime/doc/src/notes.xml
index 6c948c8c2b..f218f19a6b 100644
--- a/lib/cosTime/doc/src/notes.xml
+++ b/lib/cosTime/doc/src/notes.xml
@@ -32,23 +32,7 @@
notes.xml
- cosTime 1.2
-
- Improvements and New Features
-
- -
-
Remove the usage of erlang:now() from all Corba
- applications and use the new rand module instead of
- random.
-
- Own Id: OTP-12687
-
-
-
-
-
-
-cosTime 1.1.14
+ cosTime 1.1.14
Improvements and New Features
diff --git a/lib/cosTransactions/doc/src/notes.xml b/lib/cosTransactions/doc/src/notes.xml
index ae3b9eb6f2..4b20f23efb 100644
--- a/lib/cosTransactions/doc/src/notes.xml
+++ b/lib/cosTransactions/doc/src/notes.xml
@@ -32,23 +32,7 @@
notes.xml
- cosTransactions 1.3
-
- Improvements and New Features
-
- -
-
Remove the usage of erlang:now() from all Corba
- applications and use the new rand module instead of
- random.
-
- Own Id: OTP-12687
-
-
-
-
-
-
-cosTransactions 1.2.14
+ cosTransactions 1.2.14
Improvements and New Features
diff --git a/lib/crypto/doc/src/notes.xml b/lib/crypto/doc/src/notes.xml
index 6ab109e349..a0ebc4b3dd 100644
--- a/lib/crypto/doc/src/notes.xml
+++ b/lib/crypto/doc/src/notes.xml
@@ -30,49 +30,6 @@
This document describes the changes made to the Crypto application.
-Crypto 3.6
-
- Fixed Bugs and Malfunctions
-
- -
-
- Enhance crypto:generate_key to calculate ECC public keys
- from private key.
-
- Own Id: OTP-12394
-
- -
-
- Fix bug in crypto:generate_key for ecdh
- that could cause VM crash for faulty input.
-
- Own Id: OTP-12733
-
-
-
-
-
- Improvements and New Features
-
- -
-
- Use the EVP API for AES-CBC crypto to enables the use of
- hardware acceleration for AES-CBC crypto on newer Intel
- CPUs (AES-NI), among other platforms.
-
- Own Id: OTP-12380
-
- -
-
- Add AES ECB block encryption.
-
- Own Id: OTP-12403
-
-
-
-
-
-
Crypto 3.5
Improvements and New Features
diff --git a/lib/crypto/vsn.mk b/lib/crypto/vsn.mk
index 55b1b3e8c4..8489b59562 100644
--- a/lib/crypto/vsn.mk
+++ b/lib/crypto/vsn.mk
@@ -1 +1 @@
-CRYPTO_VSN = 3.6
+CRYPTO_VSN = 3.5
diff --git a/lib/debugger/doc/src/notes.xml b/lib/debugger/doc/src/notes.xml
index 2bf80597b5..7384189a6f 100644
--- a/lib/debugger/doc/src/notes.xml
+++ b/lib/debugger/doc/src/notes.xml
@@ -32,24 +32,6 @@
This document describes the changes made to the Debugger
application.
-Debugger 4.1
-
- Improvements and New Features
-
- -
-
- Support variables as Map keys in expressions and patterns
- Erlang will accept any expression as keys in Map
- expressions and it will accept literals or bound
- variables as keys in Map patterns.
-
- Own Id: OTP-12218
-
-
-
-
-
-
Debugger 4.0.3
Fixed Bugs and Malfunctions
diff --git a/lib/debugger/vsn.mk b/lib/debugger/vsn.mk
index b6fd4e8e44..b82f0f4e37 100644
--- a/lib/debugger/vsn.mk
+++ b/lib/debugger/vsn.mk
@@ -1 +1 @@
-DEBUGGER_VSN = 4.1
+DEBUGGER_VSN = 4.0.3
diff --git a/lib/dialyzer/doc/src/notes.xml b/lib/dialyzer/doc/src/notes.xml
index d30882b5b9..8976679c1d 100644
--- a/lib/dialyzer/doc/src/notes.xml
+++ b/lib/dialyzer/doc/src/notes.xml
@@ -31,92 +31,6 @@
This document describes the changes made to the Dialyzer
application.
-Dialyzer 2.8
-
- Fixed Bugs and Malfunctions
-
- -
-
The translation of Erlang forms to the type
- representation used by Dialyzer has been improved in
- several ways. The most important change is that deeply
- nested records can be handled.
-
- Own Id: OTP-12350
-
- -
-
Update the PLT properly when a module is changed.
- (Thanks to James Fish for the bug report, and to Stavros
- Aronis for fixing the bug.)
-
- Own Id: OTP-12637
-
- -
-
- An argument of '*'/2 is not constraind if the other
- operand can be zero.
-
- Own Id: OTP-12725
-
-
-
-
-
- Improvements and New Features
-
- -
-
The -dialyzer() attribute can be used for
- suppressing warnings in a module by specifying functions
- or warning options. It can also be used for requesting
- warnings in a module.
-
- Own Id: OTP-10280
-
- -
-
The pre-defined types array() , dict() ,
- digraph() , gb_set() , gb_tree() ,
- queue() , set() , and tid() have been
- removed.
-
- Own Id: OTP-11445 Aux Id: OTP-10342, OTP-9352
-
- -
-
A few type names that have been used for representing
- certain predefined types can now be used for user-defined
- types. This affects the types product/_ ,
- union/_ , and range/2 as well as
- tuple/N (N > 0), map/N (N > 0),
- atom/1 , integer/1 , binary/2 ,
- record/_, and 'fun'/_ . A consequence is
- that, for example, it is no longer possible to refer to a
- record type with record(r) ; instead the usual
- record notation, #r{} , is to be used.
-
- *** POTENTIAL INCOMPATIBILITY ***
-
- Own Id: OTP-11851
-
- -
-
When implementing user-defined behaviours it is now
- possible to specify optional callback functions. See OTP
- Design Principles User's Guide, Sys and Proc_Lib,
- User-Defined Behaviours, for details.
-
- Own Id: OTP-11861
-
- -
-
Add two options to the Dialyzer:
- no_missing_calls suppresses warnings about calls
- to missing or unexported functions; unknown lets
- warnings about unknown functions or types affect the exit
- status. See also dialyzer(3).
-
- Own Id: OTP-12682
-
-
-
-
-
-
Dialyzer 2.7.4
Fixed Bugs and Malfunctions
diff --git a/lib/dialyzer/vsn.mk b/lib/dialyzer/vsn.mk
index 48e0830109..527afaf4ef 100644
--- a/lib/dialyzer/vsn.mk
+++ b/lib/dialyzer/vsn.mk
@@ -1 +1 @@
-DIALYZER_VSN = 2.8
+DIALYZER_VSN = 2.7.4
diff --git a/lib/edoc/doc/src/notes.xml b/lib/edoc/doc/src/notes.xml
index 48bb415ab3..e350adb540 100644
--- a/lib/edoc/doc/src/notes.xml
+++ b/lib/edoc/doc/src/notes.xml
@@ -31,21 +31,6 @@
This document describes the changes made to the EDoc
application.
-Edoc 0.7.17
-
- Improvements and New Features
-
- -
-
- Remove functionality related to packages
-
- Own Id: OTP-12431
-
-
-
-
-
-
Edoc 0.7.16
Fixed Bugs and Malfunctions
diff --git a/lib/edoc/vsn.mk b/lib/edoc/vsn.mk
index 49a73331c6..24cfbf16d5 100644
--- a/lib/edoc/vsn.mk
+++ b/lib/edoc/vsn.mk
@@ -1 +1 @@
-EDOC_VSN = 0.7.17
+EDOC_VSN = 0.7.16
diff --git a/lib/eldap/doc/src/notes.xml b/lib/eldap/doc/src/notes.xml
index a7aefefb4a..e76101c30e 100644
--- a/lib/eldap/doc/src/notes.xml
+++ b/lib/eldap/doc/src/notes.xml
@@ -30,22 +30,6 @@
This document describes the changes made to the Eldap application.
-Eldap 1.2
-
- Improvements and New Features
-
- -
-
- Support added for LDAP Password Modify Extended Operation
- (RFC 3062). Thanks to danielwhite.
-
- Own Id: OTP-12282
-
-
-
-
-
-
Eldap 1.1.1
Fixed Bugs and Malfunctions
diff --git a/lib/eunit/doc/src/notes.xml b/lib/eunit/doc/src/notes.xml
index 3c6daf142e..6b76e097b6 100644
--- a/lib/eunit/doc/src/notes.xml
+++ b/lib/eunit/doc/src/notes.xml
@@ -32,20 +32,6 @@
This document describes the changes made to the EUnit application.
-Eunit 2.2.10
-
- Fixed Bugs and Malfunctions
-
- -
-
The eunit application is now unicode safe.
-
- Own Id: OTP-11660
-
-
-
-
-
-
Eunit 2.2.9
Fixed Bugs and Malfunctions
diff --git a/lib/eunit/vsn.mk b/lib/eunit/vsn.mk
index 8b489bdc04..dca8b3ece0 100644
--- a/lib/eunit/vsn.mk
+++ b/lib/eunit/vsn.mk
@@ -1 +1 @@
-EUNIT_VSN = 2.2.10
+EUNIT_VSN = 2.2.9
diff --git a/lib/hipe/doc/src/notes.xml b/lib/hipe/doc/src/notes.xml
index 1cc8558fe8..8d3358533b 100644
--- a/lib/hipe/doc/src/notes.xml
+++ b/lib/hipe/doc/src/notes.xml
@@ -30,42 +30,6 @@
This document describes the changes made to HiPE.
-Hipe 3.12
-
- Fixed Bugs and Malfunctions
-
- -
-
Fix a minor bug in the handling of opaque types.
-
- Own Id: OTP-12666
-
- -
-
- Fix hipe bug when matching a "writable" binary. The bug
- has been seen to sometimes cause a failed binary matching
- of a correct utf8 character, but other symptoms are also
- possible.
-
- Own Id: OTP-12667
-
-
-
-
-
- Improvements and New Features
-
- -
-
- Improved error handling when memory allocation for HiPE
- code fails.
-
- Own Id: OTP-12448
-
-
-
-
-
-
Hipe 3.11.3
Fixed Bugs and Malfunctions
diff --git a/lib/hipe/vsn.mk b/lib/hipe/vsn.mk
index e507ae933f..60b4e0559b 100644
--- a/lib/hipe/vsn.mk
+++ b/lib/hipe/vsn.mk
@@ -1 +1 @@
-HIPE_VSN = 3.12
+HIPE_VSN = 3.11.3
diff --git a/lib/inets/doc/src/notes.xml b/lib/inets/doc/src/notes.xml
index 7939787601..12bbc2b736 100644
--- a/lib/inets/doc/src/notes.xml
+++ b/lib/inets/doc/src/notes.xml
@@ -32,26 +32,7 @@
notes.xml
- Inets 6.0
-
- Improvements and New Features
-
- -
-
- Remove Server Side Include support from inets, as this is
- an old technic that has security issues and was not well
- tested.
-
- *** POTENTIAL INCOMPATIBILITY ***
-
- Own Id: OTP-12156
-
-
-
-
-
-
-Inets 5.10.7
+ Inets 5.10.7
Improvements and New Features
diff --git a/lib/inets/vsn.mk b/lib/inets/vsn.mk
index d5cb460404..e9ecb2632a 100644
--- a/lib/inets/vsn.mk
+++ b/lib/inets/vsn.mk
@@ -18,6 +18,6 @@
# %CopyrightEnd%
APPLICATION = inets
-INETS_VSN = 6.0
+INETS_VSN = 5.10.7
PRE_VSN =
APP_VSN = "$(APPLICATION)-$(INETS_VSN)$(PRE_VSN)"
diff --git a/lib/jinterface/doc/src/notes.xml b/lib/jinterface/doc/src/notes.xml
index f854fa1f3a..fc5f8be53e 100644
--- a/lib/jinterface/doc/src/notes.xml
+++ b/lib/jinterface/doc/src/notes.xml
@@ -30,59 +30,6 @@
This document describes the changes made to the Jinterface application.
-Jinterface 1.6
-
- Fixed Bugs and Malfunctions
-
- -
-
- Reformat the sources for JInterface uniformly and
- according to the standard Java style guidelines. Provide
- description of the rules applied in Eclipse format (for
- other editors one can check the settings against these).
-
- In short, the formatting style is: * indentation uses
- only spaces; each level is 4 positions * no trailing
- whitespace * mostly default Java style formatting (any
- difference is minor) * always use {} blocks * use 'final'
- as much as possible
-
- Own Id: OTP-12333
-
-
-
-
-
- Improvements and New Features
-
- -
-
- Add basic transport factory implementation. This makes
- possible creating connections between nodes using ssh
- channels for example.
-
- Own Id: OTP-12686
-
- -
-
- Add Jinterface generic match and bind methods to provide
- low level interface base methods sufficient for variety
- of higher level pattern matching/variable binding
- implementations.
-
- Own Id: OTP-12691
-
- -
-
- Minimal Java version is now 1.6
-
- Own Id: OTP-12718
-
-
-
-
-
-
Jinterface 1.5.12
Fixed Bugs and Malfunctions
diff --git a/lib/jinterface/vsn.mk b/lib/jinterface/vsn.mk
index 4df01d1151..72ad316333 100644
--- a/lib/jinterface/vsn.mk
+++ b/lib/jinterface/vsn.mk
@@ -1 +1 @@
-JINTERFACE_VSN = 1.6
+JINTERFACE_VSN = 1.5.12
diff --git a/lib/kernel/doc/src/notes.xml b/lib/kernel/doc/src/notes.xml
index 0bd9a067ca..6f7f18a8e7 100644
--- a/lib/kernel/doc/src/notes.xml
+++ b/lib/kernel/doc/src/notes.xml
@@ -30,79 +30,6 @@
This document describes the changes made to the Kernel application.
-Kernel 4.0
-
- Fixed Bugs and Malfunctions
-
- -
-
- Fix error handling in file:read_line/1 for Unicode
- contents.
-
- Own Id: OTP-12144
-
- -
-
- Introduce os:getenv/2 which is similar to
- os:getenv/1 but returns the passed default value
- if the required environment variable is undefined.
-
- Own Id: OTP-12342
-
- -
-
- It is now possible to paste text in JCL mode (using
- Ctrl-Y) that has been copied in the previous shell
- session. Also a bug that caused the JCL mode to crash
- when pasting text has been fixed.
-
- Own Id: OTP-12673
-
-
-
-
-
- Improvements and New Features
-
- -
-
- New BIF: erlang:get_keys/0 , lists all keys
- associated with the process dictionary. Note:
- erlang:get_keys/0 is auto-imported.
-
- *** POTENTIAL INCOMPATIBILITY ***
-
- Own Id: OTP-12151 Aux Id: seq12521
-
- -
-
- The internal group to user_drv protocol has been changed
- to be synchronous in order to guarantee that output sent
- to a process implementing the user_drv protocol is
- printed before replying. This protocol is used by the
- standard_output device and the ssh application when
- acting as a client.
-
- This change changes the previous unlimited buffer when
- printing to standard_io and other devices that end up in
- user_drv to 1KB.
-
- *** POTENTIAL INCOMPATIBILITY ***
-
- Own Id: OTP-12240
-
- -
-
The inflateInit/2 and deflateInit/6
- functions now accepts a WindowBits argument equal to 8
- and -8.
-
- Own Id: OTP-12564
-
-
-
-
-
-
Kernel 3.2
Fixed Bugs and Malfunctions
diff --git a/lib/kernel/vsn.mk b/lib/kernel/vsn.mk
index c912da0091..e1d447a465 100644
--- a/lib/kernel/vsn.mk
+++ b/lib/kernel/vsn.mk
@@ -1 +1 @@
-KERNEL_VSN = 4.0
+KERNEL_VSN = 3.2
diff --git a/lib/mnesia/doc/src/notes.xml b/lib/mnesia/doc/src/notes.xml
index 7f6ff1e655..dc98efbff3 100644
--- a/lib/mnesia/doc/src/notes.xml
+++ b/lib/mnesia/doc/src/notes.xml
@@ -38,37 +38,7 @@
thus constitutes one section in this document. The title of each
section is the version number of Mnesia.
- Mnesia 4.13
-
- Fixed Bugs and Malfunctions
-
- -
-
- Mnesia's dirty functions did not always exit with
- {aborted, Reason} as documented when an error
- occurred.
-
- Own Id: OTP-12714
-
-
-
-
-
- Improvements and New Features
-
- -
-
- Make Mnesia DCD dump behavior at start up optional, when
- turned off mnesia loads large disc_copies tables faster.
-
- Own Id: OTP-12481
-
-
-
-
-
-
-Mnesia 4.12.5
+ Mnesia 4.12.5
Fixed Bugs and Malfunctions
diff --git a/lib/mnesia/vsn.mk b/lib/mnesia/vsn.mk
index 79dd495c4b..b23339e408 100644
--- a/lib/mnesia/vsn.mk
+++ b/lib/mnesia/vsn.mk
@@ -1 +1 @@
-MNESIA_VSN = 4.13
+MNESIA_VSN = 4.12.5
diff --git a/lib/observer/doc/src/notes.xml b/lib/observer/doc/src/notes.xml
index 338708db43..a9ec68fc9e 100644
--- a/lib/observer/doc/src/notes.xml
+++ b/lib/observer/doc/src/notes.xml
@@ -31,28 +31,6 @@
This document describes the changes made to the Observer
application.
-Observer 2.1
-
- Improvements and New Features
-
- -
-
- Added the possibility to view sasl log entries for
- processes.
-
- Own Id: OTP-12504
-
- -
-
- Add memory allocator usage and utilization graphs.
-
- Own Id: OTP-12631
-
-
-
-
-
-
Observer 2.0.4
Fixed Bugs and Malfunctions
diff --git a/lib/observer/vsn.mk b/lib/observer/vsn.mk
index 7e7e32099b..10ed3bdfe5 100644
--- a/lib/observer/vsn.mk
+++ b/lib/observer/vsn.mk
@@ -1 +1 @@
-OBSERVER_VSN = 2.1
+OBSERVER_VSN = 2.0.4
diff --git a/lib/orber/doc/src/notes.xml b/lib/orber/doc/src/notes.xml
index 1ffd86a1fb..2167a43eee 100644
--- a/lib/orber/doc/src/notes.xml
+++ b/lib/orber/doc/src/notes.xml
@@ -33,23 +33,7 @@
- Orber 3.8
-
- Improvements and New Features
-
- -
-
Remove the usage of erlang:now() from all Corba
- applications and use the new rand module instead of
- random.
-
- Own Id: OTP-12687
-
-
-
-
-
-
-Orber 3.7.1
+ Orber 3.7.1
Fixed Bugs and Malfunctions
diff --git a/lib/os_mon/doc/src/notes.xml b/lib/os_mon/doc/src/notes.xml
index bd4206d748..d3acc1effc 100644
--- a/lib/os_mon/doc/src/notes.xml
+++ b/lib/os_mon/doc/src/notes.xml
@@ -30,25 +30,6 @@
This document describes the changes made to the OS_Mon application.
-Os_Mon 2.4
-
- Improvements and New Features
-
- -
-
- cpu_sup should use native sysctl/libkvm calls on BSD
-
- This avoids forking off with os:cmd every time we just
- want to collect the load averages. riak does this every
- second, which results in a lot of unnecessary load.
-
- Own Id: OTP-12730
-
-
-
-
-
-
Os_Mon 2.3.1
Fixed Bugs and Malfunctions
diff --git a/lib/os_mon/vsn.mk b/lib/os_mon/vsn.mk
index 7f2667e40a..833e855e0e 100644
--- a/lib/os_mon/vsn.mk
+++ b/lib/os_mon/vsn.mk
@@ -1 +1 @@
-OS_MON_VSN = 2.4
+OS_MON_VSN = 2.3.1
diff --git a/lib/parsetools/doc/src/notes.xml b/lib/parsetools/doc/src/notes.xml
index 1751238d20..c8cb70b6d2 100644
--- a/lib/parsetools/doc/src/notes.xml
+++ b/lib/parsetools/doc/src/notes.xml
@@ -30,21 +30,6 @@
This document describes the changes made to the Parsetools application.
-Parsetools 2.1
-
- Improvements and New Features
-
- -
-
The new -dialyzer() attribute is used for
- suppressing Dialyzer warnings in generated code.
-
- Own Id: OTP-12271
-
-
-
-
-
-
Parsetools 2.0.12
Fixed Bugs and Malfunctions
diff --git a/lib/parsetools/vsn.mk b/lib/parsetools/vsn.mk
index b99b3bb713..dd9cc2991c 100644
--- a/lib/parsetools/vsn.mk
+++ b/lib/parsetools/vsn.mk
@@ -1 +1 @@
-PARSETOOLS_VSN = 2.1
+PARSETOOLS_VSN = 2.0.12
diff --git a/lib/percept/doc/src/notes.xml b/lib/percept/doc/src/notes.xml
index 19d6cd6d01..b51c8fcb4d 100644
--- a/lib/percept/doc/src/notes.xml
+++ b/lib/percept/doc/src/notes.xml
@@ -32,21 +32,6 @@
This document describes the changes made to the Percept application.
-Percept 0.8.11
-
- Fixed Bugs and Malfunctions
-
- -
-
- Fix http server configuration
-
- Own Id: OTP-12662
-
-
-
-
-
-
Percept 0.8.10
Fixed Bugs and Malfunctions
diff --git a/lib/percept/vsn.mk b/lib/percept/vsn.mk
index 833ab35aa5..4451354e21 100644
--- a/lib/percept/vsn.mk
+++ b/lib/percept/vsn.mk
@@ -1 +1 @@
-PERCEPT_VSN = 0.8.11
+PERCEPT_VSN = 0.8.10
diff --git a/lib/public_key/doc/src/notes.xml b/lib/public_key/doc/src/notes.xml
index df65ad7004..f241a91eb0 100644
--- a/lib/public_key/doc/src/notes.xml
+++ b/lib/public_key/doc/src/notes.xml
@@ -34,37 +34,6 @@
notes.xml
-Public_Key 1.0
-
- Improvements and New Features
-
- -
-
- public_key: Remove legacy switch compact_bit_string
-
- E.i bitstrings will not be decode as {Unused, Binary},
- they are now Erlang bitstrings.
-
- Also the compact_bit_string implies the
- legacy_erlang_types switch So removing the switch will
- also make OCTET STRING values be represented as binaries.
-
- Undecoded open type will now be wrapped in a
- asn1_OPENTYPE tuple.
-
- This will change some values in records returned by the
- public_key API making this change a potentiall
- incompatibility.
-
- *** POTENTIAL INCOMPATIBILITY ***
-
- Own Id: OTP-12110
-
-
-
-
-
-
Public_Key 0.23
Improvements and New Features
diff --git a/lib/sasl/doc/src/notes.xml b/lib/sasl/doc/src/notes.xml
index c0ac0cf79c..95d7c6fa50 100644
--- a/lib/sasl/doc/src/notes.xml
+++ b/lib/sasl/doc/src/notes.xml
@@ -30,30 +30,6 @@
This document describes the changes made to the SASL application.
-SASL 2.4.2
-
- Fixed Bugs and Malfunctions
-
- -
-
- The undocumented upgrade instruction
- {remove_module,PrePurge,PostPurge,DepMods} is
- removed. This instruction was added for symmetry reasons
- in OTP R7B, but was never documented or tested.
-
- The existing instruction {add_module,Mod,DepMods}
- is now documented, and the complementing instruction
- {delete_module,Mod,DepMods} is added.
-
- *** POTENTIAL INCOMPATIBILITY ***
-
- Own Id: OTP-11540
-
-
-
-
-
-
SASL 2.4.1
Fixed Bugs and Malfunctions
diff --git a/lib/sasl/vsn.mk b/lib/sasl/vsn.mk
index 8d1a043410..4259a2d76c 100644
--- a/lib/sasl/vsn.mk
+++ b/lib/sasl/vsn.mk
@@ -1 +1 @@
-SASL_VSN = 2.4.2
+SASL_VSN = 2.4.1
diff --git a/lib/ssh/doc/src/notes.xml b/lib/ssh/doc/src/notes.xml
index af5b78bff2..41885c684c 100644
--- a/lib/ssh/doc/src/notes.xml
+++ b/lib/ssh/doc/src/notes.xml
@@ -29,72 +29,6 @@
notes.xml
-Ssh 4.0
-
- Fixed Bugs and Malfunctions
-
- -
-
- Included test of the 'e' and 'f' parameters in dh key
- exchange as specified in rfc 4253 section 8.
-
- Own Id: OTP-12649
-
- -
-
- Fixes the bug that once the rekey_limit bytes (by
- default, 1GB) had been transmitted the connection was
- rekeyed every minute, not after the next 'rekey_limit'.
-
- Thanks to Simon Cornish for the report and the fix!
-
- Own Id: OTP-12692
-
- -
-
- Fixes a bug that causes an SFTP connection to always fail
- when {timeout, Timeout} option is used with
- ssh_sftp:start_channel.
-
- Thanks to Simon Cornish
-
- Own Id: OTP-12708
-
-
-
-
-
- Improvements and New Features
-
- -
-
- The internal group to user_drv protocol has been changed
- to be synchronous in order to guarantee that output sent
- to a process implementing the user_drv protocol is
- printed before replying. This protocol is used by the
- standard_output device and the ssh application when
- acting as a client.
-
- This change changes the previous unlimited buffer when
- printing to standard_io and other devices that end up in
- user_drv to 1KB.
-
- *** POTENTIAL INCOMPATIBILITY ***
-
- Own Id: OTP-12240
-
- -
-
- If ssh_connection:subsystem/4 fails we do not want to
- crash but rather terminate gracefully.
-
- Own Id: OTP-12648 Aux Id: seq12834
-
-
-
-
-
-
Ssh 3.2.2
Improvements and New Features
diff --git a/lib/ssl/doc/src/notes.xml b/lib/ssl/doc/src/notes.xml
index e0992d317c..352563700b 100644
--- a/lib/ssl/doc/src/notes.xml
+++ b/lib/ssl/doc/src/notes.xml
@@ -25,68 +25,7 @@
notes.xml
This document describes the changes made to the SSL application.
- SSL 7.0
-
- Fixed Bugs and Malfunctions
-
- -
-
- Ignore signature_algorithm (TLS 1.2 extension) sent to
- TLS 1.0 or TLS 1.1 server
-
- Own Id: OTP-12670
-
-
-
-
-
- Improvements and New Features
-
- -
-
- Add new API functions to handle CRL-verification
-
- Own Id: OTP-10362 Aux Id: kunagi-215 [126]
-
- -
-
- Remove default support for SSL-3.0, due to Poodle
- vunrability in protocol specification.
-
- Add padding check for TLS-1.0 to remove Poodle
- vunrability from TLS 1.0, also add the option
- padding_check. This option only affects TLS-1.0
- connections and if set to false it disables the block
- cipher padding check to be able to interoperate with
- legacy software.
-
- Remove default support for RC4 cipher suites, as they are
- consider too weak.
-
- *** POTENTIAL INCOMPATIBILITY ***
-
- Own Id: OTP-12390
-
- -
-
- Add support for TLS ALPN (Application-Layer Protocol
- Negotiation) extension.
-
- Own Id: OTP-12580
-
- -
-
- Add SNI (Server Name Indication) support for the server
- side.
-
- Own Id: OTP-12736
-
-
-
-
-
-
-SSL 6.0
+ SSL 6.0
Fixed Bugs and Malfunctions
diff --git a/lib/stdlib/doc/src/notes.xml b/lib/stdlib/doc/src/notes.xml
index 3914a9bc0e..301a5ee2e8 100644
--- a/lib/stdlib/doc/src/notes.xml
+++ b/lib/stdlib/doc/src/notes.xml
@@ -30,224 +30,6 @@
This document describes the changes made to the STDLIB application.
-STDLIB 2.5
-
- Fixed Bugs and Malfunctions
-
- -
-
- Fix handling of single dot in filename:join/2
-
- The reference manual says that filename:join(A,B) is
- equivalent to filename:join([A,B]). In some rare cases
- this turns out not to be true. For example:
-
- filename:join("/a/.","b") -> "/a/./b" vs
- filename:join(["/a/.","b"]) -> "/a/b" .
-
- This has been corrected. A single dot is now only kept if
- it occurs at the very beginning or the very end of the
- resulting path.
-
- *** POTENTIAL INCOMPATIBILITY ***
-
- Own Id: OTP-12158
-
- -
-
- The undocumented option generic_debug for
- gen_server has been removed.
-
- Own Id: OTP-12183
-
- -
-
- erl_lint:icrt_export/4 has been rewritten to make the
- code really follow the scoping rules of Erlang, and not
- just in most situations by accident.
-
- Own Id: OTP-12186
-
- -
-
- Add 'trim_all' option to binary:split/3
-
- This option can be set to remove _ALL_ empty parts of the
- result of a call to binary:split/3.
-
- Own Id: OTP-12301
-
- -
-
Correct orddict(3) regarding evaluation order of
- fold() and map() .
-
- Own Id: OTP-12651 Aux Id: seq12832
-
- -
-
- Correct maps module error exceptions
-
- Bad input to maps module function will now yield the
- following exceptions: - {badmap,NotMap}
- or,
- badarg
-
- Own Id: OTP-12657
-
- -
-
- It is now possible to paste text in JCL mode (using
- Ctrl-Y) that has been copied in the previous shell
- session. Also a bug that caused the JCL mode to crash
- when pasting text has been fixed.
-
- Own Id: OTP-12673
-
-
-
-
-
- Improvements and New Features
-
- -
-
- Allow maps for supervisor flags and child specs
-
- Earlier, supervisor flags and child specs were given as
- tuples. While this is kept for backwards compatibility,
- it is now also allowed to give these parameters as maps,
- see sup_flags
- and child_spec .
-
- Own Id: OTP-11043
-
- -
-
- A new system message, terminate , is added. This
- can be sent with sys:terminate/2,3 . If the
- receiving process handles system messages properly it
- will terminate shortly after receiving this message.
-
- The new function proc_lib:stop/1,3 utilizes this
- new system message and monitors the receiving process in
- order to facilitate a synchronous stop mechanism for
- 'special processes'.
-
- proc_lib:stop/1,3 is used by the following
- functions:
-
- gen_server:stop/1,3 (new)
- gen_fsm:stop/1,3 (new)
- gen_event:stop/1,3 (modified to be
- synchronous) wx_object:stop/1,3
- (new)
-
- Own Id: OTP-11173 Aux Id: seq12353
-
- -
-
- Remove the pg module, which has been deprecated
- through OTP-17, is now removed from the STDLIB
- application. This module has been marked experimental for
- more than 15 years, and has largely been superseded by
- the pg2 module from the Kernel application.
-
- Own Id: OTP-11907
-
- -
-
- New BIF: erlang:get_keys/0 , lists all keys
- associated with the process dictionary. Note:
- erlang:get_keys/0 is auto-imported.
-
- *** POTENTIAL INCOMPATIBILITY ***
-
- Own Id: OTP-12151 Aux Id: seq12521
-
- -
-
Add three new functions to io_lib --
- scan_format/2 , unscan_format/1 , and
- build_text/1 -- which expose the parsed form of the
- format control sequences to make it possible to easily
- modify or filter the input to io_lib:format/2 .
- This can e.g. be used in order to replace unbounded-size
- control sequences like ~w or ~p with
- corresponding depth-limited ~W and ~P
- before doing the actual formatting.
-
- Own Id: OTP-12167
-
- -
-
Introduce the erl_anno module, an abstraction
- of the second element of tokens and tuples in the
- abstract format.
-
- Own Id: OTP-12195
-
- -
-
- Support variables as Map keys in expressions and patterns
- Erlang will accept any expression as keys in Map
- expressions and it will accept literals or bound
- variables as keys in Map patterns.
-
- Own Id: OTP-12218
-
- -
-
The last traces of Mnemosyne Rules have been removed.
-
-
- Own Id: OTP-12257
-
- -
-
- Properly support maps in match_specs
-
- Own Id: OTP-12270
-
- -
-
- New function ets:take/2 . Works the same as
- ets:delete/2 but also returns the deleted
- object(s).
-
- Own Id: OTP-12309
-
- -
-
string:tokens/2 is somewhat faster, especially
- if the list of separators only contains one separator
- character.
-
- Own Id: OTP-12422 Aux Id: seq12774
-
- -
-
- Prevent zip:zip_open/[12] from leaking file descriptors
- if parent process dies.
-
- Own Id: OTP-12566
-
- -
-
- Add a new random number generator, see rand
- module. It have better characteristics and an improved
- interface.
-
- Own Id: OTP-12586 Aux Id: OTP-12501, OTP-12502
-
- -
-
filename:split/1 when given an empty binary
- will now return an empty list, to make it consistent with
- return value when given an empty list.
-
- Own Id: OTP-12716
-
-
-
-
-
-
STDLIB 2.4
Fixed Bugs and Malfunctions
diff --git a/lib/stdlib/vsn.mk b/lib/stdlib/vsn.mk
index a1f2a946b1..f57f31c8de 100644
--- a/lib/stdlib/vsn.mk
+++ b/lib/stdlib/vsn.mk
@@ -1 +1 @@
-STDLIB_VSN = 2.5
+STDLIB_VSN = 2.4
diff --git a/lib/syntax_tools/doc/src/notes.xml b/lib/syntax_tools/doc/src/notes.xml
index 8f245083c4..408f6d5bac 100644
--- a/lib/syntax_tools/doc/src/notes.xml
+++ b/lib/syntax_tools/doc/src/notes.xml
@@ -31,20 +31,6 @@
This document describes the changes made to the Syntax_Tools
application.
-Syntax_Tools 1.7
-
- Improvements and New Features
-
- -
-
Use the new erl_anno module.
-
- Own Id: OTP-12732
-
-
-
-
-
-
Syntax_Tools 1.6.18
Fixed Bugs and Malfunctions
diff --git a/lib/syntax_tools/vsn.mk b/lib/syntax_tools/vsn.mk
index 403e90196e..1c42ef0ddb 100644
--- a/lib/syntax_tools/vsn.mk
+++ b/lib/syntax_tools/vsn.mk
@@ -1 +1 @@
-SYNTAX_TOOLS_VSN = 1.7
+SYNTAX_TOOLS_VSN = 1.6.18
diff --git a/lib/test_server/doc/src/notes.xml b/lib/test_server/doc/src/notes.xml
index 6cf7a2b52d..e996d2b4a3 100644
--- a/lib/test_server/doc/src/notes.xml
+++ b/lib/test_server/doc/src/notes.xml
@@ -32,55 +32,6 @@
notes.xml
-Test_Server 3.9
-
- Fixed Bugs and Malfunctions
-
- -
-
- The status of an aborted test due to test suite
- compilation error has changed from 'auto_skipped' to
- 'failed'. This affects both the textual log file, event
- handling and CT hook callbacks. The logging of
- compilation failures has also been improved, especially
- in the case of multiple test suites failing compilation.
-
- Own Id: OTP-10816
-
-
-
-
-
- Improvements and New Features
-
- -
-
- The Test Server application has been marked as obsolete
- and will be removed from OTP in the next major release
- (OTP 19.0).
-
- Own Id: OTP-10923 Aux Id: OTP-12705
-
- -
-
- When running OTP tests using the ts interface, it is now
- possible to specify so called test categories per OTP
- application. A test category is represented by a CT test
- specification and defines an arbitrary subset of existing
- test suites, groups and cases. Examples of test
- categories are 'smoke' (smoke tests) and 'bench'
- (benchmarks). (Call ts:help() for more info). Also,
- functions for reading terms from the current test
- specification during test, ct:get_testspec_terms/0 and
- ct:get_testspec_terms/1, have been implemented.
-
- Own Id: OTP-11962
-
-
-
-
-
-
Test_Server 3.8.1
Fixed Bugs and Malfunctions
diff --git a/lib/tools/doc/src/notes.xml b/lib/tools/doc/src/notes.xml
index 85610d623a..38b57b73a9 100644
--- a/lib/tools/doc/src/notes.xml
+++ b/lib/tools/doc/src/notes.xml
@@ -30,65 +30,6 @@
This document describes the changes made to the Tools application.
-Tools 2.8
-
- Fixed Bugs and Malfunctions
-
- -
-
- In order to improve performance of the cover tool, new
- functions are added for cover compilation and analysis on
- multiple files. This allows for more parallelisation.
-
- Some improvements of the data base access is also done in
- order to improve the performance when analysing and
- resetting cover data.
-
- Minor incompatibility: An error reason from
- analyse_to_file is changed from no_source_code_found to
- {no_source_code_found,Module}.
-
- *** POTENTIAL INCOMPATIBILITY ***
-
- Own Id: OTP-12330 Aux Id: seq12757
-
-
-
-
-
- Improvements and New Features
-
- -
-
- Allow maps for supervisor flags and child specs
-
- Earlier, supervisor flags and child specs were given as
- tuples. While this is kept for backwards compatibility,
- it is now also allowed to give these parameters as maps,
- see sup_flags
- and child_spec .
-
- Own Id: OTP-11043
-
- -
-
- Remove Mnemosyne rules support.
-
- Own Id: OTP-12511
-
- -
-
- Add printout of total number of calls and time in eprof
-
- Own Id: OTP-12681
-
-
-
-
-
-
Tools 2.7.2
Fixed Bugs and Malfunctions
diff --git a/lib/tools/vsn.mk b/lib/tools/vsn.mk
index 68c3f6e29c..3b3202d38b 100644
--- a/lib/tools/vsn.mk
+++ b/lib/tools/vsn.mk
@@ -1 +1 @@
-TOOLS_VSN = 2.8
+TOOLS_VSN = 2.7.2
diff --git a/lib/typer/doc/src/notes.xml b/lib/typer/doc/src/notes.xml
index 045b55ffe4..23e22759d6 100644
--- a/lib/typer/doc/src/notes.xml
+++ b/lib/typer/doc/src/notes.xml
@@ -30,20 +30,6 @@
This document describes the changes made to TypEr.
-TypEr 0.9.9
-
- Fixed Bugs and Malfunctions
-
- -
-
Properly extract annotations from core code.
-
- Own Id: OTP-12727
-
-
-
-
-
-
TypEr 0.9.8
Fixed Bugs and Malfunctions
diff --git a/lib/typer/vsn.mk b/lib/typer/vsn.mk
index 74c0ccfc59..ce658e257b 100644
--- a/lib/typer/vsn.mk
+++ b/lib/typer/vsn.mk
@@ -1 +1 @@
-TYPER_VSN = 0.9.9
+TYPER_VSN = 0.9.8
diff --git a/lib/webtool/doc/src/notes.xml b/lib/webtool/doc/src/notes.xml
index 4800dd6df4..e571668c91 100644
--- a/lib/webtool/doc/src/notes.xml
+++ b/lib/webtool/doc/src/notes.xml
@@ -31,23 +31,6 @@
This document describes the changes made to the Webtool
application.
-WebTool 0.9
-
- Improvements and New Features
-
- -
-
- The Webtool application has been marked as obsolete and
- will be removed from OTP in the next major release (OTP
- 19.0).
-
- Own Id: OTP-10922 Aux Id: OTP-12705
-
-
-
-
-
-
WebTool 0.8.10
Fixed Bugs and Malfunctions
diff --git a/lib/wx/doc/src/notes.xml b/lib/wx/doc/src/notes.xml
index d31e927458..682ab48ca0 100644
--- a/lib/wx/doc/src/notes.xml
+++ b/lib/wx/doc/src/notes.xml
@@ -31,55 +31,6 @@
This document describes the changes made to the wxErlang
application.
-Wx 1.4
-
- Fixed Bugs and Malfunctions
-
- -
-
- The undocumented option generic_debug for
- gen_server has been removed.
-
- Own Id: OTP-12183
-
-
-
-
-
- Improvements and New Features
-
- -
-
- Use wxWidgets-3.0, if found, as default backend on
- windows.
-
- Own Id: OTP-12632
-
- -
-
- Add missing fields in some events records. May require a
- recompilation of user applications.
-
- Own Id: OTP-12660
-
-
-
-
-
- Known Bugs and Problems
-
- -
-
- Remove raise condition where wx could crash during
- emulator stoppage.
-
- Own Id: OTP-12734
-
-
-
-
-
-
Wx 1.3.3
Fixed Bugs and Malfunctions
diff --git a/lib/wx/vsn.mk b/lib/wx/vsn.mk
index 09fb9f384c..942d4c0d6f 100644
--- a/lib/wx/vsn.mk
+++ b/lib/wx/vsn.mk
@@ -1 +1 @@
-WX_VSN = 1.4
+WX_VSN = 1.3.3
diff --git a/lib/xmerl/doc/src/notes.xml b/lib/xmerl/doc/src/notes.xml
index b9cc2bd329..3fa1f01a79 100644
--- a/lib/xmerl/doc/src/notes.xml
+++ b/lib/xmerl/doc/src/notes.xml
@@ -31,20 +31,6 @@
This document describes the changes made to the Xmerl application.
-Xmerl 1.3.8
-
- Fixed Bugs and Malfunctions
-
- -
-
Remove compiler warnings in xmerl.
-
- Own Id: OTP-12689
-
-
-
-
-
-
Xmerl 1.3.7
Fixed Bugs and Malfunctions
--
cgit v1.2.3
From 6477f1ddad8cb2e8eb8336cda15fbb14d7fa8e93 Mon Sep 17 00:00:00 2001
From: Peter Andersson
Date: Wed, 13 May 2015 11:23:26 +0200
Subject: Fix failing test case and handling double functions on one line
---
lib/test_server/src/erl2html2.erl | 12 ++++++------
lib/test_server/test/erl2html2_SUITE.erl | 31 +++++++++++++++++++------------
2 files changed, 25 insertions(+), 18 deletions(-)
(limited to 'lib')
diff --git a/lib/test_server/src/erl2html2.erl b/lib/test_server/src/erl2html2.erl
index 9101212852..acab8dfa52 100644
--- a/lib/test_server/src/erl2html2.erl
+++ b/lib/test_server/src/erl2html2.erl
@@ -188,18 +188,18 @@ build_html(SFd,DFd,Encoding,FuncsAndCs) ->
build_html(SFd,DFd,Encoding,file:read_line(SFd),1,FuncsAndCs,
false,undefined).
-%% function start line found
-build_html(SFd,DFd,Enc,{ok,Str},L0,[{F,A,L0,LastL}|FuncsAndCs],
- _IsFuncDef,_FAndLastL) ->
- FALink = test_server_ctrl:uri_encode(F++"-"++integer_to_list(A),utf8),
- file:write(DFd,[""]),
- build_html(SFd,DFd,Enc,{ok,Str},L0,FuncsAndCs,true,{F,LastL});
%% line of last expression in function found
build_html(SFd,DFd,Enc,{ok,Str},LastL,FuncsAndCs,_IsFuncDef,{F,LastL}) ->
LastLineLink = test_server_ctrl:uri_encode(F++"-last_expr",utf8),
file:write(DFd,[""]),
build_html(SFd,DFd,Enc,{ok,Str},LastL,FuncsAndCs,true,undefined);
+%% function start line found
+build_html(SFd,DFd,Enc,{ok,Str},L0,[{F,A,L0,LastL}|FuncsAndCs],
+ _IsFuncDef,_FAndLastL) ->
+ FALink = test_server_ctrl:uri_encode(F++"-"++integer_to_list(A),utf8),
+ file:write(DFd,[""]),
+ build_html(SFd,DFd,Enc,{ok,Str},L0,FuncsAndCs,true,{F,LastL});
build_html(SFd,DFd,Enc,{ok,Str},L,[{clause,L}|FuncsAndCs],
_IsFuncDef,FAndLastL) ->
build_html(SFd,DFd,Enc,{ok,Str},L,FuncsAndCs,true,FAndLastL);
diff --git a/lib/test_server/test/erl2html2_SUITE.erl b/lib/test_server/test/erl2html2_SUITE.erl
index 908985c879..7001b6086d 100644
--- a/lib/test_server/test/erl2html2_SUITE.erl
+++ b/lib/test_server/test/erl2html2_SUITE.erl
@@ -232,33 +232,40 @@ check_line_number(Last,Line,OrigLine) ->
check_link_targets(Src,Dst,L,RmFncs) ->
Mod = list_to_atom(filename:basename(filename:rootname(Src))),
Exports = Mod:module_info(exports)--[{module_info,0},{module_info,1}|RmFncs],
- {ok,{[],L},_} = xmerl_sax_parser:file(Dst,
- [{event_fun,fun sax_event/3},
- {event_state,{Exports,0}}]),
+ LastExprFuncs = [Func || {Func,_A} <- Exports],
+ {ok,{[],[],L},_} =
+ xmerl_sax_parser:file(Dst,
+ [{event_fun,fun sax_event/3},
+ {event_state,{Exports,LastExprFuncs,0}}]),
ok.
sax_event(Event,_Loc,State) ->
sax_event(Event,State).
-sax_event({startElement,_Uri,"a",_QN,Attrs},{Exports,PrevLine}) ->
+sax_event({startElement,_Uri,"a",_QN,Attrs},{Exports,LastExprFuncs,PrevLine}) ->
{_,_,"name",Name} = lists:keyfind("name",3,Attrs),
case catch list_to_integer(Name) of
Line when is_integer(Line) ->
case PrevLine + 1 of
Line ->
-% erlang:display({found_line,Line}),
- {Exports,Line};
+ {Exports,LastExprFuncs,Line};
Other ->
ct:fail({unexpected_line_number_target,Other})
end;
{'EXIT',_} ->
- {match,[FStr,AStr]} =
- re:run(Name,"^(.*)-([0-9]+)$",[{capture,all_but_first,list}]),
+ {match,[FStr,EndStr]} =
+ re:run(Name,"^(.*)-(last_expr|[0-9]+)$",
+ [{capture,all_but_first,list}]),
F = list_to_atom(http_uri:decode(FStr)),
- A = list_to_integer(AStr),
-% erlang:display({found_fnc,F,A}),
- A = proplists:get_value(F,Exports),
- {lists:delete({F,A},Exports),PrevLine}
+ case EndStr of
+ "last_expr" ->
+ true = lists:member(F,LastExprFuncs),
+ {Exports,lists:delete(F,LastExprFuncs),PrevLine};
+ _ ->
+ A = list_to_integer(EndStr),
+ A = proplists:get_value(F,Exports),
+ {lists:delete({F,A},Exports),LastExprFuncs,PrevLine}
+ end
end;
sax_event(_,State) ->
State.
--
cgit v1.2.3
From 7aef211a66219b6fef9d0bdaf9b09be6c2e0a32f Mon Sep 17 00:00:00 2001
From: Hans Nilsson
Date: Tue, 12 May 2015 17:03:28 +0200
Subject: ssh: option for handling the SSH_MSG_DEBUG message's printouts
A fun could be given in the options that will be called whenever
the SSH_MSG_DEBUG message arrives. This enables the user to
format the printout or just discard it.
The default is changed to not print the message. In RFC4253
printing is a SHOULD, but our new default is to protect logs
from dos attacs.
---
lib/ssh/doc/src/ssh.xml | 20 +++++++-
lib/ssh/src/ssh.erl | 4 ++
lib/ssh/src/ssh_connection_handler.erl | 12 ++---
lib/ssh/test/ssh_basic_SUITE.erl | 90 ++++++++++++++++++++++++++++++++++
lib/ssh/vsn.mk | 2 +-
5 files changed, 119 insertions(+), 9 deletions(-)
(limited to 'lib')
diff --git a/lib/ssh/doc/src/ssh.xml b/lib/ssh/doc/src/ssh.xml
index 72dafc0c09..501668ca78 100644
--- a/lib/ssh/doc/src/ssh.xml
+++ b/lib/ssh/doc/src/ssh.xml
@@ -201,6 +201,14 @@
-
Sets a timeout on connection when no channels are active, default is infinity
+
+ _}]]>
+ -
+
Provide a fun to implement your own logging of the SSH message SSH_MSG_DEBUG. The last three parameters are from the message, see RFC4253, section 11.3. The ConnectionRef is the reference to the connection on which the message arrived. The return value from the fun is not checked.
+ The default behaviour is ignore the message.
+ To get a printout for each message with AlwaysDisplay = true , use for example {ssh_msg_debug_fun, fun(_,true,M,_)-> io:format("DEBUG: ~p~n", [M]) end}
+
+
@@ -383,8 +391,16 @@
-
Provide a fun to implement your own logging when a user disconnects from the server.
-
-
+
+ _}]]>
+ -
+
Provide a fun to implement your own logging of the SSH message SSH_MSG_DEBUG. The last three parameters are from the message, see RFC4253, section 11.3. The ConnectionRef is the reference to the connection on which the message arrived. The return value from the fun is not checked.
+ The default behaviour is ignore the message.
+ To get a printout for each message with AlwaysDisplay = true , use for example {ssh_msg_debug_fun, fun(_,true,M,_)-> io:format("DEBUG: ~p~n", [M]) end}
+
+
+
+
diff --git a/lib/ssh/src/ssh.erl b/lib/ssh/src/ssh.erl
index d4b02a024e..71e7d77475 100644
--- a/lib/ssh/src/ssh.erl
+++ b/lib/ssh/src/ssh.erl
@@ -312,6 +312,8 @@ handle_option([{disconnectfun, _} = Opt | Rest], SocketOptions, SshOptions) ->
handle_option(Rest, SocketOptions, [handle_ssh_option(Opt) | SshOptions]);
handle_option([{failfun, _} = Opt | Rest], SocketOptions, SshOptions) ->
handle_option(Rest, SocketOptions, [handle_ssh_option(Opt) | SshOptions]);
+handle_option([{ssh_msg_debug_fun, _} = Opt | Rest], SocketOptions, SshOptions) ->
+ handle_option(Rest, SocketOptions, [handle_ssh_option(Opt) | SshOptions]);
%%Backwards compatibility should not be underscore between ip and v6 in API
handle_option([{ip_v6_disabled, Value} | Rest], SocketOptions, SshOptions) ->
handle_option(Rest, SocketOptions, [handle_ssh_option({ipv6_disabled, Value}) | SshOptions]);
@@ -417,6 +419,8 @@ handle_ssh_option({disconnectfun , Value} = Opt) when is_function(Value) ->
Opt;
handle_ssh_option({failfun, Value} = Opt) when is_function(Value) ->
Opt;
+handle_ssh_option({ssh_msg_debug_fun, Value} = Opt) when is_function(Value,4) ->
+ Opt;
handle_ssh_option({ipv6_disabled, Value} = Opt) when is_boolean(Value) ->
throw({error, {{ipv6_disabled, Opt}, option_no_longer_valid_use_inet_option_instead}});
diff --git a/lib/ssh/src/ssh_connection_handler.erl b/lib/ssh/src/ssh_connection_handler.erl
index e1f2e059e8..0f6162db60 100644
--- a/lib/ssh/src/ssh_connection_handler.erl
+++ b/lib/ssh/src/ssh_connection_handler.erl
@@ -580,12 +580,12 @@ handle_event(#ssh_msg_disconnect{description = Desc} = DisconnectMsg, _StateName
handle_event(#ssh_msg_ignore{}, StateName, State) ->
{next_state, StateName, next_packet(State)};
-handle_event(#ssh_msg_debug{always_display = true, message = DbgMsg},
- StateName, State) ->
- io:format("DEBUG: ~p\n", [DbgMsg]),
- {next_state, StateName, next_packet(State)};
-
-handle_event(#ssh_msg_debug{}, StateName, State) ->
+handle_event(#ssh_msg_debug{always_display = Display, message = DbgMsg, language=Lang},
+ StateName, #state{opts = Opts} = State) ->
+ F = proplists:get_value(ssh_msg_debug_fun, Opts,
+ fun(_ConnRef, _AlwaysDisplay, _Msg, _Language) -> ok end
+ ),
+ catch F(self(), Display, DbgMsg, Lang),
{next_state, StateName, next_packet(State)};
handle_event(#ssh_msg_unimplemented{}, StateName, State) ->
diff --git a/lib/ssh/test/ssh_basic_SUITE.erl b/lib/ssh/test/ssh_basic_SUITE.erl
index f5f8991acc..fa7b426545 100644
--- a/lib/ssh/test/ssh_basic_SUITE.erl
+++ b/lib/ssh/test/ssh_basic_SUITE.erl
@@ -52,6 +52,8 @@ all() ->
ssh_connect_arg4_timeout,
packet_size_zero,
ssh_daemon_minimal_remote_max_packet_size_option,
+ ssh_msg_debug_fun_option_client,
+ ssh_msg_debug_fun_option_server,
id_string_no_opt_client,
id_string_own_string_client,
id_string_random_client,
@@ -493,6 +495,94 @@ server_userpassword_option(Config) when is_list(Config) ->
{user_dir, UserDir}]),
ssh:stop_daemon(Pid).
+%%--------------------------------------------------------------------
+ssh_msg_debug_fun_option_client() ->
+ [{doc, "validate client that uses the 'ssh_msg_debug_fun' option"}].
+ssh_msg_debug_fun_option_client(Config) ->
+ PrivDir = ?config(priv_dir, Config),
+ UserDir = filename:join(PrivDir, nopubkey), % to make sure we don't use public-key-auth
+ file:make_dir(UserDir),
+ SysDir = ?config(data_dir, Config),
+
+ {Pid, Host, Port} = ssh_test_lib:daemon([{system_dir, SysDir},
+ {user_dir, UserDir},
+ {password, "morot"},
+ {failfun, fun ssh_test_lib:failfun/2}]),
+ Parent = self(),
+ DbgFun = fun(ConnRef,Displ,Msg,Lang) -> Parent ! {msg_dbg,{ConnRef,Displ,Msg,Lang}} end,
+
+ ConnectionRef =
+ ssh_test_lib:connect(Host, Port, [{silently_accept_hosts, true},
+ {user, "foo"},
+ {password, "morot"},
+ {user_dir, UserDir},
+ {user_interaction, false},
+ {ssh_msg_debug_fun,DbgFun}]),
+ %% Beware, implementation knowledge:
+ gen_fsm:send_all_state_event(ConnectionRef,{ssh_msg_debug,false,<<"Hello">>,<<>>}),
+ receive
+ {msg_dbg,X={ConnectionRef,false,<<"Hello">>,<<>>}} ->
+ ct:log("Got expected dbg msg ~p",[X]),
+ ssh:stop_daemon(Pid);
+ {msg_dbg,X={_,false,<<"Hello">>,<<>>}} ->
+ ct:log("Got dbg msg but bad ConnectionRef (~p expected) ~p",[ConnectionRef,X]),
+ ssh:stop_daemon(Pid),
+ {fail, "Bad ConnectionRef received"};
+ {msg_dbg,X} ->
+ ct:log("Got bad dbg msg ~p",[X]),
+ ssh:stop_daemon(Pid),
+ {fail,"Bad msg received"}
+ after 1000 ->
+ ssh:stop_daemon(Pid),
+ {fail,timeout}
+ end.
+
+%%--------------------------------------------------------------------
+ssh_msg_debug_fun_option_server() ->
+ [{doc, "validate client that uses the 'ssh_msg_debug_fun' option"}].
+ssh_msg_debug_fun_option_server(Config) ->
+ PrivDir = ?config(priv_dir, Config),
+ UserDir = filename:join(PrivDir, nopubkey), % to make sure we don't use public-key-auth
+ file:make_dir(UserDir),
+ SysDir = ?config(data_dir, Config),
+
+ Parent = self(),
+ DbgFun = fun(ConnRef,Displ,Msg,Lang) -> Parent ! {msg_dbg,{ConnRef,Displ,Msg,Lang}} end,
+ ConnFun = fun(_,_,_) -> Parent ! {connection_pid,self()} end,
+
+ {Pid, Host, Port} = ssh_test_lib:daemon([{system_dir, SysDir},
+ {user_dir, UserDir},
+ {password, "morot"},
+ {failfun, fun ssh_test_lib:failfun/2},
+ {connectfun, ConnFun},
+ {ssh_msg_debug_fun, DbgFun}]),
+ _ConnectionRef =
+ ssh_test_lib:connect(Host, Port, [{silently_accept_hosts, true},
+ {user, "foo"},
+ {password, "morot"},
+ {user_dir, UserDir},
+ {user_interaction, false}]),
+ receive
+ {connection_pid,Server} ->
+ %% Beware, implementation knowledge:
+ gen_fsm:send_all_state_event(Server,{ssh_msg_debug,false,<<"Hello">>,<<>>}),
+ receive
+ {msg_dbg,X={_,false,<<"Hello">>,<<>>}} ->
+ ct:log("Got expected dbg msg ~p",[X]),
+ ssh:stop_daemon(Pid);
+ {msg_dbg,X} ->
+ ct:log("Got bad dbg msg ~p",[X]),
+ ssh:stop_daemon(Pid),
+ {fail,"Bad msg received"}
+ after 3000 ->
+ ssh:stop_daemon(Pid),
+ {fail,timeout2}
+ end
+ after 3000 ->
+ ssh:stop_daemon(Pid),
+ {fail,timeout1}
+ end.
+
%%--------------------------------------------------------------------
known_hosts() ->
[{doc, "check that known_hosts is updated correctly"}].
diff --git a/lib/ssh/vsn.mk b/lib/ssh/vsn.mk
index b2b85a717f..40bda0c19f 100644
--- a/lib/ssh/vsn.mk
+++ b/lib/ssh/vsn.mk
@@ -1,4 +1,4 @@
#-*-makefile-*- ; force emacs to enter makefile-mode
-SSH_VSN = 3.2.2
+SSH_VSN = 3.2.3
APP_VSN = "ssh-$(SSH_VSN)"
--
cgit v1.2.3
From 42cf8b8ca9daec40a3595034a15f9f4be1cc854b Mon Sep 17 00:00:00 2001
From: Peter Andersson
Date: Wed, 13 May 2015 15:56:11 +0200
Subject: Fix problem not recognizing 'macro' tuple from epp_dodger
OTP-12740
---
lib/test_server/src/erl2html2.erl | 6 +++-
lib/test_server/test/erl2html2_SUITE.erl | 39 ++++++++++++----------
.../test/erl2html2_SUITE_data/include/header3.hrl | 1 +
lib/test_server/test/erl2html2_SUITE_data/m1.erl | 6 ++++
4 files changed, 34 insertions(+), 18 deletions(-)
create mode 100644 lib/test_server/test/erl2html2_SUITE_data/include/header3.hrl
(limited to 'lib')
diff --git a/lib/test_server/src/erl2html2.erl b/lib/test_server/src/erl2html2.erl
index acab8dfa52..b0b5c40965 100644
--- a/lib/test_server/src/erl2html2.erl
+++ b/lib/test_server/src/erl2html2.erl
@@ -170,7 +170,11 @@ get_line(Anno) ->
%%% Find the line number of the last expression in the function
find_clause_lines([{clause,CL,_Params,_Op,Exprs}], CLs) -> % last clause
try tuple_to_list(lists:last(Exprs)) of
- [_Type,ExprLine | _] ->
+ [_Type,ExprLine | _] when is_integer(ExprLine) ->
+ {lists:reverse([{clause,get_line(CL)}|CLs]), get_line(ExprLine)};
+ [tree,_ | Exprs1] ->
+ find_clause_lines([{clause,CL,undefined,undefined,Exprs1}], CLs);
+ [macro,{_var,ExprLine,_MACRO} | _] when is_integer(ExprLine) ->
{lists:reverse([{clause,get_line(CL)}|CLs]), get_line(ExprLine)};
_ ->
{lists:reverse([{clause,get_line(CL)}|CLs]), get_line(CL)}
diff --git a/lib/test_server/test/erl2html2_SUITE.erl b/lib/test_server/test/erl2html2_SUITE.erl
index 7001b6086d..796b84dedd 100644
--- a/lib/test_server/test/erl2html2_SUITE.erl
+++ b/lib/test_server/test/erl2html2_SUITE.erl
@@ -130,15 +130,7 @@ groups() ->
%% @end
%%--------------------------------------------------------------------
all() ->
- [m1].
-
-%%--------------------------------------------------------------------
-%% @spec TestCase() -> Info
-%% Info = [tuple()]
-%% @end
-%%--------------------------------------------------------------------
-m1() ->
- [].
+ [macros_defined, macros_undefined].
%%--------------------------------------------------------------------
%% @spec TestCase(Config0) ->
@@ -149,19 +141,29 @@ m1() ->
%% Comment = term()
%% @end
%%--------------------------------------------------------------------
-m1(Config) ->
- {Src,Dst} = convert_module("m1",Config),
+macros_defined(Config) ->
+ %% let erl2html2 use epp as parser
+ DataDir = ?config(data_dir,Config),
+ InclDir = filename:join(DataDir, "include"),
+ {Src,Dst} = convert_module("m1",[InclDir],Config),
+ {true,L} = check_line_numbers(Src,Dst),
+ ok = check_link_targets(Src,Dst,L,[{baz,0}],[]),
+ ok.
+
+macros_undefined(Config) ->
+ %% let erl2html2 use epp_dodger as parser
+ {Src,Dst} = convert_module("m1",[],Config),
{true,L} = check_line_numbers(Src,Dst),
- ok = check_link_targets(Src,Dst,L,[{baz,0}]),
+ ok = check_link_targets(Src,Dst,L,[{baz,0}],[{quux,0}]),
ok.
-convert_module(Mod,Config) ->
+convert_module(Mod,InclDirs,Config) ->
DataDir = ?config(data_dir,Config),
PrivDir = ?config(priv_dir,Config),
Src = filename:join(DataDir,Mod++".erl"),
Dst = filename:join(PrivDir,Mod++".erl.html"),
io:format("~s\n",[Src,filename:basename(Src)]),
- ok = erl2html2:convert(Src, Dst, [], ""),
+ ok = erl2html2:convert(Src, Dst, InclDirs, ""),
io:format("~s\n",[Dst,filename:basename(Dst)]),
{Src,Dst}.
@@ -229,14 +231,17 @@ check_line_number(Last,Line,OrigLine) ->
%% function.
%% The test module has -compile(export_all), so all functions are
%% found by listing the exported ones.
-check_link_targets(Src,Dst,L,RmFncs) ->
+check_link_targets(Src,Dst,L,RmFncs,ShouldRemain) ->
Mod = list_to_atom(filename:basename(filename:rootname(Src))),
Exports = Mod:module_info(exports)--[{module_info,0},{module_info,1}|RmFncs],
LastExprFuncs = [Func || {Func,_A} <- Exports],
- {ok,{[],[],L},_} =
+ {ok,{FAs,Fs,L},_} =
xmerl_sax_parser:file(Dst,
[{event_fun,fun sax_event/3},
- {event_state,{Exports,LastExprFuncs,0}}]),
+ {event_state,{Exports,LastExprFuncs,0}}]),
+ true = (length(FAs) == length(ShouldRemain)),
+ [] = [FA || FA <- FAs, not lists:member(FA,ShouldRemain)],
+ [] = [F || F <- Fs, not lists:keymember(F,1,ShouldRemain)],
ok.
sax_event(Event,_Loc,State) ->
diff --git a/lib/test_server/test/erl2html2_SUITE_data/include/header3.hrl b/lib/test_server/test/erl2html2_SUITE_data/include/header3.hrl
new file mode 100644
index 0000000000..2a20850a3a
--- /dev/null
+++ b/lib/test_server/test/erl2html2_SUITE_data/include/header3.hrl
@@ -0,0 +1 @@
+-define(EPP_SWITCH, on).
diff --git a/lib/test_server/test/erl2html2_SUITE_data/m1.erl b/lib/test_server/test/erl2html2_SUITE_data/m1.erl
index 156f1d0a51..1d405963a5 100644
--- a/lib/test_server/test/erl2html2_SUITE_data/m1.erl
+++ b/lib/test_server/test/erl2html2_SUITE_data/m1.erl
@@ -7,9 +7,15 @@
-include("header1.hrl").
-include("header2.hrl").
+-include("header3.hrl").
-define(MACRO1,value).
+%% This macro is used to select parser in erl2html2.
+%% If EPP_SWITCH is defined epp is used, else epp_dodger.
+epp_switch() ->
+ ?EPP_SWITCH.
+
%%% Comment
foo(x) ->
%% Comment
--
cgit v1.2.3
From 3b46b3040b82436c904f497bd51cda79a181b500 Mon Sep 17 00:00:00 2001
From: Ingela Anderton Andin
Date: Wed, 13 May 2015 16:39:13 +0200
Subject: ssl: Align "=" sign in type declarations to decided policy
---
lib/ssl/doc/src/ssl.xml | 12 ++++++------
lib/ssl/doc/src/ssl_crl_cache_api.xml | 8 ++++----
lib/ssl/doc/src/ssl_session_cache_api.xml | 20 ++++++++++----------
3 files changed, 20 insertions(+), 20 deletions(-)
(limited to 'lib')
diff --git a/lib/ssl/doc/src/ssl.xml b/lib/ssl/doc/src/ssl.xml
index 8a0bf69be4..18d98e5efb 100644
--- a/lib/ssl/doc/src/ssl.xml
+++ b/lib/ssl/doc/src/ssl.xml
@@ -123,13 +123,13 @@
The callback gen_tcp is treated specially and calls inet
directly.
- CallbackModule
- = atom()
- DataTag
- = atom()
+ CallbackModule =
+ atom()
+ DataTag =
+ atom()
Used in socket data message.
- ClosedTag
- = atom()
+ ClosedTag =
+ atom()
Used in socket close message.
diff --git a/lib/ssl/doc/src/ssl_crl_cache_api.xml b/lib/ssl/doc/src/ssl_crl_cache_api.xml
index 90aa895aff..9230442ae0 100644
--- a/lib/ssl/doc/src/ssl_crl_cache_api.xml
+++ b/lib/ssl/doc/src/ssl_crl_cache_api.xml
@@ -47,10 +47,10 @@
- cache_ref()
- - = opaque()
- dist_point()
- = #'DistributionPoint'{} see cache_ref() =
+ - opaque()
+ dist_point() =
+ #'DistributionPoint'{} see X509 certificates records
diff --git a/lib/ssl/doc/src/ssl_session_cache_api.xml b/lib/ssl/doc/src/ssl_session_cache_api.xml
index c89d3874a1..28b5f4ce23 100644
--- a/lib/ssl/doc/src/ssl_session_cache_api.xml
+++ b/lib/ssl/doc/src/ssl_session_cache_api.xml
@@ -40,20 +40,20 @@
ssl_session_cache_api :
- cache_ref()
- = opaque()
+ cache_ref() =
+ opaque()
- key()
- = {partialkey(), session_id()}
+ key() =
+ {partialkey(), session_id()}
- partialkey()
- = opaque()
+ partialkey() =
+ opaque()
- session_id()
- = binary()
+ session_id() =
+ binary()
- session()
- = opaque()
+ session() =
+ opaque()
--
cgit v1.2.3
From ddc4e717df1da722682b6ccdbf152a6b7e15f378 Mon Sep 17 00:00:00 2001
From: beaver
Date: Wed, 25 Mar 2015 18:03:26 +0300
Subject: stdlib: Add gb_trees:iterator_from
---
lib/stdlib/doc/src/gb_trees.xml | 13 +++++++++-
lib/stdlib/src/gb_trees.erl | 31 ++++++++++++++++++++++--
lib/stdlib/test/dict_SUITE.erl | 50 +++++++++++++++++++++++++++++++++++----
lib/stdlib/test/dict_test_lib.erl | 5 +++-
4 files changed, 91 insertions(+), 8 deletions(-)
(limited to 'lib')
diff --git a/lib/stdlib/doc/src/gb_trees.xml b/lib/stdlib/doc/src/gb_trees.xml
index b2f237e1d7..82167e1083 100644
--- a/lib/stdlib/doc/src/gb_trees.xml
+++ b/lib/stdlib/doc/src/gb_trees.xml
@@ -4,7 +4,7 @@
- 2001 2014
+ 2001 2015
Ericsson AB. All Rights Reserved.
@@ -182,6 +182,17 @@
memory at one time.
+
+
+ Return an iterator for a tree starting from specified key
+
+ Returns an iterator that can be used for traversing the
+ entries of Tree ; see next/1 .
+ The difference as compared to the iterator returned by
+ iterator/1 is that the first key greater than
+ or equal to Key is returned.
+
+
Return a list of the keys in a tree
diff --git a/lib/stdlib/src/gb_trees.erl b/lib/stdlib/src/gb_trees.erl
index 7069b61873..259e8f718b 100644
--- a/lib/stdlib/src/gb_trees.erl
+++ b/lib/stdlib/src/gb_trees.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2015. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -102,6 +102,10 @@
%% approach is that it does not require the complete list of all
%% elements to be built in memory at one time.
%%
+%% - iterator_from(K, T): returns an iterator that can be used for
+%% traversing the entries of tree T with key greater than or
+%% equal to K; see `next'.
+%%
%% - next(S): returns {X, V, S1} where X is the smallest key referred to
%% by the iterator S, and S1 is the new iterator to be used for
%% traversing the remaining entries, or the atom `none' if no entries
@@ -117,7 +121,7 @@
update/3, enter/3, delete/2, delete_any/2, balance/1,
is_defined/2, keys/1, values/1, to_list/1, from_orddict/1,
smallest/1, largest/1, take_smallest/1, take_largest/1,
- iterator/1, next/1, map/2]).
+ iterator/1, iterator_from/2, next/1, map/2]).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -529,6 +533,29 @@ iterator({_, _, L, _} = T, As) ->
iterator(nil, As) ->
As.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+-spec iterator_from(Key, Tree) -> Iter when
+ Tree :: tree(Key, Value),
+ Iter :: iter(Key, Value).
+
+iterator_from(S, {_, T}) ->
+ iterator_1_from(S, T).
+
+iterator_1_from(S, T) ->
+ iterator_from(S, T, []).
+
+iterator_from(S, {K, _, _, T}, As) when K < S ->
+ iterator_from(S, T, As);
+iterator_from(_, {_, _, nil, _} = T, As) ->
+ [T | As];
+iterator_from(S, {_, _, L, _} = T, As) ->
+ iterator_from(S, L, [T | As]);
+iterator_from(_, nil, As) ->
+ As.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
-spec next(Iter1) -> 'none' | {Key, Value, Iter2} when
Iter1 :: iter(Key, Value),
Iter2 :: iter(Key, Value).
diff --git a/lib/stdlib/test/dict_SUITE.erl b/lib/stdlib/test/dict_SUITE.erl
index 69814e12ce..ab624e8dd2 100644
--- a/lib/stdlib/test/dict_SUITE.erl
+++ b/lib/stdlib/test/dict_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2015. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -25,16 +25,16 @@
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
init_per_group/2,end_per_group/2,
init_per_testcase/2,end_per_testcase/2,
- create/1,store/1]).
+ create/1,store/1,iterate/1]).
-include_lib("test_server/include/test_server.hrl").
--import(lists, [foldl/3,reverse/1]).
+-import(lists, [foldl/3]).
suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
- [create, store].
+ [create, store, iterate].
groups() ->
[].
@@ -92,6 +92,48 @@ store_1(List, M) ->
end,
D0.
+%%%
+%%% Test specifics for gb_trees.
+%%%
+
+iterate(Config) when is_list(Config) ->
+ test_all(fun iterate_1/1).
+
+iterate_1(M) ->
+ case M(module, []) of
+ gb_trees -> iterate_2(M);
+ _ -> ok
+ end,
+ M(empty, []).
+
+iterate_2(M) ->
+ random:seed(1, 2, 42),
+ iter_tree(M, 1000).
+
+iter_tree(_M, 0) ->
+ ok;
+iter_tree(M, N) ->
+ L = [{I, I} || I <- lists:seq(1, N)],
+ T = M(from_list, L),
+ L = lists:reverse(iterate_tree(M, T)),
+ R = random:uniform(N),
+ KV = lists:reverse(iterate_tree_from(M, R, T)),
+ KV = [P || P={K,_} <- L, K >= R],
+ iter_tree(M, N-1).
+
+iterate_tree(M, Tree) ->
+ I = M(iterator, Tree),
+ iterate_tree_1(M, M(next, I), []).
+
+iterate_tree_from(M, Start, Tree) ->
+ I = M(iterator_from, {Start, Tree}),
+ iterate_tree_1(M, M(next, I), []).
+
+iterate_tree_1(_, none, R) ->
+ R;
+iterate_tree_1(M, {K, V, I}, R) ->
+ iterate_tree_1(M, M(next, I), [{K, V} | R]).
+
%%%
%%% Helper functions.
%%%
diff --git a/lib/stdlib/test/dict_test_lib.erl b/lib/stdlib/test/dict_test_lib.erl
index 4fdb4fa0bd..81d26ce5f8 100644
--- a/lib/stdlib/test/dict_test_lib.erl
+++ b/lib/stdlib/test/dict_test_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2015. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -29,6 +29,9 @@ new(Mod, Eq) ->
(module, []) -> Mod;
(size, D) -> Mod:size(D);
(is_empty, D) -> Mod:is_empty(D);
+ (iterator, S) -> Mod:iterator(S);
+ (iterator_from, {Start, S}) -> Mod:iterator_from(Start, S);
+ (next, I) -> Mod:next(I);
(to_list, D) -> to_list(Mod, D)
end.
--
cgit v1.2.3
From f584a60d0e5a6fa0a8002a13e8dda2a790031427 Mon Sep 17 00:00:00 2001
From: Hans Bolinder
Date: Tue, 12 May 2015 14:15:40 +0200
Subject: stdlib: Add gb_sets:iterator_from
---
lib/stdlib/doc/src/gb_sets.xml | 13 +++++++++++-
lib/stdlib/src/gb_sets.erl | 24 +++++++++++++++++++--
lib/stdlib/test/sets_SUITE.erl | 44 ++++++++++++++++++++++++++++++++++++---
lib/stdlib/test/sets_test_lib.erl | 5 ++++-
4 files changed, 79 insertions(+), 7 deletions(-)
(limited to 'lib')
diff --git a/lib/stdlib/doc/src/gb_sets.xml b/lib/stdlib/doc/src/gb_sets.xml
index ea96c14472..405bae5698 100644
--- a/lib/stdlib/doc/src/gb_sets.xml
+++ b/lib/stdlib/doc/src/gb_sets.xml
@@ -4,7 +4,7 @@
- 2001 2014
+ 2001 2015
Ericsson AB. All Rights Reserved.
@@ -305,6 +305,17 @@
memory at one time.
+
+
+ Return an iterator for a set starting from a specified element
+
+ Returns an iterator that can be used for traversing the
+ entries of Set ; see next/1 .
+ The difference as compared to the iterator returned by
+ iterator/1 is that the first element greater than
+ or equal to Element is returned.
+
+
Return largest element
diff --git a/lib/stdlib/src/gb_sets.erl b/lib/stdlib/src/gb_sets.erl
index 393fb07229..d3fbd542f7 100644
--- a/lib/stdlib/src/gb_sets.erl
+++ b/lib/stdlib/src/gb_sets.erl
@@ -137,6 +137,10 @@
%% approach is that it does not require the complete list of all
%% elements to be built in memory at one time.
%%
+%% - iterator_from(X, S): returns an iterator that can be used for
+%% traversing the elements of set S greater than or equal to X;
+%% see `next'.
+%%
%% - next(T): returns {X, T1} where X is the smallest element referred
%% to by the iterator T, and T1 is the new iterator to be used for
%% traversing the remaining elements, or the atom `none' if no
@@ -157,8 +161,8 @@
insert/2, add/2, delete/2, delete_any/2, balance/1, union/2,
union/1, intersection/2, intersection/1, is_disjoint/2, difference/2,
is_subset/2, to_list/1, from_list/1, from_ordset/1, smallest/1,
- largest/1, take_smallest/1, take_largest/1, iterator/1, next/1,
- filter/2, fold/3, is_set/1]).
+ largest/1, take_smallest/1, take_largest/1, iterator/1,
+ iterator_from/2, next/1, filter/2, fold/3, is_set/1]).
%% `sets' compatibility aliases:
@@ -500,6 +504,22 @@ iterator({_, L, _} = T, As) ->
iterator(nil, As) ->
As.
+-spec iterator_from(Element, Set) -> Iter when
+ Set :: set(Element),
+ Iter :: iter(Element).
+
+iterator_from(S, {_, T}) ->
+ iterator_from(S, T, []).
+
+iterator_from(S, {K, _, T}, As) when K < S ->
+ iterator_from(S, T, As);
+iterator_from(_, {_, nil, _} = T, As) ->
+ [T | As];
+iterator_from(S, {_, L, _} = T, As) ->
+ iterator_from(S, L, [T | As]);
+iterator_from(_, nil, As) ->
+ As.
+
-spec next(Iter1) -> {Element, Iter2} | 'none' when
Iter1 :: iter(Element),
Iter2 :: iter(Element).
diff --git a/lib/stdlib/test/sets_SUITE.erl b/lib/stdlib/test/sets_SUITE.erl
index c0cf1fc7e8..24f5d65f82 100644
--- a/lib/stdlib/test/sets_SUITE.erl
+++ b/lib/stdlib/test/sets_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2015. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -28,7 +28,7 @@
create/1,add_element/1,del_element/1,
subtract/1,intersection/1,union/1,is_subset/1,
is_set/1,fold/1,filter/1,
- take_smallest/1,take_largest/1]).
+ take_smallest/1,take_largest/1, iterate/1]).
-include_lib("test_server/include/test_server.hrl").
@@ -48,7 +48,7 @@ suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
[create, add_element, del_element, subtract,
intersection, union, is_subset, is_set, fold, filter,
- take_smallest, take_largest].
+ take_smallest, take_largest, iterate].
groups() ->
[].
@@ -426,6 +426,44 @@ take_largest_3(S0, List0, M) ->
take_largest_3(S, List, M)
end.
+iterate(Config) when is_list(Config) ->
+ test_all(fun iterate_1/1).
+
+iterate_1(M) ->
+ case M(module, []) of
+ gb_sets -> iterate_2(M);
+ _ -> ok
+ end,
+ M(empty, []).
+
+iterate_2(M) ->
+ random:seed(1, 2, 42),
+ iter_set(M, 1000).
+
+iter_set(_M, 0) ->
+ ok;
+iter_set(M, N) ->
+ L = [I || I <- lists:seq(1, N)],
+ T = M(from_list, L),
+ L = lists:reverse(iterate_set(M, T)),
+ R = random:uniform(N),
+ S = lists:reverse(iterate_set(M, R, T)),
+ S = [E || E <- L, E >= R],
+ iter_set(M, N-1).
+
+iterate_set(M, Set) ->
+ I = M(iterator, Set),
+ iterate_set_1(M, M(next, I), []).
+
+iterate_set(M, Start, Set) ->
+ I = M(iterator_from, {Start, Set}),
+ iterate_set_1(M, M(next, I), []).
+
+iterate_set_1(_, none, R) ->
+ R;
+iterate_set_1(M, {E, I}, R) ->
+ iterate_set_1(M, M(next, I), [E | R]).
+
%%%
%%% Helper functions.
%%%
diff --git a/lib/stdlib/test/sets_test_lib.erl b/lib/stdlib/test/sets_test_lib.erl
index 86f009a8f9..772139406d 100644
--- a/lib/stdlib/test/sets_test_lib.erl
+++ b/lib/stdlib/test/sets_test_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2013. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2015. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -34,7 +34,10 @@ new(Mod, Eq) ->
(is_empty, S) -> is_empty(Mod, S);
(is_set, S) -> Mod:is_set(S);
(is_subset, {S,Set}) -> is_subset(Mod, Eq, S, Set);
+ (iterator, S) -> Mod:iterator(S);
+ (iterator_from, {Start, S}) -> Mod:iterator_from(Start, S);
(module, []) -> Mod;
+ (next, I) -> Mod:next(I);
(singleton, E) -> singleton(Mod, E);
(size, S) -> Mod:size(S);
(subtract, {S1,S2}) -> subtract(Mod, S1, S2);
--
cgit v1.2.3
From ba0608d66d7b66d9108f79afd3c7c23b0ba06194 Mon Sep 17 00:00:00 2001
From: Erlang/OTP
Date: Mon, 18 May 2015 09:55:10 +0200
Subject: Update release notes
---
lib/inets/doc/src/notes.xml | 17 ++++++++++++++++-
lib/ssh/doc/src/notes.xml | 19 +++++++++++++++++++
2 files changed, 35 insertions(+), 1 deletion(-)
(limited to 'lib')
diff --git a/lib/inets/doc/src/notes.xml b/lib/inets/doc/src/notes.xml
index 12bbc2b736..bae8e327a3 100644
--- a/lib/inets/doc/src/notes.xml
+++ b/lib/inets/doc/src/notes.xml
@@ -32,7 +32,22 @@
notes.xml
- Inets 5.10.7
+ Inets 5.10.8
+
+ Fixed Bugs and Malfunctions
+
+ -
+
+ Reject messages with a Content-Length less than 0
+
+ Own Id: OTP-12739 Aux Id: seq12860
+
+
+
+
+
+
+Inets 5.10.7
Improvements and New Features
diff --git a/lib/ssh/doc/src/notes.xml b/lib/ssh/doc/src/notes.xml
index 41885c684c..579a3ae4a8 100644
--- a/lib/ssh/doc/src/notes.xml
+++ b/lib/ssh/doc/src/notes.xml
@@ -29,6 +29,25 @@
notes.xml
+Ssh 3.2.3
+
+ Fixed Bugs and Malfunctions
+
+ -
+
+ A new option for handling the SSH_MSG_DEBUG message's
+ printouts. A fun could be given in the options that will
+ be called whenever the SSH_MSG_DEBUG message arrives.
+ This enables the user to format the printout or just
+ discard it.
+
+ Own Id: OTP-12738 Aux Id: seq12860
+
+
+
+
+
+
Ssh 3.2.2
Improvements and New Features
--
cgit v1.2.3
From c604ae034a79c3ca8d084de432b51af2affb2c48 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?=
Date: Thu, 14 May 2015 22:10:32 +0200
Subject: stdlib: Add maps:filter/2
---
lib/stdlib/src/maps.erl | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
(limited to 'lib')
diff --git a/lib/stdlib/src/maps.erl b/lib/stdlib/src/maps.erl
index 3877c150ec..2913a2ff86 100644
--- a/lib/stdlib/src/maps.erl
+++ b/lib/stdlib/src/maps.erl
@@ -19,7 +19,8 @@
-module(maps).
--export([get/3,fold/3, map/2, size/1,
+-export([get/3,filter/2,fold/3, map/2,
+ size/1,
without/2, with/2]).
@@ -145,6 +146,19 @@ get(Key,Map,Default) ->
erlang:error({badmap,Map},[Key,Map,Default]).
+-spec filter(Pred,Map1) -> Map2 when
+ Pred :: fun((Key, Value) -> boolean()),
+ Key :: term(),
+ Value :: term(),
+ Map1 :: map(),
+ Map2 :: map().
+
+filter(Pred,Map) when is_function(Pred,2), is_map(Map) ->
+ maps:from_list([{K,V}||{K,V}<-maps:to_list(Map),Pred(K,V)]);
+filter(Pred,Map) ->
+ erlang:error(error_type(Map),[Pred,Map]).
+
+
-spec fold(Fun,Init,Map) -> Acc when
Fun :: fun((K, V, AccIn) -> AccOut),
Init :: term(),
--
cgit v1.2.3
From fc1967b11a65690c9ea8274c7c7fda94f7a338fa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?=
Date: Mon, 18 May 2015 10:19:24 +0200
Subject: stdlib: Document maps:filter/2
---
lib/stdlib/doc/src/maps.xml | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
(limited to 'lib')
diff --git a/lib/stdlib/doc/src/maps.xml b/lib/stdlib/doc/src/maps.xml
index e46068230a..7345a9357a 100644
--- a/lib/stdlib/doc/src/maps.xml
+++ b/lib/stdlib/doc/src/maps.xml
@@ -32,6 +32,28 @@
+
+
+ Choose pairs which satisfy a predicate
+
+
+ Returns a map Map2 for which predicate
+ Pred holds true in Map1 .
+
+
+ The call will fail with a {badmap,Map} exception if
+ Map1 is not a map or with badarg if
+ Pred is not a function of arity 2.
+
+ Example:
+
+> M = #{a => 2, b => 3, c=> 4, "a" => 1, "b" => 2, "c" => 4},
+ Pred = fun(K,V) -> is_atom(K) andalso (V rem 2) =:= 0 end,
+ maps:filter(Pred,M).
+#{a => 2,c => 4}
+
+
+
--
cgit v1.2.3
From ed64f612197b13b556125200244ae1778aacaae2 Mon Sep 17 00:00:00 2001
From: Ingela Anderton Andin
Date: Thu, 19 Mar 2015 15:28:14 +0100
Subject: ssl: Adjust sleep time in test case
Adjust time to make sure "enough" time has elapsed. Will have to do
for now.
---
lib/ssl/test/ssl_basic_SUITE.erl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'lib')
diff --git a/lib/ssl/test/ssl_basic_SUITE.erl b/lib/ssl/test/ssl_basic_SUITE.erl
index 50d5fb411f..3495b978b7 100644
--- a/lib/ssl/test/ssl_basic_SUITE.erl
+++ b/lib/ssl/test/ssl_basic_SUITE.erl
@@ -3445,7 +3445,7 @@ renegotiate_immediately(Socket) ->
end,
ok = ssl:renegotiate(Socket),
{error, renegotiation_rejected} = ssl:renegotiate(Socket),
- ct:sleep(?RENEGOTIATION_DISABLE_TIME +1),
+ ct:sleep(?RENEGOTIATION_DISABLE_TIME + ?SLEEP),
ok = ssl:renegotiate(Socket),
ct:log("Renegotiated again"),
ssl:send(Socket, "Hello world"),
--
cgit v1.2.3
From 3290512efb630ac319dc893a264a16e2aef9fdc1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?=
Date: Mon, 18 May 2015 10:26:40 +0200
Subject: stdlib: Test maps:filter/2
---
lib/stdlib/test/maps_SUITE.erl | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
(limited to 'lib')
diff --git a/lib/stdlib/test/maps_SUITE.erl b/lib/stdlib/test/maps_SUITE.erl
index 1d9c041a74..21e146ae3d 100644
--- a/lib/stdlib/test/maps_SUITE.erl
+++ b/lib/stdlib/test/maps_SUITE.erl
@@ -34,7 +34,7 @@
-export([init_per_testcase/2]).
-export([end_per_testcase/2]).
--export([t_get_3/1,
+-export([t_get_3/1, t_filter_2/1,
t_fold_3/1,t_map_2/1,t_size_1/1,
t_with_2/1,t_without_2/1]).
@@ -45,7 +45,7 @@ suite() ->
[{ct_hooks, [ts_install_cth]}].
all() ->
- [t_get_3,
+ [t_get_3,t_filter_2,
t_fold_3,t_map_2,t_size_1,
t_with_2,t_without_2].
@@ -99,6 +99,16 @@ t_with_2(_Config) ->
?badarg(with,[a,#{}]) = (catch maps:with(a,#{})),
ok.
+t_filter_2(Config) when is_list(Config) ->
+ M = #{a => 2, b => 3, c=> 4, "a" => 1, "b" => 2, "c" => 4},
+ Pred1 = fun(K,V) -> is_atom(K) andalso (V rem 2) =:= 0 end,
+ Pred2 = fun(K,V) -> is_list(K) andalso (V rem 2) =:= 0 end,
+ #{a := 2,c := 4} = maps:filter(Pred1,M),
+ #{"b" := 2,"c" := 4} = maps:filter(Pred2,M),
+ %% error case
+ ?badmap(a,filter,[_,a]) = (catch maps:filter(fun(_,_) -> ok end,id(a))),
+ ?badarg(filter,[<<>>,#{}]) = (catch maps:filter(id(<<>>),#{})),
+ ok.
t_fold_3(Config) when is_list(Config) ->
Vs = lists:seq(1,200),
--
cgit v1.2.3
From 48bd85fdfc0648facfc76078f8556a00b4f6febb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?=
Date: Mon, 18 May 2015 10:29:59 +0200
Subject: stdlib: Use lc to implement maps:map/2
---
lib/stdlib/src/maps.erl | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
(limited to 'lib')
diff --git a/lib/stdlib/src/maps.erl b/lib/stdlib/src/maps.erl
index 2913a2ff86..533ff08726 100644
--- a/lib/stdlib/src/maps.erl
+++ b/lib/stdlib/src/maps.erl
@@ -183,10 +183,7 @@ fold(Fun,Init,Map) ->
V2 :: term().
map(Fun,Map) when is_function(Fun, 2), is_map(Map) ->
- maps:from_list(lists:map(fun
- ({K,V}) ->
- {K,Fun(K,V)}
- end,maps:to_list(Map)));
+ maps:from_list([{K,Fun(K,V)}||{K,V}<-maps:to_list(Map)]);
map(Fun,Map) ->
erlang:error(error_type(Map),[Fun,Map]).
--
cgit v1.2.3
From d1851f267d96e41a0dc8f2d123ec5e5fef514518 Mon Sep 17 00:00:00 2001
From: Hans Bolinder
Date: Tue, 19 May 2015 12:58:23 +0200
Subject: dialyzer: Document dialyzer:gui() option 'check_plt'
* Mention the option 'check_plt' among gui() options.
* No longer check a PLT twice when the analysis type is 'plt_check'.
* No longer raise a case_clause error when checking a PLT finds warnings.
Thanks to James Fish.
---
lib/dialyzer/doc/src/dialyzer.xml | 1 +
lib/dialyzer/src/dialyzer.erl | 39 +++++++++---------
lib/dialyzer/test/plt_SUITE.erl | 85 +++++++++++++++++++++++++++++++++++----
3 files changed, 97 insertions(+), 28 deletions(-)
(limited to 'lib')
diff --git a/lib/dialyzer/doc/src/dialyzer.xml b/lib/dialyzer/doc/src/dialyzer.xml
index 2a8bf6edcc..5f52906625 100644
--- a/lib/dialyzer/doc/src/dialyzer.xml
+++ b/lib/dialyzer/doc/src/dialyzer.xml
@@ -368,6 +368,7 @@ Option :: {files, [Filename :: string()]}
| {include_dirs, [DirName :: string()]}
| {output_file, FileName :: string()}
| {output_plt, FileName :: string()}
+ | {check_plt, boolean()},
| {analysis_type, 'succ_typings' |
'plt_add' |
'plt_build' |
diff --git a/lib/dialyzer/src/dialyzer.erl b/lib/dialyzer/src/dialyzer.erl
index c9e7da9ef0..c8537e3bd8 100644
--- a/lib/dialyzer/src/dialyzer.erl
+++ b/lib/dialyzer/src/dialyzer.erl
@@ -2,7 +2,7 @@
%%-----------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2014. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2015. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -162,14 +162,7 @@ run(Opts) ->
{error, Msg} ->
throw({dialyzer_error, Msg});
OptsRecord ->
- case OptsRecord#options.check_plt of
- true ->
- case cl_check_init(OptsRecord) of
- {ok, ?RET_NOTHING_SUSPICIOUS} -> ok;
- {error, ErrorMsg1} -> throw({dialyzer_error, ErrorMsg1})
- end;
- false -> ok
- end,
+ ok = check_init(OptsRecord),
case dialyzer_cl:start(OptsRecord) of
{?RET_DISCREPANCIES, Warnings} -> Warnings;
{?RET_NOTHING_SUSPICIOUS, _} -> []
@@ -179,6 +172,16 @@ run(Opts) ->
erlang:error({dialyzer_error, lists:flatten(ErrorMsg)})
end.
+check_init(#options{analysis_type = plt_check}) ->
+ ok;
+check_init(#options{check_plt = true} = OptsRecord) ->
+ case cl_check_init(OptsRecord) of
+ {ok, _} -> ok;
+ {error, Msg} -> throw({dialyzer_error, Msg})
+ end;
+check_init(#options{check_plt = false}) ->
+ ok.
+
internal_gui(OptsRecord) ->
F = fun() ->
dialyzer_gui_wx:start(OptsRecord),
@@ -199,17 +202,13 @@ gui(Opts) ->
throw({dialyzer_error, Msg});
OptsRecord ->
ok = check_gui_options(OptsRecord),
- case cl_check_init(OptsRecord) of
- {ok, ?RET_NOTHING_SUSPICIOUS} ->
- F = fun() ->
- dialyzer_gui_wx:start(OptsRecord)
- end,
- case doit(F) of
- {ok, _} -> ok;
- {error, Msg} -> throw({dialyzer_error, Msg})
- end;
- {error, ErrorMsg1} ->
- throw({dialyzer_error, ErrorMsg1})
+ ok = check_init(OptsRecord),
+ F = fun() ->
+ dialyzer_gui_wx:start(OptsRecord)
+ end,
+ case doit(F) of
+ {ok, _} -> ok;
+ {error, Msg} -> throw({dialyzer_error, Msg})
end
catch
throw:{dialyzer_error, ErrorMsg} ->
diff --git a/lib/dialyzer/test/plt_SUITE.erl b/lib/dialyzer/test/plt_SUITE.erl
index ef4cdc57f0..ecbac14e5d 100644
--- a/lib/dialyzer/test/plt_SUITE.erl
+++ b/lib/dialyzer/test/plt_SUITE.erl
@@ -6,12 +6,13 @@
-include_lib("common_test/include/ct.hrl").
-include("dialyzer_test_constants.hrl").
--export([suite/0, all/0, build_plt/1, beam_tests/1, update_plt/1]).
+-export([suite/0, all/0, build_plt/1, beam_tests/1, update_plt/1,
+ run_plt_check/1, run_succ_typings/1]).
suite() ->
[{timetrap, ?plt_timeout}].
-all() -> [build_plt, beam_tests, update_plt].
+all() -> [build_plt, beam_tests, update_plt, run_plt_check, run_succ_typings].
build_plt(Config) ->
OutDir = ?config(priv_dir, Config),
@@ -37,14 +38,76 @@ beam_tests(Config) when is_list(Config) ->
">>,
Opts = [no_auto_import],
{ok, BeamFile} = compile(Config, Prog, no_auto_import, Opts),
- [] = run_dialyzer([BeamFile]),
+ [] = run_dialyzer(plt_build, [BeamFile], []),
ok.
-run_dialyzer(Files) ->
- dialyzer:run([{analysis_type, plt_build},
- {files, Files},
- {from, byte_code},
- {check_plt, false}]).
+run_plt_check(Config) when is_list(Config) ->
+ Mod1 = <<"
+ -module(run_plt_check1).
+ ">>,
+
+ Mod2A = <<"
+ -module(run_plt_check2).
+ ">>,
+
+ {ok, BeamFile1} = compile(Config, Mod1, run_plt_check1, []),
+ {ok, BeamFile2} = compile(Config, Mod2A, run_plt_check2, []),
+ [] = run_dialyzer(plt_build, [BeamFile1, BeamFile2], []),
+
+ Mod2B = <<"
+ -module(run_plt_check2).
+
+ -export([call/1]).
+
+ call(X) -> run_plt_check1:call(X).
+ ">>,
+
+ {ok, BeamFile2} = compile(Config, Mod2B, run_plt_check2, []),
+
+ % callgraph warning as run_plt_check2:call/1 makes a call to unexported
+ % function run_plt_check1:call/1.
+ [_] = run_dialyzer(plt_check, [], []),
+
+ ok.
+
+run_succ_typings(Config) when is_list(Config) ->
+ Mod1A = <<"
+ -module(run_succ_typings1).
+
+ -export([call/0]).
+
+ call() -> a.
+ ">>,
+
+ {ok, BeamFile1} = compile(Config, Mod1A, run_succ_typings1, []),
+ [] = run_dialyzer(plt_build, [BeamFile1], []),
+
+ Mod1B = <<"
+ -module(run_succ_typings1).
+
+ -export([call/0]).
+
+ call() -> b.
+ ">>,
+
+ Mod2 = <<"
+ -module(run_succ_typings2).
+
+ -export([call/0]).
+
+ -spec call() -> b.
+ call() -> run_succ_typings1:call().
+ ">>,
+
+ {ok, BeamFile1} = compile(Config, Mod1B, run_succ_typings1, []),
+ {ok, BeamFile2} = compile(Config, Mod2, run_succ_typings2, []),
+ % contract types warning as run_succ_typings2:call/0 makes a call to
+ % run_succ_typings1:call/0, which returns a (not b) in the PLT.
+ [_] = run_dialyzer(succ_typings, [BeamFile2], [{check_plt, false}]),
+ % warning not returned as run_succ_typings1 is updated in the PLT.
+ [] = run_dialyzer(succ_typings, [BeamFile2], [{check_plt, true}]),
+
+ ok.
%%% [James Fish:]
%%% If a function is removed from a module and the module has previously
@@ -103,3 +166,9 @@ compile(Config, Prog, Module, CompileOpts) ->
Opts = [{outdir, PrivDir}, debug_info | CompileOpts],
{ok, Module} = compile:file(Filename, Opts),
{ok, filename:join([PrivDir, lists:concat([Module, ".beam"])])}.
+
+run_dialyzer(Analysis, Files, Opts) ->
+ dialyzer:run([{analysis_type, Analysis},
+ {files, Files},
+ {from, byte_code} |
+ Opts]).
--
cgit v1.2.3