mbedtls/library
Daniel Kahn Gillmor 2ed81733a6 accept PKCS#3 DH parameters with privateValueLength included
library/dhm.c: accept (and ignore) optional privateValueLength for
PKCS#3 DH parameters.

PKCS#3 defines the ASN.1 encoding of a DH parameter set like this:

----------------
DHParameter ::= SEQUENCE {
  prime INTEGER, -- p
  base INTEGER, -- g
  privateValueLength INTEGER OPTIONAL }

The fields of type DHParameter have the following meanings:

     o    prime is the prime p.

     o    base is the base g.

     o    privateValueLength is the optional private-value
          length l.
----------------

See: ftp://ftp.rsasecurity.com/pub/pkcs/ascii/pkcs-3.asc

This optional parameter was added in PKCS#3 version 1.4, released
November 1, 1993.

dhm.c currently doesn't cope well with PKCS#3 files that have this
optional final parameter included. i see errors like:

------------
dhm_parse_dhmfile returned -0x33E6

Last error was: -0x33E6 - DHM - The ASN.1 data is not formatted correctly : ASN1 - Actual length differs from expected lengt
------------

You can generate PKCS#3 files with this final parameter with recent
versions of certtool from GnuTLS:

 certtool --generate-dh-params > dh.pem
2015-04-15 13:27:13 +02:00
..
.gitignore Minor gitginore fixes 2015-01-28 15:34:01 +00:00
aes.c Rename website and repository 2015-03-06 13:17:10 +00:00
aesni.c Rename website and repository 2015-03-06 13:17:10 +00:00
arc4.c Rename website and repository 2015-03-06 13:17:10 +00:00
asn1parse.c Rename website and repository 2015-03-06 13:17:10 +00:00
asn1write.c Rename website and repository 2015-03-06 13:17:10 +00:00
base64.c Rename website and repository 2015-03-06 13:17:10 +00:00
bignum.c Rename website and repository 2015-03-06 13:17:10 +00:00
blowfish.c Rename website and repository 2015-03-06 13:17:10 +00:00
camellia.c Rename website and repository 2015-03-06 13:17:10 +00:00
ccm.c Rename website and repository 2015-03-06 13:17:10 +00:00
certs.c Rename website and repository 2015-03-06 13:17:10 +00:00
cipher.c Add POLARSSL_DEPRECATED_{WARNING,REMOVED} 2015-03-23 14:11:11 +01:00
cipher_wrap.c Rename website and repository 2015-03-06 13:17:10 +00:00
CMakeLists.txt Suppress clang warning we don't want 2015-03-23 12:03:49 +01:00
ctr_drbg.c Add missing 'const' on selftest data 2015-03-11 09:13:42 +00:00
debug.c Rename website and repository 2015-03-06 13:17:10 +00:00
des.c Rename website and repository 2015-03-06 13:17:10 +00:00
dhm.c accept PKCS#3 DH parameters with privateValueLength included 2015-04-15 13:27:13 +02:00
ecdh.c Rename website and repository 2015-03-06 13:17:10 +00:00
ecdsa.c Rename website and repository 2015-03-06 13:17:10 +00:00
ecp.c Rename website and repository 2015-03-06 13:17:10 +00:00
ecp_curves.c Rename website and repository 2015-03-06 13:17:10 +00:00
entropy.c Rename website and repository 2015-03-06 13:17:10 +00:00
entropy_poll.c Rename website and repository 2015-03-06 13:17:10 +00:00
error.c Rename website and repository 2015-03-06 13:17:10 +00:00
gcm.c Add missing 'const' on selftest data 2015-03-11 09:13:42 +00:00
havege.c Rename website and repository 2015-03-06 13:17:10 +00:00
hmac_drbg.c Fix use of deprecated function in the library 2015-03-20 18:23:52 +00:00
Makefile build: Makefile: cleanup CFLAGS 2015-03-13 13:34:25 +00:00
md.c Add POLARSSL_DEPRECATED_{WARNING,REMOVED} 2015-03-23 14:11:11 +01:00
md2.c Rename website and repository 2015-03-06 13:17:10 +00:00
md4.c Rename website and repository 2015-03-06 13:17:10 +00:00
md5.c Add missing 'const' on selftest data 2015-03-11 09:13:42 +00:00
md_wrap.c Rename website and repository 2015-03-06 13:17:10 +00:00
memory_buffer_alloc.c Rename website and repository 2015-03-06 13:17:10 +00:00
net.c Rename website and repository 2015-03-06 13:17:10 +00:00
oid.c Add support for X.520 uniqueIdentifier 2015-03-27 13:03:54 +01:00
padlock.c Fix bug in Via Padlock support 2015-04-02 10:53:59 +01:00
pbkdf2.c Add POLARSSL_DEPRECATED_{WARNING,REMOVED} 2015-03-23 14:11:11 +01:00
pem.c Rename website and repository 2015-03-06 13:17:10 +00:00
pk.c Rename website and repository 2015-03-06 13:17:10 +00:00
pk_wrap.c Rename website and repository 2015-03-06 13:17:10 +00:00
pkcs5.c Add missing 'const' on selftest data 2015-03-11 09:13:42 +00:00
pkcs11.c Rename website and repository 2015-03-06 13:17:10 +00:00
pkcs12.c Rename website and repository 2015-03-06 13:17:10 +00:00
pkparse.c Fix bug in pk_parse_key() 2015-04-15 11:21:24 +02:00
pkwrite.c Rename website and repository 2015-03-06 13:17:10 +00:00
platform.c Fix bug in POLARSSL_PLATFORM_STD_EXIT support 2015-04-03 17:56:30 +02:00
ripemd160.c Rename website and repository 2015-03-06 13:17:10 +00:00
rsa.c Fix thread safety issue in RSA operations 2015-03-27 15:12:05 +01:00
sha1.c Add missing 'const' on selftest data 2015-03-11 09:13:42 +00:00
sha256.c Add missing 'const' on selftest data 2015-03-11 09:13:42 +00:00
sha512.c Add missing 'const' on selftest data 2015-03-11 09:13:42 +00:00
ssl_cache.c Rename website and repository 2015-03-06 13:17:10 +00:00
ssl_ciphersuites.c Rename website and repository 2015-03-06 13:17:10 +00:00
ssl_cli.c Fix bug with ssl_set_curves() check on client 2015-04-03 17:57:59 +02:00
ssl_srv.c Rename website and repository 2015-03-06 13:17:10 +00:00
ssl_tls.c Add POLARSSL_DEPRECATED_{WARNING,REMOVED} 2015-03-23 14:11:11 +01:00
threading.c Rename website and repository 2015-03-06 13:17:10 +00:00
timing.c Rename website and repository 2015-03-06 13:17:10 +00:00
version.c Rename website and repository 2015-03-06 13:17:10 +00:00
version_features.c Update generated file 2015-04-09 16:35:54 +02:00
x509.c Accept bitstrings in X.509 names 2015-03-27 13:03:09 +01:00
x509_create.c Rename website and repository 2015-03-06 13:17:10 +00:00
x509_crl.c Rename website and repository 2015-03-06 13:17:10 +00:00
x509_crt.c Rename website and repository 2015-03-06 13:17:10 +00:00
x509_csr.c Rename website and repository 2015-03-06 13:17:10 +00:00
x509write_crt.c Rename website and repository 2015-03-06 13:17:10 +00:00
x509write_csr.c Rename website and repository 2015-03-06 13:17:10 +00:00
xtea.c Rename website and repository 2015-03-06 13:17:10 +00:00