You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 KiB
20 KiB
changelog
1.4.0
core.ObjectIdentifierand all derived classes now obey X.660 §7.6 and thus restrict the first arc to 0 to 2, and the second arc to less than 40 if the first arc is 0 or 1. This also fixes parsing of OIDs where the first arc is 2 and the second arc is greater than 39.- Fixed
keys.PublicKeyInfo.bit_sizeto return an int rather than a float on Python 3 when working with elliptic curve keys - Fixed the
asn1crypto-testssdist on PyPi to work properly to generate a .whl
1.3.0
- Added
encrypt_key_pref(1.2.840.113549.1.9.16.2.11) tocms.CMSAttributeType(), along with related structures - Added Brainpool curves from RFC 5639 to
keys.NamedCurve() - Fixed
x509.Certificate().subject_directory_attributes_value - Fixed some incorrectly computed minimum elliptic curve primary key
encoding sizes in
keys.NamedCurve() - Fixed a
TypeErrorwhen trying to call.untag()or.copy()on acore.UTCTime()orcore.GeneralizedTime(), or a value containing one, when using Python 2
1.2.0
- Added
asn1crypto.load_order(), which returns alistof unicode strings of the names of the fully-qualified module names for all of submodules of the package. The module names are listed in their dependency load order. This is primarily intended for the sake of implementing hot reloading.
1.1.0
- Added User ID (
0.9.2342.19200300.100.1.1) tox509.NameType() - Added various EC named curves to
keys.NamedCurve()
1.0.1
- Fix an absolute import in
keysto a relative import
1.0.0
- Backwards Compatibility Breaks
cms.KeyEncryptionAlgorithmId().nativenow returns the value"rsaes_pkcs1v15"for OID1.2.840.113549.1.1.1instead of"rsa"- Removed functionality to calculate public key values from private key
values. Alternatives have been added to oscrypto.
keys.PrivateKeyInfo().unwrap()is nowoscrypto.asymmetric.PrivateKey().unwrap()keys.PrivateKeyInfo().public_keyis nowoscrypto.asymmetric.PrivateKey().public_key.unwrap()keys.PrivateKeyInfo().public_key_infois nowoscrypto.asymmetric.PrivateKey().public_key.asn1keys.PrivateKeyInfo().fingerprintis nowoscrypto.asymmetric.PrivateKey().fingerprintkeys.PublicKeyInfo().unwrap()is nowoscrypto.asymmetric.PublicKey().unwrap()keys.PublicKeyInfo().fingerprintis nowoscrypto.asymmetric.PublicKey().fingerprint
- Enhancements
- Significantly improved parsing of
core.UTCTime()andcore.GeneralizedTime()values that include timezones and fractional seconds util.timezonehas a more complete implementationcore.Choice()may now be constructed by a 2-element tuple or a 1-key dict- Added
x509.Certificate().not_valid_beforeandx509.Certificate().not_valid_after - Added
core.BitString().unused_bits - Added
keys.NamedCurve.register()for non-mainstream curve OIDs - No longer try to load optional performance dependency,
libcrypto, on Mac or Linux ocsp.CertStatus().nativewill now return meaningful unicode string values when the status choice is"good"or"unknown". Previously both returnedNonedue to the way the structure was designed.- Add support for explicit RSA SSA PSS (
1.2.840.113549.1.1.10) tokeys.PublicKeyInfo()andkeys.PrivateKeyInfo() - Added structures for nested SHA-256 Windows PE signatures to
cms.CMSAttribute() - Added RC4 (
1.2.840.113549.3.4) toalgos.EncryptionAlgorithmId() - Added secp256k1 (
1.3.132.0.10) tokeys.NamedCurve() - Added SHA-3 and SHAKE OIDs to
algos.DigestAlgorithmId()andalgos.HmacAlgorithmId() - Added RSA ES OAEP (
1.2.840.113549.1.1.7) tocms.KeyEncryptionAlgorithmId() - Add IKE Intermediate (
1.3.6.1.5.5.8.2.2) tox509.KeyPurposeId() x509.EmailAddress()andx509.DNSName()now handle invalidly-encoded values using tags forcore.PrintableString()andcore.UTF8String()- Add parameter structue from RFC 5084 for AES-CCM to
algos.EncryptionAlgorithm() - Improved robustness of parsing broken
core.Sequence()andcore.SequenceOf()values
- Significantly improved parsing of
- Bug Fixes
- Fixed encoding of tag values over 30
core.IntegerBitString()andcore.IntegerOctetString()now restrict values to non-negative integers since negative values are not implemented- When copying or dumping a BER-encoded indefinite-length value,
automatically force re-encoding to DER. To ensure all nested values are
always DER-encoded,
.dump(True)must be called. - Fix
UnboundLocalErrorwhen callingx509.IPAddress().nativeon an encoded value that has a length of zero - Fixed passing
class_via unicode string name tocore.Asn1Value() - Fixed a bug where EC private keys with leading null bytes would be
encoded in
keys.ECPrivateKey()more narrowly than RFC 5915 requires - Fixed some edge-case bugs in
util.int_to_bytes() x509.URI()now only normalizes values when comparing- Fixed BER-decoding of indefinite length
core.BitString() - Fixed DER-encoding of empty
core.BitString() - Fixed a missing return value for
core.Choice().parse() - Fixed
core.Choice().contentsworking when the chosen alternative is acore.Choice()also - Fixed parsing and encoding of nested
core.Choice()objects - Fixed a bug causing
core.ObjectIdentifier().nativeto sometimes not map the OID
- Packaging
wheel,sdistandbdist_eggreleases now all include LICENSE,sdistincludes docs- Added
asn1crypto_testspackage to PyPi
0.24.0
x509.Certificate().self_signedwill no longer return"yes"under any circumstances. This helps prevent confusion since the library does not verify the signature. Instead a library like oscrypto should be used to confirm if a certificate is self-signed.- Added various OIDs to
x509.KeyPurposeId() - Added
x509.Certificate().private_key_usage_period_value - Added structures for parsing common subject directory attributes for
X.509 certificates, including
x509.SubjectDirectoryAttribute() - Added
algos.AnyAlgorithmIdentifier()for situations where an algorithm identifier may contain a digest, signed digest or encryption algorithm OID - Fixed a bug with
x509.Certificate().subject_directory_attributes_valuenot returning the correct value - Fixed a bug where explicitly-tagged fields in a
core.Sequence()would not function properly when the field had a default value - Fixed a bug with type checking in
pem.armor()
0.23.0
- Backwards compatibility break: the
tag_type,explicit_tagandexplicit_classattributes oncore.Asn1Valueno longer exist and were replaced by theimplicitandexplicitattributes. Field param dicts may use the newexplicitandimplicitkeys, or the oldtag_typeandtagkeys. The attribute changes will likely to have little to no impact since they were primarily an implementation detail. - Teletex strings used inside of X.509 certificates are now interpreted
using Windows-1252 (a superset of ISO-8859-1). This enables compatibility
with certificates generated by OpenSSL. Strict parsing of Teletex strings
can be retained by using the
x509.strict_teletex()context manager. - Added support for nested explicit tagging, supporting values that are defined with explicit tagging and then added as a field of another structure using explicit tagging.
- Fixed a
UnicodeDecodeErrorwhen trying to find the (optional) dependency OpenSSL on Python 2 - Fixed
next_updatefield ofcrl.TbsCertListto be optional - Added the
x509.Certificate.sha256_fingerprintproperty x509.Certificate.ocsp_urlsandx509.DistributionPoint.urlwill now returnhttps://,ldap://andldaps://URLs in addition tohttp://.- Added CMS Attribute Protection definitions from RFC 6211
- Added OIDs from RFC 6962
0.22.0
- Added
parser.peek() - Implemented proper support for BER-encoded indefinite length strings of
all kinds -
core.BitString,core.OctetStringand all of thecoreclasses that are natively represented as Python unicode strings - Fixed a bug with encoding LDAP URLs in
x509.URI - Correct
x509.DNSNameto allow a leading., such as when used withx509.NameConstraints - Fixed an issue with dumping the parsed contents of
core.Anywhen explicitly tagged - Custom
setup.py cleannow accepts the short-aflag for compatibility
0.21.1
- Fixed a regression where explicit tagging of a field containing a
core.Choicewould result in an incorrect header - Fixed a bug where an
IndexErrorwas being raised instead of aValueErrorwhen a value was truncated to not include enough bytes for the header - Corrected the spec for the
valuefield ofpkcs12.Attribute - Added support for
2.16.840.1.113894.746875.1.1OID topkcs12.AttributeType
0.21.0
- Added
core.load()for loading standard, universal types without knowing the spec beforehand - Added a
strictkeyword arg to the variousload()methods and functions incorethat checks for trailing data and raises aValueErrorwhen found - Added
asn1crypto.parsersubmodule withemit()andparse()functions for low-level integration - Added
asn1crypto.versionfor version introspection without side-effects - Added
algos.DSASignature - Fixed a bug with the
_headerattribute of explicitly-tagged values only containing the explicit tag header instead of both the explicit tag header and the encapsulated value header
0.20.0
- Added support for year 0
- Added the OID for unique identifier to
x509.NameType - Fixed a bug creating the native representation of a
core.BitStringwith leading null bytes - Added a
.cast()method to allow converting between different representations of the same data, e.g.core.BitStringandcore.OctetBitString
0.19.0
- Force
algos.DigestAlgorithmto encodingparametersasNullwhen thealgorithmissha1,sha224,sha256,sha384orsha512per RFC 4055 - Resolved an issue where a BER-encoded indefinite-length value could not be
properly parsed when embedded inside of a
core.Sequenceorcore.Set - Fix
x509.Name.build()to properly handle dotted OID type values core.Choicecan now be constructed from a single-elementdictor a two-elementtupleto allow for better usability when constructing values from native Python values- All
coreobjects can now be passed toprint()with an exception being raised
0.18.5
- Don't fail importing if
ctypesor_ctypesis not available
0.18.4
core.Sequencewill now raise an exception when an unknown field is provided- Prevent
UnicodeDecodeErroron Python 2 when callingcore.OctetString.debug() - Corrected the default value for the
hash_algorithmfield oftsp.ESSCertIDv2 - Fixed a bug constructing a
cms.SignedDataobject - Ensure that specific RSA OIDs are always paired with
parametersset tocore.Null
0.18.3
- Fixed DER encoding of
core.BitStringwhen a_mapis specified (i.e. a "named bit list") to omit trailing zero bits. This fixes compliance of variousx509structures with RFC 5280. - Corrected a side effect in
keys.PrivateKeyInfo.wrap()that would cause the originalkeys.ECPrivateKeystructure to become corrupt core.IntegerOctetStringnow correctly encodes the integer as an unsigned value when converting to bytes. Previously decoding was unsigned, but encoding was signed.- Fix
util.int_from_bytes()on Python 2 to return0from an empty byte string
0.18.2
- Allow
_perfsubmodule to be removed from source tree when embedding
0.18.1
- Fixed DER encoding of
core.Setandcore.SetOf - Fixed a bug in
x509.Name.build()that could generate invalid DER encoding - Improved exception messages when parsing nested structures via the
.nativeattribute algos.SignedDigestAlgorithmnow ensures theparametersare set toNullwhenalgorithmissha224_rsa,sha256_rsa,sha384_rsaorsha512_rsa, per RFC 4055- Corrected the definition of
pdf.AdobeTimestampto mark therequires_authfield as optional - Add support for the OID
1.2.840.113549.1.9.16.2.14tocms.CMSAttributeType - Improve attribute support for
cms.AttributeCertificateV2 - Handle
cms.AttributeCertificateV2when incorrectly tagged ascms.AttributeCertificateV1incms.CertificateChoices
0.18.0
- Improved general parsing performance by 10-15%
- Add support for Windows XP
- Added
core.ObjectIdentifier.dottedattribute to always return dotted integer unicode string - Added
core.ObjectIdentifier.map()andcore.ObjectIdentifier.unmap()class methods to map dotted integer unicode strings to user-friendly unicode strings and back - Added various Apple OIDs to
x509.KeyPurposeId - Fixed a bug parsing nested indefinite-length-encoded values
- Fixed a bug with
x509.Certificate.issuer_alt_name_valueif it is the first extension queried keys.PublicKeyInfo.bit_sizeandkeys.PrivateKeyInfo.bit_sizevalues are now rounded up to the next closest multiple of 8
0.17.1
- Fix a bug in
x509.URIparsing IRIs containing explicit port numbers on Python 3.x
0.17.0
- Added
x509.TrustedCertificatefor handling OpenSSL auxiliary certificate information appended after a certificate - Added
core.Concatclass for situations such asx509.TrustedCertificate - Allow "broken" X.509 certificates to use
core.IA5Stringwhere anx509.DirectoryStringshould be used instead - Added
keys.PrivateKeyInfo.public_key_infoattribute - Added a bunch of OIDs to
x509.KeyPurposeId
0.16.0
- Added DH key exchange structures:
algos.KeyExchangeAlgorithm,algos.KeyExchangeAlgorithmIdandalgos.DHParameters. - Added DH public key support to
keys.PublicKeyInfo,keys.PublicKeyAlgorithmandkeys.PublicKeyAlgorithmId. New structures includekeys.DomainParametersandkeys.ValidationParms.
0.15.1
- Fixed
cms.CMSAttributesto be acore.SetOfinstead ofcore.SequenceOf cms.CMSAttributecan now parse unknown attribute contrustruct without an exception being raisedx509.PolicyMappingnow usesx509.PolicyIdentifierfor field types- Fixed
pdf.RevocationInfoArchivalso that all fields are now of the typecore.SequenceOfinstead of a single value - Added support for the
name_distinguisher,telephone_numberandorganization_identifierOIDs tox509.Name - Fixed
x509.Name.nativeto not accidentally create nested lists when three of more values for a single type are part of the name x509.Name.human_friendlynow reverses the order of fields when the data in anx509.Namewas encoded in most-specific to least-specific order, which is the opposite of the standard way of least-specific to most-specific.x509.NameType.human_friendlyno longer raises an exception when an unknown OID is encountered- Raise a
ValueErrorwhen parsing acore.Setand an unknown field is encountered
0.15.0
- Added support for the TLS feature extension from RFC 7633
x509.Name.build()now accepts a keyword parameteruse_printableto force string encoding to becore.PrintableStringinstead ofcore.UTF8String- Added the functions
util.uri_to_iri()andutil.iri_to_uri() - Changed
algos.SignedDigestAlgorithmIdto use the preferred OIDs when mapping a unicode string name to an OID. Previously there were multiple OIDs for some algorithms, and different OIDs would sometimes be selected due to the fact that the_mapdictis not ordered.
0.14.1
- Fixed a bug generating
x509.Certificate.sha1_fingerprinton Python 2
0.14.0
- Added the
x509.Certificate.sha1_fingerprintattribute
0.13.0
- Backwards compatibility break: the native representation of some
algos.EncryptionAlgorithmIdvalues changed.aes128becameaes128_cbc,aes192becameaes192_cbcandaes256becameaes256_cbc. - Added more OIDs to
algos.EncryptionAlgorithmId - Added more OIDs to
cms.KeyEncryptionAlgorithmId x509.Name.human_friendlynow properly supports multiple values perx509.NameTypeAndValueobject- Added
ocsp.OCSPResponse.basic_ocsp_responseandocsp.OCSPResponse.response_dataproperties - Added
algos.EncryptionAlgorithm.encryption_modeproperty - Fixed a bug with parsing times containing timezone offsets in Python 3
- The
attributesfield ofcsr.CertificationRequestInfois now optional, for compatibility with other ASN.1 parsers
0.12.2
- Correct
core.Sequence.__setitem__()so setcore.VOIDto an optional field whenNoneis set
0.12.1
- Fixed a
unicode/bytesbug withx509.URI.dump()on Python 2
0.12.0
- Backwards Compatibility Break:
core.NoValuewas renamed tocore.Voidand a singleton was added ascore.VOID - 20-30% improvement in parsing performance
core.Voidnow implements__nonzero__core.Asn1Value.copy()now performs a deep copy- All
corevalue classes are now compatible with thecopymodule core.SequenceOfandcore.SetOfnow implement__contains__- Added
x509.Name.__len__() - Fixed a bug where
core.Choice.validate()would not properly account for explicit tagging core.Choice.load()now properly passes itself as the spec when parsingx509.Certificate.crl_distribution_pointsno longer throws an exception if theDistributionPointdoes not have a value for thedistribution_pointfield
0.11.1
- Corrected
core.UTCTimeto interpret year <= 49 as 20xx and >= 50 as 19xx keys.PublicKeyInfo.hash_algocan now handle DSA keys without parameters- Added
crl.CertificateList.sha256andcrl.CertificateList.sha1 - Fixed
x509.Name.build()to properly encodecountry_name,serial_numberanddn_qualifierascore.PrintableStringas specified in RFC 5280, instead ofcore.UTF8String
0.11.0
- Added Python 2.6 support
- Added ability to compare primitive type objects
- Implemented proper support for internationalized domains, URLs and email
addresses in
x509.Certificate - Comparing
x509.Nameandx509.GeneralNameobjects adheres to RFC 5280 x509.Certificate.self_signedandx509.Certificate.self_issuedno longer require that certificate is for a CA- Fixed
x509.Certificate.valid_domainsto adhere to RFC 6125 - Added
x509.Certificate.is_valid_domain_ip() - Added
x509.Certificate.sha1andx509.Certificate.sha256 - Exposed
util.inet_ntop()andutil.inet_pton()for IP address encoding - Improved exception messages for improper types to include type's module name
0.10.1
- Fixed bug in
core.Sequenceaffecting Python 2.7 and pypy
0.10.0
- Added PEM encoding/decoding functionality
core.BitStringnow uses item access instead of attributes for named bit accesscore.BitString.nativenow uses asetof unicode strings when_mapis present- Removed
core.Asn1Value.pprint()method - Added
core.ParsableOctetStringclass - Added
core.ParsableOctetBitStringclass - Added
core.Asn1Value.copy()method - Added
core.Asn1Value.debug()method - Added
core.SequenceOf.append()method - Added
core.Sequence.spec()andcore.SequenceOf.spec()methods - Added correct IP address parsing to
x509.GeneralName x509.Nameandx509.GeneralNameare now compared according to rules in RFC 5280- Added convenience attributes to:
algos.SignedDigestAlgorithmcrl.CertificateListcrl.RevokedCertificatekeys.PublicKeyInfoocsp.OCSPRequestocsp.Requestocsp.OCSPResponseocsp.SingleResponsex509.Certificatex509.Name
- Added
asn1crypto.utilmodule with the following items:int_to_bytes()int_from_bytes()timezone.utc
- Added
setup.py cleancommand
0.9.0
- Initial release