diff --git a/.gcloudignore b/.gcloudignore
new file mode 100644
index 0000000000..9cc9db667d
--- /dev/null
+++ b/.gcloudignore
@@ -0,0 +1,2 @@
+local.yaml
+Pipfile*
diff --git a/.pylintrc b/.pylintrc
index cde3f744fa..806b3a4178 100644
--- a/.pylintrc
+++ b/.pylintrc
@@ -263,7 +263,7 @@ max-public-methods=20
# List of interface methods to ignore, separated by a comma. This is used for
# instance to not check methods defines in Zope's Interface base class.
-#ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
+#ignore-iface-methods=isImplementedBy,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
# List of method names used to declare (i.e. assign) instance attributes.
defining-attr-methods=__init__,__new__,setUp
diff --git a/.travis.yml b/.travis.yml
index f801965276..0889e3af58 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,12 +1,23 @@
language: python
cache: pip
python:
-- '2.7'
+- '3.7-dev'
+before_install:
+- export CLOUD_SDK_REPO="cloud-sdk-$(lsb_release -c -s)" &&
+ echo "deb http://packages.cloud.google.com/apt $CLOUD_SDK_REPO main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list &&
+ curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - &&
+ sudo apt-get update -y && sudo apt-get install google-cloud-sdk -y &&
+ sudo apt-get install google-cloud-sdk-datastore-emulator -y &&
+ sudo apt-get install google-cloud-sdk-pubsub-emulator -y
install:
+- pip install --upgrade setuptools
- pip install -r requirements.txt
+before_script:
+- gcloud beta emulators datastore start --no-store-on-disk --consistency 1.0 --project test-project > ds_emulator.out 2> ds_emulator.err &
+- gcloud beta emulators pubsub start --project test-project > ps_emulator.out 2> ps_emulator.err &
script:
- pylint *.py recidiviz
-- pytest recidiviz/tests/
+- pytest recidiviz/tests/ --with-emulator
after_success:
- coveralls
notifications:
diff --git a/Pipfile b/Pipfile
index ecdaa6efef..a59bb3ed8b 100644
--- a/Pipfile
+++ b/Pipfile
@@ -5,8 +5,7 @@ name = "pypi"
[packages]
altgraph = "==0.10.2"
-appengine-sdk = "==1.9.75.post0"
-astroid = "==1.6.3"
+astroid = "==2.1.0"
attrs = "~=18.2.0"
beautifulsoup4 = "==4.6.0"
callee = "==0.3"
@@ -18,7 +17,6 @@ coveralls = "==1.3.0"
cssselect = "==1.0.3"
enum34 = "==1.1.6"
funcsigs = "==1.0.2"
-futures = "==3.2.0"
idna = "==2.6"
isort = "==4.3.4"
lazy-object-proxy = "==1.3.1"
@@ -33,7 +31,7 @@ pbr = "==4.0.2"
pluggy = "==0.6.0"
py = "==1.5.3"
py2app = "==0.7.3"
-pylint = "==1.8.4"
+pylint = "==2.2.2"
pyparsing = "==2.0.1"
pytest = "==3.5.0"
pytest-cov = "==2.5.1"
@@ -41,7 +39,6 @@ pytest-mock = "==1.10.0"
python-dateutil = "==2.7.5"
pytz = "==2013.7"
requests = "==2.20.0"
-requests-toolbelt = "==0.8.0"
responses = "==0.9.0"
singledispatch = "==3.4.0.3"
six = "==1.11.0"
@@ -52,12 +49,12 @@ urllib3 = {extras = ["secure"],version = "==1.23"}
virtualenv = "==15.2.0"
waitress = "==1.1.0"
wrapt = "==1.10.11"
-xattr = "==0.6.4"
+xattr = "*"
backports_abc = "==0.5"
"backports.functools_lru_cache" = "==1.5"
bdist_mpkg = "==0.5.0"
pyOpenSSL = "==18.0.0"
-PyYAML = "==3.12"
+pyyaml = "==3.13"
WebOb = "==1.8.1"
"zope.interface" = "==4.1.1"
flask = "==1.0.2"
@@ -82,10 +79,19 @@ pycparser = "==2.19"
regex = "==2018.11.22"
tzlocal = "==1.5.1"
werkzeug = "==0.14.1"
+pyjwt = "*"
+google-cloud-datastore = "*"
+google-cloud-tasks = "*"
+google-cloud-pubsub = "*"
+google-api-core = "*"
+grpcio = "*"
+gunicorn = "*"
+google-cloud-logging = "*"
+pymysql = "*"
[dev-packages]
rope = "*"
"autopep8" = "*"
[requires]
-python_version = "2.7"
+python_version = "3.7"
diff --git a/Pipfile.lock b/Pipfile.lock
index ea58780592..659a09a00d 100644
--- a/Pipfile.lock
+++ b/Pipfile.lock
@@ -1,11 +1,11 @@
{
"_meta": {
"hash": {
- "sha256": "05caa3e02c2b22f9ddce393673a9fd7b10cb2f39cab9b3a2ea26d9aa2ecbd1f2"
+ "sha256": "b2c1e5283e9e235d801f02720b3fa6b5f22d4e374217a55b5b7975bad6b38011"
},
"pipfile-spec": 6,
"requires": {
- "python_version": "2.7"
+ "python_version": "3.7"
},
"sources": [
{
@@ -23,13 +23,6 @@
"index": "pypi",
"version": "==0.10.2"
},
- "appengine-sdk": {
- "hashes": [
- "sha256:23f0da484f6d33302fecaf8565e5337c9eeb2730aad65e5768539739c7f03d9c"
- ],
- "index": "pypi",
- "version": "==1.9.75.post0"
- },
"asn1crypto": {
"hashes": [
"sha256:2f1adbb7546ed199e3c90ef23ec95c5cf3585bac7d11fb7eb562a3fe89c64e87",
@@ -40,11 +33,11 @@
},
"astroid": {
"hashes": [
- "sha256:35cfae47aac19c7b407b7095410e895e836f2285ccf1220336afba744cc4c5f2",
- "sha256:38186e481b65877fd8b1f9acc33e922109e983eb7b6e487bd4c71002134ad331"
+ "sha256:35b032003d6a863f5dcd7ec11abd5cd5893428beaa31ab164982403bcb311f22",
+ "sha256:6a5d668d7dc69110de01cdf7aeec69a679ef486862a0850cc0fd5571505b6b7e"
],
"index": "pypi",
- "version": "==1.6.3"
+ "version": "==2.1.0"
},
"attrs": {
"hashes": [
@@ -68,7 +61,6 @@
"sha256:f0b0e4eba956de51238e17573b7087e852dfe9854afd2e9c873f73fc0ca0a6dd"
],
"index": "pypi",
- "markers": "python_version < '3.4'",
"version": "==1.5"
},
"bdist-mpkg": {
@@ -88,6 +80,13 @@
"index": "pypi",
"version": "==4.6.0"
},
+ "cachetools": {
+ "hashes": [
+ "sha256:0a258d82933a1dd18cb540aca4ac5d5690731e24d1239a08577b814998f49785",
+ "sha256:4621965b0d9d4c82a79a29edbad19946f5e7702df4afae7d1ed2df951559a8cc"
+ ],
+ "version": "==3.0.0"
+ },
"callee": {
"hashes": [
"sha256:f43c3b5619f8e8bc2a6ebbeed54977a65ef32f20a8bdcb25a67d711e588a09d2"
@@ -293,13 +292,123 @@
"index": "pypi",
"version": "==1.0.2"
},
- "futures": {
+ "google-api-core": {
+ "extras": [
+ "grpc"
+ ],
+ "hashes": [
+ "sha256:85693e163a1a6faea69a74f8feaf35d54dfa2559fbdbbe389c93ffb3bb4c9a79",
+ "sha256:eea2d223f7bdc6d68dd1c4681e17cded5a00b5a8e686e1597b89f27f58cf2980"
+ ],
+ "index": "pypi",
+ "version": "==1.7.0"
+ },
+ "google-auth": {
+ "hashes": [
+ "sha256:b6081ba9946828d6417c15ecdc723fdb7c007cdd74e140747d3876a7440f0be5",
+ "sha256:e8d64e9bc8cb6f0fc5360c693f86dc9ee6964081ee702e3b5ddc937f99efc950"
+ ],
+ "version": "==1.6.2"
+ },
+ "google-cloud-core": {
+ "hashes": [
+ "sha256:9bee63e0991be9801a4baf0b7841cf54f86c6e7fec922f45ea74cd4032ed4ee4",
+ "sha256:d85b1aaaf3bad9415ad1d8ee5eadce96d7007a82f13ce0a0629a003a11e83f29"
+ ],
+ "version": "==0.29.1"
+ },
+ "google-cloud-datastore": {
+ "hashes": [
+ "sha256:e00bddc03670be206ddcbc5c1cbda0acc51db963f0ff54189bd6710f8e93a4c9",
+ "sha256:f344af747955096fd9e412ad5937dfdac317e464cd126f84102652f60864dd1d"
+ ],
+ "index": "pypi",
+ "version": "==1.7.3"
+ },
+ "google-cloud-logging": {
+ "hashes": [
+ "sha256:464d4ce8f568f189e48b87d4020f1a66351967759b04f5f93d1abe1371b65e16",
+ "sha256:c6aadcb440aa33e0281ac8d8642d5e7fc5f03c96208dfcc29b12cf301fb94486"
+ ],
+ "index": "pypi",
+ "version": "==1.9.1"
+ },
+ "google-cloud-pubsub": {
+ "hashes": [
+ "sha256:32dbaf9b8c16d4a14b7e1eca2805689f82f69f542a68bf1516b9c77a3ef54b73",
+ "sha256:4186386aec02752e982eeb1e399d76f1cf70eed56312934df04bfa68d8cfabf0"
+ ],
+ "index": "pypi",
+ "version": "==0.39.1"
+ },
+ "google-cloud-tasks": {
+ "hashes": [
+ "sha256:17cd1842c8b05357e73fe918ee5d567e18da95fadcd858b28244a6513f8f29f9",
+ "sha256:3c5f26dd3750f9b222a69c37e85ee1acf198456dfebe1e0058f366dd27729559"
+ ],
+ "index": "pypi",
+ "version": "==0.4.0"
+ },
+ "googleapis-common-protos": {
+ "extras": [
+ "grpc"
+ ],
+ "hashes": [
+ "sha256:0946967c4c29b1339bb211949e1e17dbe0ae9ff8265fafa7bf4cf2164ef5a3b1"
+ ],
+ "version": "==1.5.5"
+ },
+ "grpc-google-iam-v1": {
+ "hashes": [
+ "sha256:5009e831dcec22f3ff00e89405249d6a838d1449a46ac8224907aa5b0e0b1aec"
+ ],
+ "version": "==0.11.4"
+ },
+ "grpcio": {
"hashes": [
- "sha256:9ec02aa7d674acb8618afb127e27fde7fc68994c0437ad759fa094a574adb265",
- "sha256:ec0a6cb848cc212002b9828c3e34c675e0c9ff6741dc445cab6fdd4e1085d1f1"
+ "sha256:082bc981d6aabfdb26bfdeab63f5626df3d2c5ac3a9ae8533dfa5ce73432f4fe",
+ "sha256:0e8ff79b12b8b07198dd847974fc32a4ed8c0d52d5224fabb9d28bf4c2e3f4a9",
+ "sha256:11c8026a3d35e8b9ad6cda7bf4f5e51b9b82e7f29a590ad194f63957657fa808",
+ "sha256:145e82aec0a643d7569499b1aa0d5167c99d9d26a2b8c4e4b3f5cd51b99a8cdc",
+ "sha256:1a820ebf0c924cbfa299cb59e4bc9582a24abfec89d9a36c281d78fa941115ae",
+ "sha256:284bee4657c4dd7d48835128b31975e8b0ea3a2eeb084c5d46de215b31d1f8f5",
+ "sha256:2a8b6b569fd23f4d9f2c8201fd8995519dfbddc60ceeffa8bf5bea2a8e9cb72c",
+ "sha256:38b93080df498656aea1dbab632e32013c580c2d00bd8c30d0f1d2c9513b0469",
+ "sha256:4837ad8fdcf99df0e89214ba42001469cab807851f30481db41fd84fc9358ce7",
+ "sha256:5447336edd6fea8ab35eca34ff5289e369e22c375bc2ac8156a419fa467949ac",
+ "sha256:57705e31f76db45b51f3a98bcfd362c89d58e99f846337a25fed957b4d43ae4f",
+ "sha256:612e742c748df51c921a7eefd76195d76467e3cc00e084e089af5b111d8210b7",
+ "sha256:62c777f801aee22100d8ea5fa057020e37b65541a8000091879a8560b089da9d",
+ "sha256:8317d351ab1e80cf20676ef3d4929d3e760df10e6e5c289283c36c4c92ca61f7",
+ "sha256:8703efaf03396123426fdea08b369712df1248fa5fdfdbee3f87a410f52e9bac",
+ "sha256:8b72721e64becd4a3e9580f12dbdf618d41e80d3ae7585dc8a921dbf76c979bb",
+ "sha256:8bb7dbe20fe883ee22a6cb2c1317ea228b75a3ef60f3749584ee2634192e3452",
+ "sha256:9a7ed6160e6c14058b4676aac68a8bf268f171f4c371ff0a0c0ab81b90803f70",
+ "sha256:a46c34768f292fa0d97e929591e51ec20dc857321d83b198de1dad9c8183e8cb",
+ "sha256:a7f21a7b48fcd9f51029419b22a9bfea097973cca5d1529b8578f1d2919e6b23",
+ "sha256:adfee9c9099cae92c2a4948bc95cc2cc3185cdf59b371e056b8dd19ed434247e",
+ "sha256:b3bbeadc6b99e4a42bf23803f5e9b292f23f3e37cc7f75a9f5efbfa9b812abc1",
+ "sha256:b51d49d89758ea45841130c5c7be79c68612d8834bd600994b8a2672c59dc9b9",
+ "sha256:cbb95a586fdf3e795eba28b4acc75fdfdb59a14df62e747fe8bc4572ef37b647",
+ "sha256:cdea5595b30f027e6603887b71f343ca5b209da74b910fe04fc25e1dfe6df263",
+ "sha256:d64350156dc4b21914409e0c93ffeeb4ceba193716fb1ae570df699383c4cd63",
+ "sha256:e10bbef59706a90672b295c0f82dcb6329d829643b8dd7c3bd120f89a093d740",
+ "sha256:e68e6afbbae2cbfadaabd33ee40314963cd83500feff733c07edb172674a7f8b",
+ "sha256:f0c0e48c255a63fec78be2f240ff5a3bd4291b1f83976895f6ee0085362568d0",
+ "sha256:f7bb6617bae5e7333e66ec1e7aac1fe419b59e0e34a8717f97e1ce2791ab9d3a",
+ "sha256:fa6e14bce7ad5de2363abb644191489ddfffcdb2751337251f7ef962ab7e3293",
+ "sha256:fd6774bbb6c717f725b39394757445ead4f69c471118364933aadb81a4f16961"
],
"index": "pypi",
- "version": "==3.2.0"
+ "version": "==1.17.1"
+ },
+ "gunicorn": {
+ "hashes": [
+ "sha256:aa8e0b40b4157b36a5df5e599f45c9c76d6af43845ba3b3b0efe2c70473c2471",
+ "sha256:fa2662097c66f920f53f70621c6c58ca4a3c4d3434205e608e121b5b3b71f4f3"
+ ],
+ "index": "pypi",
+ "version": "==19.9.0"
},
"idna": {
"hashes": [
@@ -598,6 +707,20 @@
"index": "pypi",
"version": "==0.7.3"
},
+ "pyasn1": {
+ "hashes": [
+ "sha256:da2420fe13a9452d8ae97a0e478adde1dee153b11ba832a95b223a2ba01c10f7",
+ "sha256:da6b43a8c9ae93bc80e2739efb38cc776ba74a886e3e9318d65fe81a8b8a2c6e"
+ ],
+ "version": "==0.4.5"
+ },
+ "pyasn1-modules": {
+ "hashes": [
+ "sha256:642afdabb681d39f5948fd5477764d94faf17ce40e5691e9998b52815fbb4e71",
+ "sha256:d14fcb29dabecba3d7b360bf72327c26c385248a5d603cf6be5f566ce999b261"
+ ],
+ "version": "==0.2.3"
+ },
"pycparser": {
"hashes": [
"sha256:a988718abfad80b6b157acce7bf130a30876d27603738ac39f140993246b25b3"
@@ -605,13 +728,29 @@
"index": "pypi",
"version": "==2.19"
},
+ "pyjwt": {
+ "hashes": [
+ "sha256:5c6eca3c2940464d106b99ba83b00c6add741c9becaec087fb7ccdefea71350e",
+ "sha256:8d59a976fb773f3e6a39c85636357c4f0e242707394cadadd9814f5cbaa20e96"
+ ],
+ "index": "pypi",
+ "version": "==1.7.1"
+ },
"pylint": {
"hashes": [
- "sha256:0b7e6b5d9f1d4e0b554b5d948f14ed7969e8cdf9a0120853e6e5af60813b18ab",
- "sha256:34738a82ab33cbd3bb6cd4cef823dbcabdd2b6b48a4e3a3054a2bbbf0c712be9"
+ "sha256:689de29ae747642ab230c6d37be2b969bf75663176658851f456619aacf27492",
+ "sha256:771467c434d0d9f081741fec1d64dfb011ed26e65e12a28fe06ca2f61c4d556c"
],
"index": "pypi",
- "version": "==1.8.4"
+ "version": "==2.2.2"
+ },
+ "pymysql": {
+ "hashes": [
+ "sha256:3943fbbbc1e902f41daf7f9165519f140c4451c179380677e6a848587042561a",
+ "sha256:d8c059dcd81dedb85a9f034d5e22dcb4442c0b201908bede99e306d65ea7c8e7"
+ ],
+ "index": "pypi",
+ "version": "==0.9.3"
},
"pyopenssl": {
"hashes": [
@@ -619,7 +758,6 @@
"sha256:6488f1423b00f73b7ad5167885312bb0ce410d3312eb212393795b53c8caa580"
],
"index": "pypi",
- "markers": "python_version == '2.7' and extra == 'secure'",
"version": "==18.0.0"
},
"pyparsing": {
@@ -673,17 +811,20 @@
},
"pyyaml": {
"hashes": [
- "sha256:16b20e970597e051997d90dc2cddc713a2876c47e3d92d59ee198700c5427736",
- "sha256:3262c96a1ca437e7e4763e2843746588a965426550f3797a79fca9c6199c431f",
- "sha256:592766c6303207a20efc445587778322d7f73b161bd994f227adaa341ba212ab",
- "sha256:5ac82e411044fb129bae5cfbeb3ba626acb2af31a8d17d175004b70862a741a7",
- "sha256:827dc04b8fa7d07c44de11fabbc888e627fa8293b695e0f99cb544fdfa1bf0d1",
- "sha256:bc6bced57f826ca7cb5125a10b23fd0f2fff3b7c4701d64c439a300ce665fff8",
- "sha256:c01b880ec30b5a6e6aa67b09a2fe3fb30473008c85cd6a67359a1b15ed6d83a4",
- "sha256:e863072cdf4c72eebf179342c94e6989c67185842d9997960b3e69290b2fa269"
+ "sha256:3d7da3009c0f3e783b2c873687652d83b1bbfd5c88e9813fb7e5b03c0dd3108b",
+ "sha256:3ef3092145e9b70e3ddd2c7ad59bdd0252a94dfe3949721633e41344de00a6bf",
+ "sha256:40c71b8e076d0550b2e6380bada1f1cd1017b882f7e16f09a65be98e017f211a",
+ "sha256:558dd60b890ba8fd982e05941927a3911dc409a63dcb8b634feaa0cda69330d3",
+ "sha256:a7c28b45d9f99102fa092bb213aa12e0aaf9a6a1f5e395d36166639c1f96c3a1",
+ "sha256:aa7dd4a6a427aed7df6fb7f08a580d68d9b118d90310374716ae90b710280af1",
+ "sha256:bc558586e6045763782014934bfaf39d48b8ae85a2713117d16c39864085c613",
+ "sha256:d46d7982b62e0729ad0175a9bc7e10a566fc07b224d2c79fafb5e032727eaa04",
+ "sha256:d5eef459e30b09f5a098b9cea68bebfeb268697f78d647bd255a085371ac7f3f",
+ "sha256:e01d3203230e1786cd91ccfdc8f8454c8069c91bee3962ad93b87a4b2860f537",
+ "sha256:e170a9e6fcfd19021dd29845af83bb79236068bf5fd4df3327c1be18182b2531"
],
"index": "pypi",
- "version": "==3.12"
+ "version": "==3.13"
},
"regex": {
"hashes": [
@@ -708,14 +849,6 @@
"index": "pypi",
"version": "==2.20.0"
},
- "requests-toolbelt": {
- "hashes": [
- "sha256:42c9c170abc2cacb78b8ab23ac957945c7716249206f90874651971a4acff237",
- "sha256:f6a531936c6fa4c6cfce1b9c10d5c4f498d16528d2a54a22ca00011205a187b5"
- ],
- "index": "pypi",
- "version": "==0.8.0"
- },
"responses": {
"hashes": [
"sha256:c6082710f4abfb60793899ca5f21e7ceb25aabf321560cc0726f8b59006811c9",
@@ -724,6 +857,13 @@
"index": "pypi",
"version": "==0.9.0"
},
+ "rsa": {
+ "hashes": [
+ "sha256:14ba45700ff1ec9eeb206a2ce76b32814958a98e372006c8fb76ba820211be66",
+ "sha256:1a836406405730121ae9823e19c6e806c62bbad73f890574fff50efa4122c487"
+ ],
+ "version": "==4.0"
+ },
"singledispatch": {
"hashes": [
"sha256:5b06af87df13818d14f08a028e42f566640aef80805c3b50c5056b086e3c2b9c",
@@ -788,7 +928,6 @@
"sha256:b5725a0bd4ba422ab0e66e89e030c806576753ea3ee08554382c14e685d117b5"
],
"index": "pypi",
- "markers": null,
"version": "==1.23"
},
"us": {
@@ -839,10 +978,13 @@
},
"xattr": {
"hashes": [
- "sha256:f9dcebc99555634b697fa3dad8ea3047deb389c6f1928d347a0c49277a5c0e9e"
+ "sha256:117f864caf6428a75ed1263d29e020afb5db30dcbdfc1b79da9f19ec8748d2df",
+ "sha256:4ea01c6d23252d9caeae613ea63191095924ec14df3a9390a404e84df6a1ddb7",
+ "sha256:7cb1b28eeab4fe99cc4350e831434142fce658f7d03f173ff7722144e6a47458",
+ "sha256:c0a5ec84ec3b98f0082cf3bafd299f2fa89a4e54ae4b0b1d6fab5ceea3d0d37a"
],
"index": "pypi",
- "version": "==0.6.4"
+ "version": "==0.9.6"
},
"zope.interface": {
"hashes": [
diff --git a/README.md b/README.md
index e06f92c509..9f8657cd24 100644
--- a/README.md
+++ b/README.md
@@ -75,29 +75,24 @@ _Note: Recidiviz team members and partners can download a pre-populated `secrets
your onboarding document for details._
#### Running tests
-Update your sourced `$PYTHONPATH` to add the Google App Engine libraries to the system Python path, which will
-allow imports of the various GAE libraries to work in test mode. Add the following line to your shell profile:
+Individual tests can be run via `pytest filename.py`. To run all tests, go to the root directory and run `pytest recidiviz`.
-`export PYTHONPATH="/path/to/google_appengine:/path/to/google_appengine/lib/:/path/to/google_appengine/lib/yaml-x.x/:$PYTHONPATH"`
-
-If you installed the GCloud SDK via the steps above, it's probably wherever you chose to install the SDK, under
-`google-cloud-sdk/platform/`. The `-x.x` after yaml is meant to denote a version number that will be present if you installed google_appengine as a separate component. If you did not, then it is unlikely that you will need to specify a version at all.
+The configuration in `setup.cfg` and `.coveragerc` will ensure the right code is tested and the proper code coverage
+metrics are displayed.
-Finally, you will likely need to fix an [issue in the Google App Engine installation](https://stackoverflow.com/a/27274135)
-that comes with the GCloud SDK. Check the `google_appengine/lib/fancy_urllib` folder to see if you have the nested
-`__init__.py` files with an empty file on the outer layer. If so, follow the instructions in that answer, and maybe
-copy the outer file into a temp file for safe-keeping (even though it's blank):
+A few tests (such as `sessions.py`) depend on running emulators (i.e. [Cloud Datastore Emulator](https://cloud.google.com/datastore/docs/tools/datastore-emulator)). These tests are skipped by default when run locally, but will always be tested by Travis. If you are modifying code tested by these tests then you can run the tests locally. You must first install the both emulators via `gcloud components install cloud-datastore-emulator` and `gcloud components install cloud-pusub-emulator`, which depends on the Java JRE (>=8). Then start the emulators and run the tests:
-```
-cd /path/to/google_appengine/lib/fancy_urllib
-cp __init__.py old__init__.py
-cp fancy_urllib/__init__.py __init__.py
+```bash
+# Starts the emulator
+$ gcloud beta emulators datastore start --no-store-on-disk --project test-project --consistency 1.0
+$ gcloud beta emulators pubsub start --project test-project > ps_emulator.out 2> ps_emulator.err &
+# Run the tests
+$ pytest recidiviz --with-emulator
```
-Once that's all done, individual tests can be run via `pytest filename.py`. To run all tests, go to the root directory and run `pytest recidiviz`.
+[A bug in the google client](https://github.com/googleapis/google-cloud-python/issues/5738) requires that you have default application credentials. This should not be necessary in the future. For now, make sure that you have done both `gcloud config set project recidiviz` and `gcloud auth application-default login`.
-The configuration in `setup.cfg` and `.coveragerc` will ensure the right code is tested and the proper code coverage
-metrics are displayed.
+_Note: The emulator is a long running command, either (1) run it in a separate session or (2) run it in the background (suffix with `2> emulator.out &`) and bring it back with `fg`._
#### Checking code style
Run Pylint across the main body of code, in particular: `pylint *.py recidiviz`.
@@ -111,23 +106,15 @@ inbound pull request.
There are two ways to run the app - on your local machine, or deployed to the cloud.
#### Local
-Running from your local machine is preferred for development - it yields much quicker iteration cycles, and the local
-dev server is able to handle the needs of the simple scraping tool pretty well.
-
-To run this locally, just navigate to the directory you cloned pulse-data into and run `dev_appserver.py local_app.yaml`.
-
-If you haven't run the local development server recently, or this is your first time running it at all, first make a
-call to the test datastore populator (e.g., `localhost:8080/test_populator/clear`). Any call to the test data populator
-(including `/clear`, which is used to empty the local datastore) will ensure the proper environment variables have been set
-up for your local test system.
-
-Logs will show up in the console you run the command in, and you can kick off the scraping by navigating in your browser
-to `localhost:8080/scraper/start?region=[region]` (logs won't show much until the scraping starts). For now, use region `us_ny`
+A scraper can be run locally using the `run_scraper.py` script. See that file for instructions on how to run it.
-You can check queue tasks and more on the local dev server admin page (http://localhost:8000/datastore) while it's running.
+By default the scraped entities will be logged. To persist data during a local run, set the `PERSIST_LOCALLY`
+environment variable to `true`.
-By default, no data is persisted during local runs. Instead, the scraped information for each person is logged in the console.
-To persist data during a local run, set the `PERSIST_LOCALLY` in local_app.yaml to `true`.
+The full application can also be run locally using `flask run` and talk to the local emulators for GCP services (as
+described in [running tests](#running-tests)). In practice, this is not particularly useful as there isn't a Cloud
+Tasks emulator at this time. The [appengine documentation]( https://cloud.google.com/appengine/docs/standard/python3/testing-and-deploying-your-app)
+has more information about running locally.
#### Deployed
To deploy to a live AppEngine project, navigate to the directory where you cloned `pulse-data` and run
diff --git a/app.yaml b/app.yaml
index 38a7881ff7..a4a290a5bc 100644
--- a/app.yaml
+++ b/app.yaml
@@ -1,26 +1,7 @@
-runtime: python27
-api_version: 1
-threadsafe: false
+runtime: python37
instance_class: F2
-includes:
-- base.yaml
-
-libraries:
-- name: lxml
- version: "3.7.3"
-- name: ssl
- version: latest
+entrypoint: gunicorn -b :$PORT recidiviz.server:app
env_variables:
- GAE_USE_SOCKETS_HTTPLIB : 'true'
-
-# The first five regular expressions are the default values which have to be
-# made explicit when defining custom values: https://cloud.google.com/appengine/docs/standard/python/config/appref
-skip_files:
-- ^(.*/)?#.*#$
-- ^(.*/)?.*~$
-- ^(.*/)?.*\.py[co]$
-- ^(.*/)?.*/RCS/.*$
-- ^(.*/)?\..*$
-- ^local\.yaml$
+ RECIDIVIZ_ENV: production
\ No newline at end of file
diff --git a/appengine_config.py b/appengine_config.py
deleted file mode 100644
index a88e21b68a..0000000000
--- a/appengine_config.py
+++ /dev/null
@@ -1,39 +0,0 @@
-# Recidiviz - a platform for tracking granular recidivism metrics in real time
-# Copyright (C) 2018 Recidiviz, Inc.
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see .
-# =============================================================================
-
-
-"""Custom configuration for our Google App Engine instances.
-
-Specifies where installed libraries reside in the project.
-Modifies our logging output format across the project.
-"""
-
-
-# appengine_config.py
-import logging
-import os
-from google.appengine.ext import vendor
-
-# Add any libraries installed in the "lib" folder.
-vendor.add(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'lib'))
-
-# Override GAE logger to use our formatting
-log_format = "%(module)s/%(funcName)s : %(message)s"
-fr = logging.Formatter(log_format)
-handlers = logging.getLogger().handlers
-if handlers:
- handlers[0].setFormatter(fr)
diff --git a/base.yaml b/base.yaml
deleted file mode 100644
index cb9d8bb9a5..0000000000
--- a/base.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-builtins:
-# Deferred is required to use google.appengine.ext.deferred
-- deferred: on
-
-handlers:
-- url: /_ah/queue/deferred
- script: google.appengine.ext.deferred.deferred.application
- login: admin
-
-- url: /.*
- script: recidiviz.server.app
diff --git a/conftest.py b/conftest.py
new file mode 100644
index 0000000000..4d1b5bc19d
--- /dev/null
+++ b/conftest.py
@@ -0,0 +1,101 @@
+# Recidiviz - a platform for tracking granular recidivism metrics in real time
+# Copyright (C) 2018 Recidiviz, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+# =============================================================================
+
+"""Custom configuration for how pytest should run."""
+
+
+import os
+
+import pytest
+import yaml
+
+import recidiviz
+from recidiviz.ingest import docket, sessions
+from recidiviz.utils import secrets
+
+
+def pytest_configure():
+ recidiviz.called_from_test = True
+
+
+def pytest_unconfigure():
+ del recidiviz.called_from_test
+
+
+def pytest_addoption(parser):
+ parser.addoption("-E", "--with-emulator", action="store_true",
+ help="run tests that require the datastore emulator.")
+
+
+def pytest_runtest_setup(item):
+ if ('emulator' in item.fixturenames and
+ not item.config.getoption('with_emulator', default=None)):
+ pytest.skip("requires datastore emulator")
+
+
+# TODO(263): return the datastore client from this fixture
+@pytest.fixture(scope='class')
+def emulator(request):
+ # These environment variables can only be set while these tests are
+ # running as they also impact ndb/testbed behavior
+ prior_environs = write_emulator_environs()
+ sessions.clear_ds()
+ secrets.clear_ds()
+ docket.clear_publisher()
+ docket.clear_subscriber()
+
+ def cleanup():
+ restore_environs(prior_environs)
+ sessions.clear_ds()
+ secrets.clear_ds()
+ docket.clear_publisher()
+ docket.clear_subscriber()
+
+ request.addfinalizer(cleanup)
+
+
+def write_emulator_environs():
+ old_environs = {}
+
+ # Note: If multiple emulator environments contain the same key, the last one
+ # wins
+ emulator_names = ['datastore', 'pubsub']
+ env_dict = {}
+ for emulator_name in emulator_names:
+ filename = os.path.join(
+ os.environ.get('HOME'),
+ '.config/gcloud/emulators/{}/env.yaml'.format(emulator_name))
+ env_file = open(filename, 'r')
+ env_dict.update(yaml.load(env_file))
+ env_file.close()
+
+ old_environs = {key: os.environ.get(key) for key in env_dict}
+ os.environ.update(env_dict)
+ # https://github.com/GoogleCloudPlatform/google-cloud-datastore/issues/168#issuecomment-294418422
+ if 'DATASTORE_PROJECT_ID' in env_dict:
+ old_environs['APPLICATION_ID'] = os.environ.get('APPLICATION_ID')
+ os.environ['APPLICATION_ID'] = env_dict['DATASTORE_PROJECT_ID']
+
+ return old_environs
+
+
+def restore_environs(prior_environs):
+ for key, value in prior_environs.items():
+ if value:
+ os.environ[key] = value
+ else:
+ del os.environ[key]
diff --git a/create_scraper.py b/create_scraper.py
index 33b7f46a00..239617af1d 100644
--- a/create_scraper.py
+++ b/create_scraper.py
@@ -108,9 +108,6 @@ def append_to_config_files(subs):
queue: $region_dashes-scraper
base_url: $url
names_file: $names_file
- entity_kinds:
- person: Person
- record: Record
scraper_package: $region
timezone: $timezone
"""
@@ -133,7 +130,7 @@ def append_to_config_files(subs):
parser.add_argument('--' + optional_arg)
args = parser.parse_args()
- state = us.states.lookup(unicode(args.state))
+ state = us.states.lookup(args.state)
if state is None:
raise ValueError('Couldn\'t parse state "%s"' % args.state)
region = ('us', state.abbr.lower()) + tuple(args.county.lower().split())
diff --git a/index.yaml b/index.yaml
index 0bf58ad57d..0c4ad8e822 100644
--- a/index.yaml
+++ b/index.yaml
@@ -6,6 +6,12 @@ indexes:
- name: start
direction: desc
+- kind: ScrapeSession
+ properties:
+ - name: region
+ - name: scrape_type
+ - name: docket_ack_id
+
# AUTOGENERATED
# This index.yaml is automatically updated whenever the dev_appserver
@@ -16,63 +22,6 @@ indexes:
# automatically uploaded to the admin console when you next deploy
# your application using appcfg.py.
-- kind: Inmate
- properties:
- - name: race
- - name: age
-
-- kind: Inmate
- properties:
- - name: region
- - name: __scatter__
-
-- kind: InmateFacilitySnapshot
- properties:
- - name: associated_record
- - name: snapshot_date
- direction: desc
-
-- kind: InmateFacilitySnapshot
- ancestor: yes
- properties:
- - name: snapshot_date
- direction: desc
-
-- kind: InmateSnapshot
- properties:
- - name: is_released
- - name: snapshot_date
-
-- kind: InmateSnapshot
- ancestor: yes
- properties:
- - name: class
- - name: snapshot_date
- direction: desc
-
-- kind: Record
- properties:
- - name: class
- - name: is_released
- - name: created
-
-- kind: Record
- properties:
- - name: class
- - name: is_released
- - name: created_on
-
-- kind: Record
- properties:
- - name: class
- - name: is_released
- - name: latest_release_date
-
-- kind: Record
- ancestor: yes
- properties:
- - name: custody_date
-
- kind: ScrapeSession
properties:
- name: end
@@ -88,66 +37,9 @@ indexes:
- name: start
direction: desc
-- kind: ScrapeSession
- properties:
- - name: region
- - name: scrape_type
- - name: docket_item
-
- kind: ScrapeSession
properties:
- name: region
- name: scrape_type
- name: start
direction: desc
-
-- kind: ScrapedRecord
- properties:
- - name: record_id
- - name: region
- - name: created_on
-
-- kind: Snapshot
- properties:
- - name: class
- - name: is_released
- - name: created_on
-
-- kind: Snapshot
- properties:
- - name: class
- - name: is_released
- - name: snapshot_date
-
-- kind: Snapshot
- properties:
- - name: class
- - name: is_released
- - name: snapshot_timestamp
-
-- kind: Snapshot
- ancestor: yes
- properties:
- - name: class
- - name: created_on
- direction: desc
-
-- kind: Snapshot
- ancestor: yes
- properties:
- - name: class
- - name: snapshot_date
- direction: desc
-
-- kind: Snapshot
- ancestor: yes
- properties:
- - name: class
- - name: snapshot_timestamp
- direction: desc
-
-- kind: Snapshot
- ancestor: yes
- properties:
- - name: created_on
- direction: desc
diff --git a/lib/.DS_Store b/lib/.DS_Store
deleted file mode 100644
index 5008ddfcf5..0000000000
Binary files a/lib/.DS_Store and /dev/null differ
diff --git a/lib/Click-7.0.dist-info/INSTALLER b/lib/Click-7.0.dist-info/INSTALLER
deleted file mode 100644
index a1b589e38a..0000000000
--- a/lib/Click-7.0.dist-info/INSTALLER
+++ /dev/null
@@ -1 +0,0 @@
-pip
diff --git a/lib/Click-7.0.dist-info/LICENSE.txt b/lib/Click-7.0.dist-info/LICENSE.txt
deleted file mode 100644
index 87ce152aaf..0000000000
--- a/lib/Click-7.0.dist-info/LICENSE.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-Copyright © 2014 by the Pallets team.
-
-Some rights reserved.
-
-Redistribution and use in source and binary forms of the software as
-well as documentation, with or without modification, are permitted
-provided that the following conditions are met:
-
-- Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
-- Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
-- Neither the name of the copyright holder nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
-THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
-BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE AND DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGE.
-
-----
-
-Click uses parts of optparse written by Gregory P. Ward and maintained
-by the Python Software Foundation. This is limited to code in parser.py.
-
-Copyright © 2001-2006 Gregory P. Ward. All rights reserved.
-Copyright © 2002-2006 Python Software Foundation. All rights reserved.
diff --git a/lib/Click-7.0.dist-info/METADATA b/lib/Click-7.0.dist-info/METADATA
deleted file mode 100644
index 625bdaddbb..0000000000
--- a/lib/Click-7.0.dist-info/METADATA
+++ /dev/null
@@ -1,121 +0,0 @@
-Metadata-Version: 2.1
-Name: Click
-Version: 7.0
-Summary: Composable command line interface toolkit
-Home-page: https://palletsprojects.com/p/click/
-Author: Armin Ronacher
-Author-email: armin.ronacher@active-4.com
-Maintainer: Pallets Team
-Maintainer-email: contact@palletsprojects.com
-License: BSD
-Project-URL: Documentation, https://click.palletsprojects.com/
-Project-URL: Code, https://github.com/pallets/click
-Project-URL: Issue tracker, https://github.com/pallets/click/issues
-Platform: UNKNOWN
-Classifier: Development Status :: 5 - Production/Stable
-Classifier: Intended Audience :: Developers
-Classifier: License :: OSI Approved :: BSD License
-Classifier: Operating System :: OS Independent
-Classifier: Programming Language :: Python
-Classifier: Programming Language :: Python :: 2
-Classifier: Programming Language :: Python :: 2.7
-Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.4
-Classifier: Programming Language :: Python :: 3.5
-Classifier: Programming Language :: Python :: 3.6
-Classifier: Programming Language :: Python :: 3.7
-Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
-
-\$ click\_
-==========
-
-Click is a Python package for creating beautiful command line interfaces
-in a composable way with as little code as necessary. It's the "Command
-Line Interface Creation Kit". It's highly configurable but comes with
-sensible defaults out of the box.
-
-It aims to make the process of writing command line tools quick and fun
-while also preventing any frustration caused by the inability to
-implement an intended CLI API.
-
-Click in three points:
-
-- Arbitrary nesting of commands
-- Automatic help page generation
-- Supports lazy loading of subcommands at runtime
-
-
-Installing
-----------
-
-Install and update using `pip`_:
-
-.. code-block:: text
-
- $ pip install click
-
-Click supports Python 3.4 and newer, Python 2.7, and PyPy.
-
-.. _pip: https://pip.pypa.io/en/stable/quickstart/
-
-
-A Simple Example
-----------------
-
-What does it look like? Here is an example of a simple Click program:
-
-.. code-block:: python
-
- import click
-
- @click.command()
- @click.option("--count", default=1, help="Number of greetings.")
- @click.option("--name", prompt="Your name",
- help="The person to greet.")
- def hello(count, name):
- """Simple program that greets NAME for a total of COUNT times."""
- for _ in range(count):
- click.echo("Hello, %s!" % name)
-
- if __name__ == '__main__':
- hello()
-
-And what it looks like when run:
-
-.. code-block:: text
-
- $ python hello.py --count=3
- Your name: Click
- Hello, Click!
- Hello, Click!
- Hello, Click!
-
-
-Donate
-------
-
-The Pallets organization develops and supports Click and other popular
-packages. In order to grow the community of contributors and users, and
-allow the maintainers to devote more time to the projects, `please
-donate today`_.
-
-.. _please donate today: https://palletsprojects.com/donate
-
-
-Links
------
-
-* Website: https://palletsprojects.com/p/click/
-* Documentation: https://click.palletsprojects.com/
-* License: `BSD `_
-* Releases: https://pypi.org/project/click/
-* Code: https://github.com/pallets/click
-* Issue tracker: https://github.com/pallets/click/issues
-* Test status:
-
- * Linux, Mac: https://travis-ci.org/pallets/click
- * Windows: https://ci.appveyor.com/project/pallets/click
-
-* Test coverage: https://codecov.io/gh/pallets/click
-
-
diff --git a/lib/Click-7.0.dist-info/RECORD b/lib/Click-7.0.dist-info/RECORD
deleted file mode 100644
index 0dac84328f..0000000000
--- a/lib/Click-7.0.dist-info/RECORD
+++ /dev/null
@@ -1,40 +0,0 @@
-Click-7.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
-Click-7.0.dist-info/LICENSE.txt,sha256=4hIxn676T0Wcisk3_chVcECjyrivKTZsoqSNI5AlIlw,1876
-Click-7.0.dist-info/METADATA,sha256=-r8jeke3Zer4diRvT1MjFZuiJ6yTT_qFP39svLqdaLI,3516
-Click-7.0.dist-info/RECORD,,
-Click-7.0.dist-info/WHEEL,sha256=gduuPyBvFJQSQ0zdyxF7k0zynDXbIbvg5ZBHoXum5uk,110
-Click-7.0.dist-info/top_level.txt,sha256=J1ZQogalYS4pphY_lPECoNMfw0HzTSrZglC4Yfwo4xA,6
-click/__init__.py,sha256=HjGThQ7tef9kkwCV371TBnrf0SAi6fKfU_jtEnbYTvQ,2789
-click/__init__.pyc,,
-click/_bashcomplete.py,sha256=iaNUmtxag0YPfxba3TDYCNietiTMQIrvhRLj-H8okFU,11014
-click/_bashcomplete.pyc,,
-click/_compat.py,sha256=vYmvoj4opPxo-c-2GMQQjYT_r_QkOKybkfGoeVrt0dA,23399
-click/_compat.pyc,,
-click/_termui_impl.py,sha256=xHmLtOJhKUCVD6168yucJ9fknUJPAMs0eUTPgVUO-GQ,19611
-click/_termui_impl.pyc,,
-click/_textwrap.py,sha256=gwS4m7bdQiJnzaDG8osFcRb-5vn4t4l2qSCy-5csCEc,1198
-click/_textwrap.pyc,,
-click/_unicodefun.py,sha256=QHy2_5jYlX-36O-JVrTHNnHOqg8tquUR0HmQFev7Ics,4364
-click/_unicodefun.pyc,,
-click/_winconsole.py,sha256=PPWVak8Iikm_gAPsxMrzwsVFCvHgaW3jPaDWZ1JBl3U,8965
-click/_winconsole.pyc,,
-click/core.py,sha256=q8FLcDZsagBGSRe5Y9Hi_FGvAeZvusNfoO5EkhkSQ8Y,75305
-click/core.pyc,,
-click/decorators.py,sha256=idKt6duLUUfAFftrHoREi8MJSd39XW36pUVHthdglwk,11226
-click/decorators.pyc,,
-click/exceptions.py,sha256=CNpAjBAE7qjaV4WChxQeak95e5yUOau8AsvT-8m6wss,7663
-click/exceptions.pyc,,
-click/formatting.py,sha256=eh-cypTUAhpI3HD-K4ZpR3vCiURIO62xXvKkR3tNUTM,8889
-click/formatting.pyc,,
-click/globals.py,sha256=oQkou3ZQ5DgrbVM6BwIBirwiqozbjfirzsLGAlLRRdg,1514
-click/globals.pyc,,
-click/parser.py,sha256=m-nGZz4VwprM42_qtFlWFGo7yRJQxkBlRcZodoH593Y,15510
-click/parser.pyc,,
-click/termui.py,sha256=o_ZXB2jyvL2Rce7P_bFGq452iyBq9ykJyRApIPMCZO0,23207
-click/termui.pyc,,
-click/testing.py,sha256=aYGqY_iWLu2p4k7lkuJ6t3fqpf6aPGqTsyLzNY_ngKg,13062
-click/testing.pyc,,
-click/types.py,sha256=2Q929p-aBP_ZYuMFJqJR-Ipucofv3fmDc5JzBDPmzJU,23287
-click/types.pyc,,
-click/utils.py,sha256=6-D0WkAxvv9FkgHXSHwDIv0l9Gdx9Mm6Z5vuKNLIfZI,15763
-click/utils.pyc,,
diff --git a/lib/Click-7.0.dist-info/WHEEL b/lib/Click-7.0.dist-info/WHEEL
deleted file mode 100644
index 1316c41d07..0000000000
--- a/lib/Click-7.0.dist-info/WHEEL
+++ /dev/null
@@ -1,6 +0,0 @@
-Wheel-Version: 1.0
-Generator: bdist_wheel (0.31.1)
-Root-Is-Purelib: true
-Tag: py2-none-any
-Tag: py3-none-any
-
diff --git a/lib/Click-7.0.dist-info/top_level.txt b/lib/Click-7.0.dist-info/top_level.txt
deleted file mode 100644
index dca9a90964..0000000000
--- a/lib/Click-7.0.dist-info/top_level.txt
+++ /dev/null
@@ -1 +0,0 @@
-click
diff --git a/lib/Flask-1.0.2.dist-info/INSTALLER b/lib/Flask-1.0.2.dist-info/INSTALLER
deleted file mode 100644
index a1b589e38a..0000000000
--- a/lib/Flask-1.0.2.dist-info/INSTALLER
+++ /dev/null
@@ -1 +0,0 @@
-pip
diff --git a/lib/Flask-1.0.2.dist-info/LICENSE.txt b/lib/Flask-1.0.2.dist-info/LICENSE.txt
deleted file mode 100644
index 8f9252f452..0000000000
--- a/lib/Flask-1.0.2.dist-info/LICENSE.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-Copyright © 2010 by the Pallets team.
-
-Some rights reserved.
-
-Redistribution and use in source and binary forms of the software as
-well as documentation, with or without modification, are permitted
-provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
-* Neither the name of the copyright holder nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
-THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
-BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE AND DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGE.
diff --git a/lib/Flask-1.0.2.dist-info/METADATA b/lib/Flask-1.0.2.dist-info/METADATA
deleted file mode 100644
index c600e730a9..0000000000
--- a/lib/Flask-1.0.2.dist-info/METADATA
+++ /dev/null
@@ -1,130 +0,0 @@
-Metadata-Version: 2.1
-Name: Flask
-Version: 1.0.2
-Summary: A simple framework for building complex web applications.
-Home-page: https://www.palletsprojects.com/p/flask/
-Author: Armin Ronacher
-Author-email: armin.ronacher@active-4.com
-Maintainer: Pallets team
-Maintainer-email: contact@palletsprojects.com
-License: BSD
-Project-URL: Documentation, http://flask.pocoo.org/docs/
-Project-URL: Code, https://github.com/pallets/flask
-Project-URL: Issue tracker, https://github.com/pallets/flask/issues
-Platform: any
-Classifier: Development Status :: 5 - Production/Stable
-Classifier: Environment :: Web Environment
-Classifier: Framework :: Flask
-Classifier: Intended Audience :: Developers
-Classifier: License :: OSI Approved :: BSD License
-Classifier: Operating System :: OS Independent
-Classifier: Programming Language :: Python
-Classifier: Programming Language :: Python :: 2
-Classifier: Programming Language :: Python :: 2.7
-Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.4
-Classifier: Programming Language :: Python :: 3.5
-Classifier: Programming Language :: Python :: 3.6
-Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
-Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Application
-Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
-Classifier: Topic :: Software Development :: Libraries :: Python Modules
-Provides-Extra: dev
-Provides-Extra: docs
-Provides-Extra: dotenv
-Requires-Dist: Werkzeug (>=0.14)
-Requires-Dist: Jinja2 (>=2.10)
-Requires-Dist: itsdangerous (>=0.24)
-Requires-Dist: click (>=5.1)
-Provides-Extra: dev
-Requires-Dist: pytest (>=3); extra == 'dev'
-Requires-Dist: coverage; extra == 'dev'
-Requires-Dist: tox; extra == 'dev'
-Requires-Dist: sphinx; extra == 'dev'
-Requires-Dist: pallets-sphinx-themes; extra == 'dev'
-Requires-Dist: sphinxcontrib-log-cabinet; extra == 'dev'
-Provides-Extra: docs
-Requires-Dist: sphinx; extra == 'docs'
-Requires-Dist: pallets-sphinx-themes; extra == 'docs'
-Requires-Dist: sphinxcontrib-log-cabinet; extra == 'docs'
-Provides-Extra: dotenv
-Requires-Dist: python-dotenv; extra == 'dotenv'
-
-Flask
-=====
-
-Flask is a lightweight `WSGI`_ web application framework. It is designed
-to make getting started quick and easy, with the ability to scale up to
-complex applications. It began as a simple wrapper around `Werkzeug`_
-and `Jinja`_ and has become one of the most popular Python web
-application frameworks.
-
-Flask offers suggestions, but doesn't enforce any dependencies or
-project layout. It is up to the developer to choose the tools and
-libraries they want to use. There are many extensions provided by the
-community that make adding new functionality easy.
-
-
-Installing
-----------
-
-Install and update using `pip`_:
-
-.. code-block:: text
-
- pip install -U Flask
-
-
-A Simple Example
-----------------
-
-.. code-block:: python
-
- from flask import Flask
-
- app = Flask(__name__)
-
- @app.route('/')
- def hello():
- return 'Hello, World!'
-
-.. code-block:: text
-
- $ FLASK_APP=hello.py flask run
- * Serving Flask app "hello"
- * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
-
-
-Donate
-------
-
-The Pallets organization develops and supports Flask and the libraries
-it uses. In order to grow the community of contributors and users, and
-allow the maintainers to devote more time to the projects, `please
-donate today`_.
-
-.. _please donate today: https://psfmember.org/civicrm/contribute/transact?reset=1&id=20
-
-
-Links
------
-
-* Website: https://www.palletsprojects.com/p/flask/
-* Documentation: http://flask.pocoo.org/docs/
-* License: `BSD `_
-* Releases: https://pypi.org/project/Flask/
-* Code: https://github.com/pallets/flask
-* Issue tracker: https://github.com/pallets/flask/issues
-* Test status:
-
- * Linux, Mac: https://travis-ci.org/pallets/flask
- * Windows: https://ci.appveyor.com/project/pallets/flask
-
-* Test coverage: https://codecov.io/gh/pallets/flask
-
-.. _WSGI: https://wsgi.readthedocs.io
-.. _Werkzeug: https://www.palletsprojects.com/p/werkzeug/
-.. _Jinja: https://www.palletsprojects.com/p/jinja/
-.. _pip: https://pip.pypa.io/en/stable/quickstart/
-
-
diff --git a/lib/Flask-1.0.2.dist-info/RECORD b/lib/Flask-1.0.2.dist-info/RECORD
deleted file mode 100644
index 8b762a391b..0000000000
--- a/lib/Flask-1.0.2.dist-info/RECORD
+++ /dev/null
@@ -1,48 +0,0 @@
-../../bin/flask,sha256=GWmOx6xJK1t_71kthZo9ktKtx3IfMF4VDVIV2WKSv9A,288
-Flask-1.0.2.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
-Flask-1.0.2.dist-info/LICENSE.txt,sha256=ziEXA3AIuaiUn1qe4cd1XxCESWTYrk4TjN7Qb06J3l8,1575
-Flask-1.0.2.dist-info/METADATA,sha256=iA5tiNWzTtgCVe80aTZGNWsckj853fJyfvHs9U-WZRk,4182
-Flask-1.0.2.dist-info/RECORD,,
-Flask-1.0.2.dist-info/WHEEL,sha256=J3CsTk7Mf2JNUyhImI-mjX-fmI4oDjyiXgWT4qgZiCE,110
-Flask-1.0.2.dist-info/entry_points.txt,sha256=gBLA1aKg0OYR8AhbAfg8lnburHtKcgJLDU52BBctN0k,42
-Flask-1.0.2.dist-info/top_level.txt,sha256=dvi65F6AeGWVU0TBpYiC04yM60-FX1gJFkK31IKQr5c,6
-flask/__init__.py,sha256=qq8lK6QQbxJALf1igz7qsvUwOTAoKvFGfdLm7jPNsso,1673
-flask/__init__.pyc,,
-flask/__main__.py,sha256=pgIXrHhxM5MAMvgzAqWpw_t6AXZ1zG38us4JRgJKtxk,291
-flask/__main__.pyc,,
-flask/_compat.py,sha256=UDFGhosh6mOdNB-4evKPuneHum1OpcAlwTNJCRm0irQ,2892
-flask/_compat.pyc,,
-flask/app.py,sha256=ahpe3T8w98rQd_Er5d7uDxK57S1nnqGQx3V3hirBovU,94147
-flask/app.pyc,,
-flask/blueprints.py,sha256=Cyhl_x99tgwqEZPtNDJUFneAfVJxWfEU4bQA7zWS6VU,18331
-flask/blueprints.pyc,,
-flask/cli.py,sha256=30QYAO10Do9LbZYCLgfI_xhKjASdLopL8wKKVUGS2oA,29442
-flask/cli.pyc,,
-flask/config.py,sha256=kznUhj4DLYxsTF_4kfDG8GEHto1oZG_kqblyrLFtpqQ,9951
-flask/config.pyc,,
-flask/ctx.py,sha256=leFzS9fzmo0uaLCdxpHc5_iiJZ1H0X_Ig4yPCOvT--g,16224
-flask/ctx.pyc,,
-flask/debughelpers.py,sha256=1ceC-UyqZTd4KsJkf0OObHPsVt5R3T6vnmYhiWBjV-w,6479
-flask/debughelpers.pyc,,
-flask/globals.py,sha256=pGg72QW_-4xUfsI33I5L_y76c21AeqfSqXDcbd8wvXU,1649
-flask/globals.pyc,,
-flask/helpers.py,sha256=YCl8D1plTO1evEYP4KIgaY3H8Izww5j4EdgRJ89oHTw,40106
-flask/helpers.pyc,,
-flask/json/__init__.py,sha256=Ns1Hj805XIxuBMh2z0dYnMVfb_KUgLzDmP3WoUYaPhw,10729
-flask/json/__init__.pyc,,
-flask/json/tag.py,sha256=9ehzrmt5k7hxf7ZEK0NOs3swvQyU9fWNe-pnYe69N60,8223
-flask/json/tag.pyc,,
-flask/logging.py,sha256=qV9h0vt7NIRkKM9OHDWndzO61E5CeBMlqPJyTt-W2Wc,2231
-flask/logging.pyc,,
-flask/sessions.py,sha256=2XHV4ASREhSEZ8bsPQW6pNVNuFtbR-04BzfKg0AfvHo,14452
-flask/sessions.pyc,,
-flask/signals.py,sha256=BGQbVyCYXnzKK2DVCzppKFyWN1qmrtW1QMAYUs-1Nr8,2211
-flask/signals.pyc,,
-flask/templating.py,sha256=FDfWMbpgpC3qObW8GGXRAVrkHFF8K4CHOJymB1wvULI,4914
-flask/templating.pyc,,
-flask/testing.py,sha256=XD3gWNvLUV8dqVHwKd9tZzsj81fSHtjOphQ1wTNtlMs,9379
-flask/testing.pyc,,
-flask/views.py,sha256=Wy-_WkUVtCfE2zCXYeJehNgHuEtviE4v3HYfJ--MpbY,5733
-flask/views.pyc,,
-flask/wrappers.py,sha256=1Z9hF5-hXQajn_58XITQFRY8efv3Vy3uZ0avBfZu6XI,7511
-flask/wrappers.pyc,,
diff --git a/lib/Flask-1.0.2.dist-info/WHEEL b/lib/Flask-1.0.2.dist-info/WHEEL
deleted file mode 100644
index f21b51cd8a..0000000000
--- a/lib/Flask-1.0.2.dist-info/WHEEL
+++ /dev/null
@@ -1,6 +0,0 @@
-Wheel-Version: 1.0
-Generator: bdist_wheel (0.31.0)
-Root-Is-Purelib: true
-Tag: py2-none-any
-Tag: py3-none-any
-
diff --git a/lib/Flask-1.0.2.dist-info/entry_points.txt b/lib/Flask-1.0.2.dist-info/entry_points.txt
deleted file mode 100644
index 1eb025200e..0000000000
--- a/lib/Flask-1.0.2.dist-info/entry_points.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-[console_scripts]
-flask = flask.cli:main
-
diff --git a/lib/Flask-1.0.2.dist-info/top_level.txt b/lib/Flask-1.0.2.dist-info/top_level.txt
deleted file mode 100644
index 7e1060246f..0000000000
--- a/lib/Flask-1.0.2.dist-info/top_level.txt
+++ /dev/null
@@ -1 +0,0 @@
-flask
diff --git a/lib/Jinja2-2.10.dist-info/DESCRIPTION.rst b/lib/Jinja2-2.10.dist-info/DESCRIPTION.rst
deleted file mode 100644
index 1594da5ce5..0000000000
--- a/lib/Jinja2-2.10.dist-info/DESCRIPTION.rst
+++ /dev/null
@@ -1,37 +0,0 @@
-
-Jinja2
-~~~~~~
-
-Jinja2 is a template engine written in pure Python. It provides a
-`Django`_ inspired non-XML syntax but supports inline expressions and
-an optional `sandboxed`_ environment.
-
-Nutshell
---------
-
-Here a small example of a Jinja template::
-
- {% extends 'base.html' %}
- {% block title %}Memberlist{% endblock %}
- {% block content %}
-
- {% endblock %}
-
-Philosophy
-----------
-
-Application logic is for the controller but don't try to make the life
-for the template designer too hard by giving him too few functionality.
-
-For more informations visit the new `Jinja2 webpage`_ and `documentation`_.
-
-.. _sandboxed: https://en.wikipedia.org/wiki/Sandbox_(computer_security)
-.. _Django: https://www.djangoproject.com/
-.. _Jinja2 webpage: http://jinja.pocoo.org/
-.. _documentation: http://jinja.pocoo.org/2/documentation/
-
-
diff --git a/lib/Jinja2-2.10.dist-info/INSTALLER b/lib/Jinja2-2.10.dist-info/INSTALLER
deleted file mode 100644
index a1b589e38a..0000000000
--- a/lib/Jinja2-2.10.dist-info/INSTALLER
+++ /dev/null
@@ -1 +0,0 @@
-pip
diff --git a/lib/Jinja2-2.10.dist-info/LICENSE.txt b/lib/Jinja2-2.10.dist-info/LICENSE.txt
deleted file mode 100644
index 10145a2643..0000000000
--- a/lib/Jinja2-2.10.dist-info/LICENSE.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-Copyright (c) 2009 by the Jinja Team, see AUTHORS for more details.
-
-Some rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials provided
- with the distribution.
-
- * The names of the contributors may not be used to endorse or
- promote products derived from this software without specific
- prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/lib/Jinja2-2.10.dist-info/METADATA b/lib/Jinja2-2.10.dist-info/METADATA
deleted file mode 100644
index 40f2b46b40..0000000000
--- a/lib/Jinja2-2.10.dist-info/METADATA
+++ /dev/null
@@ -1,68 +0,0 @@
-Metadata-Version: 2.0
-Name: Jinja2
-Version: 2.10
-Summary: A small but fast and easy to use stand-alone template engine written in pure python.
-Home-page: http://jinja.pocoo.org/
-Author: Armin Ronacher
-Author-email: armin.ronacher@active-4.com
-License: BSD
-Description-Content-Type: UNKNOWN
-Platform: UNKNOWN
-Classifier: Development Status :: 5 - Production/Stable
-Classifier: Environment :: Web Environment
-Classifier: Intended Audience :: Developers
-Classifier: License :: OSI Approved :: BSD License
-Classifier: Operating System :: OS Independent
-Classifier: Programming Language :: Python
-Classifier: Programming Language :: Python :: 2
-Classifier: Programming Language :: Python :: 2.6
-Classifier: Programming Language :: Python :: 2.7
-Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.3
-Classifier: Programming Language :: Python :: 3.4
-Classifier: Programming Language :: Python :: 3.5
-Classifier: Programming Language :: Python :: 3.6
-Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
-Classifier: Topic :: Software Development :: Libraries :: Python Modules
-Classifier: Topic :: Text Processing :: Markup :: HTML
-Requires-Dist: MarkupSafe (>=0.23)
-Provides-Extra: i18n
-Requires-Dist: Babel (>=0.8); extra == 'i18n'
-
-
-Jinja2
-~~~~~~
-
-Jinja2 is a template engine written in pure Python. It provides a
-`Django`_ inspired non-XML syntax but supports inline expressions and
-an optional `sandboxed`_ environment.
-
-Nutshell
---------
-
-Here a small example of a Jinja template::
-
- {% extends 'base.html' %}
- {% block title %}Memberlist{% endblock %}
- {% block content %}
-
- {% endblock %}
-
-Philosophy
-----------
-
-Application logic is for the controller but don't try to make the life
-for the template designer too hard by giving him too few functionality.
-
-For more informations visit the new `Jinja2 webpage`_ and `documentation`_.
-
-.. _sandboxed: https://en.wikipedia.org/wiki/Sandbox_(computer_security)
-.. _Django: https://www.djangoproject.com/
-.. _Jinja2 webpage: http://jinja.pocoo.org/
-.. _documentation: http://jinja.pocoo.org/2/documentation/
-
-
diff --git a/lib/Jinja2-2.10.dist-info/RECORD b/lib/Jinja2-2.10.dist-info/RECORD
deleted file mode 100644
index 6151967b48..0000000000
--- a/lib/Jinja2-2.10.dist-info/RECORD
+++ /dev/null
@@ -1,61 +0,0 @@
-Jinja2-2.10.dist-info/DESCRIPTION.rst,sha256=b5ckFDoM7vVtz_mAsJD4OPteFKCqE7beu353g4COoYI,978
-Jinja2-2.10.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
-Jinja2-2.10.dist-info/LICENSE.txt,sha256=JvzUNv3Io51EiWrAPm8d_SXjhJnEjyDYvB3Tvwqqils,1554
-Jinja2-2.10.dist-info/METADATA,sha256=18EgU8zR6-av-0-5y_gXebzK4GnBB_76lALUsl-6QHM,2258
-Jinja2-2.10.dist-info/RECORD,,
-Jinja2-2.10.dist-info/WHEEL,sha256=kdsN-5OJAZIiHN-iO4Rhl82KyS0bDWf4uBwMbkNafr8,110
-Jinja2-2.10.dist-info/entry_points.txt,sha256=NdzVcOrqyNyKDxD09aERj__3bFx2paZhizFDsKmVhiA,72
-Jinja2-2.10.dist-info/metadata.json,sha256=NPUJ9TMBxVQAv_kTJzvU8HwmP-4XZvbK9mz6_4YUVl4,1473
-Jinja2-2.10.dist-info/top_level.txt,sha256=PkeVWtLb3-CqjWi1fO29OCbj55EhX_chhKrCdrVe_zs,7
-jinja2/__init__.py,sha256=xJHjaMoy51_KXn1wf0cysH6tUUifUxZCwSOfcJGEYZw,2614
-jinja2/__init__.pyc,,
-jinja2/_compat.py,sha256=xP60CE5Qr8FTYcDE1f54tbZLKGvMwYml4-8T7Q4KG9k,2596
-jinja2/_compat.pyc,,
-jinja2/_identifier.py,sha256=W1QBSY-iJsyt6oR_nKSuNNCzV95vLIOYgUNPUI1d5gU,1726
-jinja2/_identifier.pyc,,
-jinja2/asyncfilters.py,sha256=cTDPvrS8Hp_IkwsZ1m9af_lr5nHysw7uTa5gV0NmZVE,4144
-jinja2/asyncsupport.py,sha256=UErQ3YlTLaSjFb94P4MVn08-aVD9jJxty2JVfMRb-1M,7878
-jinja2/bccache.py,sha256=nQldx0ZRYANMyfvOihRoYFKSlUdd5vJkS7BjxNwlOZM,12794
-jinja2/bccache.pyc,,
-jinja2/compiler.py,sha256=BqC5U6JxObSRhblyT_a6Tp5GtEU5z3US1a4jLQaxxgo,65386
-jinja2/compiler.pyc,,
-jinja2/constants.py,sha256=uwwV8ZUhHhacAuz5PTwckfsbqBaqM7aKfyJL7kGX5YQ,1626
-jinja2/constants.pyc,,
-jinja2/debug.py,sha256=WTVeUFGUa4v6ReCsYv-iVPa3pkNB75OinJt3PfxNdXs,12045
-jinja2/debug.pyc,,
-jinja2/defaults.py,sha256=Em-95hmsJxIenDCZFB1YSvf9CNhe9rBmytN3yUrBcWA,1400
-jinja2/defaults.pyc,,
-jinja2/environment.py,sha256=VnkAkqw8JbjZct4tAyHlpBrka2vqB-Z58RAP-32P1ZY,50849
-jinja2/environment.pyc,,
-jinja2/exceptions.py,sha256=_Rj-NVi98Q6AiEjYQOsP8dEIdu5AlmRHzcSNOPdWix4,4428
-jinja2/exceptions.pyc,,
-jinja2/ext.py,sha256=atMQydEC86tN1zUsdQiHw5L5cF62nDbqGue25Yiu3N4,24500
-jinja2/ext.pyc,,
-jinja2/filters.py,sha256=yOAJk0MsH-_gEC0i0U6NweVQhbtYaC-uE8xswHFLF4w,36528
-jinja2/filters.pyc,,
-jinja2/idtracking.py,sha256=2GbDSzIvGArEBGLkovLkqEfmYxmWsEf8c3QZwM4uNsw,9197
-jinja2/idtracking.pyc,,
-jinja2/lexer.py,sha256=ySEPoXd1g7wRjsuw23uimS6nkGN5aqrYwcOKxCaVMBQ,28559
-jinja2/lexer.pyc,,
-jinja2/loaders.py,sha256=xiTuURKAEObyym0nU8PCIXu_Qp8fn0AJ5oIADUUm-5Q,17382
-jinja2/loaders.pyc,,
-jinja2/meta.py,sha256=fmKHxkmZYAOm9QyWWy8EMd6eefAIh234rkBMW2X4ZR8,4340
-jinja2/meta.pyc,,
-jinja2/nativetypes.py,sha256=_sJhS8f-8Q0QMIC0dm1YEdLyxEyoO-kch8qOL5xUDfE,7308
-jinja2/nativetypes.pyc,,
-jinja2/nodes.py,sha256=L10L_nQDfubLhO3XjpF9qz46FSh2clL-3e49ogVlMmA,30853
-jinja2/nodes.pyc,,
-jinja2/optimizer.py,sha256=MsdlFACJ0FRdPtjmCAdt7JQ9SGrXFaDNUaslsWQaG3M,1722
-jinja2/optimizer.pyc,,
-jinja2/parser.py,sha256=lPzTEbcpTRBLw8ii6OYyExHeAhaZLMA05Hpv4ll3ULk,35875
-jinja2/parser.pyc,,
-jinja2/runtime.py,sha256=DHdD38Pq8gj7uWQC5usJyWFoNWL317A9AvXOW_CLB34,27755
-jinja2/runtime.pyc,,
-jinja2/sandbox.py,sha256=TVyZHlNqqTzsv9fv2NvJNmSdWRHTguhyMHdxjWms32U,16708
-jinja2/sandbox.pyc,,
-jinja2/tests.py,sha256=iJQLwbapZr-EKquTG_fVOVdwHUUKf3SX9eNkjQDF8oU,4237
-jinja2/tests.pyc,,
-jinja2/utils.py,sha256=q24VupGZotQ-uOyrJxCaXtDWhZC1RgsQG7kcdmjck2Q,20629
-jinja2/utils.pyc,,
-jinja2/visitor.py,sha256=JD1H1cANA29JcntFfN5fPyqQxB4bI4wC00BzZa-XHks,3316
-jinja2/visitor.pyc,,
diff --git a/lib/Jinja2-2.10.dist-info/WHEEL b/lib/Jinja2-2.10.dist-info/WHEEL
deleted file mode 100644
index 7332a419cd..0000000000
--- a/lib/Jinja2-2.10.dist-info/WHEEL
+++ /dev/null
@@ -1,6 +0,0 @@
-Wheel-Version: 1.0
-Generator: bdist_wheel (0.30.0)
-Root-Is-Purelib: true
-Tag: py2-none-any
-Tag: py3-none-any
-
diff --git a/lib/Jinja2-2.10.dist-info/entry_points.txt b/lib/Jinja2-2.10.dist-info/entry_points.txt
deleted file mode 100644
index 32e6b75302..0000000000
--- a/lib/Jinja2-2.10.dist-info/entry_points.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-
- [babel.extractors]
- jinja2 = jinja2.ext:babel_extract[i18n]
-
\ No newline at end of file
diff --git a/lib/Jinja2-2.10.dist-info/metadata.json b/lib/Jinja2-2.10.dist-info/metadata.json
deleted file mode 100644
index 7f5dc3879d..0000000000
--- a/lib/Jinja2-2.10.dist-info/metadata.json
+++ /dev/null
@@ -1 +0,0 @@
-{"classifiers": ["Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Text Processing :: Markup :: HTML"], "description_content_type": "UNKNOWN", "extensions": {"python.details": {"contacts": [{"email": "armin.ronacher@active-4.com", "name": "Armin Ronacher", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst", "license": "LICENSE.txt"}, "project_urls": {"Home": "http://jinja.pocoo.org/"}}, "python.exports": {"babel.extractors": {"jinja2": "jinja2.ext:babel_extract [i18n]"}}}, "extras": ["i18n"], "generator": "bdist_wheel (0.30.0)", "license": "BSD", "metadata_version": "2.0", "name": "Jinja2", "run_requires": [{"extra": "i18n", "requires": ["Babel (>=0.8)"]}, {"requires": ["MarkupSafe (>=0.23)"]}], "summary": "A small but fast and easy to use stand-alone template engine written in pure python.", "version": "2.10"}
\ No newline at end of file
diff --git a/lib/Jinja2-2.10.dist-info/top_level.txt b/lib/Jinja2-2.10.dist-info/top_level.txt
deleted file mode 100644
index 7f7afbf3bf..0000000000
--- a/lib/Jinja2-2.10.dist-info/top_level.txt
+++ /dev/null
@@ -1 +0,0 @@
-jinja2
diff --git a/lib/MarkupSafe-1.1.0.dist-info/INSTALLER b/lib/MarkupSafe-1.1.0.dist-info/INSTALLER
deleted file mode 100644
index a1b589e38a..0000000000
--- a/lib/MarkupSafe-1.1.0.dist-info/INSTALLER
+++ /dev/null
@@ -1 +0,0 @@
-pip
diff --git a/lib/MarkupSafe-1.1.0.dist-info/LICENSE.rst b/lib/MarkupSafe-1.1.0.dist-info/LICENSE.rst
deleted file mode 100644
index 28c925898a..0000000000
--- a/lib/MarkupSafe-1.1.0.dist-info/LICENSE.rst
+++ /dev/null
@@ -1,33 +0,0 @@
-`BSD 3-Clause `_
-
-Copyright © 2010 by the Pallets team.
-
-Some rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-- Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
-- Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
-- Neither the name of the copyright holder nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
-THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
-BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE AND DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGE.
diff --git a/lib/MarkupSafe-1.1.0.dist-info/METADATA b/lib/MarkupSafe-1.1.0.dist-info/METADATA
deleted file mode 100644
index 15cf9f92f8..0000000000
--- a/lib/MarkupSafe-1.1.0.dist-info/METADATA
+++ /dev/null
@@ -1,103 +0,0 @@
-Metadata-Version: 2.1
-Name: MarkupSafe
-Version: 1.1.0
-Summary: Safely add untrusted strings to HTML/XML markup.
-Home-page: https://www.palletsprojects.com/p/markupsafe/
-Author: Armin Ronacher
-Author-email: armin.ronacher@active-4.com
-Maintainer: Pallets Team
-Maintainer-email: contact@palletsprojects.com
-License: BSD
-Project-URL: Code, https://github.com/pallets/markupsafe
-Project-URL: Issue tracker, https://github.com/pallets/markupsafe/issues
-Project-URL: Documentation, https://markupsafe.palletsprojects.com/
-Platform: UNKNOWN
-Classifier: Development Status :: 5 - Production/Stable
-Classifier: Environment :: Web Environment
-Classifier: Intended Audience :: Developers
-Classifier: License :: OSI Approved :: BSD License
-Classifier: Operating System :: OS Independent
-Classifier: Programming Language :: Python
-Classifier: Programming Language :: Python :: 2
-Classifier: Programming Language :: Python :: 2.7
-Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.4
-Classifier: Programming Language :: Python :: 3.5
-Classifier: Programming Language :: Python :: 3.6
-Classifier: Programming Language :: Python :: 3.7
-Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
-Classifier: Topic :: Software Development :: Libraries :: Python Modules
-Classifier: Topic :: Text Processing :: Markup :: HTML
-Requires-Python: >=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*
-
-MarkupSafe
-==========
-
-MarkupSafe implements a text object that escapes characters so it is
-safe to use in HTML and XML. Characters that have special meanings are
-replaced so that they display as the actual characters. This mitigates
-injection attacks, meaning untrusted user input can safely be displayed
-on a page.
-
-
-Installing
-----------
-
-Install and update using `pip`_:
-
-.. code-block:: text
-
- pip install -U MarkupSafe
-
-.. _pip: https://pip.pypa.io/en/stable/quickstart/
-
-
-Examples
---------
-
-.. code-block:: pycon
-
- >>> from markupsafe import Markup, escape
- >>> # escape replaces special characters and wraps in Markup
- >>> escape('')
- Markup(u'<script>alert(document.cookie);</script>')
- >>> # wrap in Markup to mark text "safe" and prevent escaping
- >>> Markup('Hello')
- Markup('hello')
- >>> escape(Markup('Hello'))
- Markup('hello')
- >>> # Markup is a text subclass (str on Python 3, unicode on Python 2)
- >>> # methods and operators escape their arguments
- >>> template = Markup("Hello %s")
- >>> template % '"World"'
- Markup('Hello "World"')
-
-
-Donate
-------
-
-The Pallets organization develops and supports MarkupSafe and other
-libraries that use it. In order to grow the community of contributors
-and users, and allow the maintainers to devote more time to the
-projects, `please donate today`_.
-
-.. _please donate today: https://psfmember.org/civicrm/contribute/transact?reset=1&id=20
-
-
-Links
------
-
-* Website: https://www.palletsprojects.com/p/markupsafe/
-* Documentation: https://markupsafe.palletsprojects.com/
-* License: `BSD `_
-* Releases: https://pypi.org/project/MarkupSafe/
-* Code: https://github.com/pallets/markupsafe
-* Issue tracker: https://github.com/pallets/markupsafe/issues
-* Test status:
-
- * Linux, Mac: https://travis-ci.org/pallets/markupsafe
- * Windows: https://ci.appveyor.com/project/pallets/markupsafe
-
-* Test coverage: https://codecov.io/gh/pallets/markupsafe
-
-
diff --git a/lib/MarkupSafe-1.1.0.dist-info/RECORD b/lib/MarkupSafe-1.1.0.dist-info/RECORD
deleted file mode 100644
index 6a2ab840f4..0000000000
--- a/lib/MarkupSafe-1.1.0.dist-info/RECORD
+++ /dev/null
@@ -1,16 +0,0 @@
-MarkupSafe-1.1.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
-MarkupSafe-1.1.0.dist-info/LICENSE.rst,sha256=7V249lpOdvRv2m6SF9gCDtq_nsg8tFpdeTdsWWM_g9M,1614
-MarkupSafe-1.1.0.dist-info/METADATA,sha256=TQpVUBLFsel2ZJb9pTbCUrLsM-SyNylHTrlhfyLkLs8,3585
-MarkupSafe-1.1.0.dist-info/RECORD,,
-MarkupSafe-1.1.0.dist-info/WHEEL,sha256=-M5xJ8aEWVS0Iy75UrvRplI2XU8S_DdxB3Jyo-3Rn00,109
-MarkupSafe-1.1.0.dist-info/top_level.txt,sha256=qy0Plje5IJuvsCBjejJyhDCjEAdcDLK_2agVcex8Z6U,11
-markupsafe/__init__.py,sha256=T5J4pS7LRx1xRqfV3xz-QN_D9pSmfVDJnTrc2cTO4Ro,10164
-markupsafe/__init__.pyc,,
-markupsafe/_compat.py,sha256=3oSvQpEFzsJ29NKVy-Fqk6ZlRxmlCB5k0G21aN0zNtQ,596
-markupsafe/_compat.pyc,,
-markupsafe/_constants.py,sha256=ueEz1Jxdw5TKWBbhPr4Ad_2L2MSEh73AYiYe4l3cZy4,4728
-markupsafe/_constants.pyc,,
-markupsafe/_native.py,sha256=fUrjjbRXIpHM-8l9QXFJ2xg5rv_48U2aN99plyL0kfs,1911
-markupsafe/_native.pyc,,
-markupsafe/_speedups.c,sha256=VfElhhq9oulHEd2wBZ2MX9A80r4jFovsVGQD2zxmVk0,9883
-markupsafe/_speedups.so,sha256=QQySl9hy4kVfxkosXEo36oPDZYHxmp7pBEZZzh5wWro,27108
diff --git a/lib/MarkupSafe-1.1.0.dist-info/WHEEL b/lib/MarkupSafe-1.1.0.dist-info/WHEEL
deleted file mode 100644
index b6684a74d7..0000000000
--- a/lib/MarkupSafe-1.1.0.dist-info/WHEEL
+++ /dev/null
@@ -1,5 +0,0 @@
-Wheel-Version: 1.0
-Generator: bdist_wheel (0.32.2)
-Root-Is-Purelib: false
-Tag: cp27-cp27m-macosx_10_6_intel
-
diff --git a/lib/MarkupSafe-1.1.0.dist-info/top_level.txt b/lib/MarkupSafe-1.1.0.dist-info/top_level.txt
deleted file mode 100644
index 75bf729258..0000000000
--- a/lib/MarkupSafe-1.1.0.dist-info/top_level.txt
+++ /dev/null
@@ -1 +0,0 @@
-markupsafe
diff --git a/lib/PyMySQL-0.9.2.dist-info/INSTALLER b/lib/PyMySQL-0.9.2.dist-info/INSTALLER
deleted file mode 100644
index a1b589e38a..0000000000
--- a/lib/PyMySQL-0.9.2.dist-info/INSTALLER
+++ /dev/null
@@ -1 +0,0 @@
-pip
diff --git a/lib/PyMySQL-0.9.2.dist-info/LICENSE.txt b/lib/PyMySQL-0.9.2.dist-info/LICENSE.txt
deleted file mode 100644
index 86b18e10bc..0000000000
--- a/lib/PyMySQL-0.9.2.dist-info/LICENSE.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (c) 2010, 2013 PyMySQL contributors
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/lib/PyMySQL-0.9.2.dist-info/METADATA b/lib/PyMySQL-0.9.2.dist-info/METADATA
deleted file mode 100644
index 1eebedf4cc..0000000000
--- a/lib/PyMySQL-0.9.2.dist-info/METADATA
+++ /dev/null
@@ -1,175 +0,0 @@
-Metadata-Version: 2.1
-Name: PyMySQL
-Version: 0.9.2
-Summary: Pure Python MySQL Driver
-Home-page: https://github.com/PyMySQL/PyMySQL/
-Author: yutaka.matsubara
-Author-email: yutaka.matsubara@gmail.com
-Maintainer: INADA Naoki
-Maintainer-email: songofacandy@gmail.com
-License: "MIT"
-Project-URL: Documentation, https://pymysql.readthedocs.io/
-Keywords: MySQL
-Platform: UNKNOWN
-Classifier: Development Status :: 5 - Production/Stable
-Classifier: Programming Language :: Python :: 2
-Classifier: Programming Language :: Python :: 2.7
-Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.4
-Classifier: Programming Language :: Python :: 3.5
-Classifier: Programming Language :: Python :: 3.6
-Classifier: Programming Language :: Python :: 3.7
-Classifier: Programming Language :: Python :: Implementation :: CPython
-Classifier: Programming Language :: Python :: Implementation :: PyPy
-Classifier: Intended Audience :: Developers
-Classifier: License :: OSI Approved :: MIT License
-Classifier: Topic :: Database
-Requires-Dist: cryptography
-
-.. image:: https://readthedocs.org/projects/pymysql/badge/?version=latest
- :target: https://pymysql.readthedocs.io/
- :alt: Documentation Status
-
-.. image:: https://badge.fury.io/py/PyMySQL.svg
- :target: https://badge.fury.io/py/PyMySQL
-
-.. image:: https://travis-ci.org/PyMySQL/PyMySQL.svg?branch=master
- :target: https://travis-ci.org/PyMySQL/PyMySQL
-
-.. image:: https://coveralls.io/repos/PyMySQL/PyMySQL/badge.svg?branch=master&service=github
- :target: https://coveralls.io/github/PyMySQL/PyMySQL?branch=master
-
-.. image:: https://img.shields.io/badge/license-MIT-blue.svg
- :target: https://github.com/PyMySQL/PyMySQL/blob/master/LICENSE
-
-
-PyMySQL
-=======
-
-.. contents:: Table of Contents
- :local:
-
-This package contains a pure-Python MySQL client library, based on `PEP 249`_.
-
-Most public APIs are compatible with mysqlclient and MySQLdb.
-
-NOTE: PyMySQL doesn't support low level APIs `_mysql` provides like `data_seek`,
-`store_result`, and `use_result`. You should use high level APIs defined in `PEP 249`_.
-But some APIs like `autocommit` and `ping` are supported because `PEP 249`_ doesn't cover
-their usecase.
-
-.. _`PEP 249`: https://www.python.org/dev/peps/pep-0249/
-
-
-Requirements
--------------
-
-* Python -- one of the following:
-
- - CPython_ : 2.7 and >= 3.4
- - PyPy_ : Latest version
-
-* MySQL Server -- one of the following:
-
- - MySQL_ >= 5.5
- - MariaDB_ >= 5.5
-
-.. _CPython: https://www.python.org/
-.. _PyPy: https://pypy.org/
-.. _MySQL: https://www.mysql.com/
-.. _MariaDB: https://mariadb.org/
-
-
-Installation
-------------
-
-Package is uploaded on `PyPI `_.
-
-You can install it with pip::
-
- $ pip3 install PyMySQL
-
-
-Documentation
--------------
-
-Documentation is available online: https://pymysql.readthedocs.io/
-
-For support, please refer to the `StackOverflow
-`_.
-
-Example
--------
-
-The following examples make use of a simple table
-
-.. code:: sql
-
- CREATE TABLE `users` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `email` varchar(255) COLLATE utf8_bin NOT NULL,
- `password` varchar(255) COLLATE utf8_bin NOT NULL,
- PRIMARY KEY (`id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin
- AUTO_INCREMENT=1 ;
-
-
-.. code:: python
-
- import pymysql.cursors
-
- # Connect to the database
- connection = pymysql.connect(host='localhost',
- user='user',
- password='passwd',
- db='db',
- charset='utf8mb4',
- cursorclass=pymysql.cursors.DictCursor)
-
- try:
- with connection.cursor() as cursor:
- # Create a new record
- sql = "INSERT INTO `users` (`email`, `password`) VALUES (%s, %s)"
- cursor.execute(sql, ('webmaster@python.org', 'very-secret'))
-
- # connection is not autocommit by default. So you must commit to save
- # your changes.
- connection.commit()
-
- with connection.cursor() as cursor:
- # Read a single record
- sql = "SELECT `id`, `password` FROM `users` WHERE `email`=%s"
- cursor.execute(sql, ('webmaster@python.org',))
- result = cursor.fetchone()
- print(result)
- finally:
- connection.close()
-
-This example will print:
-
-.. code:: python
-
- {'password': 'very-secret', 'id': 1}
-
-
-Resources
----------
-
-* DB-API 2.0: http://www.python.org/dev/peps/pep-0249
-
-* MySQL Reference Manuals: http://dev.mysql.com/doc/
-
-* MySQL client/server protocol:
- http://dev.mysql.com/doc/internals/en/client-server-protocol.html
-
-* "Connector" channel in MySQL Community Slack:
- http://lefred.be/mysql-community-on-slack/
-
-* PyMySQL mailing list: https://groups.google.com/forum/#!forum/pymysql-users
-
-License
--------
-
-PyMySQL is released under the MIT License. See LICENSE for more information.
-
-
diff --git a/lib/PyMySQL-0.9.2.dist-info/RECORD b/lib/PyMySQL-0.9.2.dist-info/RECORD
deleted file mode 100644
index 101b978796..0000000000
--- a/lib/PyMySQL-0.9.2.dist-info/RECORD
+++ /dev/null
@@ -1,48 +0,0 @@
-PyMySQL-0.9.2.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
-PyMySQL-0.9.2.dist-info/LICENSE.txt,sha256=MUEg3GXwgA9ziksxQAx27hTezR--d86cNUCkIbhup7Y,1070
-PyMySQL-0.9.2.dist-info/METADATA,sha256=N83Xuhlf01F-R8VkfRICsEnlSIJGso3koKlnyW7bQGc,5003
-PyMySQL-0.9.2.dist-info/RECORD,,
-PyMySQL-0.9.2.dist-info/WHEEL,sha256=gduuPyBvFJQSQ0zdyxF7k0zynDXbIbvg5ZBHoXum5uk,110
-PyMySQL-0.9.2.dist-info/top_level.txt,sha256=IKlV-f4o90sOdnMd6HBvo0l2nqfJOGUzkwZeaEEGuRg,8
-pymysql/__init__.py,sha256=Cu-8Q7oX4ufip0tDOe4iNdHzr-VsvRrf8ltFgJgfxIM,4732
-pymysql/__init__.pyc,,
-pymysql/_auth.py,sha256=RbZjkgztjeNstG2e8yESgG9fXOV19H4SOSx96Y7BkSI,7235
-pymysql/_auth.pyc,,
-pymysql/_compat.py,sha256=DSxMV2ib-rhIuQIKiXX44yds_0bN2M_RddfYQiSdB6U,481
-pymysql/_compat.pyc,,
-pymysql/_socketio.py,sha256=smsw4wudNM4CKl85uis8QHfjDhz2iXQRvl8QV4TmB1w,4049
-pymysql/_socketio.pyc,,
-pymysql/charset.py,sha256=hc-McGS6wBttI-akxJkVe8jlzAa-0zDjL-9d1X5Csac,13780
-pymysql/charset.pyc,,
-pymysql/connections.py,sha256=kxyup-22NNqnE5un6y9we4b7funi3V8JqWqvs7-gKMQ,48736
-pymysql/connections.pyc,,
-pymysql/constants/CLIENT.py,sha256=cPMxnQQbBG6xqaEDwqzggTfWIuJQ1Oy7HrIgw_vgpo4,853
-pymysql/constants/CLIENT.pyc,,
-pymysql/constants/COMMAND.py,sha256=ypGdEUmi8m9cdBZ3rDU6mb7bsIyu9ldCDvc4pNF7V70,680
-pymysql/constants/COMMAND.pyc,,
-pymysql/constants/CR.py,sha256=5ojVkbisyw7Qo_cTNpnHYvV6xHRZXK39Qqv8tjGbIbg,2228
-pymysql/constants/CR.pyc,,
-pymysql/constants/ER.py,sha256=8q1PZOxezbXbRaPZrHrQebyLDx4CvAUkBArJ9xBuW0Y,12297
-pymysql/constants/ER.pyc,,
-pymysql/constants/FIELD_TYPE.py,sha256=yHZLSyQewMxTDx4PLrI1H_iwH2FnsrgBZFa56UG2HiQ,372
-pymysql/constants/FIELD_TYPE.pyc,,
-pymysql/constants/FLAG.py,sha256=Fy-PrCLnUI7fx_o5WypYnUAzWAM0E9d5yL8fFRVKffY,214
-pymysql/constants/FLAG.pyc,,
-pymysql/constants/SERVER_STATUS.py,sha256=KogVCOrV-S5aAFwyVKeKgua13nwdt1WFyHagjCZbcpM,334
-pymysql/constants/SERVER_STATUS.pyc,,
-pymysql/constants/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
-pymysql/constants/__init__.pyc,,
-pymysql/converters.py,sha256=e0Fw4W8ot6MU0txHXUdO9tV7gw-_T603YPorH9MW1mY,12742
-pymysql/converters.pyc,,
-pymysql/cursors.py,sha256=7fORGx-GgU0Y_fcTsyqdrexsKTeUcHmlXXnQ4VMGF3Y,17254
-pymysql/cursors.pyc,,
-pymysql/err.py,sha256=PaXGLqOnDXJoeYjLbMZQE5UQ3MHFqiiHCzaDPP-_NJA,3716
-pymysql/err.pyc,,
-pymysql/optionfile.py,sha256=4yW8A7aAR2Aild7ibLOCzIlTCcYd90PtR8LRGJSZs8o,658
-pymysql/optionfile.pyc,,
-pymysql/protocol.py,sha256=GH2yzGqPwqX2t2G87k3EJQt7bYQOLEN6QoN_m15c4Ak,12024
-pymysql/protocol.pyc,,
-pymysql/times.py,sha256=_qXgDaYwsHntvpIKSKXp1rrYIgtq6Z9pLyLnO2XNoL0,360
-pymysql/times.pyc,,
-pymysql/util.py,sha256=fJeidaLnzMru74X9FYol-NWv-oy_KiCQuRp77HuV96k,332
-pymysql/util.pyc,,
diff --git a/lib/PyMySQL-0.9.2.dist-info/WHEEL b/lib/PyMySQL-0.9.2.dist-info/WHEEL
deleted file mode 100644
index 1316c41d07..0000000000
--- a/lib/PyMySQL-0.9.2.dist-info/WHEEL
+++ /dev/null
@@ -1,6 +0,0 @@
-Wheel-Version: 1.0
-Generator: bdist_wheel (0.31.1)
-Root-Is-Purelib: true
-Tag: py2-none-any
-Tag: py3-none-any
-
diff --git a/lib/PyMySQL-0.9.2.dist-info/top_level.txt b/lib/PyMySQL-0.9.2.dist-info/top_level.txt
deleted file mode 100644
index d4a7eda50c..0000000000
--- a/lib/PyMySQL-0.9.2.dist-info/top_level.txt
+++ /dev/null
@@ -1 +0,0 @@
-pymysql
diff --git a/lib/SQLAlchemy-1.2.14.dist-info/INSTALLER b/lib/SQLAlchemy-1.2.14.dist-info/INSTALLER
deleted file mode 100644
index a1b589e38a..0000000000
--- a/lib/SQLAlchemy-1.2.14.dist-info/INSTALLER
+++ /dev/null
@@ -1 +0,0 @@
-pip
diff --git a/lib/SQLAlchemy-1.2.14.dist-info/LICENSE b/lib/SQLAlchemy-1.2.14.dist-info/LICENSE
deleted file mode 100644
index 6784c0b657..0000000000
--- a/lib/SQLAlchemy-1.2.14.dist-info/LICENSE
+++ /dev/null
@@ -1,20 +0,0 @@
-This is the MIT license: http://www.opensource.org/licenses/mit-license.php
-
-Copyright (c) 2005-2018 the SQLAlchemy authors and contributors .
-SQLAlchemy is a trademark of Michael Bayer.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this
-software and associated documentation files (the "Software"), to deal in the Software
-without restriction, including without limitation the rights to use, copy, modify, merge,
-publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
-to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or
-substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
-INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
-FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
diff --git a/lib/SQLAlchemy-1.2.14.dist-info/METADATA b/lib/SQLAlchemy-1.2.14.dist-info/METADATA
deleted file mode 100644
index de2928d87b..0000000000
--- a/lib/SQLAlchemy-1.2.14.dist-info/METADATA
+++ /dev/null
@@ -1,182 +0,0 @@
-Metadata-Version: 2.1
-Name: SQLAlchemy
-Version: 1.2.14
-Summary: Database Abstraction Library
-Home-page: http://www.sqlalchemy.org
-Author: Mike Bayer
-Author-email: mike_mp@zzzcomputing.com
-License: MIT License
-Platform: UNKNOWN
-Classifier: Development Status :: 5 - Production/Stable
-Classifier: Intended Audience :: Developers
-Classifier: License :: OSI Approved :: MIT License
-Classifier: Programming Language :: Python
-Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: Implementation :: CPython
-Classifier: Programming Language :: Python :: Implementation :: PyPy
-Classifier: Topic :: Database :: Front-Ends
-Classifier: Operating System :: OS Independent
-Provides-Extra: mssql_pymssql
-Requires-Dist: pymssql; extra == 'mssql_pymssql'
-Provides-Extra: mssql_pyodbc
-Requires-Dist: pyodbc; extra == 'mssql_pyodbc'
-Provides-Extra: mysql
-Requires-Dist: mysqlclient; extra == 'mysql'
-Provides-Extra: oracle
-Requires-Dist: cx-oracle; extra == 'oracle'
-Provides-Extra: postgresql
-Requires-Dist: psycopg2; extra == 'postgresql'
-Provides-Extra: postgresql_pg8000
-Requires-Dist: pg8000; extra == 'postgresql_pg8000'
-Provides-Extra: postgresql_psycopg2binary
-Requires-Dist: psycopg2-binary; extra == 'postgresql_psycopg2binary'
-Provides-Extra: postgresql_psycopg2cffi
-Requires-Dist: psycopg2cffi; extra == 'postgresql_psycopg2cffi'
-Provides-Extra: pymysql
-Requires-Dist: pymysql; extra == 'pymysql'
-
-SQLAlchemy
-==========
-
-The Python SQL Toolkit and Object Relational Mapper
-
-Introduction
--------------
-
-SQLAlchemy is the Python SQL toolkit and Object Relational Mapper
-that gives application developers the full power and
-flexibility of SQL. SQLAlchemy provides a full suite
-of well known enterprise-level persistence patterns,
-designed for efficient and high-performing database
-access, adapted into a simple and Pythonic domain
-language.
-
-Major SQLAlchemy features include:
-
-* An industrial strength ORM, built
- from the core on the identity map, unit of work,
- and data mapper patterns. These patterns
- allow transparent persistence of objects
- using a declarative configuration system.
- Domain models
- can be constructed and manipulated naturally,
- and changes are synchronized with the
- current transaction automatically.
-* A relationally-oriented query system, exposing
- the full range of SQL's capabilities
- explicitly, including joins, subqueries,
- correlation, and most everything else,
- in terms of the object model.
- Writing queries with the ORM uses the same
- techniques of relational composition you use
- when writing SQL. While you can drop into
- literal SQL at any time, it's virtually never
- needed.
-* A comprehensive and flexible system
- of eager loading for related collections and objects.
- Collections are cached within a session,
- and can be loaded on individual access, all
- at once using joins, or by query per collection
- across the full result set.
-* A Core SQL construction system and DBAPI
- interaction layer. The SQLAlchemy Core is
- separate from the ORM and is a full database
- abstraction layer in its own right, and includes
- an extensible Python-based SQL expression
- language, schema metadata, connection pooling,
- type coercion, and custom types.
-* All primary and foreign key constraints are
- assumed to be composite and natural. Surrogate
- integer primary keys are of course still the
- norm, but SQLAlchemy never assumes or hardcodes
- to this model.
-* Database introspection and generation. Database
- schemas can be "reflected" in one step into
- Python structures representing database metadata;
- those same structures can then generate
- CREATE statements right back out - all within
- the Core, independent of the ORM.
-
-SQLAlchemy's philosophy:
-
-* SQL databases behave less and less like object
- collections the more size and performance start to
- matter; object collections behave less and less like
- tables and rows the more abstraction starts to matter.
- SQLAlchemy aims to accommodate both of these
- principles.
-* An ORM doesn't need to hide the "R". A relational
- database provides rich, set-based functionality
- that should be fully exposed. SQLAlchemy's
- ORM provides an open-ended set of patterns
- that allow a developer to construct a custom
- mediation layer between a domain model and
- a relational schema, turning the so-called
- "object relational impedance" issue into
- a distant memory.
-* The developer, in all cases, makes all decisions
- regarding the design, structure, and naming conventions
- of both the object model as well as the relational
- schema. SQLAlchemy only provides the means
- to automate the execution of these decisions.
-* With SQLAlchemy, there's no such thing as
- "the ORM generated a bad query" - you
- retain full control over the structure of
- queries, including how joins are organized,
- how subqueries and correlation is used, what
- columns are requested. Everything SQLAlchemy
- does is ultimately the result of a developer-
- initiated decision.
-* Don't use an ORM if the problem doesn't need one.
- SQLAlchemy consists of a Core and separate ORM
- component. The Core offers a full SQL expression
- language that allows Pythonic construction
- of SQL constructs that render directly to SQL
- strings for a target database, returning
- result sets that are essentially enhanced DBAPI
- cursors.
-* Transactions should be the norm. With SQLAlchemy's
- ORM, nothing goes to permanent storage until
- commit() is called. SQLAlchemy encourages applications
- to create a consistent means of delineating
- the start and end of a series of operations.
-* Never render a literal value in a SQL statement.
- Bound parameters are used to the greatest degree
- possible, allowing query optimizers to cache
- query plans effectively and making SQL injection
- attacks a non-issue.
-
-Documentation
--------------
-
-Latest documentation is at:
-
-http://www.sqlalchemy.org/docs/
-
-Installation / Requirements
----------------------------
-
-Full documentation for installation is at
-`Installation `_.
-
-Getting Help / Development / Bug reporting
-------------------------------------------
-
-Please refer to the `SQLAlchemy Community Guide `_.
-
-Code of Conduct
----------------
-
-Above all, SQLAlchemy places great emphasis on polite, thoughtful, and
-constructive communication between users and developers.
-Please see our current Code of Conduct at
-`Code of Conduct `_.
-
-License
--------
-
-SQLAlchemy is distributed under the `MIT license
-`_.
-
-
-
diff --git a/lib/SQLAlchemy-1.2.14.dist-info/RECORD b/lib/SQLAlchemy-1.2.14.dist-info/RECORD
deleted file mode 100644
index 21743c83df..0000000000
--- a/lib/SQLAlchemy-1.2.14.dist-info/RECORD
+++ /dev/null
@@ -1,391 +0,0 @@
-SQLAlchemy-1.2.14.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
-SQLAlchemy-1.2.14.dist-info/LICENSE,sha256=c72j19bFaPSUwdElIKl9QaOLfOkdiMIfG0abdHsX9_0,1229
-SQLAlchemy-1.2.14.dist-info/METADATA,sha256=RTSO49Nh7sIoPtw9lybiGzBAGnH3T4QGbRZbnfhmOxM,6694
-SQLAlchemy-1.2.14.dist-info/RECORD,,
-SQLAlchemy-1.2.14.dist-info/WHEEL,sha256=NrGw1dsaesa9hpMv3oa1Rr1pfdkYzNndfxogY-JDDRo,110
-SQLAlchemy-1.2.14.dist-info/top_level.txt,sha256=rp-ZgB7D8G11ivXON5VGPjupT1voYmWqkciDt5Uaw_Q,11
-sqlalchemy/__init__.py,sha256=Q0Imf7g2osYSLfUTndc63_ohj_soadKEUc-Ri8iXV3k,2249
-sqlalchemy/__init__.pyc,,
-sqlalchemy/connectors/__init__.py,sha256=rrgdmDtnZrYz2KspapOs6wEkbRh0nnLSGAGZ1_9w2_o,278
-sqlalchemy/connectors/__init__.pyc,,
-sqlalchemy/connectors/mxodbc.py,sha256=1JQJ9A9oBDamnA8hGjxTd0duDfa-KZLd-dYuBzpMcVc,5348
-sqlalchemy/connectors/mxodbc.pyc,,
-sqlalchemy/connectors/pyodbc.py,sha256=c0Q60nv30NR7GohqxnabESUAO4CqXfyhzBUCG6HdR78,5648
-sqlalchemy/connectors/pyodbc.pyc,,
-sqlalchemy/connectors/zxJDBC.py,sha256=KYrmLZt8Y5Qr49sja2ALf8IPnExjk4zsGrQqNJqgtxA,1868
-sqlalchemy/connectors/zxJDBC.pyc,,
-sqlalchemy/cprocessors.so,sha256=IQ8Wb_fV4wuXAjXLW-5wWi62Jp_UsvmBSJoCwAt5Q7Q,16828
-sqlalchemy/cresultproxy.so,sha256=V_yiSpQmmxgr2beE624AxF9qUrQWOSVYRpZwsIMqGoU,18856
-sqlalchemy/cutils.so,sha256=ZjEO-_U_fyU8RUt2EMxi3KKgzfeiiPeDWnCmCq1Lcg0,9684
-sqlalchemy/databases/__init__.py,sha256=ZOSHd9ibbeNSthK3xVTpl5lRJbA0fR1IUVskoytyrHE,817
-sqlalchemy/databases/__init__.pyc,,
-sqlalchemy/dialects/__init__.py,sha256=rrWo1qtl19-67MV9hxlbt5XYZJjC5BlTwdKGxd0PUUc,1346
-sqlalchemy/dialects/__init__.pyc,,
-sqlalchemy/dialects/firebird/__init__.py,sha256=XfFW_BjZuiB2k0Mhc2PnWndfPu5viJMkC6QZ68sKHUQ,627
-sqlalchemy/dialects/firebird/__init__.pyc,,
-sqlalchemy/dialects/firebird/base.py,sha256=J1uFdDD2FF84qFspip6bvl3gJm7xO4GW6YUiyfz96z8,28297
-sqlalchemy/dialects/firebird/base.pyc,,
-sqlalchemy/dialects/firebird/fdb.py,sha256=OOEVOxB8o5tJvY-fyGkStlPXjIs6a877vmTBZuWAKko,4325
-sqlalchemy/dialects/firebird/fdb.pyc,,
-sqlalchemy/dialects/firebird/kinterbasdb.py,sha256=Fj-KyDyXQm-scFDOwpePSweYOBn-EcnPJdEwLA4rxMk,6300
-sqlalchemy/dialects/firebird/kinterbasdb.pyc,,
-sqlalchemy/dialects/mssql/__init__.py,sha256=rqhEBPQR7hHAvfQcNtQqlNspzwHP0n_lz5jzdx6ZIKk,1074
-sqlalchemy/dialects/mssql/__init__.pyc,,
-sqlalchemy/dialects/mssql/adodbapi.py,sha256=pd-vPua2A8uZ1vulBKZplABa40mMgvhaObJxKk-RvAk,2692
-sqlalchemy/dialects/mssql/adodbapi.pyc,,
-sqlalchemy/dialects/mssql/base.py,sha256=SUst2o7ch2K-uHeU2C3UahSy4i5EHz6vq9JN5ioDwHM,78190
-sqlalchemy/dialects/mssql/base.pyc,,
-sqlalchemy/dialects/mssql/information_schema.py,sha256=201ucz4TI_5iENg9bC53nBOqd6M1EmcnVXvDugbnPFA,6605
-sqlalchemy/dialects/mssql/information_schema.pyc,,
-sqlalchemy/dialects/mssql/mxodbc.py,sha256=U0Tu183J9d3YVJ18h-Ro6dUo7uPZdBAPrtDit0PDSkc,4604
-sqlalchemy/dialects/mssql/mxodbc.pyc,,
-sqlalchemy/dialects/mssql/pymssql.py,sha256=BMapRUlKdwKlyqqOHu5DnZI1_L1IK8N5VCDMdWmlH-U,3852
-sqlalchemy/dialects/mssql/pymssql.pyc,,
-sqlalchemy/dialects/mssql/pyodbc.py,sha256=V074z3m5ELQf0Cp4G6wBH1Lzm7He8us53Z20OHGPKfM,10717
-sqlalchemy/dialects/mssql/pyodbc.pyc,,
-sqlalchemy/dialects/mssql/zxjdbc.py,sha256=vGfY3F80odCna8_uVjguLPO0VXAyDwDobBQfJsByw7M,2282
-sqlalchemy/dialects/mssql/zxjdbc.pyc,,
-sqlalchemy/dialects/mysql/__init__.py,sha256=ak3nuGjushrYFvbM4f4xldmqPw_zaBe9vzmBlMsxHb0,1221
-sqlalchemy/dialects/mysql/__init__.pyc,,
-sqlalchemy/dialects/mysql/base.py,sha256=Q6RQH9sAgi5nJOZXZEdcP6sPJcxk4flbrEJFzeKoKcY,90017
-sqlalchemy/dialects/mysql/base.pyc,,
-sqlalchemy/dialects/mysql/cymysql.py,sha256=T7eHTy4KqN8A4xpDktp2JSZjpVCMd1zB3TFZOoFV8Z4,1998
-sqlalchemy/dialects/mysql/cymysql.pyc,,
-sqlalchemy/dialects/mysql/dml.py,sha256=VyUXudSFgMfpivUFH_T049WH1Xo1CLXKLIjG1HyQMXw,2680
-sqlalchemy/dialects/mysql/dml.pyc,,
-sqlalchemy/dialects/mysql/enumerated.py,sha256=V9c9_71luaSUEoctXNAPLI8je-J18G1xaTv31SSv17g,11363
-sqlalchemy/dialects/mysql/enumerated.pyc,,
-sqlalchemy/dialects/mysql/gaerdbms.py,sha256=a94buqzpqDBhePvBANjCe5fOmRnQU8-PKK5B8qfLuK4,3387
-sqlalchemy/dialects/mysql/gaerdbms.pyc,,
-sqlalchemy/dialects/mysql/json.py,sha256=fpm8X6SBhX3vhBxBG1ia33Y33AmKrBkAUkuyvk66B0w,2071
-sqlalchemy/dialects/mysql/json.pyc,,
-sqlalchemy/dialects/mysql/mysqlconnector.py,sha256=PpFjZlkmz-qWmFFvZ772cfL-OBHPvifGUpcYpQuu3Hs,8414
-sqlalchemy/dialects/mysql/mysqlconnector.pyc,,
-sqlalchemy/dialects/mysql/mysqldb.py,sha256=CoZ_kGBYDAmu2dPObeBLjU2WNhjDIHHaOKqasWajvKc,6968
-sqlalchemy/dialects/mysql/mysqldb.pyc,,
-sqlalchemy/dialects/mysql/oursql.py,sha256=m9F7sFDBFpRY0AqpDq6sBOl6d-CU4n3ZYOGyb0vvLdY,7776
-sqlalchemy/dialects/mysql/oursql.pyc,,
-sqlalchemy/dialects/mysql/pymysql.py,sha256=ohWuSzK2gDsWtDxUvfUHm8PSjzYIBYB_siiQlJVCsXo,1997
-sqlalchemy/dialects/mysql/pymysql.pyc,,
-sqlalchemy/dialects/mysql/pyodbc.py,sha256=MHywwWXyOZ94Gl8fqSj_L8hNqfIOApFXhHZ6X1hZhxc,2657
-sqlalchemy/dialects/mysql/pyodbc.pyc,,
-sqlalchemy/dialects/mysql/reflection.py,sha256=FzDSqiF_PPhdBc7Ex21LZuGUQY_jdfc9lpzW2i0kpyI,16780
-sqlalchemy/dialects/mysql/reflection.pyc,,
-sqlalchemy/dialects/mysql/types.py,sha256=yboSkXVM4Hfse8ZqaAHht1571XgQ-RHrXgj22pSTe7E,25137
-sqlalchemy/dialects/mysql/types.pyc,,
-sqlalchemy/dialects/mysql/zxjdbc.py,sha256=-arAeE65pqUuMzBHLfzfMpBnTlNVtD2tkhZInomSP60,3937
-sqlalchemy/dialects/mysql/zxjdbc.pyc,,
-sqlalchemy/dialects/oracle/__init__.py,sha256=0aHajiUEgaE6jARlaSdsuurEXmhGTkeLX9EO99IDVMI,811
-sqlalchemy/dialects/oracle/__init__.pyc,,
-sqlalchemy/dialects/oracle/base.py,sha256=oqinKLQO4vTz4sri-TSDmIjqupiYIv0TEnE8UzwYLgs,64988
-sqlalchemy/dialects/oracle/base.pyc,,
-sqlalchemy/dialects/oracle/cx_oracle.py,sha256=2B0PnHo3kBNsze0UqwjDV42xKF5fnshgK9zGzZmtLnU,37803
-sqlalchemy/dialects/oracle/cx_oracle.pyc,,
-sqlalchemy/dialects/oracle/zxjdbc.py,sha256=cmDtRIa-cYqNLkzyZBlfyeigaEQFe7ffRWxxqRHyUBQ,8112
-sqlalchemy/dialects/oracle/zxjdbc.pyc,,
-sqlalchemy/dialects/postgresql/__init__.py,sha256=e74OBltKsvshxdDxacC-1JUDmhMa0qyw-nZ68TF341M,1529
-sqlalchemy/dialects/postgresql/__init__.pyc,,
-sqlalchemy/dialects/postgresql/array.py,sha256=hMO962lq4eZWNoXnKnq6tLX27b66-pZtmx7ON3hzj50,9952
-sqlalchemy/dialects/postgresql/array.pyc,,
-sqlalchemy/dialects/postgresql/base.py,sha256=2KupG3L1kmId18jJfPaJRTyGF43PoaW0jUc1OLL22wo,113387
-sqlalchemy/dialects/postgresql/base.pyc,,
-sqlalchemy/dialects/postgresql/dml.py,sha256=tz3KlGuR4Rx-v71OKoNaDoXERWRVSQSl6m5vYj4hjV4,7570
-sqlalchemy/dialects/postgresql/dml.pyc,,
-sqlalchemy/dialects/postgresql/ext.py,sha256=_lsfv4cvzv8SR1Y02Ia-MSGY69VFU0IKqZzc_o7SxsE,7272
-sqlalchemy/dialects/postgresql/ext.pyc,,
-sqlalchemy/dialects/postgresql/hstore.py,sha256=qmcAGQsdqlMHPcGgSzqNr5ZIufskKb-Q9cqMXWbfhyE,12411
-sqlalchemy/dialects/postgresql/hstore.pyc,,
-sqlalchemy/dialects/postgresql/json.py,sha256=2PBpZWmsM0qwH4vlmVXm2G9TQICNq9BPdUsejqT3SBU,9820
-sqlalchemy/dialects/postgresql/json.pyc,,
-sqlalchemy/dialects/postgresql/pg8000.py,sha256=0Yobx92-frW-BuVLM-lOVduhBsbhbX7inMWdZaQrz3w,9220
-sqlalchemy/dialects/postgresql/pg8000.pyc,,
-sqlalchemy/dialects/postgresql/psycopg2.py,sha256=ythf8lkG7CVncRlsGNVYrw8XOlOpfHYw1S6z0c2aLik,27187
-sqlalchemy/dialects/postgresql/psycopg2.pyc,,
-sqlalchemy/dialects/postgresql/psycopg2cffi.py,sha256=Ako0qThKTsuXiZB4t2ZWGysT1qrcfSJryalE2Ik5syw,1651
-sqlalchemy/dialects/postgresql/psycopg2cffi.pyc,,
-sqlalchemy/dialects/postgresql/pygresql.py,sha256=JV589Bg3z_7bKieAP4lIqWzJpbR_O9DOmpCmH012c8Y,7611
-sqlalchemy/dialects/postgresql/pygresql.pyc,,
-sqlalchemy/dialects/postgresql/pypostgresql.py,sha256=T-gI_Rz6CV0c1-RgWm8NliN9iZWoK2KNGIidcg_5KlM,2655
-sqlalchemy/dialects/postgresql/pypostgresql.pyc,,
-sqlalchemy/dialects/postgresql/ranges.py,sha256=DJCITJtwFAJ74a3sYFizz69wm3FhfHPkzLDntGqhphw,4971
-sqlalchemy/dialects/postgresql/ranges.pyc,,
-sqlalchemy/dialects/postgresql/zxjdbc.py,sha256=KE-mXnKcl68PIvF11aBpiFiolCbH16n_LJMDlCBuWJQ,1397
-sqlalchemy/dialects/postgresql/zxjdbc.pyc,,
-sqlalchemy/dialects/sqlite/__init__.py,sha256=cvuTxTCYYsC_GHaOCCVc_dpaymxy0lpfFv1c89QDQ48,720
-sqlalchemy/dialects/sqlite/__init__.pyc,,
-sqlalchemy/dialects/sqlite/base.py,sha256=057JTRQ8uFnKEoBwXURPEJBQGaLvk9tleGDf-qTIO3A,59157
-sqlalchemy/dialects/sqlite/base.pyc,,
-sqlalchemy/dialects/sqlite/pysqlcipher.py,sha256=MLj6njhSj5RwQCs5PXQRtTO-jUCfCGfjLyQfp52tFus,4650
-sqlalchemy/dialects/sqlite/pysqlcipher.pyc,,
-sqlalchemy/dialects/sqlite/pysqlite.py,sha256=aAhdzjnyJrVrOLU_W2QB3YXY6qcOpbOqUpPZVx7GTMQ,14975
-sqlalchemy/dialects/sqlite/pysqlite.pyc,,
-sqlalchemy/dialects/sybase/__init__.py,sha256=gh1f630fgd5Wow5tfr5HPWxKBMqFn6YSZYAQ2EZX2yA,873
-sqlalchemy/dialects/sybase/__init__.pyc,,
-sqlalchemy/dialects/sybase/base.py,sha256=F-izMkFqZJ7cdS7P0sX_GuRp91ZqbWLrbwO5VogmPfE,29456
-sqlalchemy/dialects/sybase/base.pyc,,
-sqlalchemy/dialects/sybase/mxodbc.py,sha256=EHt1U0g449XNX8tN0oTxIkVterSipz9HErniuo7upZs,901
-sqlalchemy/dialects/sybase/mxodbc.pyc,,
-sqlalchemy/dialects/sybase/pyodbc.py,sha256=bOkWunYEOfA7lLL59S_yxJ11E6QkFuBN5YjnUlKJkXQ,2102
-sqlalchemy/dialects/sybase/pyodbc.pyc,,
-sqlalchemy/dialects/sybase/pysybase.py,sha256=UNcGk5DQ4T05AeozHlm68JTIQDcha5pvAzGj9VtKWlY,3208
-sqlalchemy/dialects/sybase/pysybase.pyc,,
-sqlalchemy/engine/__init__.py,sha256=doMfvJaGS8BlAVOfGLMsVbu0l25NDmv5A_P_YMmLwiA,20410
-sqlalchemy/engine/__init__.pyc,,
-sqlalchemy/engine/base.py,sha256=ElWaZowMo81m_X54eJqROiX4TCGlrbKVvhbpLhEAe3s,83296
-sqlalchemy/engine/base.pyc,,
-sqlalchemy/engine/default.py,sha256=P0Bfh0Da3CfZmLpdk4QpZlCrJfRYnAofaujA-1_7Ggk,49295
-sqlalchemy/engine/default.pyc,,
-sqlalchemy/engine/interfaces.py,sha256=sX6XTe1YDGAU8HIt9XRlylbNAR58EiONEwGCdcmZX_A,41554
-sqlalchemy/engine/interfaces.pyc,,
-sqlalchemy/engine/reflection.py,sha256=Ft7eFqEK8phKXcGPwJqMevW7T96DheGNANpwMNTJ7os,31894
-sqlalchemy/engine/reflection.pyc,,
-sqlalchemy/engine/result.py,sha256=KEvcDuBKgdZtoWXoFrz_V0g6TYPxZ9GVH_K2MTxhrNg,51701
-sqlalchemy/engine/result.pyc,,
-sqlalchemy/engine/strategies.py,sha256=Sozz1zXVkyjW6I4jsgYVcsJp8KYgN4YkPqvsb3sUCZQ,9552
-sqlalchemy/engine/strategies.pyc,,
-sqlalchemy/engine/threadlocal.py,sha256=_zaDX4IcY7wcdQpoSIZYR6LujR5VrbmkpiPybW2dg5s,4186
-sqlalchemy/engine/threadlocal.pyc,,
-sqlalchemy/engine/url.py,sha256=1s60hXA1oen8E1VeUUOKWvVVQldAvwxJpOMHDUiisl4,9181
-sqlalchemy/engine/url.pyc,,
-sqlalchemy/engine/util.py,sha256=iP2jhZWMEFi6eBR5hXyp2KDd4XqJKrGE3tA_QeCwU_w,2338
-sqlalchemy/engine/util.pyc,,
-sqlalchemy/event/__init__.py,sha256=MTOLXdVCMskX_yRE5dZwWHNkMLkv-y9caaM9XFwlR8E,419
-sqlalchemy/event/__init__.pyc,,
-sqlalchemy/event/api.py,sha256=U8n3cmqB9DaO6UYud2RHMNXsEoELmKzhQRXPEq1q-qQ,5990
-sqlalchemy/event/api.pyc,,
-sqlalchemy/event/attr.py,sha256=Bpwt2BDboQy1oAtjJ2T2LsXwjALXPf3nKZmEnqx_RHg,12905
-sqlalchemy/event/attr.pyc,,
-sqlalchemy/event/base.py,sha256=3DoHv2ecDAtNN3b-F2o2yCVp4uWcAiv_OcEE-Lvwov8,9540
-sqlalchemy/event/base.pyc,,
-sqlalchemy/event/legacy.py,sha256=hsxGTAa3aKkCgByaiBF_MddZxY0ORp2CYEfe5kQy93U,5814
-sqlalchemy/event/legacy.pyc,,
-sqlalchemy/event/registry.py,sha256=L3DdvjGeESvn_Pmj7Fkm2wbMOrHUkdhAkkJeR7ij7cg,7786
-sqlalchemy/event/registry.pyc,,
-sqlalchemy/events.py,sha256=e1Y2-c0KK_-kBILjruD4jDm8Ar0_wy3RNWBgFE3QwTQ,51646
-sqlalchemy/events.pyc,,
-sqlalchemy/exc.py,sha256=B8e-WMzl6nLJH1Zf29nSgiAPHdFQncJfnEVunytV6hI,14432
-sqlalchemy/exc.pyc,,
-sqlalchemy/ext/__init__.py,sha256=dZJYsRwHsMYpTkUyMDACt0CVVxqe-EvP0bTCgBH0gKE,322
-sqlalchemy/ext/__init__.pyc,,
-sqlalchemy/ext/associationproxy.py,sha256=RiyOnBAYwIC0LH6o0b6Ogs0c4ghFtdvqFHDI4u5SyJ0,36345
-sqlalchemy/ext/associationproxy.pyc,,
-sqlalchemy/ext/automap.py,sha256=R8sx-Zi0sk5fBwCyPTgT46-RVklFnrL5kGrxzbp3WTY,42422
-sqlalchemy/ext/automap.pyc,,
-sqlalchemy/ext/baked.py,sha256=BhQUF9cRjE6Q2-L4US3rB1J8qdT9-vs7xEpfyNhIr2M,19082
-sqlalchemy/ext/baked.pyc,,
-sqlalchemy/ext/compiler.py,sha256=vmIz7I8mOpihaZDhAcNpeky48IIeB8QMTgxxPMFtmJ4,16845
-sqlalchemy/ext/compiler.pyc,,
-sqlalchemy/ext/declarative/__init__.py,sha256=8dR4W5dZ6DztbqaOp5g0OS8aqWIwTGGDA4uVyJ-BHoc,756
-sqlalchemy/ext/declarative/__init__.pyc,,
-sqlalchemy/ext/declarative/api.py,sha256=4s67E7i0YQm9f5ucL2bEvBJnRcNjS0XYRo_EILa0srA,25066
-sqlalchemy/ext/declarative/api.pyc,,
-sqlalchemy/ext/declarative/base.py,sha256=z85iRkZlk_wmklJXWrRPl9weTkTfm8KhjNGni-ziyCs,29433
-sqlalchemy/ext/declarative/base.pyc,,
-sqlalchemy/ext/declarative/clsregistry.py,sha256=CwCu667YYxnXPWfsxU_w3cLou4BODKHh2BjVvozkPAw,10817
-sqlalchemy/ext/declarative/clsregistry.pyc,,
-sqlalchemy/ext/horizontal_shard.py,sha256=FlB92O2Rf10UTlH5-3IKjHdC3Ya5m1Xp0ongWEG9-lY,7496
-sqlalchemy/ext/horizontal_shard.pyc,,
-sqlalchemy/ext/hybrid.py,sha256=np8Efk2TaCb0XXDebtksyXPTFEewxzZ9FkUhGhQbmTo,40087
-sqlalchemy/ext/hybrid.pyc,,
-sqlalchemy/ext/indexable.py,sha256=SDNEPbRxtIR535iy8-7H976WbNQJSnJ_4oaXnyGJbko,11128
-sqlalchemy/ext/indexable.pyc,,
-sqlalchemy/ext/instrumentation.py,sha256=HRgNiuYJ90_uSKC1iDwsEl8_KXscMQkEb9KeElk-yLE,14856
-sqlalchemy/ext/instrumentation.pyc,,
-sqlalchemy/ext/mutable.py,sha256=2qgpHBVm1b6zy3IKGofM3-8PwUkCIUr8vwGpDN_nFMY,32531
-sqlalchemy/ext/mutable.pyc,,
-sqlalchemy/ext/orderinglist.py,sha256=-pUrJOsZkjOt7F0G_6y38h8rq0cYltvFMHjv4WHlRaI,13816
-sqlalchemy/ext/orderinglist.pyc,,
-sqlalchemy/ext/serializer.py,sha256=2M_aXqRksCYNd_Sef-l4AZ8hRFKOMYJD7Y5xyCqO_E4,5608
-sqlalchemy/ext/serializer.pyc,,
-sqlalchemy/inspection.py,sha256=OcKvEukttgf8L8hpp-sNS-6fJSvrClRUQAD_O3NWfXQ,3093
-sqlalchemy/inspection.pyc,,
-sqlalchemy/interfaces.py,sha256=51RGQymBHqZ4Saj2PZEZ5xk-AGZ72AYKmoTTEBsTEPc,10967
-sqlalchemy/interfaces.pyc,,
-sqlalchemy/log.py,sha256=c9RRbdYa0iOw_6sgdISr0NcM6xJPe6BT2lrYtnoSxGA,6712
-sqlalchemy/log.pyc,,
-sqlalchemy/orm/__init__.py,sha256=Um0BgXXSPuVe2D-PV0ioQopLAVm0LSbnEzQZB0g-LAI,8763
-sqlalchemy/orm/__init__.pyc,,
-sqlalchemy/orm/attributes.py,sha256=J742ow68CX3lH3i_CfHBj6yRQpWED0QtyWUU6Oyq1a0,60563
-sqlalchemy/orm/attributes.pyc,,
-sqlalchemy/orm/base.py,sha256=MJi8DLr2Lx3o-0MXmjPLI3g82u-olU6G28F1xe3qubA,14795
-sqlalchemy/orm/base.pyc,,
-sqlalchemy/orm/collections.py,sha256=fH5nFWzoTeeCYeuaaqTsibY_3IU7WpwYdfjLNMdVSsw,52449
-sqlalchemy/orm/collections.pyc,,
-sqlalchemy/orm/dependency.py,sha256=hXpJsTfC4eKZyjPm6AOXOQaMb4geIwn-IGpBaXBNfME,45802
-sqlalchemy/orm/dependency.pyc,,
-sqlalchemy/orm/deprecated_interfaces.py,sha256=5Vzc_YJVzjJDTz3jDIj6S3Uh59NAcFfmCV5AYVUlY_s,18254
-sqlalchemy/orm/deprecated_interfaces.pyc,,
-sqlalchemy/orm/descriptor_props.py,sha256=n0LKgFbstmQ8vs6PFQfNWLOcm0i8hrnH2sJD6AsUCn0,27752
-sqlalchemy/orm/descriptor_props.pyc,,
-sqlalchemy/orm/dynamic.py,sha256=vWhx_j3H2rLRFHdmzienB24A3opQshOLrEuM2CBaqQ4,13312
-sqlalchemy/orm/dynamic.pyc,,
-sqlalchemy/orm/evaluator.py,sha256=GH81gACGkSBkynmfqHgqlZYjU3wv9pXqnZ0hGnxGuFY,5411
-sqlalchemy/orm/evaluator.pyc,,
-sqlalchemy/orm/events.py,sha256=kn-jjt2jdLZHef3WF2NRqdEqKO-YQqtSjceEPYoN09o,88321
-sqlalchemy/orm/events.pyc,,
-sqlalchemy/orm/exc.py,sha256=CgXQOVleTlrPxag-cqbLWpvYZEHAP4qgoL8AV-JuRGM,5459
-sqlalchemy/orm/exc.pyc,,
-sqlalchemy/orm/identity.py,sha256=lC9aPcReGjm7Lj7FlFhfFQR5_Ek0jvKXiC_5yBsb-1A,10255
-sqlalchemy/orm/identity.pyc,,
-sqlalchemy/orm/instrumentation.py,sha256=fDfrl1KDyfQOG-y1XvqQvRtflUcU8mX0cyyWBafINtc,18819
-sqlalchemy/orm/instrumentation.pyc,,
-sqlalchemy/orm/interfaces.py,sha256=aIGbn_wjejjbIFebbRk1x1F_EwmVNuLrgrFrEfHz6Go,24948
-sqlalchemy/orm/interfaces.pyc,,
-sqlalchemy/orm/loading.py,sha256=mY3RwFGyO-xDopbMcgs_puv5w_IikLpjDLShs7PT4RU,31306
-sqlalchemy/orm/loading.pyc,,
-sqlalchemy/orm/mapper.py,sha256=LMTiXWEEppcP7zX2DqAXaqhgz6jVM49Yp92IIUMBz-s,125661
-sqlalchemy/orm/mapper.pyc,,
-sqlalchemy/orm/path_registry.py,sha256=0KNqaTaHFchUkEGZ9ivXal2Eo2DLri-DQTgRVuB7wDA,7751
-sqlalchemy/orm/path_registry.pyc,,
-sqlalchemy/orm/persistence.py,sha256=yoPHWV7WfjUdYUmr__S77zcu61Qd-Xt1r_NRJgo4kHY,59921
-sqlalchemy/orm/persistence.pyc,,
-sqlalchemy/orm/properties.py,sha256=4kJybUUAshFg1M12BliUWDxhlhQIQ1_2FpripXbygJQ,10458
-sqlalchemy/orm/properties.pyc,,
-sqlalchemy/orm/query.py,sha256=9WZNRBxTdCFuOdGFBpgGfMGsCXE-gsiJZcfRnW2zve4,161757
-sqlalchemy/orm/query.pyc,,
-sqlalchemy/orm/relationships.py,sha256=SlPjGqMziCgjm4Ku67U_GdQbSLFVrleitTqV-tUCP4o,118398
-sqlalchemy/orm/relationships.pyc,,
-sqlalchemy/orm/scoping.py,sha256=DOCDDbBCQFvibuVinlJjGlp_UyJCrZ_QONo-9wOwG9U,6272
-sqlalchemy/orm/scoping.pyc,,
-sqlalchemy/orm/session.py,sha256=2DSuvJEydtA0kNOlFthBYWgq7860FKTNb-Ws8FPM6Kk,125251
-sqlalchemy/orm/session.pyc,,
-sqlalchemy/orm/state.py,sha256=inuKfXbO1Xbd4Na4clrMqj2ZMNaGtekpj7I7cC1BN6k,29093
-sqlalchemy/orm/state.pyc,,
-sqlalchemy/orm/strategies.py,sha256=qFbwaTq48ywMsLMbLN_pG_JBx4LJq0Y0LTAnXaGgDhQ,74423
-sqlalchemy/orm/strategies.pyc,,
-sqlalchemy/orm/strategy_options.py,sha256=4NGgi5DsIwH4DZlz_7weO7RvfDxW-g4Tu82asnkyZBQ,49186
-sqlalchemy/orm/strategy_options.pyc,,
-sqlalchemy/orm/sync.py,sha256=ZkUytu_ucR9qMvj0rYUHCbx44qM2X_taMZe2BKLhhJc,5451
-sqlalchemy/orm/sync.pyc,,
-sqlalchemy/orm/unitofwork.py,sha256=SshcQgyS1Z623uDXRCs7EH28puHGURtErSHLCraIhUQ,24818
-sqlalchemy/orm/unitofwork.pyc,,
-sqlalchemy/orm/util.py,sha256=B3KRGZYgQlzdFPsgDVY6LZLaRo_FeqAvCMXvKeNQ1No,41244
-sqlalchemy/orm/util.pyc,,
-sqlalchemy/pool.py,sha256=wA3cvKxMV46xUD7rfS0KRfuD9EimzPqj2qFm5W8gAXE,52832
-sqlalchemy/pool.pyc,,
-sqlalchemy/processors.py,sha256=xxZZ1TrStefh2oh0MiWTZQNuNJAi15IxpRs_zkFggXY,5104
-sqlalchemy/processors.pyc,,
-sqlalchemy/schema.py,sha256=S8tx3M3c-cAPZv9ADlzY2eE_cZ7NurHH8cWUHYHcSkw,1289
-sqlalchemy/schema.pyc,,
-sqlalchemy/sql/__init__.py,sha256=xoVOg-2Frtowwp_2SjtsncUNkN6fZ04DODnZ0eBmivA,1869
-sqlalchemy/sql/__init__.pyc,,
-sqlalchemy/sql/annotation.py,sha256=QQmA_W2SOpCehVyTM8BfK3aZD8rABVT9G6Z2I0MTM7o,6654
-sqlalchemy/sql/annotation.pyc,,
-sqlalchemy/sql/base.py,sha256=h5T4_zxn4_eXsVulBRIWZanik27cRVsjFgp8aP7o3_A,21012
-sqlalchemy/sql/base.pyc,,
-sqlalchemy/sql/compiler.py,sha256=pMI3YmDHbjBtRzWV1SrbBrZqqpcO8ciTgpAuMKsVNow,115618
-sqlalchemy/sql/compiler.pyc,,
-sqlalchemy/sql/crud.py,sha256=9OjyAOXZ0xTgwn3hK1b8hzwS9zj-G3hBGVaR3F3o61o,25069
-sqlalchemy/sql/crud.pyc,,
-sqlalchemy/sql/ddl.py,sha256=PRcERd9PIFZJQZyI-qZ61ifBUnPmKHr7jyi0WrgeBKE,39141
-sqlalchemy/sql/ddl.pyc,,
-sqlalchemy/sql/default_comparator.py,sha256=XpYI3Jqn72SpigQyy1T618L7NubMjacfvFTrbKeK2VY,12032
-sqlalchemy/sql/default_comparator.pyc,,
-sqlalchemy/sql/dml.py,sha256=TgQAtNKW6LgTpbo4BZxEAbHtJDcUUtRTaE5dH0ZuvPg,34451
-sqlalchemy/sql/dml.pyc,,
-sqlalchemy/sql/elements.py,sha256=_wXMhaFnROpACNb-XEprrB26trznBaM77ThNllllKEY,151009
-sqlalchemy/sql/elements.pyc,,
-sqlalchemy/sql/expression.py,sha256=6JyyfdqdtuyJiIU3h_U8N6NrylJ-Cg5p66ahsid2Fkk,6335
-sqlalchemy/sql/expression.pyc,,
-sqlalchemy/sql/functions.py,sha256=SuwYsssVU68OtMZpyDCt8g5MmY6xs6KGl7Ga3ojEfVI,26367
-sqlalchemy/sql/functions.pyc,,
-sqlalchemy/sql/naming.py,sha256=8wxA_omnCzrJQ4jO5DdGJYN5zAlYWaeiZvaT8gKei3M,4662
-sqlalchemy/sql/naming.pyc,,
-sqlalchemy/sql/operators.py,sha256=5DEVS34BxzAddF_u8wXFpOvbLT2AYnehHTYjGRfd_RQ,41441
-sqlalchemy/sql/operators.pyc,,
-sqlalchemy/sql/schema.py,sha256=MdpTb0nluC1fULwe_P5dQnpmTkPshNpd6nHxLf1FJs8,159311
-sqlalchemy/sql/schema.pyc,,
-sqlalchemy/sql/selectable.py,sha256=FCF1p74t3BYgM6-W9IRWP8W6vMiJXrtc2kL8OBQNnqA,128030
-sqlalchemy/sql/selectable.pyc,,
-sqlalchemy/sql/sqltypes.py,sha256=ReEwSbkMu0Go4pXZXUtV5aYzx1lauHutuTXjoR0Jfac,92873
-sqlalchemy/sql/sqltypes.pyc,,
-sqlalchemy/sql/type_api.py,sha256=nApAMAtnutmHF9A4GfAaMgcrWtRA3EFMDp3OOEY83iU,50523
-sqlalchemy/sql/type_api.pyc,,
-sqlalchemy/sql/util.py,sha256=iKrQYXL0aCACOZzl0yoQRXemZERErzRtT6Ca9KE7Ggw,24844
-sqlalchemy/sql/util.pyc,,
-sqlalchemy/sql/visitors.py,sha256=VZNpyVTjeW6JBdLNTzdUGgzhsWfuwseq83CQaHNE7p0,10266
-sqlalchemy/sql/visitors.pyc,,
-sqlalchemy/testing/__init__.py,sha256=lS_k5h5ApYxpAx1oGzzKh7DlMNT-ECWRlqaBjYh8y3g,1146
-sqlalchemy/testing/__init__.pyc,,
-sqlalchemy/testing/assertions.py,sha256=NlGPzVMQUEvwbUiEN0kG-H3dcqybrfd8mUf2_tBhOmc,17756
-sqlalchemy/testing/assertions.pyc,,
-sqlalchemy/testing/assertsql.py,sha256=rPuxqGDk6VeksC9H3yAzvHLB8Detx5p6yKouiOEFAuQ,13249
-sqlalchemy/testing/assertsql.pyc,,
-sqlalchemy/testing/config.py,sha256=OZ53Y2cqFONCo-gdgexRiMmUkVdLhZzu13RInI97c8k,2729
-sqlalchemy/testing/config.pyc,,
-sqlalchemy/testing/engines.py,sha256=MC5IDTlP_8FbXFafkGdoR9BRQbIFvHXdStQNvy7WEq8,10417
-sqlalchemy/testing/engines.pyc,,
-sqlalchemy/testing/entities.py,sha256=hM-4tFsUSD6aYmrNNPk40Pl-r1igkRpamQRhvxptlQE,2992
-sqlalchemy/testing/entities.pyc,,
-sqlalchemy/testing/exclusions.py,sha256=UVG7BceJmByns7En_CkDX7lX70d7-CawrXSbL5ZNBOM,12694
-sqlalchemy/testing/exclusions.pyc,,
-sqlalchemy/testing/fixtures.py,sha256=6eywiWK8bdxdK-4I3fqxyDOHqX3Eo6xGad7wI3NLn2o,10733
-sqlalchemy/testing/fixtures.pyc,,
-sqlalchemy/testing/mock.py,sha256=FHzc3v4APchNIr_CsQmGFGFGjgYhEWEC7ldOFksicDE,630
-sqlalchemy/testing/mock.pyc,,
-sqlalchemy/testing/pickleable.py,sha256=dBtRFeAp26iIc2IRnSiGVS3sM5Mv8yM-d6peMAKvX08,2641
-sqlalchemy/testing/pickleable.pyc,,
-sqlalchemy/testing/plugin/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
-sqlalchemy/testing/plugin/__init__.pyc,,
-sqlalchemy/testing/plugin/bootstrap.py,sha256=Iw8R-d1gqoz_NKFtPyGfdX56QPcQHny_9Lvwov65aVY,1634
-sqlalchemy/testing/plugin/bootstrap.pyc,,
-sqlalchemy/testing/plugin/noseplugin.py,sha256=BS3TkwihocaxBVRexAya2KmQN18EVOEEb0Q2wi-o5Nk,2883
-sqlalchemy/testing/plugin/noseplugin.pyc,,
-sqlalchemy/testing/plugin/plugin_base.py,sha256=vsMI2bt0_PgmPn6Wvc1bl1SwnYSyOhdETnlbxumqvvk,18311
-sqlalchemy/testing/plugin/plugin_base.pyc,,
-sqlalchemy/testing/plugin/pytestplugin.py,sha256=Oderf9DyC-nHlrC9GRig-mzwEuFsKOsDg2TN64wDnz0,6937
-sqlalchemy/testing/plugin/pytestplugin.pyc,,
-sqlalchemy/testing/profiling.py,sha256=1AZ3YOAZgyZmHSvryBU1d9G_uQ2uDog1BS1DUcuECEk,8392
-sqlalchemy/testing/profiling.pyc,,
-sqlalchemy/testing/provision.py,sha256=I2aDppj5wTaT1PwXka9xqEZNNR0KwK2IG54A5aiTqJc,13269
-sqlalchemy/testing/provision.pyc,,
-sqlalchemy/testing/replay_fixture.py,sha256=iAxg7XsFkKSCcJnrNPQNJfjMxOgeBAa-ShOkywWPJ4w,5429
-sqlalchemy/testing/replay_fixture.pyc,,
-sqlalchemy/testing/requirements.py,sha256=6hT1ArLsyyDbQuQjyadspnnbbmDwZn8Iy9elPzS7eMU,25971
-sqlalchemy/testing/requirements.pyc,,
-sqlalchemy/testing/runner.py,sha256=-eFBB4f_Io7Hkpmx6Q-84zI_lLiiB1x_QX_9R205O4Q,1607
-sqlalchemy/testing/runner.pyc,,
-sqlalchemy/testing/schema.py,sha256=olCTZtTwTNWoYyh5dgbsSlyiIhD_-GYhVwsF0ggxyqM,3544
-sqlalchemy/testing/schema.pyc,,
-sqlalchemy/testing/suite/__init__.py,sha256=a5wEMpoK7EsumXDDqjoEI-f2QzfFzX8JfJKyAD6iiA0,519
-sqlalchemy/testing/suite/__init__.pyc,,
-sqlalchemy/testing/suite/test_cte.py,sha256=2pS4jICuEa60fe0vXcgRhLzmZWNrRrRANWUMrnI5zzc,6521
-sqlalchemy/testing/suite/test_cte.pyc,,
-sqlalchemy/testing/suite/test_ddl.py,sha256=Baw0ou9nKdADmrRuXgWzF1FZx0rvkkw3JHc6yw5BN0M,1838
-sqlalchemy/testing/suite/test_ddl.pyc,,
-sqlalchemy/testing/suite/test_dialect.py,sha256=iGTMfkkG9yg_RQVRVesLaeg6ITLYDpbCTJSR47Ua-V4,3468
-sqlalchemy/testing/suite/test_dialect.pyc,,
-sqlalchemy/testing/suite/test_insert.py,sha256=kpiW5l4O8KP6V1L0NEy4hdyXOqsGFX7USXZGTx2Hd84,9637
-sqlalchemy/testing/suite/test_insert.pyc,,
-sqlalchemy/testing/suite/test_reflection.py,sha256=Z2Hl4_VCQP6Ov3Mi6G_Bmi6P5HY2cGkdBULsgqPP2Y0,36707
-sqlalchemy/testing/suite/test_reflection.pyc,,
-sqlalchemy/testing/suite/test_results.py,sha256=UMT5_s0p2_ngse6-ei-UalcXao70IkNYLzm_5s0gKBo,11737
-sqlalchemy/testing/suite/test_results.pyc,,
-sqlalchemy/testing/suite/test_select.py,sha256=EupgoOXnuUtDNDVK_YM1Ttq1RjzTwei4LM_-qobRhBI,16003
-sqlalchemy/testing/suite/test_select.pyc,,
-sqlalchemy/testing/suite/test_sequence.py,sha256=jyEM4sBMA2sXoJVHTSOd8vXSVX1gl85XmEBccuu4Clg,4560
-sqlalchemy/testing/suite/test_sequence.pyc,,
-sqlalchemy/testing/suite/test_types.py,sha256=TZXK3yxQQ74h2JY9BKnvuUGtWxCAPhoywmgQTWUeKc4,28865
-sqlalchemy/testing/suite/test_types.pyc,,
-sqlalchemy/testing/suite/test_update_delete.py,sha256=r5p467r-EUsjEcWGfUE0VPIfN4LLXZpLRnnyBLyyjl4,1582
-sqlalchemy/testing/suite/test_update_delete.pyc,,
-sqlalchemy/testing/util.py,sha256=Lck4smouPjDXAk24gFDJt8LfFhNfg2bz6hhNHHqYr3E,7535
-sqlalchemy/testing/util.pyc,,
-sqlalchemy/testing/warnings.py,sha256=TxPoKoCaIrDiIPovvyqI31WafMwJwi8YjDOQgRV-X1A,1301
-sqlalchemy/testing/warnings.pyc,,
-sqlalchemy/types.py,sha256=PoH2ZBkg-fqdntFKFBAAQMSoyAVxWtI_kKvqeZADMDc,1713
-sqlalchemy/types.pyc,,
-sqlalchemy/util/__init__.py,sha256=CPSATlQ_Nad9aoK4zRZwlnJPmECRqayud8wV3Liq5B0,2552
-sqlalchemy/util/__init__.pyc,,
-sqlalchemy/util/_collections.py,sha256=C5E1rjV7FA4SOqy8Ys27XLaAin9XnvYacOC42FSlc4w,28283
-sqlalchemy/util/_collections.pyc,,
-sqlalchemy/util/compat.py,sha256=0akDJfgNAnJNNYV1wZfbpEN62L0brSfP6KKSTS6V2X0,9623
-sqlalchemy/util/compat.pyc,,
-sqlalchemy/util/deprecations.py,sha256=VYVbKqkvRQ8jtzsKpihCCahj90PjKHi1WSQWhdOpl8w,4403
-sqlalchemy/util/deprecations.pyc,,
-sqlalchemy/util/langhelpers.py,sha256=k9MERizbSl90znjnBLCExnoodnq0b5MqCS1XWYsHyaQ,42589
-sqlalchemy/util/langhelpers.pyc,,
-sqlalchemy/util/queue.py,sha256=7vCGAhE4i7H_Am7-e5F6sVgTMNoXBpNGBnwN9Juj9cM,6548
-sqlalchemy/util/queue.pyc,,
-sqlalchemy/util/topological.py,sha256=WG0jWfUc_lPS0Blau9GElTux7Gv2nStTKXBqQlCvmU4,2794
-sqlalchemy/util/topological.pyc,,
diff --git a/lib/SQLAlchemy-1.2.14.dist-info/WHEEL b/lib/SQLAlchemy-1.2.14.dist-info/WHEEL
deleted file mode 100644
index 59f9523344..0000000000
--- a/lib/SQLAlchemy-1.2.14.dist-info/WHEEL
+++ /dev/null
@@ -1,5 +0,0 @@
-Wheel-Version: 1.0
-Generator: bdist_wheel (0.32.2)
-Root-Is-Purelib: false
-Tag: cp27-cp27m-macosx_10_9_x86_64
-
diff --git a/lib/SQLAlchemy-1.2.14.dist-info/top_level.txt b/lib/SQLAlchemy-1.2.14.dist-info/top_level.txt
deleted file mode 100644
index 39fb2befb5..0000000000
--- a/lib/SQLAlchemy-1.2.14.dist-info/top_level.txt
+++ /dev/null
@@ -1 +0,0 @@
-sqlalchemy
diff --git a/lib/Werkzeug-0.14.1.dist-info/DESCRIPTION.rst b/lib/Werkzeug-0.14.1.dist-info/DESCRIPTION.rst
deleted file mode 100644
index 675f08d10a..0000000000
--- a/lib/Werkzeug-0.14.1.dist-info/DESCRIPTION.rst
+++ /dev/null
@@ -1,80 +0,0 @@
-Werkzeug
-========
-
-Werkzeug is a comprehensive `WSGI`_ web application library. It began as
-a simple collection of various utilities for WSGI applications and has
-become one of the most advanced WSGI utility libraries.
-
-It includes:
-
-* An interactive debugger that allows inspecting stack traces and source
- code in the browser with an interactive interpreter for any frame in
- the stack.
-* A full-featured request object with objects to interact with headers,
- query args, form data, files, and cookies.
-* A response object that can wrap other WSGI applications and handle
- streaming data.
-* A routing system for matching URLs to endpoints and generating URLs
- for endpoints, with an extensible system for capturing variables from
- URLs.
-* HTTP utilities to handle entity tags, cache control, dates, user
- agents, cookies, files, and more.
-* A threaded WSGI server for use while developing applications locally.
-* A test client for simulating HTTP requests during testing without
- requiring running a server.
-
-Werkzeug is Unicode aware and doesn't enforce any dependencies. It is up
-to the developer to choose a template engine, database adapter, and even
-how to handle requests. It can be used to build all sorts of end user
-applications such as blogs, wikis, or bulletin boards.
-
-`Flask`_ wraps Werkzeug, using it to handle the details of WSGI while
-providing more structure and patterns for defining powerful
-applications.
-
-
-Installing
-----------
-
-Install and update using `pip`_:
-
-.. code-block:: text
-
- pip install -U Werkzeug
-
-
-A Simple Example
-----------------
-
-.. code-block:: python
-
- from werkzeug.wrappers import Request, Response
-
- @Request.application
- def application(request):
- return Response('Hello, World!')
-
- if __name__ == '__main__':
- from werkzeug.serving import run_simple
- run_simple('localhost', 4000, application)
-
-
-Links
------
-
-* Website: https://www.palletsprojects.com/p/werkzeug/
-* Releases: https://pypi.org/project/Werkzeug/
-* Code: https://github.com/pallets/werkzeug
-* Issue tracker: https://github.com/pallets/werkzeug/issues
-* Test status:
-
- * Linux, Mac: https://travis-ci.org/pallets/werkzeug
- * Windows: https://ci.appveyor.com/project/davidism/werkzeug
-
-* Test coverage: https://codecov.io/gh/pallets/werkzeug
-
-.. _WSGI: https://wsgi.readthedocs.io/en/latest/
-.. _Flask: https://www.palletsprojects.com/p/flask/
-.. _pip: https://pip.pypa.io/en/stable/quickstart/
-
-
diff --git a/lib/Werkzeug-0.14.1.dist-info/INSTALLER b/lib/Werkzeug-0.14.1.dist-info/INSTALLER
deleted file mode 100644
index a1b589e38a..0000000000
--- a/lib/Werkzeug-0.14.1.dist-info/INSTALLER
+++ /dev/null
@@ -1 +0,0 @@
-pip
diff --git a/lib/Werkzeug-0.14.1.dist-info/LICENSE.txt b/lib/Werkzeug-0.14.1.dist-info/LICENSE.txt
deleted file mode 100644
index 1cc75bb0e3..0000000000
--- a/lib/Werkzeug-0.14.1.dist-info/LICENSE.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-Copyright © 2007 by the Pallets team.
-
-Some rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-* Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
-* Neither the name of the copyright holder nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
-THIS SOFTWARE AND DOCUMENTATION IS PROVIDED BY THE COPYRIGHT HOLDERS AND
-CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
-BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
-COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
-INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
-USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-THIS SOFTWARE AND DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGE.
diff --git a/lib/Werkzeug-0.14.1.dist-info/METADATA b/lib/Werkzeug-0.14.1.dist-info/METADATA
deleted file mode 100644
index bfc3c4e896..0000000000
--- a/lib/Werkzeug-0.14.1.dist-info/METADATA
+++ /dev/null
@@ -1,116 +0,0 @@
-Metadata-Version: 2.0
-Name: Werkzeug
-Version: 0.14.1
-Summary: The comprehensive WSGI web application library.
-Home-page: https://www.palletsprojects.org/p/werkzeug/
-Author: Armin Ronacher
-Author-email: armin.ronacher@active-4.com
-License: BSD
-Description-Content-Type: UNKNOWN
-Platform: any
-Classifier: Development Status :: 5 - Production/Stable
-Classifier: Environment :: Web Environment
-Classifier: Intended Audience :: Developers
-Classifier: License :: OSI Approved :: BSD License
-Classifier: Operating System :: OS Independent
-Classifier: Programming Language :: Python
-Classifier: Programming Language :: Python :: 2
-Classifier: Programming Language :: Python :: 2.6
-Classifier: Programming Language :: Python :: 2.7
-Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.3
-Classifier: Programming Language :: Python :: 3.4
-Classifier: Programming Language :: Python :: 3.5
-Classifier: Programming Language :: Python :: 3.6
-Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
-Classifier: Topic :: Software Development :: Libraries :: Python Modules
-Provides-Extra: dev
-Requires-Dist: coverage; extra == 'dev'
-Requires-Dist: pytest; extra == 'dev'
-Requires-Dist: sphinx; extra == 'dev'
-Requires-Dist: tox; extra == 'dev'
-Provides-Extra: termcolor
-Requires-Dist: termcolor; extra == 'termcolor'
-Provides-Extra: watchdog
-Requires-Dist: watchdog; extra == 'watchdog'
-
-Werkzeug
-========
-
-Werkzeug is a comprehensive `WSGI`_ web application library. It began as
-a simple collection of various utilities for WSGI applications and has
-become one of the most advanced WSGI utility libraries.
-
-It includes:
-
-* An interactive debugger that allows inspecting stack traces and source
- code in the browser with an interactive interpreter for any frame in
- the stack.
-* A full-featured request object with objects to interact with headers,
- query args, form data, files, and cookies.
-* A response object that can wrap other WSGI applications and handle
- streaming data.
-* A routing system for matching URLs to endpoints and generating URLs
- for endpoints, with an extensible system for capturing variables from
- URLs.
-* HTTP utilities to handle entity tags, cache control, dates, user
- agents, cookies, files, and more.
-* A threaded WSGI server for use while developing applications locally.
-* A test client for simulating HTTP requests during testing without
- requiring running a server.
-
-Werkzeug is Unicode aware and doesn't enforce any dependencies. It is up
-to the developer to choose a template engine, database adapter, and even
-how to handle requests. It can be used to build all sorts of end user
-applications such as blogs, wikis, or bulletin boards.
-
-`Flask`_ wraps Werkzeug, using it to handle the details of WSGI while
-providing more structure and patterns for defining powerful
-applications.
-
-
-Installing
-----------
-
-Install and update using `pip`_:
-
-.. code-block:: text
-
- pip install -U Werkzeug
-
-
-A Simple Example
-----------------
-
-.. code-block:: python
-
- from werkzeug.wrappers import Request, Response
-
- @Request.application
- def application(request):
- return Response('Hello, World!')
-
- if __name__ == '__main__':
- from werkzeug.serving import run_simple
- run_simple('localhost', 4000, application)
-
-
-Links
------
-
-* Website: https://www.palletsprojects.com/p/werkzeug/
-* Releases: https://pypi.org/project/Werkzeug/
-* Code: https://github.com/pallets/werkzeug
-* Issue tracker: https://github.com/pallets/werkzeug/issues
-* Test status:
-
- * Linux, Mac: https://travis-ci.org/pallets/werkzeug
- * Windows: https://ci.appveyor.com/project/davidism/werkzeug
-
-* Test coverage: https://codecov.io/gh/pallets/werkzeug
-
-.. _WSGI: https://wsgi.readthedocs.io/en/latest/
-.. _Flask: https://www.palletsprojects.com/p/flask/
-.. _pip: https://pip.pypa.io/en/stable/quickstart/
-
-
diff --git a/lib/Werkzeug-0.14.1.dist-info/RECORD b/lib/Werkzeug-0.14.1.dist-info/RECORD
deleted file mode 100644
index 450d790dfd..0000000000
--- a/lib/Werkzeug-0.14.1.dist-info/RECORD
+++ /dev/null
@@ -1,97 +0,0 @@
-Werkzeug-0.14.1.dist-info/DESCRIPTION.rst,sha256=rOCN36jwsWtWsTpqPG96z7FMilB5qI1CIARSKRuUmz8,2452
-Werkzeug-0.14.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
-Werkzeug-0.14.1.dist-info/LICENSE.txt,sha256=xndz_dD4m269AF9l_Xbl5V3tM1N3C1LoZC2PEPxWO-8,1534
-Werkzeug-0.14.1.dist-info/METADATA,sha256=FbfadrPdJNUWAxMOKxGUtHe5R3IDSBKYYmAz3FvI3uY,3872
-Werkzeug-0.14.1.dist-info/RECORD,,
-Werkzeug-0.14.1.dist-info/WHEEL,sha256=GrqQvamwgBV4nLoJe0vhYRSWzWsx7xjlt74FT0SWYfE,110
-Werkzeug-0.14.1.dist-info/metadata.json,sha256=4489UTt6HBp2NQil95-pBkjU4Je93SMHvMxZ_rjOpqA,1452
-Werkzeug-0.14.1.dist-info/top_level.txt,sha256=QRyj2VjwJoQkrwjwFIOlB8Xg3r9un0NtqVHQF-15xaw,9
-werkzeug/__init__.py,sha256=NR0d4n_-U9BLVKlOISean3zUt2vBwhvK-AZE6M0sC0k,6842
-werkzeug/__init__.pyc,,
-werkzeug/_compat.py,sha256=8c4U9o6A_TR9nKCcTbpZNxpqCXcXDVIbFawwKM2s92c,6311
-werkzeug/_compat.pyc,,
-werkzeug/_internal.py,sha256=GhEyGMlsSz_tYjsDWO9TG35VN7304MM8gjKDrXLEdVc,13873
-werkzeug/_internal.pyc,,
-werkzeug/_reloader.py,sha256=AyPphcOHPbu6qzW0UbrVvTDJdre5WgpxbhIJN_TqzUc,9264
-werkzeug/_reloader.pyc,,
-werkzeug/contrib/__init__.py,sha256=f7PfttZhbrImqpr5Ezre8CXgwvcGUJK7zWNpO34WWrw,623
-werkzeug/contrib/__init__.pyc,,
-werkzeug/contrib/atom.py,sha256=qqfJcfIn2RYY-3hO3Oz0aLq9YuNubcPQ_KZcNsDwVJo,15575
-werkzeug/contrib/atom.pyc,,
-werkzeug/contrib/cache.py,sha256=xBImHNj09BmX_7kC5NUCx8f_l4L8_O7zi0jCL21UZKE,32163
-werkzeug/contrib/cache.pyc,,
-werkzeug/contrib/fixers.py,sha256=gR06T-w71ur-tHQ_31kP_4jpOncPJ4Wc1dOqTvYusr8,10179
-werkzeug/contrib/fixers.pyc,,
-werkzeug/contrib/iterio.py,sha256=RlqDvGhz0RneTpzE8dVc-yWCUv4nkPl1jEc_EDp2fH0,10814
-werkzeug/contrib/iterio.pyc,,
-werkzeug/contrib/jsrouting.py,sha256=QTmgeDoKXvNK02KzXgx9lr3cAH6fAzpwF5bBdPNvJPs,8564
-werkzeug/contrib/jsrouting.pyc,,
-werkzeug/contrib/limiter.py,sha256=iS8-ahPZ-JLRnmfIBzxpm7O_s3lPsiDMVWv7llAIDCI,1334
-werkzeug/contrib/limiter.pyc,,
-werkzeug/contrib/lint.py,sha256=Mj9NeUN7s4zIUWeQOAVjrmtZIcl3Mm2yDe9BSIr9YGE,12558
-werkzeug/contrib/lint.pyc,,
-werkzeug/contrib/profiler.py,sha256=ISwCWvwVyGpDLRBRpLjo_qUWma6GXYBrTAco4PEQSHY,5151
-werkzeug/contrib/profiler.pyc,,
-werkzeug/contrib/securecookie.py,sha256=uWMyHDHY3lkeBRiCSayGqWkAIy4a7xAbSE_Hln9ecqc,12196
-werkzeug/contrib/securecookie.pyc,,
-werkzeug/contrib/sessions.py,sha256=39LVNvLbm5JWpbxM79WC2l87MJFbqeISARjwYbkJatw,12577
-werkzeug/contrib/sessions.pyc,,
-werkzeug/contrib/testtools.py,sha256=G9xN-qeihJlhExrIZMCahvQOIDxdL9NiX874jiiHFMs,2453
-werkzeug/contrib/testtools.pyc,,
-werkzeug/contrib/wrappers.py,sha256=v7OYlz7wQtDlS9fey75UiRZ1IkUWqCpzbhsLy4k14Hw,10398
-werkzeug/contrib/wrappers.pyc,,
-werkzeug/datastructures.py,sha256=3IgNKNqrz-ZjmAG7y3YgEYK-enDiMT_b652PsypWcYg,90080
-werkzeug/datastructures.pyc,,
-werkzeug/debug/__init__.py,sha256=uSn9BqCZ5E3ySgpoZtundpROGsn-uYvZtSFiTfAX24M,17452
-werkzeug/debug/__init__.pyc,,
-werkzeug/debug/console.py,sha256=n3-dsKk1TsjnN-u4ZgmuWCU_HO0qw5IA7ttjhyyMM6I,5607
-werkzeug/debug/console.pyc,,
-werkzeug/debug/repr.py,sha256=bKqstDYGfECpeLerd48s_hxuqK4b6UWnjMu3d_DHO8I,9340
-werkzeug/debug/repr.pyc,,
-werkzeug/debug/shared/FONT_LICENSE,sha256=LwAVEI1oYnvXiNMT9SnCH_TaLCxCpeHziDrMg0gPkAI,4673
-werkzeug/debug/shared/console.png,sha256=bxax6RXXlvOij_KeqvSNX0ojJf83YbnZ7my-3Gx9w2A,507
-werkzeug/debug/shared/debugger.js,sha256=PKPVYuyO4SX1hkqLOwCLvmIEO5154WatFYaXE-zIfKI,6264
-werkzeug/debug/shared/jquery.js,sha256=7LkWEzqTdpEfELxcZZlS6wAx5Ff13zZ83lYO2_ujj7g,95957
-werkzeug/debug/shared/less.png,sha256=-4-kNRaXJSONVLahrQKUxMwXGm9R4OnZ9SxDGpHlIR4,191
-werkzeug/debug/shared/more.png,sha256=GngN7CioHQoV58rH6ojnkYi8c_qED2Aka5FO5UXrReY,200
-werkzeug/debug/shared/source.png,sha256=RoGcBTE4CyCB85GBuDGTFlAnUqxwTBiIfDqW15EpnUQ,818
-werkzeug/debug/shared/style.css,sha256=IEO0PC2pWmh2aEyGCaN--txuWsRCliuhlbEhPDFwh0A,6270
-werkzeug/debug/shared/ubuntu.ttf,sha256=1eaHFyepmy4FyDvjLVzpITrGEBu_CZYY94jE0nED1c0,70220
-werkzeug/debug/tbtools.py,sha256=rBudXCmkVdAKIcdhxANxgf09g6kQjJWW9_5bjSpr4OY,18451
-werkzeug/debug/tbtools.pyc,,
-werkzeug/exceptions.py,sha256=3wp95Hqj9FqV8MdikV99JRcHse_fSMn27V8tgP5Hw2c,20505
-werkzeug/exceptions.pyc,,
-werkzeug/filesystem.py,sha256=hHWeWo_gqLMzTRfYt8-7n2wWcWUNTnDyudQDLOBEICE,2175
-werkzeug/filesystem.pyc,,
-werkzeug/formparser.py,sha256=mUuCwjzjb8_E4RzrAT2AioLuZSYpqR1KXTK6LScRYzA,21722
-werkzeug/formparser.pyc,,
-werkzeug/http.py,sha256=RQg4MJuhRv2isNRiEh__Phh09ebpfT3Kuu_GfrZ54_c,40079
-werkzeug/http.pyc,,
-werkzeug/local.py,sha256=QdQhWV5L8p1Y1CJ1CDStwxaUs24SuN5aebHwjVD08C8,14553
-werkzeug/local.pyc,,
-werkzeug/posixemulation.py,sha256=xEF2Bxc-vUCPkiu4IbfWVd3LW7DROYAT-ExW6THqyzw,3519
-werkzeug/posixemulation.pyc,,
-werkzeug/routing.py,sha256=2JVtdSgxKGeANy4Z_FP-dKESvKtkYGCZ1J2fARCLGCY,67214
-werkzeug/routing.pyc,,
-werkzeug/script.py,sha256=DwaVDcXdaOTffdNvlBdLitxWXjKaRVT32VbhDtljFPY,11365
-werkzeug/script.pyc,,
-werkzeug/security.py,sha256=0m107exslz4QJLWQCpfQJ04z3re4eGHVggRvrQVAdWc,9193
-werkzeug/security.pyc,,
-werkzeug/serving.py,sha256=A0flnIJHufdn2QJ9oeuHfrXwP3LzP8fn3rNW6hbxKUg,31926
-werkzeug/serving.pyc,,
-werkzeug/test.py,sha256=XmECSmnpASiYQTct4oMiWr0LT5jHWCtKqnpYKZd2ui8,36100
-werkzeug/test.pyc,,
-werkzeug/testapp.py,sha256=3HQRW1sHZKXuAjCvFMet4KXtQG3loYTFnvn6LWt-4zI,9396
-werkzeug/testapp.pyc,,
-werkzeug/urls.py,sha256=dUeLg2IeTm0WLmSvFeD4hBZWGdOs-uHudR5-t8n9zPo,36771
-werkzeug/urls.pyc,,
-werkzeug/useragents.py,sha256=BhYMf4cBTHyN4U0WsQedePIocmNlH_34C-UwqSThGCc,5865
-werkzeug/useragents.pyc,,
-werkzeug/utils.py,sha256=BrY1j0DHQ8RTb0K1StIobKuMJhN9SQQkWEARbrh2qpk,22972
-werkzeug/utils.pyc,,
-werkzeug/websocket.py,sha256=PpSeDxXD_0UsPAa5hQhQNM6mxibeUgn8lA8eRqiS0vM,11344
-werkzeug/websocket.pyc,,
-werkzeug/wrappers.py,sha256=kbyL_aFjxELwPgMwfNCYjKu-CR6kNkh-oO8wv3GXbk8,84511
-werkzeug/wrappers.pyc,,
-werkzeug/wsgi.py,sha256=1Nob-aeChWQf7MsiicO8RZt6J90iRzEcik44ev9Qu8s,49347
-werkzeug/wsgi.pyc,,
diff --git a/lib/Werkzeug-0.14.1.dist-info/WHEEL b/lib/Werkzeug-0.14.1.dist-info/WHEEL
deleted file mode 100644
index 0de529b1ed..0000000000
--- a/lib/Werkzeug-0.14.1.dist-info/WHEEL
+++ /dev/null
@@ -1,6 +0,0 @@
-Wheel-Version: 1.0
-Generator: bdist_wheel (0.26.0)
-Root-Is-Purelib: true
-Tag: py2-none-any
-Tag: py3-none-any
-
diff --git a/lib/Werkzeug-0.14.1.dist-info/metadata.json b/lib/Werkzeug-0.14.1.dist-info/metadata.json
deleted file mode 100644
index bca8d1262a..0000000000
--- a/lib/Werkzeug-0.14.1.dist-info/metadata.json
+++ /dev/null
@@ -1 +0,0 @@
-{"generator": "bdist_wheel (0.26.0)", "summary": "The comprehensive WSGI web application library.", "classifiers": ["Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries :: Python Modules"], "description_content_type": "UNKNOWN", "extensions": {"python.details": {"project_urls": {"Home": "https://www.palletsprojects.org/p/werkzeug/"}, "contacts": [{"email": "armin.ronacher@active-4.com", "name": "Armin Ronacher", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst", "license": "LICENSE.txt"}}}, "license": "BSD", "metadata_version": "2.0", "name": "Werkzeug", "platform": "any", "extras": ["dev", "termcolor", "watchdog"], "run_requires": [{"requires": ["coverage", "pytest", "sphinx", "tox"], "extra": "dev"}, {"requires": ["termcolor"], "extra": "termcolor"}, {"requires": ["watchdog"], "extra": "watchdog"}], "version": "0.14.1"}
\ No newline at end of file
diff --git a/lib/Werkzeug-0.14.1.dist-info/top_level.txt b/lib/Werkzeug-0.14.1.dist-info/top_level.txt
deleted file mode 100644
index 6fe8da8499..0000000000
--- a/lib/Werkzeug-0.14.1.dist-info/top_level.txt
+++ /dev/null
@@ -1 +0,0 @@
-werkzeug
diff --git a/lib/asn1crypto-0.24.0.dist-info/DESCRIPTION.rst b/lib/asn1crypto-0.24.0.dist-info/DESCRIPTION.rst
deleted file mode 100644
index 08533b5160..0000000000
--- a/lib/asn1crypto-0.24.0.dist-info/DESCRIPTION.rst
+++ /dev/null
@@ -1,3 +0,0 @@
-Docs for this project are maintained at https://github.com/wbond/asn1crypto#readme.
-
-
diff --git a/lib/asn1crypto-0.24.0.dist-info/INSTALLER b/lib/asn1crypto-0.24.0.dist-info/INSTALLER
deleted file mode 100644
index a1b589e38a..0000000000
--- a/lib/asn1crypto-0.24.0.dist-info/INSTALLER
+++ /dev/null
@@ -1 +0,0 @@
-pip
diff --git a/lib/asn1crypto-0.24.0.dist-info/METADATA b/lib/asn1crypto-0.24.0.dist-info/METADATA
deleted file mode 100644
index 943af2b606..0000000000
--- a/lib/asn1crypto-0.24.0.dist-info/METADATA
+++ /dev/null
@@ -1,27 +0,0 @@
-Metadata-Version: 2.0
-Name: asn1crypto
-Version: 0.24.0
-Summary: Fast ASN.1 parser and serializer with definitions for private keys, public keys, certificates, CRL, OCSP, CMS, PKCS#3, PKCS#7, PKCS#8, PKCS#12, PKCS#5, X.509 and TSP
-Home-page: https://github.com/wbond/asn1crypto
-Author: wbond
-Author-email: will@wbond.net
-License: MIT
-Description-Content-Type: UNKNOWN
-Keywords: asn1 crypto pki x509 certificate rsa dsa ec dh
-Platform: UNKNOWN
-Classifier: Development Status :: 4 - Beta
-Classifier: Intended Audience :: Developers
-Classifier: License :: OSI Approved :: MIT License
-Classifier: Programming Language :: Python :: 2.6
-Classifier: Programming Language :: Python :: 2.7
-Classifier: Programming Language :: Python :: 3.2
-Classifier: Programming Language :: Python :: 3.3
-Classifier: Programming Language :: Python :: 3.4
-Classifier: Programming Language :: Python :: 3.5
-Classifier: Programming Language :: Python :: 3.6
-Classifier: Programming Language :: Python :: Implementation :: PyPy
-Classifier: Topic :: Security :: Cryptography
-
-Docs for this project are maintained at https://github.com/wbond/asn1crypto#readme.
-
-
diff --git a/lib/asn1crypto-0.24.0.dist-info/RECORD b/lib/asn1crypto-0.24.0.dist-info/RECORD
deleted file mode 100644
index f9110a0fdf..0000000000
--- a/lib/asn1crypto-0.24.0.dist-info/RECORD
+++ /dev/null
@@ -1,61 +0,0 @@
-asn1crypto-0.24.0.dist-info/DESCRIPTION.rst,sha256=AKxcPr8A1r7Lgepi1zxda_bylQUpelEwT9VouCPpXFA,86
-asn1crypto-0.24.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
-asn1crypto-0.24.0.dist-info/METADATA,sha256=k2awXhDUj-10m5VIjPmW4_v1_g8IxusRxHuHmSikb-c,1132
-asn1crypto-0.24.0.dist-info/RECORD,,
-asn1crypto-0.24.0.dist-info/WHEEL,sha256=GrqQvamwgBV4nLoJe0vhYRSWzWsx7xjlt74FT0SWYfE,110
-asn1crypto-0.24.0.dist-info/metadata.json,sha256=GWUZOttbqBGOXofIFkjNpPeItn-MlCQZLATLKFjoHL4,1177
-asn1crypto-0.24.0.dist-info/top_level.txt,sha256=z8-jF_Q-jgzGox7T2XYian3-yeptLS2I7MjoJLBaq1Y,11
-asn1crypto/__init__.py,sha256=d-HnaY-IU0N1aepUI9bYR11J2EGccGAN8kDvKMgGu78,209
-asn1crypto/__init__.pyc,,
-asn1crypto/_elliptic_curve.py,sha256=vdORN6l6XZyCQpA-9tdk71IrGLciAHEimOc5KsG7YNw,9419
-asn1crypto/_elliptic_curve.pyc,,
-asn1crypto/_errors.py,sha256=YCCXkifzLkCnxo-iIO-oIWY-UuPZNbEai7z94ps8ck4,967
-asn1crypto/_errors.pyc,,
-asn1crypto/_ffi.py,sha256=Y4IhTLrLTxt7Xg5vcQFLAvH_Mq8xg3LTcmkIJn-G8eE,738
-asn1crypto/_ffi.pyc,,
-asn1crypto/_inet.py,sha256=z2K8CKxSfEQ3d0UMIIgXw5NugKLZyRS__Cn10ivbiGM,4661
-asn1crypto/_inet.pyc,,
-asn1crypto/_int.py,sha256=I-INe1rHGsQfV6vndtD53fhyjsEOG5a6WoDY4w6M2B4,4618
-asn1crypto/_int.pyc,,
-asn1crypto/_iri.py,sha256=5gG6VBG-tYAQT6lWnjvHRH-RvIStaeG_PxhyPLnL-KQ,8628
-asn1crypto/_iri.pyc,,
-asn1crypto/_ordereddict.py,sha256=5VAYLbxxEtfdZGKgjzINxlmNkYg9d_7JmZAFfr0EcAk,4533
-asn1crypto/_ordereddict.pyc,,
-asn1crypto/_perf/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
-asn1crypto/_perf/__init__.pyc,,
-asn1crypto/_perf/_big_num_ctypes.py,sha256=bc1WXhoR08nB-l0mOutKldupcjybswWckOxquiXByx8,2027
-asn1crypto/_perf/_big_num_ctypes.pyc,,
-asn1crypto/_teletex_codec.py,sha256=LhDpkTprPaoc7UJ9i9uwnP-5Am00SVbHSQizPpCLpqE,5053
-asn1crypto/_teletex_codec.pyc,,
-asn1crypto/_types.py,sha256=OwsX30epv-ETI9eGrLW9GLqv0KeoiSRnJcjN92roqhQ,939
-asn1crypto/_types.pyc,,
-asn1crypto/algos.py,sha256=zcJgP8VnZTT60ijR5-RPuhI9v4kcxrWgzv7_EjlZfW0,34095
-asn1crypto/algos.pyc,,
-asn1crypto/cms.py,sha256=BOWS3bT33ZfmMpdL_yogG-3PwI2fbWEr1F7aw_5PFZo,25118
-asn1crypto/cms.pyc,,
-asn1crypto/core.py,sha256=IDrq3cOH6xxc64nQcHr9LUdKvr2DU4ehd49I6k5XOcM,157260
-asn1crypto/core.pyc,,
-asn1crypto/crl.py,sha256=KJLuEn1IDJO19X4eLYhRyaM-ACnxKkimoGsyAnzGdgA,16104
-asn1crypto/crl.pyc,,
-asn1crypto/csr.py,sha256=CP0tOGyHPEV3ZpnB7L4L9X-X1epD6TVixal6UAtTvLQ,2142
-asn1crypto/csr.pyc,,
-asn1crypto/keys.py,sha256=fH9hBBq2buS378sKS8OYFHpRSQSOU2qCSnxqMeeGBHk,35185
-asn1crypto/keys.pyc,,
-asn1crypto/ocsp.py,sha256=jF_F5-xwcATqxs-2Qpo9V83lhfDNYuZZTd4ODpKnyAM,17792
-asn1crypto/ocsp.pyc,,
-asn1crypto/parser.py,sha256=pkyVS-BJk4mDTve0mZMUmrrUV_IHnQk9AvgtkEvfEKM,9149
-asn1crypto/parser.pyc,,
-asn1crypto/pdf.py,sha256=HNybnna5WG2ftmb8Nx_T5reyLJ0E7hJXoj37DuLbpX0,2250
-asn1crypto/pdf.pyc,,
-asn1crypto/pem.py,sha256=s46r_KCQ9h1HENXMh4AGKTXesivQrKnWzU3-gok75uI,6145
-asn1crypto/pem.pyc,,
-asn1crypto/pkcs12.py,sha256=q-KGfvaO72B8AfvolwsqhAQpjuqnkEczPddXYLBFUSE,4566
-asn1crypto/pkcs12.pyc,,
-asn1crypto/tsp.py,sha256=jpjpFmWBwX4GUVrYu9Gnk6YXRnzb-uVFvfaJSo-m_2Q,7827
-asn1crypto/tsp.pyc,,
-asn1crypto/util.py,sha256=m3dc7XtmQiq__uC0G2jcyHYkaJPsnm7KGAWiCXj-xio,18043
-asn1crypto/util.pyc,,
-asn1crypto/version.py,sha256=SqGlEZKUpqLOswcILajD1bITTOejwN3Jvlnw325hHjQ,154
-asn1crypto/version.pyc,,
-asn1crypto/x509.py,sha256=IGKOKTX3GWIsZhTtcpbcDkFWjpoTozNPlItYZ8pY8QA,92305
-asn1crypto/x509.pyc,,
diff --git a/lib/asn1crypto-0.24.0.dist-info/WHEEL b/lib/asn1crypto-0.24.0.dist-info/WHEEL
deleted file mode 100644
index 0de529b1ed..0000000000
--- a/lib/asn1crypto-0.24.0.dist-info/WHEEL
+++ /dev/null
@@ -1,6 +0,0 @@
-Wheel-Version: 1.0
-Generator: bdist_wheel (0.26.0)
-Root-Is-Purelib: true
-Tag: py2-none-any
-Tag: py3-none-any
-
diff --git a/lib/asn1crypto-0.24.0.dist-info/metadata.json b/lib/asn1crypto-0.24.0.dist-info/metadata.json
deleted file mode 100644
index caa3c3a87c..0000000000
--- a/lib/asn1crypto-0.24.0.dist-info/metadata.json
+++ /dev/null
@@ -1 +0,0 @@
-{"generator": "bdist_wheel (0.26.0)", "summary": "Fast ASN.1 parser and serializer with definitions for private keys, public keys, certificates, CRL, OCSP, CMS, PKCS#3, PKCS#7, PKCS#8, PKCS#12, PKCS#5, X.509 and TSP", "classifiers": ["Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Security :: Cryptography"], "description_content_type": "UNKNOWN", "extensions": {"python.details": {"project_urls": {"Home": "https://github.com/wbond/asn1crypto"}, "contacts": [{"email": "will@wbond.net", "name": "wbond", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst"}}}, "keywords": ["asn1", "crypto", "pki", "x509", "certificate", "rsa", "dsa", "ec", "dh"], "license": "MIT", "metadata_version": "2.0", "name": "asn1crypto", "version": "0.24.0"}
\ No newline at end of file
diff --git a/lib/asn1crypto-0.24.0.dist-info/top_level.txt b/lib/asn1crypto-0.24.0.dist-info/top_level.txt
deleted file mode 100644
index 35a704e46d..0000000000
--- a/lib/asn1crypto-0.24.0.dist-info/top_level.txt
+++ /dev/null
@@ -1 +0,0 @@
-asn1crypto
diff --git a/lib/asn1crypto/__init__.py b/lib/asn1crypto/__init__.py
deleted file mode 100644
index afdeb4380a..0000000000
--- a/lib/asn1crypto/__init__.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# coding: utf-8
-from __future__ import unicode_literals, division, absolute_import, print_function
-
-from .version import __version__, __version_info__
-
-__all__ = [
- '__version__',
- '__version_info__',
-]
diff --git a/lib/asn1crypto/_elliptic_curve.py b/lib/asn1crypto/_elliptic_curve.py
deleted file mode 100644
index 8c0f12dd36..0000000000
--- a/lib/asn1crypto/_elliptic_curve.py
+++ /dev/null
@@ -1,314 +0,0 @@
-# coding: utf-8
-
-"""
-Classes and objects to represent prime-field elliptic curves and points on them.
-Exports the following items:
-
- - PrimeCurve()
- - PrimePoint()
- - SECP192R1_CURVE
- - SECP192R1_BASE_POINT
- - SECP224R1_CURVE
- - SECP224R1_BASE_POINT
- - SECP256R1_CURVE
- - SECP256R1_BASE_POINT
- - SECP384R1_CURVE
- - SECP384R1_BASE_POINT
- - SECP521R1_CURVE
- - SECP521R1_BASE_POINT
-
-The curve constants are all PrimeCurve() objects and the base point constants
-are all PrimePoint() objects.
-
-Some of the following source code is derived from
-http://webpages.charter.net/curryfans/peter/downloads.html, but has been heavily
-modified to fit into this projects lint settings. The original project license
-is listed below:
-
-Copyright (c) 2014 Peter Pearson
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-"""
-
-from __future__ import unicode_literals, division, absolute_import, print_function
-
-from ._int import inverse_mod
-
-
-class PrimeCurve():
- """
- Elliptic curve over a prime field. Characteristic two field curves are not
- supported.
- """
-
- def __init__(self, p, a, b):
- """
- The curve of points satisfying y^2 = x^3 + a*x + b (mod p)
-
- :param p:
- The prime number as an integer
-
- :param a:
- The component a as an integer
-
- :param b:
- The component b as an integer
- """
-
- self.p = p
- self.a = a
- self.b = b
-
- def contains(self, point):
- """
- :param point:
- A Point object
-
- :return:
- Boolean if the point is on this curve
- """
-
- y2 = point.y * point.y
- x3 = point.x * point.x * point.x
- return (y2 - (x3 + self.a * point.x + self.b)) % self.p == 0
-
-
-class PrimePoint():
- """
- A point on a prime-field elliptic curve
- """
-
- def __init__(self, curve, x, y, order=None):
- """
- :param curve:
- A PrimeCurve object
-
- :param x:
- The x coordinate of the point as an integer
-
- :param y:
- The y coordinate of the point as an integer
-
- :param order:
- The order of the point, as an integer - optional
- """
-
- self.curve = curve
- self.x = x
- self.y = y
- self.order = order
-
- # self.curve is allowed to be None only for INFINITY:
- if self.curve:
- if not self.curve.contains(self):
- raise ValueError('Invalid EC point')
-
- if self.order:
- if self * self.order != INFINITY:
- raise ValueError('Invalid EC point')
-
- def __cmp__(self, other):
- """
- :param other:
- A PrimePoint object
-
- :return:
- 0 if identical, 1 otherwise
- """
- if self.curve == other.curve and self.x == other.x and self.y == other.y:
- return 0
- else:
- return 1
-
- def __add__(self, other):
- """
- :param other:
- A PrimePoint object
-
- :return:
- A PrimePoint object
- """
-
- # X9.62 B.3:
-
- if other == INFINITY:
- return self
- if self == INFINITY:
- return other
- assert self.curve == other.curve
- if self.x == other.x:
- if (self.y + other.y) % self.curve.p == 0:
- return INFINITY
- else:
- return self.double()
-
- p = self.curve.p
-
- l_ = ((other.y - self.y) * inverse_mod(other.x - self.x, p)) % p
-
- x3 = (l_ * l_ - self.x - other.x) % p
- y3 = (l_ * (self.x - x3) - self.y) % p
-
- return PrimePoint(self.curve, x3, y3)
-
- def __mul__(self, other):
- """
- :param other:
- An integer to multiple the Point by
-
- :return:
- A PrimePoint object
- """
-
- def leftmost_bit(x):
- assert x > 0
- result = 1
- while result <= x:
- result = 2 * result
- return result // 2
-
- e = other
- if self.order:
- e = e % self.order
- if e == 0:
- return INFINITY
- if self == INFINITY:
- return INFINITY
- assert e > 0
-
- # From X9.62 D.3.2:
-
- e3 = 3 * e
- negative_self = PrimePoint(self.curve, self.x, -self.y, self.order)
- i = leftmost_bit(e3) // 2
- result = self
- # print "Multiplying %s by %d (e3 = %d):" % ( self, other, e3 )
- while i > 1:
- result = result.double()
- if (e3 & i) != 0 and (e & i) == 0:
- result = result + self
- if (e3 & i) == 0 and (e & i) != 0:
- result = result + negative_self
- # print ". . . i = %d, result = %s" % ( i, result )
- i = i // 2
-
- return result
-
- def __rmul__(self, other):
- """
- :param other:
- An integer to multiple the Point by
-
- :return:
- A PrimePoint object
- """
-
- return self * other
-
- def double(self):
- """
- :return:
- A PrimePoint object that is twice this point
- """
-
- # X9.62 B.3:
-
- p = self.curve.p
- a = self.curve.a
-
- l_ = ((3 * self.x * self.x + a) * inverse_mod(2 * self.y, p)) % p
-
- x3 = (l_ * l_ - 2 * self.x) % p
- y3 = (l_ * (self.x - x3) - self.y) % p
-
- return PrimePoint(self.curve, x3, y3)
-
-
-# This one point is the Point At Infinity for all purposes:
-INFINITY = PrimePoint(None, None, None)
-
-
-# NIST Curve P-192:
-SECP192R1_CURVE = PrimeCurve(
- 6277101735386680763835789423207666416083908700390324961279,
- -3,
- 0x64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1
-)
-SECP192R1_BASE_POINT = PrimePoint(
- SECP192R1_CURVE,
- 0x188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012,
- 0x07192b95ffc8da78631011ed6b24cdd573f977a11e794811,
- 6277101735386680763835789423176059013767194773182842284081
-)
-
-
-# NIST Curve P-224:
-SECP224R1_CURVE = PrimeCurve(
- 26959946667150639794667015087019630673557916260026308143510066298881,
- -3,
- 0xb4050a850c04b3abf54132565044b0b7d7bfd8ba270b39432355ffb4
-)
-SECP224R1_BASE_POINT = PrimePoint(
- SECP224R1_CURVE,
- 0xb70e0cbd6bb4bf7f321390b94a03c1d356c21122343280d6115c1d21,
- 0xbd376388b5f723fb4c22dfe6cd4375a05a07476444d5819985007e34,
- 26959946667150639794667015087019625940457807714424391721682722368061
-)
-
-
-# NIST Curve P-256:
-SECP256R1_CURVE = PrimeCurve(
- 115792089210356248762697446949407573530086143415290314195533631308867097853951,
- -3,
- 0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b
-)
-SECP256R1_BASE_POINT = PrimePoint(
- SECP256R1_CURVE,
- 0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296,
- 0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5,
- 115792089210356248762697446949407573529996955224135760342422259061068512044369
-)
-
-
-# NIST Curve P-384:
-SECP384R1_CURVE = PrimeCurve(
- 39402006196394479212279040100143613805079739270465446667948293404245721771496870329047266088258938001861606973112319, # noqa
- -3,
- 0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef
-)
-SECP384R1_BASE_POINT = PrimePoint(
- SECP384R1_CURVE,
- 0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7,
- 0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f,
- 39402006196394479212279040100143613805079739270465446667946905279627659399113263569398956308152294913554433653942643
-)
-
-
-# NIST Curve P-521:
-SECP521R1_CURVE = PrimeCurve(
- 6864797660130609714981900799081393217269435300143305409394463459185543183397656052122559640661454554977296311391480858037121987999716643812574028291115057151, # noqa
- -3,
- 0x051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00 # noqa
-)
-SECP521R1_BASE_POINT = PrimePoint(
- SECP521R1_CURVE,
- 0xc6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66, # noqa
- 0x11839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650, # noqa
- 6864797660130609714981900799081393217269435300143305409394463459185543183397655394245057746333217197532963996371363321113864768612440380340372808892707005449 # noqa
-)
diff --git a/lib/asn1crypto/_errors.py b/lib/asn1crypto/_errors.py
deleted file mode 100644
index cc785a52c0..0000000000
--- a/lib/asn1crypto/_errors.py
+++ /dev/null
@@ -1,45 +0,0 @@
-# coding: utf-8
-
-"""
-Helper for formatting exception messages. Exports the following items:
-
- - unwrap()
-"""
-
-from __future__ import unicode_literals, division, absolute_import, print_function
-
-import re
-import textwrap
-
-
-def unwrap(string, *params):
- """
- Takes a multi-line string and does the following:
-
- - dedents
- - converts newlines with text before and after into a single line
- - strips leading and trailing whitespace
-
- :param string:
- The string to format
-
- :param *params:
- Params to interpolate into the string
-
- :return:
- The formatted string
- """
-
- output = textwrap.dedent(string)
-
- # Unwrap lines, taking into account bulleted lists, ordered lists and
- # underlines consisting of = signs
- if output.find('\n') != -1:
- output = re.sub('(?<=\\S)\n(?=[^ \n\t\\d\\*\\-=])', ' ', output)
-
- if params:
- output = output % params
-
- output = output.strip()
-
- return output
diff --git a/lib/asn1crypto/_ffi.py b/lib/asn1crypto/_ffi.py
deleted file mode 100644
index 2a4f5bf55a..0000000000
--- a/lib/asn1crypto/_ffi.py
+++ /dev/null
@@ -1,45 +0,0 @@
-# coding: utf-8
-
-"""
-FFI helper compatibility functions. Exports the following items:
-
- - LibraryNotFoundError
- - FFIEngineError
- - bytes_from_buffer()
- - buffer_from_bytes()
- - null()
-"""
-
-from __future__ import unicode_literals, division, absolute_import, print_function
-
-from ctypes import create_string_buffer
-
-
-def buffer_from_bytes(initializer):
- return create_string_buffer(initializer)
-
-
-def bytes_from_buffer(buffer, maxlen=None):
- return buffer.raw
-
-
-def null():
- return None
-
-
-class LibraryNotFoundError(Exception):
-
- """
- An exception when trying to find a shared library
- """
-
- pass
-
-
-class FFIEngineError(Exception):
-
- """
- An exception when trying to instantiate ctypes or cffi
- """
-
- pass
diff --git a/lib/asn1crypto/_inet.py b/lib/asn1crypto/_inet.py
deleted file mode 100644
index 045ba561cc..0000000000
--- a/lib/asn1crypto/_inet.py
+++ /dev/null
@@ -1,170 +0,0 @@
-# coding: utf-8
-from __future__ import unicode_literals, division, absolute_import, print_function
-
-import socket
-import struct
-
-from ._errors import unwrap
-from ._types import byte_cls, bytes_to_list, str_cls, type_name
-
-
-def inet_ntop(address_family, packed_ip):
- """
- Windows compatibility shim for socket.inet_ntop().
-
- :param address_family:
- socket.AF_INET for IPv4 or socket.AF_INET6 for IPv6
-
- :param packed_ip:
- A byte string of the network form of an IP address
-
- :return:
- A unicode string of the IP address
- """
-
- if address_family not in set([socket.AF_INET, socket.AF_INET6]):
- raise ValueError(unwrap(
- '''
- address_family must be socket.AF_INET (%s) or socket.AF_INET6 (%s),
- not %s
- ''',
- repr(socket.AF_INET),
- repr(socket.AF_INET6),
- repr(address_family)
- ))
-
- if not isinstance(packed_ip, byte_cls):
- raise TypeError(unwrap(
- '''
- packed_ip must be a byte string, not %s
- ''',
- type_name(packed_ip)
- ))
-
- required_len = 4 if address_family == socket.AF_INET else 16
- if len(packed_ip) != required_len:
- raise ValueError(unwrap(
- '''
- packed_ip must be %d bytes long - is %d
- ''',
- required_len,
- len(packed_ip)
- ))
-
- if address_family == socket.AF_INET:
- return '%d.%d.%d.%d' % tuple(bytes_to_list(packed_ip))
-
- octets = struct.unpack(b'!HHHHHHHH', packed_ip)
-
- runs_of_zero = {}
- longest_run = 0
- zero_index = None
- for i, octet in enumerate(octets + (-1,)):
- if octet != 0:
- if zero_index is not None:
- length = i - zero_index
- if length not in runs_of_zero:
- runs_of_zero[length] = zero_index
- longest_run = max(longest_run, length)
- zero_index = None
- elif zero_index is None:
- zero_index = i
-
- hexed = [hex(o)[2:] for o in octets]
-
- if longest_run < 2:
- return ':'.join(hexed)
-
- zero_start = runs_of_zero[longest_run]
- zero_end = zero_start + longest_run
-
- return ':'.join(hexed[:zero_start]) + '::' + ':'.join(hexed[zero_end:])
-
-
-def inet_pton(address_family, ip_string):
- """
- Windows compatibility shim for socket.inet_ntop().
-
- :param address_family:
- socket.AF_INET for IPv4 or socket.AF_INET6 for IPv6
-
- :param ip_string:
- A unicode string of an IP address
-
- :return:
- A byte string of the network form of the IP address
- """
-
- if address_family not in set([socket.AF_INET, socket.AF_INET6]):
- raise ValueError(unwrap(
- '''
- address_family must be socket.AF_INET (%s) or socket.AF_INET6 (%s),
- not %s
- ''',
- repr(socket.AF_INET),
- repr(socket.AF_INET6),
- repr(address_family)
- ))
-
- if not isinstance(ip_string, str_cls):
- raise TypeError(unwrap(
- '''
- ip_string must be a unicode string, not %s
- ''',
- type_name(ip_string)
- ))
-
- if address_family == socket.AF_INET:
- octets = ip_string.split('.')
- error = len(octets) != 4
- if not error:
- ints = []
- for o in octets:
- o = int(o)
- if o > 255 or o < 0:
- error = True
- break
- ints.append(o)
-
- if error:
- raise ValueError(unwrap(
- '''
- ip_string must be a dotted string with four integers in the
- range of 0 to 255, got %s
- ''',
- repr(ip_string)
- ))
-
- return struct.pack(b'!BBBB', *ints)
-
- error = False
- omitted = ip_string.count('::')
- if omitted > 1:
- error = True
- elif omitted == 0:
- octets = ip_string.split(':')
- error = len(octets) != 8
- else:
- begin, end = ip_string.split('::')
- begin_octets = begin.split(':')
- end_octets = end.split(':')
- missing = 8 - len(begin_octets) - len(end_octets)
- octets = begin_octets + (['0'] * missing) + end_octets
-
- if not error:
- ints = []
- for o in octets:
- o = int(o, 16)
- if o > 65535 or o < 0:
- error = True
- break
- ints.append(o)
-
- return struct.pack(b'!HHHHHHHH', *ints)
-
- raise ValueError(unwrap(
- '''
- ip_string must be a valid ipv6 string, got %s
- ''',
- repr(ip_string)
- ))
diff --git a/lib/asn1crypto/_int.py b/lib/asn1crypto/_int.py
deleted file mode 100644
index d0c23194af..0000000000
--- a/lib/asn1crypto/_int.py
+++ /dev/null
@@ -1,159 +0,0 @@
-# coding: utf-8
-
-"""
-Function for calculating the modular inverse. Exports the following items:
-
- - inverse_mod()
-
-Source code is derived from
-http://webpages.charter.net/curryfans/peter/downloads.html, but has been heavily
-modified to fit into this projects lint settings. The original project license
-is listed below:
-
-Copyright (c) 2014 Peter Pearson
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-"""
-
-from __future__ import unicode_literals, division, absolute_import, print_function
-
-import math
-import platform
-
-from .util import int_to_bytes, int_from_bytes
-
-# First try to use ctypes with OpenSSL for better performance
-try:
- from ._ffi import (
- buffer_from_bytes,
- bytes_from_buffer,
- FFIEngineError,
- LibraryNotFoundError,
- null,
- )
-
- # Some versions of PyPy have segfault issues, so we just punt on PyPy
- if platform.python_implementation() == 'PyPy':
- raise EnvironmentError()
-
- try:
- from ._perf._big_num_ctypes import libcrypto
-
- def inverse_mod(a, p):
- """
- Compute the modular inverse of a (mod p)
-
- :param a:
- An integer
-
- :param p:
- An integer
-
- :return:
- An integer
- """
-
- ctx = libcrypto.BN_CTX_new()
-
- a_bytes = int_to_bytes(abs(a))
- p_bytes = int_to_bytes(abs(p))
-
- a_buf = buffer_from_bytes(a_bytes)
- a_bn = libcrypto.BN_bin2bn(a_buf, len(a_bytes), null())
- if a < 0:
- libcrypto.BN_set_negative(a_bn, 1)
-
- p_buf = buffer_from_bytes(p_bytes)
- p_bn = libcrypto.BN_bin2bn(p_buf, len(p_bytes), null())
- if p < 0:
- libcrypto.BN_set_negative(p_bn, 1)
-
- r_bn = libcrypto.BN_mod_inverse(null(), a_bn, p_bn, ctx)
- r_len_bits = libcrypto.BN_num_bits(r_bn)
- r_len = int(math.ceil(r_len_bits / 8))
- r_buf = buffer_from_bytes(r_len)
- libcrypto.BN_bn2bin(r_bn, r_buf)
- r_bytes = bytes_from_buffer(r_buf, r_len)
- result = int_from_bytes(r_bytes)
-
- libcrypto.BN_free(a_bn)
- libcrypto.BN_free(p_bn)
- libcrypto.BN_free(r_bn)
- libcrypto.BN_CTX_free(ctx)
-
- return result
- except (LibraryNotFoundError, FFIEngineError):
- raise EnvironmentError()
-
-# If there was an issue using ctypes or OpenSSL, we fall back to pure python
-except (EnvironmentError, ImportError):
-
- def inverse_mod(a, p):
- """
- Compute the modular inverse of a (mod p)
-
- :param a:
- An integer
-
- :param p:
- An integer
-
- :return:
- An integer
- """
-
- if a < 0 or p <= a:
- a = a % p
-
- # From Ferguson and Schneier, roughly:
-
- c, d = a, p
- uc, vc, ud, vd = 1, 0, 0, 1
- while c != 0:
- q, c, d = divmod(d, c) + (c,)
- uc, vc, ud, vd = ud - q * uc, vd - q * vc, uc, vc
-
- # At this point, d is the GCD, and ud*a+vd*p = d.
- # If d == 1, this means that ud is a inverse.
-
- assert d == 1
- if ud > 0:
- return ud
- else:
- return ud + p
-
-
-def fill_width(bytes_, width):
- """
- Ensure a byte string representing a positive integer is a specific width
- (in bytes)
-
- :param bytes_:
- The integer byte string
-
- :param width:
- The desired width as an integer
-
- :return:
- A byte string of the width specified
- """
-
- while len(bytes_) < width:
- bytes_ = b'\x00' + bytes_
- return bytes_
diff --git a/lib/asn1crypto/_iri.py b/lib/asn1crypto/_iri.py
deleted file mode 100644
index 57ddd40af9..0000000000
--- a/lib/asn1crypto/_iri.py
+++ /dev/null
@@ -1,288 +0,0 @@
-# coding: utf-8
-
-"""
-Functions to convert unicode IRIs into ASCII byte string URIs and back. Exports
-the following items:
-
- - iri_to_uri()
- - uri_to_iri()
-"""
-
-from __future__ import unicode_literals, division, absolute_import, print_function
-
-from encodings import idna # noqa
-import codecs
-import re
-import sys
-
-from ._errors import unwrap
-from ._types import byte_cls, str_cls, type_name, bytes_to_list, int_types
-
-if sys.version_info < (3,):
- from urlparse import urlsplit, urlunsplit
- from urllib import (
- quote as urlquote,
- unquote as unquote_to_bytes,
- )
-
-else:
- from urllib.parse import (
- quote as urlquote,
- unquote_to_bytes,
- urlsplit,
- urlunsplit,
- )
-
-
-def iri_to_uri(value):
- """
- Normalizes and encodes a unicode IRI into an ASCII byte string URI
-
- :param value:
- A unicode string of an IRI
-
- :return:
- A byte string of the ASCII-encoded URI
- """
-
- if not isinstance(value, str_cls):
- raise TypeError(unwrap(
- '''
- value must be a unicode string, not %s
- ''',
- type_name(value)
- ))
-
- scheme = None
- # Python 2.6 doesn't split properly is the URL doesn't start with http:// or https://
- if sys.version_info < (2, 7) and not value.startswith('http://') and not value.startswith('https://'):
- real_prefix = None
- prefix_match = re.match('^[^:]*://', value)
- if prefix_match:
- real_prefix = prefix_match.group(0)
- value = 'http://' + value[len(real_prefix):]
- parsed = urlsplit(value)
- if real_prefix:
- value = real_prefix + value[7:]
- scheme = _urlquote(real_prefix[:-3])
- else:
- parsed = urlsplit(value)
-
- if scheme is None:
- scheme = _urlquote(parsed.scheme)
- hostname = parsed.hostname
- if hostname is not None:
- hostname = hostname.encode('idna')
- # RFC 3986 allows userinfo to contain sub-delims
- username = _urlquote(parsed.username, safe='!$&\'()*+,;=')
- password = _urlquote(parsed.password, safe='!$&\'()*+,;=')
- port = parsed.port
- if port is not None:
- port = str_cls(port).encode('ascii')
-
- netloc = b''
- if username is not None:
- netloc += username
- if password:
- netloc += b':' + password
- netloc += b'@'
- if hostname is not None:
- netloc += hostname
- if port is not None:
- default_http = scheme == b'http' and port == b'80'
- default_https = scheme == b'https' and port == b'443'
- if not default_http and not default_https:
- netloc += b':' + port
-
- # RFC 3986 allows a path to contain sub-delims, plus "@" and ":"
- path = _urlquote(parsed.path, safe='/!$&\'()*+,;=@:')
- # RFC 3986 allows the query to contain sub-delims, plus "@", ":" , "/" and "?"
- query = _urlquote(parsed.query, safe='/?!$&\'()*+,;=@:')
- # RFC 3986 allows the fragment to contain sub-delims, plus "@", ":" , "/" and "?"
- fragment = _urlquote(parsed.fragment, safe='/?!$&\'()*+,;=@:')
-
- if query is None and fragment is None and path == b'/':
- path = None
-
- # Python 2.7 compat
- if path is None:
- path = ''
-
- output = urlunsplit((scheme, netloc, path, query, fragment))
- if isinstance(output, str_cls):
- output = output.encode('latin1')
- return output
-
-
-def uri_to_iri(value):
- """
- Converts an ASCII URI byte string into a unicode IRI
-
- :param value:
- An ASCII-encoded byte string of the URI
-
- :return:
- A unicode string of the IRI
- """
-
- if not isinstance(value, byte_cls):
- raise TypeError(unwrap(
- '''
- value must be a byte string, not %s
- ''',
- type_name(value)
- ))
-
- parsed = urlsplit(value)
-
- scheme = parsed.scheme
- if scheme is not None:
- scheme = scheme.decode('ascii')
-
- username = _urlunquote(parsed.username, remap=[':', '@'])
- password = _urlunquote(parsed.password, remap=[':', '@'])
- hostname = parsed.hostname
- if hostname:
- hostname = hostname.decode('idna')
- port = parsed.port
- if port and not isinstance(port, int_types):
- port = port.decode('ascii')
-
- netloc = ''
- if username is not None:
- netloc += username
- if password:
- netloc += ':' + password
- netloc += '@'
- if hostname is not None:
- netloc += hostname
- if port is not None:
- netloc += ':' + str_cls(port)
-
- path = _urlunquote(parsed.path, remap=['/'], preserve=True)
- query = _urlunquote(parsed.query, remap=['&', '='], preserve=True)
- fragment = _urlunquote(parsed.fragment)
-
- return urlunsplit((scheme, netloc, path, query, fragment))
-
-
-def _iri_utf8_errors_handler(exc):
- """
- Error handler for decoding UTF-8 parts of a URI into an IRI. Leaves byte
- sequences encoded in %XX format, but as part of a unicode string.
-
- :param exc:
- The UnicodeDecodeError exception
-
- :return:
- A 2-element tuple of (replacement unicode string, integer index to
- resume at)
- """
-
- bytes_as_ints = bytes_to_list(exc.object[exc.start:exc.end])
- replacements = ['%%%02x' % num for num in bytes_as_ints]
- return (''.join(replacements), exc.end)
-
-
-codecs.register_error('iriutf8', _iri_utf8_errors_handler)
-
-
-def _urlquote(string, safe=''):
- """
- Quotes a unicode string for use in a URL
-
- :param string:
- A unicode string
-
- :param safe:
- A unicode string of character to not encode
-
- :return:
- None (if string is None) or an ASCII byte string of the quoted string
- """
-
- if string is None or string == '':
- return None
-
- # Anything already hex quoted is pulled out of the URL and unquoted if
- # possible
- escapes = []
- if re.search('%[0-9a-fA-F]{2}', string):
- # Try to unquote any percent values, restoring them if they are not
- # valid UTF-8. Also, requote any safe chars since encoded versions of
- # those are functionally different than the unquoted ones.
- def _try_unescape(match):
- byte_string = unquote_to_bytes(match.group(0))
- unicode_string = byte_string.decode('utf-8', 'iriutf8')
- for safe_char in list(safe):
- unicode_string = unicode_string.replace(safe_char, '%%%02x' % ord(safe_char))
- return unicode_string
- string = re.sub('(?:%[0-9a-fA-F]{2})+', _try_unescape, string)
-
- # Once we have the minimal set of hex quoted values, removed them from
- # the string so that they are not double quoted
- def _extract_escape(match):
- escapes.append(match.group(0).encode('ascii'))
- return '\x00'
- string = re.sub('%[0-9a-fA-F]{2}', _extract_escape, string)
-
- output = urlquote(string.encode('utf-8'), safe=safe.encode('utf-8'))
- if not isinstance(output, byte_cls):
- output = output.encode('ascii')
-
- # Restore the existing quoted values that we extracted
- if len(escapes) > 0:
- def _return_escape(_):
- return escapes.pop(0)
- output = re.sub(b'%00', _return_escape, output)
-
- return output
-
-
-def _urlunquote(byte_string, remap=None, preserve=None):
- """
- Unquotes a URI portion from a byte string into unicode using UTF-8
-
- :param byte_string:
- A byte string of the data to unquote
-
- :param remap:
- A list of characters (as unicode) that should be re-mapped to a
- %XX encoding. This is used when characters are not valid in part of a
- URL.
-
- :param preserve:
- A bool - indicates that the chars to be remapped if they occur in
- non-hex form, should be preserved. E.g. / for URL path.
-
- :return:
- A unicode string
- """
-
- if byte_string is None:
- return byte_string
-
- if byte_string == b'':
- return ''
-
- if preserve:
- replacements = ['\x1A', '\x1C', '\x1D', '\x1E', '\x1F']
- preserve_unmap = {}
- for char in remap:
- replacement = replacements.pop(0)
- preserve_unmap[replacement] = char
- byte_string = byte_string.replace(char.encode('ascii'), replacement.encode('ascii'))
-
- byte_string = unquote_to_bytes(byte_string)
-
- if remap:
- for char in remap:
- byte_string = byte_string.replace(char.encode('ascii'), ('%%%02x' % ord(char)).encode('ascii'))
-
- output = byte_string.decode('utf-8', 'iriutf8')
-
- if preserve:
- for replacement, original in preserve_unmap.items():
- output = output.replace(replacement, original)
-
- return output
diff --git a/lib/asn1crypto/_ordereddict.py b/lib/asn1crypto/_ordereddict.py
deleted file mode 100644
index 2f18ab5ae9..0000000000
--- a/lib/asn1crypto/_ordereddict.py
+++ /dev/null
@@ -1,135 +0,0 @@
-# Copyright (c) 2009 Raymond Hettinger
-#
-# Permission is hereby granted, free of charge, to any person
-# obtaining a copy of this software and associated documentation files
-# (the "Software"), to deal in the Software without restriction,
-# including without limitation the rights to use, copy, modify, merge,
-# publish, distribute, sublicense, and/or sell copies of the Software,
-# and to permit persons to whom the Software is furnished to do so,
-# subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be
-# included in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-# OTHER DEALINGS IN THE SOFTWARE.
-
-import sys
-
-if not sys.version_info < (2, 7):
-
- from collections import OrderedDict
-
-else:
-
- from UserDict import DictMixin
-
- class OrderedDict(dict, DictMixin):
-
- def __init__(self, *args, **kwds):
- if len(args) > 1:
- raise TypeError('expected at most 1 arguments, got %d' % len(args))
- try:
- self.__end
- except AttributeError:
- self.clear()
- self.update(*args, **kwds)
-
- def clear(self):
- self.__end = end = []
- end += [None, end, end] # sentinel node for doubly linked list
- self.__map = {} # key --> [key, prev, next]
- dict.clear(self)
-
- def __setitem__(self, key, value):
- if key not in self:
- end = self.__end
- curr = end[1]
- curr[2] = end[1] = self.__map[key] = [key, curr, end]
- dict.__setitem__(self, key, value)
-
- def __delitem__(self, key):
- dict.__delitem__(self, key)
- key, prev, next_ = self.__map.pop(key)
- prev[2] = next_
- next_[1] = prev
-
- def __iter__(self):
- end = self.__end
- curr = end[2]
- while curr is not end:
- yield curr[0]
- curr = curr[2]
-
- def __reversed__(self):
- end = self.__end
- curr = end[1]
- while curr is not end:
- yield curr[0]
- curr = curr[1]
-
- def popitem(self, last=True):
- if not self:
- raise KeyError('dictionary is empty')
- if last:
- key = reversed(self).next()
- else:
- key = iter(self).next()
- value = self.pop(key)
- return key, value
-
- def __reduce__(self):
- items = [[k, self[k]] for k in self]
- tmp = self.__map, self.__end
- del self.__map, self.__end
- inst_dict = vars(self).copy()
- self.__map, self.__end = tmp
- if inst_dict:
- return (self.__class__, (items,), inst_dict)
- return self.__class__, (items,)
-
- def keys(self):
- return list(self)
-
- setdefault = DictMixin.setdefault
- update = DictMixin.update
- pop = DictMixin.pop
- values = DictMixin.values
- items = DictMixin.items
- iterkeys = DictMixin.iterkeys
- itervalues = DictMixin.itervalues
- iteritems = DictMixin.iteritems
-
- def __repr__(self):
- if not self:
- return '%s()' % (self.__class__.__name__,)
- return '%s(%r)' % (self.__class__.__name__, self.items())
-
- def copy(self):
- return self.__class__(self)
-
- @classmethod
- def fromkeys(cls, iterable, value=None):
- d = cls()
- for key in iterable:
- d[key] = value
- return d
-
- def __eq__(self, other):
- if isinstance(other, OrderedDict):
- if len(self) != len(other):
- return False
- for p, q in zip(self.items(), other.items()):
- if p != q:
- return False
- return True
- return dict.__eq__(self, other)
-
- def __ne__(self, other):
- return not self == other
diff --git a/lib/asn1crypto/_perf/__init__.py b/lib/asn1crypto/_perf/__init__.py
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/lib/asn1crypto/_perf/_big_num_ctypes.py b/lib/asn1crypto/_perf/_big_num_ctypes.py
deleted file mode 100644
index 8e37e9b069..0000000000
--- a/lib/asn1crypto/_perf/_big_num_ctypes.py
+++ /dev/null
@@ -1,69 +0,0 @@
-# coding: utf-8
-
-"""
-ctypes interface for BN_mod_inverse() function from OpenSSL. Exports the
-following items:
-
- - libcrypto
- - BN_bn2bin()
- - BN_CTX_free()
- - BN_CTX_new()
- - BN_free()
- - BN_mod_inverse()
- - BN_new()
- - BN_num_bits()
- - BN_set_negative()
-
-Will raise asn1crypto._ffi.LibraryNotFoundError() if libcrypto can not be
-found. Will raise asn1crypto._ffi.FFIEngineError() if there is an error
-interfacing with libcrypto.
-"""
-
-from __future__ import unicode_literals, division, absolute_import, print_function
-
-import sys
-
-from ctypes import CDLL, c_int, c_char_p, c_void_p
-from ctypes.util import find_library
-
-from .._ffi import LibraryNotFoundError, FFIEngineError
-
-
-try:
- # On Python 2, the unicode string here may raise a UnicodeDecodeError as it
- # tries to join a bytestring path to the unicode name "crypto"
- libcrypto_path = find_library(b'crypto' if sys.version_info < (3,) else 'crypto')
- if not libcrypto_path:
- raise LibraryNotFoundError('The library libcrypto could not be found')
-
- libcrypto = CDLL(libcrypto_path)
-
- libcrypto.BN_new.argtypes = []
- libcrypto.BN_new.restype = c_void_p
-
- libcrypto.BN_bin2bn.argtypes = [c_char_p, c_int, c_void_p]
- libcrypto.BN_bin2bn.restype = c_void_p
-
- libcrypto.BN_bn2bin.argtypes = [c_void_p, c_char_p]
- libcrypto.BN_bn2bin.restype = c_int
-
- libcrypto.BN_set_negative.argtypes = [c_void_p, c_int]
- libcrypto.BN_set_negative.restype = None
-
- libcrypto.BN_num_bits.argtypes = [c_void_p]
- libcrypto.BN_num_bits.restype = c_int
-
- libcrypto.BN_free.argtypes = [c_void_p]
- libcrypto.BN_free.restype = None
-
- libcrypto.BN_CTX_new.argtypes = []
- libcrypto.BN_CTX_new.restype = c_void_p
-
- libcrypto.BN_CTX_free.argtypes = [c_void_p]
- libcrypto.BN_CTX_free.restype = None
-
- libcrypto.BN_mod_inverse.argtypes = [c_void_p, c_void_p, c_void_p, c_void_p]
- libcrypto.BN_mod_inverse.restype = c_void_p
-
-except (AttributeError):
- raise FFIEngineError('Error initializing ctypes')
diff --git a/lib/asn1crypto/_teletex_codec.py b/lib/asn1crypto/_teletex_codec.py
deleted file mode 100644
index b5991aaf1d..0000000000
--- a/lib/asn1crypto/_teletex_codec.py
+++ /dev/null
@@ -1,331 +0,0 @@
-# coding: utf-8
-
-"""
-Implementation of the teletex T.61 codec. Exports the following items:
-
- - register()
-"""
-
-from __future__ import unicode_literals, division, absolute_import, print_function
-
-import codecs
-
-
-class TeletexCodec(codecs.Codec):
-
- def encode(self, input_, errors='strict'):
- return codecs.charmap_encode(input_, errors, ENCODING_TABLE)
-
- def decode(self, input_, errors='strict'):
- return codecs.charmap_decode(input_, errors, DECODING_TABLE)
-
-
-class TeletexIncrementalEncoder(codecs.IncrementalEncoder):
-
- def encode(self, input_, final=False):
- return codecs.charmap_encode(input_, self.errors, ENCODING_TABLE)[0]
-
-
-class TeletexIncrementalDecoder(codecs.IncrementalDecoder):
-
- def decode(self, input_, final=False):
- return codecs.charmap_decode(input_, self.errors, DECODING_TABLE)[0]
-
-
-class TeletexStreamWriter(TeletexCodec, codecs.StreamWriter):
-
- pass
-
-
-class TeletexStreamReader(TeletexCodec, codecs.StreamReader):
-
- pass
-
-
-def teletex_search_function(name):
- """
- Search function for teletex codec that is passed to codecs.register()
- """
-
- if name != 'teletex':
- return None
-
- return codecs.CodecInfo(
- name='teletex',
- encode=TeletexCodec().encode,
- decode=TeletexCodec().decode,
- incrementalencoder=TeletexIncrementalEncoder,
- incrementaldecoder=TeletexIncrementalDecoder,
- streamreader=TeletexStreamReader,
- streamwriter=TeletexStreamWriter,
- )
-
-
-def register():
- """
- Registers the teletex codec
- """
-
- codecs.register(teletex_search_function)
-
-
-# http://en.wikipedia.org/wiki/ITU_T.61
-DECODING_TABLE = (
- '\u0000'
- '\u0001'
- '\u0002'
- '\u0003'
- '\u0004'
- '\u0005'
- '\u0006'
- '\u0007'
- '\u0008'
- '\u0009'
- '\u000A'
- '\u000B'
- '\u000C'
- '\u000D'
- '\u000E'
- '\u000F'
- '\u0010'
- '\u0011'
- '\u0012'
- '\u0013'
- '\u0014'
- '\u0015'
- '\u0016'
- '\u0017'
- '\u0018'
- '\u0019'
- '\u001A'
- '\u001B'
- '\u001C'
- '\u001D'
- '\u001E'
- '\u001F'
- '\u0020'
- '\u0021'
- '\u0022'
- '\ufffe'
- '\ufffe'
- '\u0025'
- '\u0026'
- '\u0027'
- '\u0028'
- '\u0029'
- '\u002A'
- '\u002B'
- '\u002C'
- '\u002D'
- '\u002E'
- '\u002F'
- '\u0030'
- '\u0031'
- '\u0032'
- '\u0033'
- '\u0034'
- '\u0035'
- '\u0036'
- '\u0037'
- '\u0038'
- '\u0039'
- '\u003A'
- '\u003B'
- '\u003C'
- '\u003D'
- '\u003E'
- '\u003F'
- '\u0040'
- '\u0041'
- '\u0042'
- '\u0043'
- '\u0044'
- '\u0045'
- '\u0046'
- '\u0047'
- '\u0048'
- '\u0049'
- '\u004A'
- '\u004B'
- '\u004C'
- '\u004D'
- '\u004E'
- '\u004F'
- '\u0050'
- '\u0051'
- '\u0052'
- '\u0053'
- '\u0054'
- '\u0055'
- '\u0056'
- '\u0057'
- '\u0058'
- '\u0059'
- '\u005A'
- '\u005B'
- '\ufffe'
- '\u005D'
- '\ufffe'
- '\u005F'
- '\ufffe'
- '\u0061'
- '\u0062'
- '\u0063'
- '\u0064'
- '\u0065'
- '\u0066'
- '\u0067'
- '\u0068'
- '\u0069'
- '\u006A'
- '\u006B'
- '\u006C'
- '\u006D'
- '\u006E'
- '\u006F'
- '\u0070'
- '\u0071'
- '\u0072'
- '\u0073'
- '\u0074'
- '\u0075'
- '\u0076'
- '\u0077'
- '\u0078'
- '\u0079'
- '\u007A'
- '\ufffe'
- '\u007C'
- '\ufffe'
- '\ufffe'
- '\u007F'
- '\u0080'
- '\u0081'
- '\u0082'
- '\u0083'
- '\u0084'
- '\u0085'
- '\u0086'
- '\u0087'
- '\u0088'
- '\u0089'
- '\u008A'
- '\u008B'
- '\u008C'
- '\u008D'
- '\u008E'
- '\u008F'
- '\u0090'
- '\u0091'
- '\u0092'
- '\u0093'
- '\u0094'
- '\u0095'
- '\u0096'
- '\u0097'
- '\u0098'
- '\u0099'
- '\u009A'
- '\u009B'
- '\u009C'
- '\u009D'
- '\u009E'
- '\u009F'
- '\u00A0'
- '\u00A1'
- '\u00A2'
- '\u00A3'
- '\u0024'
- '\u00A5'
- '\u0023'
- '\u00A7'
- '\u00A4'
- '\ufffe'
- '\ufffe'
- '\u00AB'
- '\ufffe'
- '\ufffe'
- '\ufffe'
- '\ufffe'
- '\u00B0'
- '\u00B1'
- '\u00B2'
- '\u00B3'
- '\u00D7'
- '\u00B5'
- '\u00B6'
- '\u00B7'
- '\u00F7'
- '\ufffe'
- '\ufffe'
- '\u00BB'
- '\u00BC'
- '\u00BD'
- '\u00BE'
- '\u00BF'
- '\ufffe'
- '\u0300'
- '\u0301'
- '\u0302'
- '\u0303'
- '\u0304'
- '\u0306'
- '\u0307'
- '\u0308'
- '\ufffe'
- '\u030A'
- '\u0327'
- '\u0332'
- '\u030B'
- '\u0328'
- '\u030C'
- '\ufffe'
- '\ufffe'
- '\ufffe'
- '\ufffe'
- '\ufffe'
- '\ufffe'
- '\ufffe'
- '\ufffe'
- '\ufffe'
- '\ufffe'
- '\ufffe'
- '\ufffe'
- '\ufffe'
- '\ufffe'
- '\ufffe'
- '\ufffe'
- '\u2126'
- '\u00C6'
- '\u00D0'
- '\u00AA'
- '\u0126'
- '\ufffe'
- '\u0132'
- '\u013F'
- '\u0141'
- '\u00D8'
- '\u0152'
- '\u00BA'
- '\u00DE'
- '\u0166'
- '\u014A'
- '\u0149'
- '\u0138'
- '\u00E6'
- '\u0111'
- '\u00F0'
- '\u0127'
- '\u0131'
- '\u0133'
- '\u0140'
- '\u0142'
- '\u00F8'
- '\u0153'
- '\u00DF'
- '\u00FE'
- '\u0167'
- '\u014B'
- '\ufffe'
-)
-ENCODING_TABLE = codecs.charmap_build(DECODING_TABLE)
diff --git a/lib/asn1crypto/_types.py b/lib/asn1crypto/_types.py
deleted file mode 100644
index b9ca8cc79b..0000000000
--- a/lib/asn1crypto/_types.py
+++ /dev/null
@@ -1,46 +0,0 @@
-# coding: utf-8
-from __future__ import unicode_literals, division, absolute_import, print_function
-
-import inspect
-import sys
-
-
-if sys.version_info < (3,):
- str_cls = unicode # noqa
- byte_cls = str
- int_types = (int, long) # noqa
-
- def bytes_to_list(byte_string):
- return [ord(b) for b in byte_string]
-
- chr_cls = chr
-
-else:
- str_cls = str
- byte_cls = bytes
- int_types = int
-
- bytes_to_list = list
-
- def chr_cls(num):
- return bytes([num])
-
-
-def type_name(value):
- """
- Returns a user-readable name for the type of an object
-
- :param value:
- A value to get the type name of
-
- :return:
- A unicode string of the object's type name
- """
-
- if inspect.isclass(value):
- cls = value
- else:
- cls = value.__class__
- if cls.__module__ in set(['builtins', '__builtin__']):
- return cls.__name__
- return '%s.%s' % (cls.__module__, cls.__name__)
diff --git a/lib/asn1crypto/algos.py b/lib/asn1crypto/algos.py
deleted file mode 100644
index c805433a7f..0000000000
--- a/lib/asn1crypto/algos.py
+++ /dev/null
@@ -1,1143 +0,0 @@
-# coding: utf-8
-
-"""
-ASN.1 type classes for various algorithms using in various aspects of public
-key cryptography. Exports the following items:
-
- - AlgorithmIdentifier()
- - AnyAlgorithmIdentifier()
- - DigestAlgorithm()
- - DigestInfo()
- - DSASignature()
- - EncryptionAlgorithm()
- - HmacAlgorithm()
- - KdfAlgorithm()
- - Pkcs5MacAlgorithm()
- - SignedDigestAlgorithm()
-
-Other type classes are defined that help compose the types listed above.
-"""
-
-from __future__ import unicode_literals, division, absolute_import, print_function
-
-from ._errors import unwrap
-from ._int import fill_width
-from .util import int_from_bytes, int_to_bytes
-from .core import (
- Any,
- Choice,
- Integer,
- Null,
- ObjectIdentifier,
- OctetString,
- Sequence,
- Void,
-)
-
-
-# Structures and OIDs in this file are pulled from
-# https://tools.ietf.org/html/rfc3279, https://tools.ietf.org/html/rfc4055,
-# https://tools.ietf.org/html/rfc5758, https://tools.ietf.org/html/rfc7292,
-# http://www.emc.com/collateral/white-papers/h11302-pkcs5v2-1-password-based-cryptography-standard-wp.pdf
-
-class AlgorithmIdentifier(Sequence):
- _fields = [
- ('algorithm', ObjectIdentifier),
- ('parameters', Any, {'optional': True}),
- ]
-
-
-class _ForceNullParameters(object):
- """
- Various structures based on AlgorithmIdentifier require that the parameters
- field be core.Null() for certain OIDs. This mixin ensures that happens.
- """
-
- # The following attribute, plus the parameters spec callback and custom
- # __setitem__ are all to handle a situation where parameters should not be
- # optional and must be Null for certain OIDs. More info at
- # https://tools.ietf.org/html/rfc4055#page-15 and
- # https://tools.ietf.org/html/rfc4055#section-2.1
- _null_algos = set([
- '1.2.840.113549.1.1.1', # rsassa_pkcs1v15 / rsaes_pkcs1v15 / rsa
- '1.2.840.113549.1.1.11', # sha256_rsa
- '1.2.840.113549.1.1.12', # sha384_rsa
- '1.2.840.113549.1.1.13', # sha512_rsa
- '1.2.840.113549.1.1.14', # sha224_rsa
- '1.3.14.3.2.26', # sha1
- '2.16.840.1.101.3.4.2.4', # sha224
- '2.16.840.1.101.3.4.2.1', # sha256
- '2.16.840.1.101.3.4.2.2', # sha384
- '2.16.840.1.101.3.4.2.3', # sha512
- ])
-
- def _parameters_spec(self):
- if self._oid_pair == ('algorithm', 'parameters'):
- algo = self['algorithm'].native
- if algo in self._oid_specs:
- return self._oid_specs[algo]
-
- if self['algorithm'].dotted in self._null_algos:
- return Null
-
- return None
-
- _spec_callbacks = {
- 'parameters': _parameters_spec
- }
-
- # We have to override this since the spec callback uses the value of
- # algorithm to determine the parameter spec, however default values are
- # assigned before setting a field, so a default value can't be based on
- # another field value (unless it is a default also). Thus we have to
- # manually check to see if the algorithm was set and parameters is unset,
- # and then fix the value as appropriate.
- def __setitem__(self, key, value):
- res = super(_ForceNullParameters, self).__setitem__(key, value)
- if key != 'algorithm':
- return res
- if self['algorithm'].dotted not in self._null_algos:
- return res
- if self['parameters'].__class__ != Void:
- return res
- self['parameters'] = Null()
- return res
-
-
-class HmacAlgorithmId(ObjectIdentifier):
- _map = {
- '1.3.14.3.2.10': 'des_mac',
- '1.2.840.113549.2.7': 'sha1',
- '1.2.840.113549.2.8': 'sha224',
- '1.2.840.113549.2.9': 'sha256',
- '1.2.840.113549.2.10': 'sha384',
- '1.2.840.113549.2.11': 'sha512',
- '1.2.840.113549.2.12': 'sha512_224',
- '1.2.840.113549.2.13': 'sha512_256',
- }
-
-
-class HmacAlgorithm(Sequence):
- _fields = [
- ('algorithm', HmacAlgorithmId),
- ('parameters', Any, {'optional': True}),
- ]
-
-
-class DigestAlgorithmId(ObjectIdentifier):
- _map = {
- '1.2.840.113549.2.2': 'md2',
- '1.2.840.113549.2.5': 'md5',
- '1.3.14.3.2.26': 'sha1',
- '2.16.840.1.101.3.4.2.4': 'sha224',
- '2.16.840.1.101.3.4.2.1': 'sha256',
- '2.16.840.1.101.3.4.2.2': 'sha384',
- '2.16.840.1.101.3.4.2.3': 'sha512',
- '2.16.840.1.101.3.4.2.5': 'sha512_224',
- '2.16.840.1.101.3.4.2.6': 'sha512_256',
- }
-
-
-class DigestAlgorithm(_ForceNullParameters, Sequence):
- _fields = [
- ('algorithm', DigestAlgorithmId),
- ('parameters', Any, {'optional': True}),
- ]
-
-
-# This structure is what is signed with a SignedDigestAlgorithm
-class DigestInfo(Sequence):
- _fields = [
- ('digest_algorithm', DigestAlgorithm),
- ('digest', OctetString),
- ]
-
-
-class MaskGenAlgorithmId(ObjectIdentifier):
- _map = {
- '1.2.840.113549.1.1.8': 'mgf1',
- }
-
-
-class MaskGenAlgorithm(Sequence):
- _fields = [
- ('algorithm', MaskGenAlgorithmId),
- ('parameters', Any, {'optional': True}),
- ]
-
- _oid_pair = ('algorithm', 'parameters')
- _oid_specs = {
- 'mgf1': DigestAlgorithm
- }
-
-
-class TrailerField(Integer):
- _map = {
- 1: 'trailer_field_bc',
- }
-
-
-class RSASSAPSSParams(Sequence):
- _fields = [
- (
- 'hash_algorithm',
- DigestAlgorithm,
- {
- 'explicit': 0,
- 'default': {'algorithm': 'sha1'},
- }
- ),
- (
- 'mask_gen_algorithm',
- MaskGenAlgorithm,
- {
- 'explicit': 1,
- 'default': {
- 'algorithm': 'mgf1',
- 'parameters': {'algorithm': 'sha1'},
- },
- }
- ),
- (
- 'salt_length',
- Integer,
- {
- 'explicit': 2,
- 'default': 20,
- }
- ),
- (
- 'trailer_field',
- TrailerField,
- {
- 'explicit': 3,
- 'default': 'trailer_field_bc',
- }
- ),
- ]
-
-
-class SignedDigestAlgorithmId(ObjectIdentifier):
- _map = {
- '1.3.14.3.2.3': 'md5_rsa',
- '1.3.14.3.2.29': 'sha1_rsa',
- '1.3.14.7.2.3.1': 'md2_rsa',
- '1.2.840.113549.1.1.2': 'md2_rsa',
- '1.2.840.113549.1.1.4': 'md5_rsa',
- '1.2.840.113549.1.1.5': 'sha1_rsa',
- '1.2.840.113549.1.1.14': 'sha224_rsa',
- '1.2.840.113549.1.1.11': 'sha256_rsa',
- '1.2.840.113549.1.1.12': 'sha384_rsa',
- '1.2.840.113549.1.1.13': 'sha512_rsa',
- '1.2.840.113549.1.1.10': 'rsassa_pss',
- '1.2.840.10040.4.3': 'sha1_dsa',
- '1.3.14.3.2.13': 'sha1_dsa',
- '1.3.14.3.2.27': 'sha1_dsa',
- '2.16.840.1.101.3.4.3.1': 'sha224_dsa',
- '2.16.840.1.101.3.4.3.2': 'sha256_dsa',
- '1.2.840.10045.4.1': 'sha1_ecdsa',
- '1.2.840.10045.4.3.1': 'sha224_ecdsa',
- '1.2.840.10045.4.3.2': 'sha256_ecdsa',
- '1.2.840.10045.4.3.3': 'sha384_ecdsa',
- '1.2.840.10045.4.3.4': 'sha512_ecdsa',
- # For when the digest is specified elsewhere in a Sequence
- '1.2.840.113549.1.1.1': 'rsassa_pkcs1v15',
- '1.2.840.10040.4.1': 'dsa',
- '1.2.840.10045.4': 'ecdsa',
- }
-
- _reverse_map = {
- 'dsa': '1.2.840.10040.4.1',
- 'ecdsa': '1.2.840.10045.4',
- 'md2_rsa': '1.2.840.113549.1.1.2',
- 'md5_rsa': '1.2.840.113549.1.1.4',
- 'rsassa_pkcs1v15': '1.2.840.113549.1.1.1',
- 'rsassa_pss': '1.2.840.113549.1.1.10',
- 'sha1_dsa': '1.2.840.10040.4.3',
- 'sha1_ecdsa': '1.2.840.10045.4.1',
- 'sha1_rsa': '1.2.840.113549.1.1.5',
- 'sha224_dsa': '2.16.840.1.101.3.4.3.1',
- 'sha224_ecdsa': '1.2.840.10045.4.3.1',
- 'sha224_rsa': '1.2.840.113549.1.1.14',
- 'sha256_dsa': '2.16.840.1.101.3.4.3.2',
- 'sha256_ecdsa': '1.2.840.10045.4.3.2',
- 'sha256_rsa': '1.2.840.113549.1.1.11',
- 'sha384_ecdsa': '1.2.840.10045.4.3.3',
- 'sha384_rsa': '1.2.840.113549.1.1.12',
- 'sha512_ecdsa': '1.2.840.10045.4.3.4',
- 'sha512_rsa': '1.2.840.113549.1.1.13',
- }
-
-
-class SignedDigestAlgorithm(_ForceNullParameters, Sequence):
- _fields = [
- ('algorithm', SignedDigestAlgorithmId),
- ('parameters', Any, {'optional': True}),
- ]
-
- _oid_pair = ('algorithm', 'parameters')
- _oid_specs = {
- 'rsassa_pss': RSASSAPSSParams,
- }
-
- @property
- def signature_algo(self):
- """
- :return:
- A unicode string of "rsassa_pkcs1v15", "rsassa_pss", "dsa" or
- "ecdsa"
- """
-
- algorithm = self['algorithm'].native
-
- algo_map = {
- 'md2_rsa': 'rsassa_pkcs1v15',
- 'md5_rsa': 'rsassa_pkcs1v15',
- 'sha1_rsa': 'rsassa_pkcs1v15',
- 'sha224_rsa': 'rsassa_pkcs1v15',
- 'sha256_rsa': 'rsassa_pkcs1v15',
- 'sha384_rsa': 'rsassa_pkcs1v15',
- 'sha512_rsa': 'rsassa_pkcs1v15',
- 'rsassa_pkcs1v15': 'rsassa_pkcs1v15',
- 'rsassa_pss': 'rsassa_pss',
- 'sha1_dsa': 'dsa',
- 'sha224_dsa': 'dsa',
- 'sha256_dsa': 'dsa',
- 'dsa': 'dsa',
- 'sha1_ecdsa': 'ecdsa',
- 'sha224_ecdsa': 'ecdsa',
- 'sha256_ecdsa': 'ecdsa',
- 'sha384_ecdsa': 'ecdsa',
- 'sha512_ecdsa': 'ecdsa',
- 'ecdsa': 'ecdsa',
- }
- if algorithm in algo_map:
- return algo_map[algorithm]
-
- raise ValueError(unwrap(
- '''
- Signature algorithm not known for %s
- ''',
- algorithm
- ))
-
- @property
- def hash_algo(self):
- """
- :return:
- A unicode string of "md2", "md5", "sha1", "sha224", "sha256",
- "sha384", "sha512", "sha512_224", "sha512_256"
- """
-
- algorithm = self['algorithm'].native
-
- algo_map = {
- 'md2_rsa': 'md2',
- 'md5_rsa': 'md5',
- 'sha1_rsa': 'sha1',
- 'sha224_rsa': 'sha224',
- 'sha256_rsa': 'sha256',
- 'sha384_rsa': 'sha384',
- 'sha512_rsa': 'sha512',
- 'sha1_dsa': 'sha1',
- 'sha224_dsa': 'sha224',
- 'sha256_dsa': 'sha256',
- 'sha1_ecdsa': 'sha1',
- 'sha224_ecdsa': 'sha224',
- 'sha256_ecdsa': 'sha256',
- 'sha384_ecdsa': 'sha384',
- 'sha512_ecdsa': 'sha512',
- }
- if algorithm in algo_map:
- return algo_map[algorithm]
-
- if algorithm == 'rsassa_pss':
- return self['parameters']['hash_algorithm']['algorithm'].native
-
- raise ValueError(unwrap(
- '''
- Hash algorithm not known for %s
- ''',
- algorithm
- ))
-
-
-class Pbkdf2Salt(Choice):
- _alternatives = [
- ('specified', OctetString),
- ('other_source', AlgorithmIdentifier),
- ]
-
-
-class Pbkdf2Params(Sequence):
- _fields = [
- ('salt', Pbkdf2Salt),
- ('iteration_count', Integer),
- ('key_length', Integer, {'optional': True}),
- ('prf', HmacAlgorithm, {'default': {'algorithm': 'sha1'}}),
- ]
-
-
-class KdfAlgorithmId(ObjectIdentifier):
- _map = {
- '1.2.840.113549.1.5.12': 'pbkdf2'
- }
-
-
-class KdfAlgorithm(Sequence):
- _fields = [
- ('algorithm', KdfAlgorithmId),
- ('parameters', Any, {'optional': True}),
- ]
- _oid_pair = ('algorithm', 'parameters')
- _oid_specs = {
- 'pbkdf2': Pbkdf2Params
- }
-
-
-class DHParameters(Sequence):
- """
- Original Name: DHParameter
- Source: ftp://ftp.rsasecurity.com/pub/pkcs/ascii/pkcs-3.asc section 9
- """
-
- _fields = [
- ('p', Integer),
- ('g', Integer),
- ('private_value_length', Integer, {'optional': True}),
- ]
-
-
-class KeyExchangeAlgorithmId(ObjectIdentifier):
- _map = {
- '1.2.840.113549.1.3.1': 'dh',
- }
-
-
-class KeyExchangeAlgorithm(Sequence):
- _fields = [
- ('algorithm', KeyExchangeAlgorithmId),
- ('parameters', Any, {'optional': True}),
- ]
- _oid_pair = ('algorithm', 'parameters')
- _oid_specs = {
- 'dh': DHParameters,
- }
-
-
-class Rc2Params(Sequence):
- _fields = [
- ('rc2_parameter_version', Integer, {'optional': True}),
- ('iv', OctetString),
- ]
-
-
-class Rc5ParamVersion(Integer):
- _map = {
- 16: 'v1-0'
- }
-
-
-class Rc5Params(Sequence):
- _fields = [
- ('version', Rc5ParamVersion),
- ('rounds', Integer),
- ('block_size_in_bits', Integer),
- ('iv', OctetString, {'optional': True}),
- ]
-
-
-class Pbes1Params(Sequence):
- _fields = [
- ('salt', OctetString),
- ('iterations', Integer),
- ]
-
-
-class PSourceAlgorithmId(ObjectIdentifier):
- _map = {
- '1.2.840.113549.1.1.9': 'p_specified',
- }
-
-
-class PSourceAlgorithm(Sequence):
- _fields = [
- ('algorithm', PSourceAlgorithmId),
- ('parameters', Any, {'optional': True}),
- ]
-
- _oid_pair = ('algorithm', 'parameters')
- _oid_specs = {
- 'p_specified': OctetString
- }
-
-
-class RSAESOAEPParams(Sequence):
- _fields = [
- (
- 'hash_algorithm',
- DigestAlgorithm,
- {
- 'explicit': 0,
- 'default': {'algorithm': 'sha1'}
- }
- ),
- (
- 'mask_gen_algorithm',
- MaskGenAlgorithm,
- {
- 'explicit': 1,
- 'default': {
- 'algorithm': 'mgf1',
- 'parameters': {'algorithm': 'sha1'}
- }
- }
- ),
- (
- 'p_source_algorithm',
- PSourceAlgorithm,
- {
- 'explicit': 2,
- 'default': {
- 'algorithm': 'p_specified',
- 'parameters': b''
- }
- }
- ),
- ]
-
-
-class DSASignature(Sequence):
- """
- An ASN.1 class for translating between the OS crypto library's
- representation of an (EC)DSA signature and the ASN.1 structure that is part
- of various RFCs.
-
- Original Name: DSS-Sig-Value
- Source: https://tools.ietf.org/html/rfc3279#section-2.2.2
- """
-
- _fields = [
- ('r', Integer),
- ('s', Integer),
- ]
-
- @classmethod
- def from_p1363(cls, data):
- """
- Reads a signature from a byte string encoding accordint to IEEE P1363,
- which is used by Microsoft's BCryptSignHash() function.
-
- :param data:
- A byte string from BCryptSignHash()
-
- :return:
- A DSASignature object
- """
-
- r = int_from_bytes(data[0:len(data) // 2])
- s = int_from_bytes(data[len(data) // 2:])
- return cls({'r': r, 's': s})
-
- def to_p1363(self):
- """
- Dumps a signature to a byte string compatible with Microsoft's
- BCryptVerifySignature() function.
-
- :return:
- A byte string compatible with BCryptVerifySignature()
- """
-
- r_bytes = int_to_bytes(self['r'].native)
- s_bytes = int_to_bytes(self['s'].native)
-
- int_byte_length = max(len(r_bytes), len(s_bytes))
- r_bytes = fill_width(r_bytes, int_byte_length)
- s_bytes = fill_width(s_bytes, int_byte_length)
-
- return r_bytes + s_bytes
-
-
-class EncryptionAlgorithmId(ObjectIdentifier):
- _map = {
- '1.3.14.3.2.7': 'des',
- '1.2.840.113549.3.7': 'tripledes_3key',
- '1.2.840.113549.3.2': 'rc2',
- '1.2.840.113549.3.9': 'rc5',
- # From http://csrc.nist.gov/groups/ST/crypto_apps_infra/csor/algorithms.html#AES
- '2.16.840.1.101.3.4.1.1': 'aes128_ecb',
- '2.16.840.1.101.3.4.1.2': 'aes128_cbc',
- '2.16.840.1.101.3.4.1.3': 'aes128_ofb',
- '2.16.840.1.101.3.4.1.4': 'aes128_cfb',
- '2.16.840.1.101.3.4.1.5': 'aes128_wrap',
- '2.16.840.1.101.3.4.1.6': 'aes128_gcm',
- '2.16.840.1.101.3.4.1.7': 'aes128_ccm',
- '2.16.840.1.101.3.4.1.8': 'aes128_wrap_pad',
- '2.16.840.1.101.3.4.1.21': 'aes192_ecb',
- '2.16.840.1.101.3.4.1.22': 'aes192_cbc',
- '2.16.840.1.101.3.4.1.23': 'aes192_ofb',
- '2.16.840.1.101.3.4.1.24': 'aes192_cfb',
- '2.16.840.1.101.3.4.1.25': 'aes192_wrap',
- '2.16.840.1.101.3.4.1.26': 'aes192_gcm',
- '2.16.840.1.101.3.4.1.27': 'aes192_ccm',
- '2.16.840.1.101.3.4.1.28': 'aes192_wrap_pad',
- '2.16.840.1.101.3.4.1.41': 'aes256_ecb',
- '2.16.840.1.101.3.4.1.42': 'aes256_cbc',
- '2.16.840.1.101.3.4.1.43': 'aes256_ofb',
- '2.16.840.1.101.3.4.1.44': 'aes256_cfb',
- '2.16.840.1.101.3.4.1.45': 'aes256_wrap',
- '2.16.840.1.101.3.4.1.46': 'aes256_gcm',
- '2.16.840.1.101.3.4.1.47': 'aes256_ccm',
- '2.16.840.1.101.3.4.1.48': 'aes256_wrap_pad',
- # From PKCS#5
- '1.2.840.113549.1.5.13': 'pbes2',
- '1.2.840.113549.1.5.1': 'pbes1_md2_des',
- '1.2.840.113549.1.5.3': 'pbes1_md5_des',
- '1.2.840.113549.1.5.4': 'pbes1_md2_rc2',
- '1.2.840.113549.1.5.6': 'pbes1_md5_rc2',
- '1.2.840.113549.1.5.10': 'pbes1_sha1_des',
- '1.2.840.113549.1.5.11': 'pbes1_sha1_rc2',
- # From PKCS#12
- '1.2.840.113549.1.12.1.1': 'pkcs12_sha1_rc4_128',
- '1.2.840.113549.1.12.1.2': 'pkcs12_sha1_rc4_40',
- '1.2.840.113549.1.12.1.3': 'pkcs12_sha1_tripledes_3key',
- '1.2.840.113549.1.12.1.4': 'pkcs12_sha1_tripledes_2key',
- '1.2.840.113549.1.12.1.5': 'pkcs12_sha1_rc2_128',
- '1.2.840.113549.1.12.1.6': 'pkcs12_sha1_rc2_40',
- # PKCS#1 v2.2
- '1.2.840.113549.1.1.1': 'rsaes_pkcs1v15',
- '1.2.840.113549.1.1.7': 'rsaes_oaep',
- }
-
-
-class EncryptionAlgorithm(_ForceNullParameters, Sequence):
- _fields = [
- ('algorithm', EncryptionAlgorithmId),
- ('parameters', Any, {'optional': True}),
- ]
-
- _oid_pair = ('algorithm', 'parameters')
- _oid_specs = {
- 'des': OctetString,
- 'tripledes_3key': OctetString,
- 'rc2': Rc2Params,
- 'rc5': Rc5Params,
- 'aes128_cbc': OctetString,
- 'aes192_cbc': OctetString,
- 'aes256_cbc': OctetString,
- 'aes128_ofb': OctetString,
- 'aes192_ofb': OctetString,
- 'aes256_ofb': OctetString,
- # From PKCS#5
- 'pbes1_md2_des': Pbes1Params,
- 'pbes1_md5_des': Pbes1Params,
- 'pbes1_md2_rc2': Pbes1Params,
- 'pbes1_md5_rc2': Pbes1Params,
- 'pbes1_sha1_des': Pbes1Params,
- 'pbes1_sha1_rc2': Pbes1Params,
- # From PKCS#12
- 'pkcs12_sha1_rc4_128': Pbes1Params,
- 'pkcs12_sha1_rc4_40': Pbes1Params,
- 'pkcs12_sha1_tripledes_3key': Pbes1Params,
- 'pkcs12_sha1_tripledes_2key': Pbes1Params,
- 'pkcs12_sha1_rc2_128': Pbes1Params,
- 'pkcs12_sha1_rc2_40': Pbes1Params,
- # PKCS#1 v2.2
- 'rsaes_oaep': RSAESOAEPParams,
- }
-
- @property
- def kdf(self):
- """
- Returns the name of the key derivation function to use.
-
- :return:
- A unicode from of one of the following: "pbkdf1", "pbkdf2",
- "pkcs12_kdf"
- """
-
- encryption_algo = self['algorithm'].native
-
- if encryption_algo == 'pbes2':
- return self['parameters']['key_derivation_func']['algorithm'].native
-
- if encryption_algo.find('.') == -1:
- if encryption_algo.find('_') != -1:
- encryption_algo, _ = encryption_algo.split('_', 1)
-
- if encryption_algo == 'pbes1':
- return 'pbkdf1'
-
- if encryption_algo == 'pkcs12':
- return 'pkcs12_kdf'
-
- raise ValueError(unwrap(
- '''
- Encryption algorithm "%s" does not have a registered key
- derivation function
- ''',
- encryption_algo
- ))
-
- raise ValueError(unwrap(
- '''
- Unrecognized encryption algorithm "%s", can not determine key
- derivation function
- ''',
- encryption_algo
- ))
-
- @property
- def kdf_hmac(self):
- """
- Returns the HMAC algorithm to use with the KDF.
-
- :return:
- A unicode string of one of the following: "md2", "md5", "sha1",
- "sha224", "sha256", "sha384", "sha512"
- """
-
- encryption_algo = self['algorithm'].native
-
- if encryption_algo == 'pbes2':
- return self['parameters']['key_derivation_func']['parameters']['prf']['algorithm'].native
-
- if encryption_algo.find('.') == -1:
- if encryption_algo.find('_') != -1:
- _, hmac_algo, _ = encryption_algo.split('_', 2)
- return hmac_algo
-
- raise ValueError(unwrap(
- '''
- Encryption algorithm "%s" does not have a registered key
- derivation function
- ''',
- encryption_algo
- ))
-
- raise ValueError(unwrap(
- '''
- Unrecognized encryption algorithm "%s", can not determine key
- derivation hmac algorithm
- ''',
- encryption_algo
- ))
-
- @property
- def kdf_salt(self):
- """
- Returns the byte string to use as the salt for the KDF.
-
- :return:
- A byte string
- """
-
- encryption_algo = self['algorithm'].native
-
- if encryption_algo == 'pbes2':
- salt = self['parameters']['key_derivation_func']['parameters']['salt']
-
- if salt.name == 'other_source':
- raise ValueError(unwrap(
- '''
- Can not determine key derivation salt - the
- reserved-for-future-use other source salt choice was
- specified in the PBKDF2 params structure
- '''
- ))
-
- return salt.native
-
- if encryption_algo.find('.') == -1:
- if encryption_algo.find('_') != -1:
- return self['parameters']['salt'].native
-
- raise ValueError(unwrap(
- '''
- Encryption algorithm "%s" does not have a registered key
- derivation function
- ''',
- encryption_algo
- ))
-
- raise ValueError(unwrap(
- '''
- Unrecognized encryption algorithm "%s", can not determine key
- derivation salt
- ''',
- encryption_algo
- ))
-
- @property
- def kdf_iterations(self):
- """
- Returns the number of iterations that should be run via the KDF.
-
- :return:
- An integer
- """
-
- encryption_algo = self['algorithm'].native
-
- if encryption_algo == 'pbes2':
- return self['parameters']['key_derivation_func']['parameters']['iteration_count'].native
-
- if encryption_algo.find('.') == -1:
- if encryption_algo.find('_') != -1:
- return self['parameters']['iterations'].native
-
- raise ValueError(unwrap(
- '''
- Encryption algorithm "%s" does not have a registered key
- derivation function
- ''',
- encryption_algo
- ))
-
- raise ValueError(unwrap(
- '''
- Unrecognized encryption algorithm "%s", can not determine key
- derivation iterations
- ''',
- encryption_algo
- ))
-
- @property
- def key_length(self):
- """
- Returns the key length to pass to the cipher/kdf. The PKCS#5 spec does
- not specify a way to store the RC5 key length, however this tends not
- to be a problem since OpenSSL does not support RC5 in PKCS#8 and OS X
- does not provide an RC5 cipher for use in the Security Transforms
- library.
-
- :raises:
- ValueError - when the key length can not be determined
-
- :return:
- An integer representing the length in bytes
- """
-
- encryption_algo = self['algorithm'].native
-
- if encryption_algo[0:3] == 'aes':
- return {
- 'aes128_': 16,
- 'aes192_': 24,
- 'aes256_': 32,
- }[encryption_algo[0:7]]
-
- cipher_lengths = {
- 'des': 8,
- 'tripledes_3key': 24,
- }
-
- if encryption_algo in cipher_lengths:
- return cipher_lengths[encryption_algo]
-
- if encryption_algo == 'rc2':
- rc2_params = self['parameters'].parsed['encryption_scheme']['parameters'].parsed
- rc2_parameter_version = rc2_params['rc2_parameter_version'].native
-
- # See page 24 of
- # http://www.emc.com/collateral/white-papers/h11302-pkcs5v2-1-password-based-cryptography-standard-wp.pdf
- encoded_key_bits_map = {
- 160: 5, # 40-bit
- 120: 8, # 64-bit
- 58: 16, # 128-bit
- }
-
- if rc2_parameter_version in encoded_key_bits_map:
- return encoded_key_bits_map[rc2_parameter_version]
-
- if rc2_parameter_version >= 256:
- return rc2_parameter_version
-
- if rc2_parameter_version is None:
- return 4 # 32-bit default
-
- raise ValueError(unwrap(
- '''
- Invalid RC2 parameter version found in EncryptionAlgorithm
- parameters
- '''
- ))
-
- if encryption_algo == 'pbes2':
- key_length = self['parameters']['key_derivation_func']['parameters']['key_length'].native
- if key_length is not None:
- return key_length
-
- # If the KDF params don't specify the key size, we can infer it from
- # the encryption scheme for all schemes except for RC5. However, in
- # practical terms, neither OpenSSL or OS X support RC5 for PKCS#8
- # so it is unlikely to be an issue that is run into.
-
- return self['parameters']['encryption_scheme'].key_length
-
- if encryption_algo.find('.') == -1:
- return {
- 'pbes1_md2_des': 8,
- 'pbes1_md5_des': 8,
- 'pbes1_md2_rc2': 8,
- 'pbes1_md5_rc2': 8,
- 'pbes1_sha1_des': 8,
- 'pbes1_sha1_rc2': 8,
- 'pkcs12_sha1_rc4_128': 16,
- 'pkcs12_sha1_rc4_40': 5,
- 'pkcs12_sha1_tripledes_3key': 24,
- 'pkcs12_sha1_tripledes_2key': 16,
- 'pkcs12_sha1_rc2_128': 16,
- 'pkcs12_sha1_rc2_40': 5,
- }[encryption_algo]
-
- raise ValueError(unwrap(
- '''
- Unrecognized encryption algorithm "%s"
- ''',
- encryption_algo
- ))
-
- @property
- def encryption_mode(self):
- """
- Returns the name of the encryption mode to use.
-
- :return:
- A unicode string from one of the following: "cbc", "ecb", "ofb",
- "cfb", "wrap", "gcm", "ccm", "wrap_pad"
- """
-
- encryption_algo = self['algorithm'].native
-
- if encryption_algo[0:7] in set(['aes128_', 'aes192_', 'aes256_']):
- return encryption_algo[7:]
-
- if encryption_algo[0:6] == 'pbes1_':
- return 'cbc'
-
- if encryption_algo[0:7] == 'pkcs12_':
- return 'cbc'
-
- if encryption_algo in set(['des', 'tripledes_3key', 'rc2', 'rc5']):
- return 'cbc'
-
- if encryption_algo == 'pbes2':
- return self['parameters']['encryption_scheme'].encryption_mode
-
- raise ValueError(unwrap(
- '''
- Unrecognized encryption algorithm "%s"
- ''',
- encryption_algo
- ))
-
- @property
- def encryption_cipher(self):
- """
- Returns the name of the symmetric encryption cipher to use. The key
- length can be retrieved via the .key_length property to disabiguate
- between different variations of TripleDES, AES, and the RC* ciphers.
-
- :return:
- A unicode string from one of the following: "rc2", "rc5", "des",
- "tripledes", "aes"
- """
-
- encryption_algo = self['algorithm'].native
-
- if encryption_algo[0:7] in set(['aes128_', 'aes192_', 'aes256_']):
- return 'aes'
-
- if encryption_algo in set(['des', 'rc2', 'rc5']):
- return encryption_algo
-
- if encryption_algo == 'tripledes_3key':
- return 'tripledes'
-
- if encryption_algo == 'pbes2':
- return self['parameters']['encryption_scheme'].encryption_cipher
-
- if encryption_algo.find('.') == -1:
- return {
- 'pbes1_md2_des': 'des',
- 'pbes1_md5_des': 'des',
- 'pbes1_md2_rc2': 'rc2',
- 'pbes1_md5_rc2': 'rc2',
- 'pbes1_sha1_des': 'des',
- 'pbes1_sha1_rc2': 'rc2',
- 'pkcs12_sha1_rc4_128': 'rc4',
- 'pkcs12_sha1_rc4_40': 'rc4',
- 'pkcs12_sha1_tripledes_3key': 'tripledes',
- 'pkcs12_sha1_tripledes_2key': 'tripledes',
- 'pkcs12_sha1_rc2_128': 'rc2',
- 'pkcs12_sha1_rc2_40': 'rc2',
- }[encryption_algo]
-
- raise ValueError(unwrap(
- '''
- Unrecognized encryption algorithm "%s"
- ''',
- encryption_algo
- ))
-
- @property
- def encryption_block_size(self):
- """
- Returns the block size of the encryption cipher, in bytes.
-
- :return:
- An integer that is the block size in bytes
- """
-
- encryption_algo = self['algorithm'].native
-
- if encryption_algo[0:7] in set(['aes128_', 'aes192_', 'aes256_']):
- return 16
-
- cipher_map = {
- 'des': 8,
- 'tripledes_3key': 8,
- 'rc2': 8,
- }
- if encryption_algo in cipher_map:
- return cipher_map[encryption_algo]
-
- if encryption_algo == 'rc5':
- return self['parameters'].parsed['block_size_in_bits'].native / 8
-
- if encryption_algo == 'pbes2':
- return self['parameters']['encryption_scheme'].encryption_block_size
-
- if encryption_algo.find('.') == -1:
- return {
- 'pbes1_md2_des': 8,
- 'pbes1_md5_des': 8,
- 'pbes1_md2_rc2': 8,
- 'pbes1_md5_rc2': 8,
- 'pbes1_sha1_des': 8,
- 'pbes1_sha1_rc2': 8,
- 'pkcs12_sha1_rc4_128': 0,
- 'pkcs12_sha1_rc4_40': 0,
- 'pkcs12_sha1_tripledes_3key': 8,
- 'pkcs12_sha1_tripledes_2key': 8,
- 'pkcs12_sha1_rc2_128': 8,
- 'pkcs12_sha1_rc2_40': 8,
- }[encryption_algo]
-
- raise ValueError(unwrap(
- '''
- Unrecognized encryption algorithm "%s"
- ''',
- encryption_algo
- ))
-
- @property
- def encryption_iv(self):
- """
- Returns the byte string of the initialization vector for the encryption
- scheme. Only the PBES2 stores the IV in the params. For PBES1, the IV
- is derived from the KDF and this property will return None.
-
- :return:
- A byte string or None
- """
-
- encryption_algo = self['algorithm'].native
-
- if encryption_algo in set(['rc2', 'rc5']):
- return self['parameters'].parsed['iv'].native
-
- # For DES/Triple DES and AES the IV is the entirety of the parameters
- octet_string_iv_oids = set([
- 'des',
- 'tripledes_3key',
- 'aes128_cbc',
- 'aes192_cbc',
- 'aes256_cbc',
- 'aes128_ofb',
- 'aes192_ofb',
- 'aes256_ofb',
- ])
- if encryption_algo in octet_string_iv_oids:
- return self['parameters'].native
-
- if encryption_algo == 'pbes2':
- return self['parameters']['encryption_scheme'].encryption_iv
-
- # All of the PBES1 algos use their KDF to create the IV. For the pbkdf1,
- # the KDF is told to generate a key that is an extra 8 bytes long, and
- # that is used for the IV. For the PKCS#12 KDF, it is called with an id
- # of 2 to generate the IV. In either case, we can't return the IV
- # without knowing the user's password.
- if encryption_algo.find('.') == -1:
- return None
-
- raise ValueError(unwrap(
- '''
- Unrecognized encryption algorithm "%s"
- ''',
- encryption_algo
- ))
-
-
-class Pbes2Params(Sequence):
- _fields = [
- ('key_derivation_func', KdfAlgorithm),
- ('encryption_scheme', EncryptionAlgorithm),
- ]
-
-
-class Pbmac1Params(Sequence):
- _fields = [
- ('key_derivation_func', KdfAlgorithm),
- ('message_auth_scheme', HmacAlgorithm),
- ]
-
-
-class Pkcs5MacId(ObjectIdentifier):
- _map = {
- '1.2.840.113549.1.5.14': 'pbmac1',
- }
-
-
-class Pkcs5MacAlgorithm(Sequence):
- _fields = [
- ('algorithm', Pkcs5MacId),
- ('parameters', Any),
- ]
-
- _oid_pair = ('algorithm', 'parameters')
- _oid_specs = {
- 'pbmac1': Pbmac1Params,
- }
-
-
-EncryptionAlgorithm._oid_specs['pbes2'] = Pbes2Params
-
-
-class AnyAlgorithmId(ObjectIdentifier):
- _map = {}
-
- def _setup(self):
- _map = self.__class__._map
- for other_cls in (EncryptionAlgorithmId, SignedDigestAlgorithmId, DigestAlgorithmId):
- for oid, name in other_cls._map.items():
- _map[oid] = name
-
-
-class AnyAlgorithmIdentifier(_ForceNullParameters, Sequence):
- _fields = [
- ('algorithm', AnyAlgorithmId),
- ('parameters', Any, {'optional': True}),
- ]
-
- _oid_pair = ('algorithm', 'parameters')
- _oid_specs = {}
-
- def _setup(self):
- Sequence._setup(self)
- specs = self.__class__._oid_specs
- for other_cls in (EncryptionAlgorithm, SignedDigestAlgorithm):
- for oid, spec in other_cls._oid_specs.items():
- specs[oid] = spec
diff --git a/lib/asn1crypto/cms.py b/lib/asn1crypto/cms.py
deleted file mode 100644
index 9cad9492cb..0000000000
--- a/lib/asn1crypto/cms.py
+++ /dev/null
@@ -1,932 +0,0 @@
-# coding: utf-8
-
-"""
-ASN.1 type classes for cryptographic message syntax (CMS). Structures are also
-compatible with PKCS#7. Exports the following items:
-
- - AuthenticatedData()
- - AuthEnvelopedData()
- - CompressedData()
- - ContentInfo()
- - DigestedData()
- - EncryptedData()
- - EnvelopedData()
- - SignedAndEnvelopedData()
- - SignedData()
-
-Other type classes are defined that help compose the types listed above.
-
-Most CMS structures in the wild are formatted as ContentInfo encapsulating one of the other types.
-"""
-
-from __future__ import unicode_literals, division, absolute_import, print_function
-
-try:
- import zlib
-except (ImportError):
- zlib = None
-
-from .algos import (
- _ForceNullParameters,
- DigestAlgorithm,
- EncryptionAlgorithm,
- HmacAlgorithm,
- KdfAlgorithm,
- SignedDigestAlgorithm,
-)
-from .core import (
- Any,
- BitString,
- Choice,
- Enumerated,
- GeneralizedTime,
- Integer,
- ObjectIdentifier,
- OctetBitString,
- OctetString,
- ParsableOctetString,
- Sequence,
- SequenceOf,
- SetOf,
- UTCTime,
- UTF8String,
-)
-from .crl import CertificateList
-from .keys import PublicKeyInfo
-from .ocsp import OCSPResponse
-from .x509 import Attributes, Certificate, Extensions, GeneralName, GeneralNames, Name
-
-
-# These structures are taken from
-# ftp://ftp.rsasecurity.com/pub/pkcs/ascii/pkcs-6.asc
-
-class ExtendedCertificateInfo(Sequence):
- _fields = [
- ('version', Integer),
- ('certificate', Certificate),
- ('attributes', Attributes),
- ]
-
-
-class ExtendedCertificate(Sequence):
- _fields = [
- ('extended_certificate_info', ExtendedCertificateInfo),
- ('signature_algorithm', SignedDigestAlgorithm),
- ('signature', OctetBitString),
- ]
-
-
-# These structures are taken from https://tools.ietf.org/html/rfc5652,
-# https://tools.ietf.org/html/rfc5083, http://tools.ietf.org/html/rfc2315,
-# https://tools.ietf.org/html/rfc5940, https://tools.ietf.org/html/rfc3274,
-# https://tools.ietf.org/html/rfc3281
-
-
-class CMSVersion(Integer):
- _map = {
- 0: 'v0',
- 1: 'v1',
- 2: 'v2',
- 3: 'v3',
- 4: 'v4',
- 5: 'v5',
- }
-
-
-class CMSAttributeType(ObjectIdentifier):
- _map = {
- '1.2.840.113549.1.9.3': 'content_type',
- '1.2.840.113549.1.9.4': 'message_digest',
- '1.2.840.113549.1.9.5': 'signing_time',
- '1.2.840.113549.1.9.6': 'counter_signature',
- # https://tools.ietf.org/html/rfc3161#page-20
- '1.2.840.113549.1.9.16.2.14': 'signature_time_stamp_token',
- # https://tools.ietf.org/html/rfc6211#page-5
- '1.2.840.113549.1.9.52': 'cms_algorithm_protection',
- }
-
-
-class Time(Choice):
- _alternatives = [
- ('utc_time', UTCTime),
- ('generalized_time', GeneralizedTime),
- ]
-
-
-class ContentType(ObjectIdentifier):
- _map = {
- '1.2.840.113549.1.7.1': 'data',
- '1.2.840.113549.1.7.2': 'signed_data',
- '1.2.840.113549.1.7.3': 'enveloped_data',
- '1.2.840.113549.1.7.4': 'signed_and_enveloped_data',
- '1.2.840.113549.1.7.5': 'digested_data',
- '1.2.840.113549.1.7.6': 'encrypted_data',
- '1.2.840.113549.1.9.16.1.2': 'authenticated_data',
- '1.2.840.113549.1.9.16.1.9': 'compressed_data',
- '1.2.840.113549.1.9.16.1.23': 'authenticated_enveloped_data',
- }
-
-
-class CMSAlgorithmProtection(Sequence):
- _fields = [
- ('digest_algorithm', DigestAlgorithm),
- ('signature_algorithm', SignedDigestAlgorithm, {'implicit': 1, 'optional': True}),
- ('mac_algorithm', HmacAlgorithm, {'implicit': 2, 'optional': True}),
- ]
-
-
-class SetOfContentType(SetOf):
- _child_spec = ContentType
-
-
-class SetOfOctetString(SetOf):
- _child_spec = OctetString
-
-
-class SetOfTime(SetOf):
- _child_spec = Time
-
-
-class SetOfAny(SetOf):
- _child_spec = Any
-
-
-class SetOfCMSAlgorithmProtection(SetOf):
- _child_spec = CMSAlgorithmProtection
-
-
-class CMSAttribute(Sequence):
- _fields = [
- ('type', CMSAttributeType),
- ('values', None),
- ]
-
- _oid_specs = {}
-
- def _values_spec(self):
- return self._oid_specs.get(self['type'].native, SetOfAny)
-
- _spec_callbacks = {
- 'values': _values_spec
- }
-
-
-class CMSAttributes(SetOf):
- _child_spec = CMSAttribute
-
-
-class IssuerSerial(Sequence):
- _fields = [
- ('issuer', GeneralNames),
- ('serial', Integer),
- ('issuer_uid', OctetBitString, {'optional': True}),
- ]
-
-
-class AttCertVersion(Integer):
- _map = {
- 0: 'v1',
- 1: 'v2',
- }
-
-
-class AttCertSubject(Choice):
- _alternatives = [
- ('base_certificate_id', IssuerSerial, {'explicit': 0}),
- ('subject_name', GeneralNames, {'explicit': 1}),
- ]
-
-
-class AttCertValidityPeriod(Sequence):
- _fields = [
- ('not_before_time', GeneralizedTime),
- ('not_after_time', GeneralizedTime),
- ]
-
-
-class AttributeCertificateInfoV1(Sequence):
- _fields = [
- ('version', AttCertVersion, {'default': 'v1'}),
- ('subject', AttCertSubject),
- ('issuer', GeneralNames),
- ('signature', SignedDigestAlgorithm),
- ('serial_number', Integer),
- ('att_cert_validity_period', AttCertValidityPeriod),
- ('attributes', Attributes),
- ('issuer_unique_id', OctetBitString, {'optional': True}),
- ('extensions', Extensions, {'optional': True}),
- ]
-
-
-class AttributeCertificateV1(Sequence):
- _fields = [
- ('ac_info', AttributeCertificateInfoV1),
- ('signature_algorithm', SignedDigestAlgorithm),
- ('signature', OctetBitString),
- ]
-
-
-class DigestedObjectType(Enumerated):
- _map = {
- 0: 'public_key',
- 1: 'public_key_cert',
- 2: 'other_objy_types',
- }
-
-
-class ObjectDigestInfo(Sequence):
- _fields = [
- ('digested_object_type', DigestedObjectType),
- ('other_object_type_id', ObjectIdentifier, {'optional': True}),
- ('digest_algorithm', DigestAlgorithm),
- ('object_digest', OctetBitString),
- ]
-
-
-class Holder(Sequence):
- _fields = [
- ('base_certificate_id', IssuerSerial, {'implicit': 0, 'optional': True}),
- ('entity_name', GeneralNames, {'implicit': 1, 'optional': True}),
- ('object_digest_info', ObjectDigestInfo, {'implicit': 2, 'optional': True}),
- ]
-
-
-class V2Form(Sequence):
- _fields = [
- ('issuer_name', GeneralNames, {'optional': True}),
- ('base_certificate_id', IssuerSerial, {'explicit': 0, 'optional': True}),
- ('object_digest_info', ObjectDigestInfo, {'explicit': 1, 'optional': True}),
- ]
-
-
-class AttCertIssuer(Choice):
- _alternatives = [
- ('v1_form', GeneralNames),
- ('v2_form', V2Form, {'explicit': 0}),
- ]
-
-
-class IetfAttrValue(Choice):
- _alternatives = [
- ('octets', OctetString),
- ('oid', ObjectIdentifier),
- ('string', UTF8String),
- ]
-
-
-class IetfAttrValues(SequenceOf):
- _child_spec = IetfAttrValue
-
-
-class IetfAttrSyntax(Sequence):
- _fields = [
- ('policy_authority', GeneralNames, {'implicit': 0, 'optional': True}),
- ('values', IetfAttrValues),
- ]
-
-
-class SetOfIetfAttrSyntax(SetOf):
- _child_spec = IetfAttrSyntax
-
-
-class SvceAuthInfo(Sequence):
- _fields = [
- ('service', GeneralName),
- ('ident', GeneralName),
- ('auth_info', OctetString, {'optional': True}),
- ]
-
-
-class SetOfSvceAuthInfo(SetOf):
- _child_spec = SvceAuthInfo
-
-
-class RoleSyntax(Sequence):
- _fields = [
- ('role_authority', GeneralNames, {'implicit': 0, 'optional': True}),
- ('role_name', GeneralName, {'implicit': 1}),
- ]
-
-
-class SetOfRoleSyntax(SetOf):
- _child_spec = RoleSyntax
-
-
-class ClassList(BitString):
- _map = {
- 0: 'unmarked',
- 1: 'unclassified',
- 2: 'restricted',
- 3: 'confidential',
- 4: 'secret',
- 5: 'top_secret',
- }
-
-
-class SecurityCategory(Sequence):
- _fields = [
- ('type', ObjectIdentifier, {'implicit': 0}),
- ('value', Any, {'implicit': 1}),
- ]
-
-
-class SetOfSecurityCategory(SetOf):
- _child_spec = SecurityCategory
-
-
-class Clearance(Sequence):
- _fields = [
- ('policy_id', ObjectIdentifier, {'implicit': 0}),
- ('class_list', ClassList, {'implicit': 1, 'default': 'unclassified'}),
- ('security_categories', SetOfSecurityCategory, {'implicit': 2, 'optional': True}),
- ]
-
-
-class SetOfClearance(SetOf):
- _child_spec = Clearance
-
-
-class BigTime(Sequence):
- _fields = [
- ('major', Integer),
- ('fractional_seconds', Integer),
- ('sign', Integer, {'optional': True}),
- ]
-
-
-class LeapData(Sequence):
- _fields = [
- ('leap_time', BigTime),
- ('action', Integer),
- ]
-
-
-class SetOfLeapData(SetOf):
- _child_spec = LeapData
-
-
-class TimingMetrics(Sequence):
- _fields = [
- ('ntp_time', BigTime),
- ('offset', BigTime),
- ('delay', BigTime),
- ('expiration', BigTime),
- ('leap_event', SetOfLeapData, {'optional': True}),
- ]
-
-
-class SetOfTimingMetrics(SetOf):
- _child_spec = TimingMetrics
-
-
-class TimingPolicy(Sequence):
- _fields = [
- ('policy_id', SequenceOf, {'spec': ObjectIdentifier}),
- ('max_offset', BigTime, {'explicit': 0, 'optional': True}),
- ('max_delay', BigTime, {'explicit': 1, 'optional': True}),
- ]
-
-
-class SetOfTimingPolicy(SetOf):
- _child_spec = TimingPolicy
-
-
-class AttCertAttributeType(ObjectIdentifier):
- _map = {
- '1.3.6.1.5.5.7.10.1': 'authentication_info',
- '1.3.6.1.5.5.7.10.2': 'access_identity',
- '1.3.6.1.5.5.7.10.3': 'charging_identity',
- '1.3.6.1.5.5.7.10.4': 'group',
- '2.5.4.72': 'role',
- '2.5.4.55': 'clearance',
- '1.3.6.1.4.1.601.10.4.1': 'timing_metrics',
- '1.3.6.1.4.1.601.10.4.2': 'timing_policy',
- }
-
-
-class AttCertAttribute(Sequence):
- _fields = [
- ('type', AttCertAttributeType),
- ('values', None),
- ]
-
- _oid_specs = {
- 'authentication_info': SetOfSvceAuthInfo,
- 'access_identity': SetOfSvceAuthInfo,
- 'charging_identity': SetOfIetfAttrSyntax,
- 'group': SetOfIetfAttrSyntax,
- 'role': SetOfRoleSyntax,
- 'clearance': SetOfClearance,
- 'timing_metrics': SetOfTimingMetrics,
- 'timing_policy': SetOfTimingPolicy,
- }
-
- def _values_spec(self):
- return self._oid_specs.get(self['type'].native, SetOfAny)
-
- _spec_callbacks = {
- 'values': _values_spec
- }
-
-
-class AttCertAttributes(SequenceOf):
- _child_spec = AttCertAttribute
-
-
-class AttributeCertificateInfoV2(Sequence):
- _fields = [
- ('version', AttCertVersion),
- ('holder', Holder),
- ('issuer', AttCertIssuer),
- ('signature', SignedDigestAlgorithm),
- ('serial_number', Integer),
- ('att_cert_validity_period', AttCertValidityPeriod),
- ('attributes', AttCertAttributes),
- ('issuer_unique_id', OctetBitString, {'optional': True}),
- ('extensions', Extensions, {'optional': True}),
- ]
-
-
-class AttributeCertificateV2(Sequence):
- # Handle the situation where a V2 cert is encoded as V1
- _bad_tag = 1
-
- _fields = [
- ('ac_info', AttributeCertificateInfoV2),
- ('signature_algorithm', SignedDigestAlgorithm),
- ('signature', OctetBitString),
- ]
-
-
-class OtherCertificateFormat(Sequence):
- _fields = [
- ('other_cert_format', ObjectIdentifier),
- ('other_cert', Any),
- ]
-
-
-class CertificateChoices(Choice):
- _alternatives = [
- ('certificate', Certificate),
- ('extended_certificate', ExtendedCertificate, {'implicit': 0}),
- ('v1_attr_cert', AttributeCertificateV1, {'implicit': 1}),
- ('v2_attr_cert', AttributeCertificateV2, {'implicit': 2}),
- ('other', OtherCertificateFormat, {'implicit': 3}),
- ]
-
- def validate(self, class_, tag, contents):
- """
- Ensures that the class and tag specified exist as an alternative. This
- custom version fixes parsing broken encodings there a V2 attribute
- # certificate is encoded as a V1
-
- :param class_:
- The integer class_ from the encoded value header
-
- :param tag:
- The integer tag from the encoded value header
-
- :param contents:
- A byte string of the contents of the value - used when the object
- is explicitly tagged
-
- :raises:
- ValueError - when value is not a valid alternative
- """
-
- super(CertificateChoices, self).validate(class_, tag, contents)
- if self._choice == 2:
- if AttCertVersion.load(Sequence.load(contents)[0].dump()).native == 'v2':
- self._choice = 3
-
-
-class CertificateSet(SetOf):
- _child_spec = CertificateChoices
-
-
-class ContentInfo(Sequence):
- _fields = [
- ('content_type', ContentType),
- ('content', Any, {'explicit': 0, 'optional': True}),
- ]
-
- _oid_pair = ('content_type', 'content')
- _oid_specs = {}
-
-
-class SetOfContentInfo(SetOf):
- _child_spec = ContentInfo
-
-
-class EncapsulatedContentInfo(Sequence):
- _fields = [
- ('content_type', ContentType),
- ('content', ParsableOctetString, {'explicit': 0, 'optional': True}),
- ]
-
- _oid_pair = ('content_type', 'content')
- _oid_specs = {}
-
-
-class IssuerAndSerialNumber(Sequence):
- _fields = [
- ('issuer', Name),
- ('serial_number', Integer),
- ]
-
-
-class SignerIdentifier(Choice):
- _alternatives = [
- ('issuer_and_serial_number', IssuerAndSerialNumber),
- ('subject_key_identifier', OctetString, {'implicit': 0}),
- ]
-
-
-class DigestAlgorithms(SetOf):
- _child_spec = DigestAlgorithm
-
-
-class CertificateRevocationLists(SetOf):
- _child_spec = CertificateList
-
-
-class SCVPReqRes(Sequence):
- _fields = [
- ('request', ContentInfo, {'explicit': 0, 'optional': True}),
- ('response', ContentInfo),
- ]
-
-
-class OtherRevInfoFormatId(ObjectIdentifier):
- _map = {
- '1.3.6.1.5.5.7.16.2': 'ocsp_response',
- '1.3.6.1.5.5.7.16.4': 'scvp',
- }
-
-
-class OtherRevocationInfoFormat(Sequence):
- _fields = [
- ('other_rev_info_format', OtherRevInfoFormatId),
- ('other_rev_info', Any),
- ]
-
- _oid_pair = ('other_rev_info_format', 'other_rev_info')
- _oid_specs = {
- 'ocsp_response': OCSPResponse,
- 'scvp': SCVPReqRes,
- }
-
-
-class RevocationInfoChoice(Choice):
- _alternatives = [
- ('crl', CertificateList),
- ('other', OtherRevocationInfoFormat, {'implicit': 1}),
- ]
-
-
-class RevocationInfoChoices(SetOf):
- _child_spec = RevocationInfoChoice
-
-
-class SignerInfo(Sequence):
- _fields = [
- ('version', CMSVersion),
- ('sid', SignerIdentifier),
- ('digest_algorithm', DigestAlgorithm),
- ('signed_attrs', CMSAttributes, {'implicit': 0, 'optional': True}),
- ('signature_algorithm', SignedDigestAlgorithm),
- ('signature', OctetString),
- ('unsigned_attrs', CMSAttributes, {'implicit': 1, 'optional': True}),
- ]
-
-
-class SignerInfos(SetOf):
- _child_spec = SignerInfo
-
-
-class SignedData(Sequence):
- _fields = [
- ('version', CMSVersion),
- ('digest_algorithms', DigestAlgorithms),
- ('encap_content_info', None),
- ('certificates', CertificateSet, {'implicit': 0, 'optional': True}),
- ('crls', RevocationInfoChoices, {'implicit': 1, 'optional': True}),
- ('signer_infos', SignerInfos),
- ]
-
- def _encap_content_info_spec(self):
- # If the encap_content_info is version v1, then this could be a PKCS#7
- # structure, or a CMS structure. CMS wraps the encoded value in an
- # Octet String tag.
-
- # If the version is greater than 1, it is definite CMS
- if self['version'].native != 'v1':
- return EncapsulatedContentInfo
-
- # Otherwise, the ContentInfo spec from PKCS#7 will be compatible with
- # CMS v1 (which only allows Data, an Octet String) and PKCS#7, which
- # allows Any
- return ContentInfo
-
- _spec_callbacks = {
- 'encap_content_info': _encap_content_info_spec
- }
-
-
-class OriginatorInfo(Sequence):
- _fields = [
- ('certs', CertificateSet, {'implicit': 0, 'optional': True}),
- ('crls', RevocationInfoChoices, {'implicit': 1, 'optional': True}),
- ]
-
-
-class RecipientIdentifier(Choice):
- _alternatives = [
- ('issuer_and_serial_number', IssuerAndSerialNumber),
- ('subject_key_identifier', OctetString, {'implicit': 0}),
- ]
-
-
-class KeyEncryptionAlgorithmId(ObjectIdentifier):
- _map = {
- '1.2.840.113549.1.1.1': 'rsa',
- '2.16.840.1.101.3.4.1.5': 'aes128_wrap',
- '2.16.840.1.101.3.4.1.8': 'aes128_wrap_pad',
- '2.16.840.1.101.3.4.1.25': 'aes192_wrap',
- '2.16.840.1.101.3.4.1.28': 'aes192_wrap_pad',
- '2.16.840.1.101.3.4.1.45': 'aes256_wrap',
- '2.16.840.1.101.3.4.1.48': 'aes256_wrap_pad',
- }
-
-
-class KeyEncryptionAlgorithm(_ForceNullParameters, Sequence):
- _fields = [
- ('algorithm', KeyEncryptionAlgorithmId),
- ('parameters', Any, {'optional': True}),
- ]
-
-
-class KeyTransRecipientInfo(Sequence):
- _fields = [
- ('version', CMSVersion),
- ('rid', RecipientIdentifier),
- ('key_encryption_algorithm', KeyEncryptionAlgorithm),
- ('encrypted_key', OctetString),
- ]
-
-
-class OriginatorIdentifierOrKey(Choice):
- _alternatives = [
- ('issuer_and_serial_number', IssuerAndSerialNumber),
- ('subject_key_identifier', OctetString, {'implicit': 0}),
- ('originator_key', PublicKeyInfo, {'implicit': 1}),
- ]
-
-
-class OtherKeyAttribute(Sequence):
- _fields = [
- ('key_attr_id', ObjectIdentifier),
- ('key_attr', Any),
- ]
-
-
-class RecipientKeyIdentifier(Sequence):
- _fields = [
- ('subject_key_identifier', OctetString),
- ('date', GeneralizedTime, {'optional': True}),
- ('other', OtherKeyAttribute, {'optional': True}),
- ]
-
-
-class KeyAgreementRecipientIdentifier(Choice):
- _alternatives = [
- ('issuer_and_serial_number', IssuerAndSerialNumber),
- ('r_key_id', RecipientKeyIdentifier, {'implicit': 0}),
- ]
-
-
-class RecipientEncryptedKey(Sequence):
- _fields = [
- ('rid', KeyAgreementRecipientIdentifier),
- ('encrypted_key', OctetString),
- ]
-
-
-class RecipientEncryptedKeys(SequenceOf):
- _child_spec = RecipientEncryptedKey
-
-
-class KeyAgreeRecipientInfo(Sequence):
- _fields = [
- ('version', CMSVersion),
- ('originator', OriginatorIdentifierOrKey, {'explicit': 0}),
- ('ukm', OctetString, {'explicit': 1, 'optional': True}),
- ('key_encryption_algorithm', KeyEncryptionAlgorithm),
- ('recipient_encrypted_keys', RecipientEncryptedKeys),
- ]
-
-
-class KEKIdentifier(Sequence):
- _fields = [
- ('key_identifier', OctetString),
- ('date', GeneralizedTime, {'optional': True}),
- ('other', OtherKeyAttribute, {'optional': True}),
- ]
-
-
-class KEKRecipientInfo(Sequence):
- _fields = [
- ('version', CMSVersion),
- ('kekid', KEKIdentifier),
- ('key_encryption_algorithm', KeyEncryptionAlgorithm),
- ('encrypted_key', OctetString),
- ]
-
-
-class PasswordRecipientInfo(Sequence):
- _fields = [
- ('version', CMSVersion),
- ('key_derivation_algorithm', KdfAlgorithm, {'implicit': 0, 'optional': True}),
- ('key_encryption_algorithm', KeyEncryptionAlgorithm),
- ('encrypted_key', OctetString),
- ]
-
-
-class OtherRecipientInfo(Sequence):
- _fields = [
- ('ori_type', ObjectIdentifier),
- ('ori_value', Any),
- ]
-
-
-class RecipientInfo(Choice):
- _alternatives = [
- ('ktri', KeyTransRecipientInfo),
- ('kari', KeyAgreeRecipientInfo, {'implicit': 1}),
- ('kekri', KEKRecipientInfo, {'implicit': 2}),
- ('pwri', PasswordRecipientInfo, {'implicit': 3}),
- ('ori', OtherRecipientInfo, {'implicit': 4}),
- ]
-
-
-class RecipientInfos(SetOf):
- _child_spec = RecipientInfo
-
-
-class EncryptedContentInfo(Sequence):
- _fields = [
- ('content_type', ContentType),
- ('content_encryption_algorithm', EncryptionAlgorithm),
- ('encrypted_content', OctetString, {'implicit': 0, 'optional': True}),
- ]
-
-
-class EnvelopedData(Sequence):
- _fields = [
- ('version', CMSVersion),
- ('originator_info', OriginatorInfo, {'implicit': 0, 'optional': True}),
- ('recipient_infos', RecipientInfos),
- ('encrypted_content_info', EncryptedContentInfo),
- ('unprotected_attrs', CMSAttributes, {'implicit': 1, 'optional': True}),
- ]
-
-
-class SignedAndEnvelopedData(Sequence):
- _fields = [
- ('version', CMSVersion),
- ('recipient_infos', RecipientInfos),
- ('digest_algorithms', DigestAlgorithms),
- ('encrypted_content_info', EncryptedContentInfo),
- ('certificates', CertificateSet, {'implicit': 0, 'optional': True}),
- ('crls', CertificateRevocationLists, {'implicit': 1, 'optional': True}),
- ('signer_infos', SignerInfos),
- ]
-
-
-class DigestedData(Sequence):
- _fields = [
- ('version', CMSVersion),
- ('digest_algorithm', DigestAlgorithm),
- ('encap_content_info', None),
- ('digest', OctetString),
- ]
-
- def _encap_content_info_spec(self):
- # If the encap_content_info is version v1, then this could be a PKCS#7
- # structure, or a CMS structure. CMS wraps the encoded value in an
- # Octet String tag.
-
- # If the version is greater than 1, it is definite CMS
- if self['version'].native != 'v1':
- return EncapsulatedContentInfo
-
- # Otherwise, the ContentInfo spec from PKCS#7 will be compatible with
- # CMS v1 (which only allows Data, an Octet String) and PKCS#7, which
- # allows Any
- return ContentInfo
-
- _spec_callbacks = {
- 'encap_content_info': _encap_content_info_spec
- }
-
-
-class EncryptedData(Sequence):
- _fields = [
- ('version', CMSVersion),
- ('encrypted_content_info', EncryptedContentInfo),
- ('unprotected_attrs', CMSAttributes, {'implicit': 1, 'optional': True}),
- ]
-
-
-class AuthenticatedData(Sequence):
- _fields = [
- ('version', CMSVersion),
- ('originator_info', OriginatorInfo, {'implicit': 0, 'optional': True}),
- ('recipient_infos', RecipientInfos),
- ('mac_algorithm', HmacAlgorithm),
- ('digest_algorithm', DigestAlgorithm, {'implicit': 1, 'optional': True}),
- # This does not require the _spec_callbacks approach of SignedData and
- # DigestedData since AuthenticatedData was not part of PKCS#7
- ('encap_content_info', EncapsulatedContentInfo),
- ('auth_attrs', CMSAttributes, {'implicit': 2, 'optional': True}),
- ('mac', OctetString),
- ('unauth_attrs', CMSAttributes, {'implicit': 3, 'optional': True}),
- ]
-
-
-class AuthEnvelopedData(Sequence):
- _fields = [
- ('version', CMSVersion),
- ('originator_info', OriginatorInfo, {'implicit': 0, 'optional': True}),
- ('recipient_infos', RecipientInfos),
- ('auth_encrypted_content_info', EncryptedContentInfo),
- ('auth_attrs', CMSAttributes, {'implicit': 1, 'optional': True}),
- ('mac', OctetString),
- ('unauth_attrs', CMSAttributes, {'implicit': 2, 'optional': True}),
- ]
-
-
-class CompressionAlgorithmId(ObjectIdentifier):
- _map = {
- '1.2.840.113549.1.9.16.3.8': 'zlib',
- }
-
-
-class CompressionAlgorithm(Sequence):
- _fields = [
- ('algorithm', CompressionAlgorithmId),
- ('parameters', Any, {'optional': True}),
- ]
-
-
-class CompressedData(Sequence):
- _fields = [
- ('version', CMSVersion),
- ('compression_algorithm', CompressionAlgorithm),
- ('encap_content_info', EncapsulatedContentInfo),
- ]
-
- _decompressed = None
-
- @property
- def decompressed(self):
- if self._decompressed is None:
- if zlib is None:
- raise SystemError('The zlib module is not available')
- self._decompressed = zlib.decompress(self['encap_content_info']['content'].native)
- return self._decompressed
-
-
-ContentInfo._oid_specs = {
- 'data': OctetString,
- 'signed_data': SignedData,
- 'enveloped_data': EnvelopedData,
- 'signed_and_enveloped_data': SignedAndEnvelopedData,
- 'digested_data': DigestedData,
- 'encrypted_data': EncryptedData,
- 'authenticated_data': AuthenticatedData,
- 'compressed_data': CompressedData,
- 'authenticated_enveloped_data': AuthEnvelopedData,
-}
-
-
-EncapsulatedContentInfo._oid_specs = {
- 'signed_data': SignedData,
- 'enveloped_data': EnvelopedData,
- 'signed_and_enveloped_data': SignedAndEnvelopedData,
- 'digested_data': DigestedData,
- 'encrypted_data': EncryptedData,
- 'authenticated_data': AuthenticatedData,
- 'compressed_data': CompressedData,
- 'authenticated_enveloped_data': AuthEnvelopedData,
-}
-
-
-CMSAttribute._oid_specs = {
- 'content_type': SetOfContentType,
- 'message_digest': SetOfOctetString,
- 'signing_time': SetOfTime,
- 'counter_signature': SignerInfos,
- 'signature_time_stamp_token': SetOfContentInfo,
- 'cms_algorithm_protection': SetOfCMSAlgorithmProtection,
-}
diff --git a/lib/asn1crypto/core.py b/lib/asn1crypto/core.py
deleted file mode 100644
index 14a8203896..0000000000
--- a/lib/asn1crypto/core.py
+++ /dev/null
@@ -1,5242 +0,0 @@
-# coding: utf-8
-
-"""
-ASN.1 type classes for universal types. Exports the following items:
-
- - load()
- - Any()
- - Asn1Value()
- - BitString()
- - BMPString()
- - Boolean()
- - CharacterString()
- - Choice()
- - EmbeddedPdv()
- - Enumerated()
- - GeneralizedTime()
- - GeneralString()
- - GraphicString()
- - IA5String()
- - InstanceOf()
- - Integer()
- - IntegerBitString()
- - IntegerOctetString()
- - Null()
- - NumericString()
- - ObjectDescriptor()
- - ObjectIdentifier()
- - OctetBitString()
- - OctetString()
- - PrintableString()
- - Real()
- - RelativeOid()
- - Sequence()
- - SequenceOf()
- - Set()
- - SetOf()
- - TeletexString()
- - UniversalString()
- - UTCTime()
- - UTF8String()
- - VideotexString()
- - VisibleString()
- - VOID
- - Void()
-
-Other type classes are defined that help compose the types listed above.
-"""
-
-from __future__ import unicode_literals, division, absolute_import, print_function
-
-from datetime import datetime, timedelta
-import binascii
-import copy
-import math
-import re
-import sys
-
-from . import _teletex_codec
-from ._errors import unwrap
-from ._ordereddict import OrderedDict
-from ._types import type_name, str_cls, byte_cls, int_types, chr_cls
-from .parser import _parse, _dump_header
-from .util import int_to_bytes, int_from_bytes, timezone, extended_datetime
-
-if sys.version_info <= (3,):
- from cStringIO import StringIO as BytesIO
-
- range = xrange # noqa
- _PY2 = True
-
-else:
- from io import BytesIO
-
- _PY2 = False
-
-
-_teletex_codec.register()
-
-
-CLASS_NUM_TO_NAME_MAP = {
- 0: 'universal',
- 1: 'application',
- 2: 'context',
- 3: 'private',
-}
-
-CLASS_NAME_TO_NUM_MAP = {
- 'universal': 0,
- 'application': 1,
- 'context': 2,
- 'private': 3,
- 0: 0,
- 1: 1,
- 2: 2,
- 3: 3,
-}
-
-METHOD_NUM_TO_NAME_MAP = {
- 0: 'primitive',
- 1: 'constructed',
-}
-
-
-_OID_RE = re.compile(r'^\d+(\.\d+)*$')
-
-
-# A global tracker to ensure that _setup() is called for every class, even
-# if is has been called for a parent class. This allows different _fields
-# definitions for child classes. Without such a construct, the child classes
-# would just see the parent class attributes and would use them.
-_SETUP_CLASSES = {}
-
-
-def load(encoded_data, strict=False):
- """
- Loads a BER/DER-encoded byte string and construct a universal object based
- on the tag value:
-
- - 1: Boolean
- - 2: Integer
- - 3: BitString
- - 4: OctetString
- - 5: Null
- - 6: ObjectIdentifier
- - 7: ObjectDescriptor
- - 8: InstanceOf
- - 9: Real
- - 10: Enumerated
- - 11: EmbeddedPdv
- - 12: UTF8String
- - 13: RelativeOid
- - 16: Sequence,
- - 17: Set
- - 18: NumericString
- - 19: PrintableString
- - 20: TeletexString
- - 21: VideotexString
- - 22: IA5String
- - 23: UTCTime
- - 24: GeneralizedTime
- - 25: GraphicString
- - 26: VisibleString
- - 27: GeneralString
- - 28: UniversalString
- - 29: CharacterString
- - 30: BMPString
-
- :param encoded_data:
- A byte string of BER or DER-encoded data
-
- :param strict:
- A boolean indicating if trailing data should be forbidden - if so, a
- ValueError will be raised when trailing data exists
-
- :raises:
- ValueError - when strict is True and trailing data is present
- ValueError - when the encoded value tag a tag other than listed above
- ValueError - when the ASN.1 header length is longer than the data
- TypeError - when encoded_data is not a byte string
-
- :return:
- An instance of the one of the universal classes
- """
-
- return Asn1Value.load(encoded_data, strict=strict)
-
-
-class Asn1Value(object):
- """
- The basis of all ASN.1 values
- """
-
- # The integer 0 for primitive, 1 for constructed
- method = None
-
- # An integer 0 through 3 - see CLASS_NUM_TO_NAME_MAP for value
- class_ = None
-
- # An integer 1 or greater indicating the tag number
- tag = None
-
- # An alternate tag allowed for this type - used for handling broken
- # structures where a string value is encoded using an incorrect tag
- _bad_tag = None
-
- # If the value has been implicitly tagged
- implicit = False
-
- # If explicitly tagged, a tuple of 2-element tuples containing the
- # class int and tag int, from innermost to outermost
- explicit = None
-
- # The BER/DER header bytes
- _header = None
-
- # Raw encoded value bytes not including class, method, tag, length header
- contents = None
-
- # The BER/DER trailer bytes
- _trailer = b''
-
- # The native python representation of the value - this is not used by
- # some classes since they utilize _bytes or _unicode
- _native = None
-
- @classmethod
- def load(cls, encoded_data, strict=False, **kwargs):
- """
- Loads a BER/DER-encoded byte string using the current class as the spec
-
- :param encoded_data:
- A byte string of BER or DER-encoded data
-
- :param strict:
- A boolean indicating if trailing data should be forbidden - if so, a
- ValueError will be raised when trailing data exists
-
- :return:
- An instance of the current class
- """
-
- if not isinstance(encoded_data, byte_cls):
- raise TypeError('encoded_data must be a byte string, not %s' % type_name(encoded_data))
-
- spec = None
- if cls.tag is not None:
- spec = cls
-
- value, _ = _parse_build(encoded_data, spec=spec, spec_params=kwargs, strict=strict)
- return value
-
- def __init__(self, explicit=None, implicit=None, no_explicit=False, tag_type=None, class_=None, tag=None,
- optional=None, default=None, contents=None):
- """
- The optional parameter is not used, but rather included so we don't
- have to delete it from the parameter dictionary when passing as keyword
- args
-
- :param explicit:
- An int tag number for explicit tagging, or a 2-element tuple of
- class and tag.
-
- :param implicit:
- An int tag number for implicit tagging, or a 2-element tuple of
- class and tag.
-
- :param no_explicit:
- If explicit tagging info should be removed from this instance.
- Used internally to allow contructing the underlying value that
- has been wrapped in an explicit tag.
-
- :param tag_type:
- None for normal values, or one of "implicit", "explicit" for tagged
- values. Deprecated in favor of explicit and implicit params.
-
- :param class_:
- The class for the value - defaults to "universal" if tag_type is
- None, otherwise defaults to "context". Valid values include:
- - "universal"
- - "application"
- - "context"
- - "private"
- Deprecated in favor of explicit and implicit params.
-
- :param tag:
- The integer tag to override - usually this is used with tag_type or
- class_. Deprecated in favor of explicit and implicit params.
-
- :param optional:
- Dummy parameter that allows "optional" key in spec param dicts
-
- :param default:
- The default value to use if the value is currently None
-
- :param contents:
- A byte string of the encoded contents of the value
-
- :raises:
- ValueError - when implicit, explicit, tag_type, class_ or tag are invalid values
- """
-
- try:
- if self.__class__ not in _SETUP_CLASSES:
- cls = self.__class__
- # Allow explicit to be specified as a simple 2-element tuple
- # instead of requiring the user make a nested tuple
- if cls.explicit is not None and isinstance(cls.explicit[0], int_types):
- cls.explicit = (cls.explicit, )
- if hasattr(cls, '_setup'):
- self._setup()
- _SETUP_CLASSES[cls] = True
-
- # Normalize tagging values
- if explicit is not None:
- if isinstance(explicit, int_types):
- if class_ is None:
- class_ = 'context'
- explicit = (class_, explicit)
- # Prevent both explicit and tag_type == 'explicit'
- if tag_type == 'explicit':
- tag_type = None
- tag = None
-
- if implicit is not None:
- if isinstance(implicit, int_types):
- if class_ is None:
- class_ = 'context'
- implicit = (class_, implicit)
- # Prevent both implicit and tag_type == 'implicit'
- if tag_type == 'implicit':
- tag_type = None
- tag = None
-
- # Convert old tag_type API to explicit/implicit params
- if tag_type is not None:
- if class_ is None:
- class_ = 'context'
- if tag_type == 'explicit':
- explicit = (class_, tag)
- elif tag_type == 'implicit':
- implicit = (class_, tag)
- else:
- raise ValueError(unwrap(
- '''
- tag_type must be one of "implicit", "explicit", not %s
- ''',
- repr(tag_type)
- ))
-
- if explicit is not None:
- # Ensure we have a tuple of 2-element tuples
- if len(explicit) == 2 and isinstance(explicit[1], int_types):
- explicit = (explicit, )
- for class_, tag in explicit:
- invalid_class = None
- if isinstance(class_, int_types):
- if class_ not in CLASS_NUM_TO_NAME_MAP:
- invalid_class = class_
- else:
- if class_ not in CLASS_NAME_TO_NUM_MAP:
- invalid_class = class_
- class_ = CLASS_NAME_TO_NUM_MAP[class_]
- if invalid_class is not None:
- raise ValueError(unwrap(
- '''
- explicit class must be one of "universal", "application",
- "context", "private", not %s
- ''',
- repr(invalid_class)
- ))
- if tag is not None:
- if not isinstance(tag, int_types):
- raise TypeError(unwrap(
- '''
- explicit tag must be an integer, not %s
- ''',
- type_name(tag)
- ))
- if self.explicit is None:
- self.explicit = ((class_, tag), )
- else:
- self.explicit = self.explicit + ((class_, tag), )
-
- elif implicit is not None:
- class_, tag = implicit
- if class_ not in CLASS_NAME_TO_NUM_MAP:
- raise ValueError(unwrap(
- '''
- implicit class must be one of "universal", "application",
- "context", "private", not %s
- ''',
- repr(class_)
- ))
- if tag is not None:
- if not isinstance(tag, int_types):
- raise TypeError(unwrap(
- '''
- implicit tag must be an integer, not %s
- ''',
- type_name(tag)
- ))
- self.class_ = CLASS_NAME_TO_NUM_MAP[class_]
- self.tag = tag
- self.implicit = True
- else:
- if class_ is not None:
- if class_ not in CLASS_NUM_TO_NAME_MAP:
- raise ValueError(unwrap(
- '''
- class_ must be one of "universal", "application",
- "context", "private", not %s
- ''',
- repr(class_)
- ))
- self.class_ = CLASS_NAME_TO_NUM_MAP[class_]
-
- if tag is not None:
- self.tag = tag
-
- if no_explicit:
- self.explicit = None
-
- if contents is not None:
- self.contents = contents
-
- elif default is not None:
- self.set(default)
-
- except (ValueError, TypeError) as e:
- args = e.args[1:]
- e.args = (e.args[0] + '\n while constructing %s' % type_name(self),) + args
- raise e
-
- def __str__(self):
- """
- Since str is different in Python 2 and 3, this calls the appropriate
- method, __unicode__() or __bytes__()
-
- :return:
- A unicode string
- """
-
- if _PY2:
- return self.__bytes__()
- else:
- return self.__unicode__()
-
- def __repr__(self):
- """
- :return:
- A unicode string
- """
-
- if _PY2:
- return '<%s %s b%s>' % (type_name(self), id(self), repr(self.dump()))
- else:
- return '<%s %s %s>' % (type_name(self), id(self), repr(self.dump()))
-
- def __bytes__(self):
- """
- A fall-back method for print() in Python 2
-
- :return:
- A byte string of the output of repr()
- """
-
- return self.__repr__().encode('utf-8')
-
- def __unicode__(self):
- """
- A fall-back method for print() in Python 3
-
- :return:
- A unicode string of the output of repr()
- """
-
- return self.__repr__()
-
- def _new_instance(self):
- """
- Constructs a new copy of the current object, preserving any tagging
-
- :return:
- An Asn1Value object
- """
-
- new_obj = self.__class__()
- new_obj.class_ = self.class_
- new_obj.tag = self.tag
- new_obj.implicit = self.implicit
- new_obj.explicit = self.explicit
- return new_obj
-
- def __copy__(self):
- """
- Implements the copy.copy() interface
-
- :return:
- A new shallow copy of the current Asn1Value object
- """
-
- new_obj = self._new_instance()
- new_obj._copy(self, copy.copy)
- return new_obj
-
- def __deepcopy__(self, memo):
- """
- Implements the copy.deepcopy() interface
-
- :param memo:
- A dict for memoization
-
- :return:
- A new deep copy of the current Asn1Value object
- """
-
- new_obj = self._new_instance()
- memo[id(self)] = new_obj
- new_obj._copy(self, copy.deepcopy)
- return new_obj
-
- def copy(self):
- """
- Copies the object, preserving any special tagging from it
-
- :return:
- An Asn1Value object
- """
-
- return copy.deepcopy(self)
-
- def retag(self, tagging, tag=None):
- """
- Copies the object, applying a new tagging to it
-
- :param tagging:
- A dict containing the keys "explicit" and "implicit". Legacy
- API allows a unicode string of "implicit" or "explicit".
-
- :param tag:
- A integer tag number. Only used when tagging is a unicode string.
-
- :return:
- An Asn1Value object
- """
-
- # This is required to preserve the old API
- if not isinstance(tagging, dict):
- tagging = {tagging: tag}
- new_obj = self.__class__(explicit=tagging.get('explicit'), implicit=tagging.get('implicit'))
- new_obj._copy(self, copy.deepcopy)
- return new_obj
-
- def untag(self):
- """
- Copies the object, removing any special tagging from it
-
- :return:
- An Asn1Value object
- """
-
- new_obj = self.__class__()
- new_obj._copy(self, copy.deepcopy)
- return new_obj
-
- def _copy(self, other, copy_func):
- """
- Copies the contents of another Asn1Value object to itself
-
- :param object:
- Another instance of the same class
-
- :param copy_func:
- An reference of copy.copy() or copy.deepcopy() to use when copying
- lists, dicts and objects
- """
-
- if self.__class__ != other.__class__:
- raise TypeError(unwrap(
- '''
- Can not copy values from %s object to %s object
- ''',
- type_name(other),
- type_name(self)
- ))
-
- self.contents = other.contents
- self._native = copy_func(other._native)
-
- def debug(self, nest_level=1):
- """
- Show the binary data and parsed data in a tree structure
- """
-
- prefix = ' ' * nest_level
-
- # This interacts with Any and moves the tag, implicit, explicit, _header,
- # contents, _footer to the parsed value so duplicate data isn't present
- has_parsed = hasattr(self, 'parsed')
-
- _basic_debug(prefix, self)
- if has_parsed:
- self.parsed.debug(nest_level + 2)
- elif hasattr(self, 'chosen'):
- self.chosen.debug(nest_level + 2)
- else:
- if _PY2 and isinstance(self.native, byte_cls):
- print('%s Native: b%s' % (prefix, repr(self.native)))
- else:
- print('%s Native: %s' % (prefix, self.native))
-
- def dump(self, force=False):
- """
- Encodes the value using DER
-
- :param force:
- If the encoded contents already exist, clear them and regenerate
- to ensure they are in DER format instead of BER format
-
- :return:
- A byte string of the DER-encoded value
- """
-
- contents = self.contents
-
- if self._header is None or force:
- if isinstance(self, Constructable) and self._indefinite:
- self.method = 0
-
- header = _dump_header(self.class_, self.method, self.tag, self.contents)
-
- if self.explicit is not None:
- for class_, tag in self.explicit:
- header = _dump_header(class_, 1, tag, header + self.contents) + header
-
- self._header = header
- self._trailer = b''
-
- return self._header + contents
-
-
-class ValueMap():
- """
- Basic functionality that allows for mapping values from ints or OIDs to
- python unicode strings
- """
-
- # A dict from primitive value (int or OID) to unicode string. This needs
- # to be defined in the source code
- _map = None
-
- # A dict from unicode string to int/OID. This is automatically generated
- # from _map the first time it is needed
- _reverse_map = None
-
- def _setup(self):
- """
- Generates _reverse_map from _map
- """
-
- cls = self.__class__
- if cls._map is None or cls._reverse_map is not None:
- return
- cls._reverse_map = {}
- for key, value in cls._map.items():
- cls._reverse_map[value] = key
-
-
-class Castable(object):
- """
- A mixin to handle converting an object between different classes that
- represent the same encoded value, but with different rules for converting
- to and from native Python values
- """
-
- def cast(self, other_class):
- """
- Converts the current object into an object of a different class. The
- new class must use the ASN.1 encoding for the value.
-
- :param other_class:
- The class to instantiate the new object from
-
- :return:
- An instance of the type other_class
- """
-
- if other_class.tag != self.__class__.tag:
- raise TypeError(unwrap(
- '''
- Can not covert a value from %s object to %s object since they
- use different tags: %d versus %d
- ''',
- type_name(other_class),
- type_name(self),
- other_class.tag,
- self.__class__.tag
- ))
-
- new_obj = other_class()
- new_obj.class_ = self.class_
- new_obj.implicit = self.implicit
- new_obj.explicit = self.explicit
- new_obj._header = self._header
- new_obj.contents = self.contents
- new_obj._trailer = self._trailer
- if isinstance(self, Constructable):
- new_obj.method = self.method
- new_obj._indefinite = self._indefinite
- return new_obj
-
-
-class Constructable(object):
- """
- A mixin to handle string types that may be constructed from chunks
- contained within an indefinite length BER-encoded container
- """
-
- # Instance attribute indicating if an object was indefinite
- # length when parsed - affects parsing and dumping
- _indefinite = False
-
- # Class attribute that indicates the offset into self.contents
- # that contains the chunks of data to merge
- _chunks_offset = 0
-
- def _merge_chunks(self):
- """
- :return:
- A concatenation of the native values of the contained chunks
- """
-
- if not self._indefinite:
- return self._as_chunk()
-
- pointer = self._chunks_offset
- contents_len = len(self.contents)
- output = None
-
- while pointer < contents_len:
- # We pass the current class as the spec so content semantics are preserved
- sub_value, pointer = _parse_build(self.contents, pointer, spec=self.__class__)
- if output is None:
- output = sub_value._merge_chunks()
- else:
- output += sub_value._merge_chunks()
-
- if output is None:
- return self._as_chunk()
-
- return output
-
- def _as_chunk(self):
- """
- A method to return a chunk of data that can be combined for
- constructed method values
-
- :return:
- A native Python value that can be added together. Examples include
- byte strings, unicode strings or tuples.
- """
-
- if self._chunks_offset == 0:
- return self.contents
- return self.contents[self._chunks_offset:]
-
- def _copy(self, other, copy_func):
- """
- Copies the contents of another Constructable object to itself
-
- :param object:
- Another instance of the same class
-
- :param copy_func:
- An reference of copy.copy() or copy.deepcopy() to use when copying
- lists, dicts and objects
- """
-
- super(Constructable, self)._copy(other, copy_func)
- self.method = other.method
- self._indefinite = other._indefinite
-
-
-class Void(Asn1Value):
- """
- A representation of an optional value that is not present. Has .native
- property and .dump() method to be compatible with other value classes.
- """
-
- contents = b''
-
- def __eq__(self, other):
- """
- :param other:
- The other Primitive to compare to
-
- :return:
- A boolean
- """
-
- return other.__class__ == self.__class__
-
- def __nonzero__(self):
- return False
-
- def __len__(self):
- return 0
-
- def __iter__(self):
- return iter(())
-
- @property
- def native(self):
- """
- The a native Python datatype representation of this value
-
- :return:
- None
- """
-
- return None
-
- def dump(self, force=False):
- """
- Encodes the value using DER
-
- :param force:
- If the encoded contents already exist, clear them and regenerate
- to ensure they are in DER format instead of BER format
-
- :return:
- A byte string of the DER-encoded value
- """
-
- return b''
-
-
-VOID = Void()
-
-
-class Any(Asn1Value):
- """
- A value class that can contain any value, and allows for easy parsing of
- the underlying encoded value using a spec. This is normally contained in
- a Structure that has an ObjectIdentifier field and _oid_pair and _oid_specs
- defined.
- """
-
- # The parsed value object
- _parsed = None
-
- def __init__(self, value=None, **kwargs):
- """
- Sets the value of the object before passing to Asn1Value.__init__()
-
- :param value:
- An Asn1Value object that will be set as the parsed value
- """
-
- Asn1Value.__init__(self, **kwargs)
-
- try:
- if value is not None:
- if not isinstance(value, Asn1Value):
- raise TypeError(unwrap(
- '''
- value must be an instance of Asn1Value, not %s
- ''',
- type_name(value)
- ))
-
- self._parsed = (value, value.__class__, None)
- self.contents = value.dump()
-
- except (ValueError, TypeError) as e:
- args = e.args[1:]
- e.args = (e.args[0] + '\n while constructing %s' % type_name(self),) + args
- raise e
-
- @property
- def native(self):
- """
- The a native Python datatype representation of this value
-
- :return:
- The .native value from the parsed value object
- """
-
- if self._parsed is None:
- self.parse()
-
- return self._parsed[0].native
-
- @property
- def parsed(self):
- """
- Returns the parsed object from .parse()
-
- :return:
- The object returned by .parse()
- """
-
- if self._parsed is None:
- self.parse()
-
- return self._parsed[0]
-
- def parse(self, spec=None, spec_params=None):
- """
- Parses the contents generically, or using a spec with optional params
-
- :param spec:
- A class derived from Asn1Value that defines what class_ and tag the
- value should have, and the semantics of the encoded value. The
- return value will be of this type. If omitted, the encoded value
- will be decoded using the standard universal tag based on the
- encoded tag number.
-
- :param spec_params:
- A dict of params to pass to the spec object
-
- :return:
- An object of the type spec, or if not present, a child of Asn1Value
- """
-
- if self._parsed is None or self._parsed[1:3] != (spec, spec_params):
- try:
- passed_params = spec_params or {}
- _tag_type_to_explicit_implicit(passed_params)
- if self.explicit is not None:
- if 'explicit' in passed_params:
- passed_params['explicit'] = self.explicit + passed_params['explicit']
- else:
- passed_params['explicit'] = self.explicit
- contents = self._header + self.contents + self._trailer
- parsed_value, _ = _parse_build(
- contents,
- spec=spec,
- spec_params=passed_params
- )
- self._parsed = (parsed_value, spec, spec_params)
-
- # Once we've parsed the Any value, clear any attributes from this object
- # since they are now duplicate
- self.tag = None
- self.explicit = None
- self.implicit = False
- self._header = b''
- self.contents = contents
- self._trailer = b''
-
- except (ValueError, TypeError) as e:
- args = e.args[1:]
- e.args = (e.args[0] + '\n while parsing %s' % type_name(self),) + args
- raise e
- return self._parsed[0]
-
- def _copy(self, other, copy_func):
- """
- Copies the contents of another Any object to itself
-
- :param object:
- Another instance of the same class
-
- :param copy_func:
- An reference of copy.copy() or copy.deepcopy() to use when copying
- lists, dicts and objects
- """
-
- super(Any, self)._copy(other, copy_func)
- self._parsed = copy_func(other._parsed)
-
- def dump(self, force=False):
- """
- Encodes the value using DER
-
- :param force:
- If the encoded contents already exist, clear them and regenerate
- to ensure they are in DER format instead of BER format
-
- :return:
- A byte string of the DER-encoded value
- """
-
- if self._parsed is None:
- self.parse()
-
- return self._parsed[0].dump(force=force)
-
-
-class Choice(Asn1Value):
- """
- A class to handle when a value may be one of several options
- """
-
- # The index in _alternatives of the validated alternative
- _choice = None
-
- # The name of the chosen alternative
- _name = None
-
- # The Asn1Value object for the chosen alternative
- _parsed = None
-
- # A list of tuples in one of the following forms.
- #
- # Option 1, a unicode string field name and a value class
- #
- # ("name", Asn1ValueClass)
- #
- # Option 2, same as Option 1, but with a dict of class params
- #
- # ("name", Asn1ValueClass, {'explicit': 5})
- _alternatives = None
-
- # A dict that maps tuples of (class_, tag) to an index in _alternatives
- _id_map = None
-
- # A dict that maps alternative names to an index in _alternatives
- _name_map = None
-
- @classmethod
- def load(cls, encoded_data, strict=False, **kwargs):
- """
- Loads a BER/DER-encoded byte string using the current class as the spec
-
- :param encoded_data:
- A byte string of BER or DER encoded data
-
- :param strict:
- A boolean indicating if trailing data should be forbidden - if so, a
- ValueError will be raised when trailing data exists
-
- :return:
- A instance of the current class
- """
-
- if not isinstance(encoded_data, byte_cls):
- raise TypeError('encoded_data must be a byte string, not %s' % type_name(encoded_data))
-
- value, _ = _parse_build(encoded_data, spec=cls, spec_params=kwargs, strict=strict)
- return value
-
- def _setup(self):
- """
- Generates _id_map from _alternatives to allow validating contents
- """
-
- cls = self.__class__
- cls._id_map = {}
- cls._name_map = {}
- for index, info in enumerate(cls._alternatives):
- if len(info) < 3:
- info = info + ({},)
- cls._alternatives[index] = info
- id_ = _build_id_tuple(info[2], info[1])
- cls._id_map[id_] = index
- cls._name_map[info[0]] = index
-
- def __init__(self, name=None, value=None, **kwargs):
- """
- Checks to ensure implicit tagging is not being used since it is
- incompatible with Choice, then forwards on to Asn1Value.__init__()
-
- :param name:
- The name of the alternative to be set - used with value.
- Alternatively this may be a dict with a single key being the name
- and the value being the value, or a two-element tuple of the the
- name and the value.
-
- :param value:
- The alternative value to set - used with name
-
- :raises:
- ValueError - when implicit param is passed (or legacy tag_type param is "implicit")
- """
-
- _tag_type_to_explicit_implicit(kwargs)
-
- Asn1Value.__init__(self, **kwargs)
-
- try:
- if kwargs.get('implicit') is not None:
- raise ValueError(unwrap(
- '''
- The Choice type can not be implicitly tagged even if in an
- implicit module - due to its nature any tagging must be
- explicit
- '''
- ))
-
- if name is not None:
- if isinstance(name, dict):
- if len(name) != 1:
- raise ValueError(unwrap(
- '''
- When passing a dict as the "name" argument to %s,
- it must have a single key/value - however %d were
- present
- ''',
- type_name(self),
- len(name)
- ))
- name, value = list(name.items())[0]
-
- if isinstance(name, tuple):
- if len(name) != 2:
- raise ValueError(unwrap(
- '''
- When passing a tuple as the "name" argument to %s,
- it must have two elements, the name and value -
- however %d were present
- ''',
- type_name(self),
- len(name)
- ))
- value = name[1]
- name = name[0]
-
- if name not in self._name_map:
- raise ValueError(unwrap(
- '''
- The name specified, "%s", is not a valid alternative
- for %s
- ''',
- name,
- type_name(self)
- ))
-
- self._choice = self._name_map[name]
- _, spec, params = self._alternatives[self._choice]
-
- if not isinstance(value, spec):
- value = spec(value, **params)
- else:
- value = _fix_tagging(value, params)
- self._parsed = value
-
- except (ValueError, TypeError) as e:
- args = e.args[1:]
- e.args = (e.args[0] + '\n while constructing %s' % type_name(self),) + args
- raise e
-
- @property
- def name(self):
- """
- :return:
- A unicode string of the field name of the chosen alternative
- """
- if not self._name:
- self._name = self._alternatives[self._choice][0]
- return self._name
-
- def parse(self):
- """
- Parses the detected alternative
-
- :return:
- An Asn1Value object of the chosen alternative
- """
-
- if self._parsed is not None:
- return self._parsed
-
- try:
- _, spec, params = self._alternatives[self._choice]
- self._parsed, _ = _parse_build(self.contents, spec=spec, spec_params=params)
- except (ValueError, TypeError) as e:
- args = e.args[1:]
- e.args = (e.args[0] + '\n while parsing %s' % type_name(self),) + args
- raise e
-
- @property
- def chosen(self):
- """
- :return:
- An Asn1Value object of the chosen alternative
- """
-
- return self.parse()
-
- @property
- def native(self):
- """
- The a native Python datatype representation of this value
-
- :return:
- The .native value from the contained value object
- """
-
- return self.chosen.native
-
- def validate(self, class_, tag, contents):
- """
- Ensures that the class and tag specified exist as an alternative
-
- :param class_:
- The integer class_ from the encoded value header
-
- :param tag:
- The integer tag from the encoded value header
-
- :param contents:
- A byte string of the contents of the value - used when the object
- is explicitly tagged
-
- :raises:
- ValueError - when value is not a valid alternative
- """
-
- id_ = (class_, tag)
-
- if self.explicit is not None:
- if self.explicit[-1] != id_:
- raise ValueError(unwrap(
- '''
- %s was explicitly tagged, but the value provided does not
- match the class and tag
- ''',
- type_name(self)
- ))
-
- ((class_, _, tag, _, _, _), _) = _parse(contents, len(contents))
- id_ = (class_, tag)
-
- if id_ in self._id_map:
- self._choice = self._id_map[id_]
- return
-
- # This means the Choice was implicitly tagged
- if self.class_ is not None and self.tag is not None:
- if len(self._alternatives) > 1:
- raise ValueError(unwrap(
- '''
- %s was implicitly tagged, but more than one alternative
- exists
- ''',
- type_name(self)
- ))
- if id_ == (self.class_, self.tag):
- self._choice = 0
- return
-
- asn1 = self._format_class_tag(class_, tag)
- asn1s = [self._format_class_tag(pair[0], pair[1]) for pair in self._id_map]
-
- raise ValueError(unwrap(
- '''
- Value %s did not match the class and tag of any of the alternatives
- in %s: %s
- ''',
- asn1,
- type_name(self),
- ', '.join(asn1s)
- ))
-
- def _format_class_tag(self, class_, tag):
- """
- :return:
- A unicode string of a human-friendly representation of the class and tag
- """
-
- return '[%s %s]' % (CLASS_NUM_TO_NAME_MAP[class_].upper(), tag)
-
- def _copy(self, other, copy_func):
- """
- Copies the contents of another Choice object to itself
-
- :param object:
- Another instance of the same class
-
- :param copy_func:
- An reference of copy.copy() or copy.deepcopy() to use when copying
- lists, dicts and objects
- """
-
- super(Choice, self)._copy(other, copy_func)
- self._choice = other._choice
- self._name = other._name
- self._parsed = copy_func(other._parsed)
-
- def dump(self, force=False):
- """
- Encodes the value using DER
-
- :param force:
- If the encoded contents already exist, clear them and regenerate
- to ensure they are in DER format instead of BER format
-
- :return:
- A byte string of the DER-encoded value
- """
-
- self.contents = self.chosen.dump(force=force)
- if self._header is None or force:
- self._header = b''
- if self.explicit is not None:
- for class_, tag in self.explicit:
- self._header = _dump_header(class_, 1, tag, self._header + self.contents) + self._header
- return self._header + self.contents
-
-
-class Concat(object):
- """
- A class that contains two or more encoded child values concatentated
- together. THIS IS NOT PART OF THE ASN.1 SPECIFICATION! This exists to handle
- the x509.TrustedCertificate() class for OpenSSL certificates containing
- extra information.
- """
-
- # A list of the specs of the concatenated values
- _child_specs = None
-
- _children = None
-
- @classmethod
- def load(cls, encoded_data, strict=False):
- """
- Loads a BER/DER-encoded byte string using the current class as the spec
-
- :param encoded_data:
- A byte string of BER or DER encoded data
-
- :param strict:
- A boolean indicating if trailing data should be forbidden - if so, a
- ValueError will be raised when trailing data exists
-
- :return:
- A Concat object
- """
-
- return cls(contents=encoded_data, strict=strict)
-
- def __init__(self, value=None, contents=None, strict=False):
- """
- :param value:
- A native Python datatype to initialize the object value with
-
- :param contents:
- A byte string of the encoded contents of the value
-
- :param strict:
- A boolean indicating if trailing data should be forbidden - if so, a
- ValueError will be raised when trailing data exists in contents
-
- :raises:
- ValueError - when an error occurs with one of the children
- TypeError - when an error occurs with one of the children
- """
-
- if contents is not None:
- try:
- contents_len = len(contents)
- self._children = []
-
- offset = 0
- for spec in self._child_specs:
- if offset < contents_len:
- child_value, offset = _parse_build(contents, pointer=offset, spec=spec)
- else:
- child_value = spec()
- self._children.append(child_value)
-
- if strict and offset != contents_len:
- extra_bytes = contents_len - offset
- raise ValueError('Extra data - %d bytes of trailing data were provided' % extra_bytes)
-
- except (ValueError, TypeError) as e:
- args = e.args[1:]
- e.args = (e.args[0] + '\n while constructing %s' % type_name(self),) + args
- raise e
-
- if value is not None:
- if self._children is None:
- self._children = [None] * len(self._child_specs)
- for index, data in enumerate(value):
- self.__setitem__(index, data)
-
- def __str__(self):
- """
- Since str is different in Python 2 and 3, this calls the appropriate
- method, __unicode__() or __bytes__()
-
- :return:
- A unicode string
- """
-
- if _PY2:
- return self.__bytes__()
- else:
- return self.__unicode__()
-
- def __bytes__(self):
- """
- A byte string of the DER-encoded contents
- """
-
- return self.dump()
-
- def __unicode__(self):
- """
- :return:
- A unicode string
- """
-
- return repr(self)
-
- def __repr__(self):
- """
- :return:
- A unicode string
- """
-
- return '<%s %s %s>' % (type_name(self), id(self), repr(self.dump()))
-
- def __copy__(self):
- """
- Implements the copy.copy() interface
-
- :return:
- A new shallow copy of the Concat object
- """
-
- new_obj = self.__class__()
- new_obj._copy(self, copy.copy)
- return new_obj
-
- def __deepcopy__(self, memo):
- """
- Implements the copy.deepcopy() interface
-
- :param memo:
- A dict for memoization
-
- :return:
- A new deep copy of the Concat object and all child objects
- """
-
- new_obj = self.__class__()
- memo[id(self)] = new_obj
- new_obj._copy(self, copy.deepcopy)
- return new_obj
-
- def copy(self):
- """
- Copies the object
-
- :return:
- A Concat object
- """
-
- return copy.deepcopy(self)
-
- def _copy(self, other, copy_func):
- """
- Copies the contents of another Concat object to itself
-
- :param object:
- Another instance of the same class
-
- :param copy_func:
- An reference of copy.copy() or copy.deepcopy() to use when copying
- lists, dicts and objects
- """
-
- if self.__class__ != other.__class__:
- raise TypeError(unwrap(
- '''
- Can not copy values from %s object to %s object
- ''',
- type_name(other),
- type_name(self)
- ))
-
- self._children = copy_func(other._children)
-
- def debug(self, nest_level=1):
- """
- Show the binary data and parsed data in a tree structure
- """
-
- prefix = ' ' * nest_level
- print('%s%s Object #%s' % (prefix, type_name(self), id(self)))
- print('%s Children:' % (prefix,))
- for child in self._children:
- child.debug(nest_level + 2)
-
- def dump(self, force=False):
- """
- Encodes the value using DER
-
- :param force:
- If the encoded contents already exist, clear them and regenerate
- to ensure they are in DER format instead of BER format
-
- :return:
- A byte string of the DER-encoded value
- """
-
- contents = b''
- for child in self._children:
- contents += child.dump(force=force)
- return contents
-
- @property
- def contents(self):
- """
- :return:
- A byte string of the DER-encoded contents of the children
- """
-
- return self.dump()
-
- def __len__(self):
- """
- :return:
- Integer
- """
-
- return len(self._children)
-
- def __getitem__(self, key):
- """
- Allows accessing children by index
-
- :param key:
- An integer of the child index
-
- :raises:
- KeyError - when an index is invalid
-
- :return:
- The Asn1Value object of the child specified
- """
-
- if key > len(self._child_specs) - 1 or key < 0:
- raise KeyError(unwrap(
- '''
- No child is definition for position %d of %s
- ''',
- key,
- type_name(self)
- ))
-
- return self._children[key]
-
- def __setitem__(self, key, value):
- """
- Allows settings children by index
-
- :param key:
- An integer of the child index
-
- :param value:
- An Asn1Value object to set the child to
-
- :raises:
- KeyError - when an index is invalid
- ValueError - when the value is not an instance of Asn1Value
- """
-
- if key > len(self._child_specs) - 1 or key < 0:
- raise KeyError(unwrap(
- '''
- No child is defined for position %d of %s
- ''',
- key,
- type_name(self)
- ))
-
- if not isinstance(value, Asn1Value):
- raise ValueError(unwrap(
- '''
- Value for child %s of %s is not an instance of
- asn1crypto.core.Asn1Value
- ''',
- key,
- type_name(self)
- ))
-
- self._children[key] = value
-
- def __iter__(self):
- """
- :return:
- An iterator of child values
- """
-
- return iter(self._children)
-
-
-class Primitive(Asn1Value):
- """
- Sets the class_ and method attributes for primitive, universal values
- """
-
- class_ = 0
-
- method = 0
-
- def __init__(self, value=None, default=None, contents=None, **kwargs):
- """
- Sets the value of the object before passing to Asn1Value.__init__()
-
- :param value:
- A native Python datatype to initialize the object value with
-
- :param default:
- The default value if no value is specified
-
- :param contents:
- A byte string of the encoded contents of the value
- """
-
- Asn1Value.__init__(self, **kwargs)
-
- try:
- if contents is not None:
- self.contents = contents
-
- elif value is not None:
- self.set(value)
-
- elif default is not None:
- self.set(default)
-
- except (ValueError, TypeError) as e:
- args = e.args[1:]
- e.args = (e.args[0] + '\n while constructing %s' % type_name(self),) + args
- raise e
-
- def set(self, value):
- """
- Sets the value of the object
-
- :param value:
- A byte string
- """
-
- if not isinstance(value, byte_cls):
- raise TypeError(unwrap(
- '''
- %s value must be a byte string, not %s
- ''',
- type_name(self),
- type_name(value)
- ))
-
- self._native = value
- self.contents = value
- self._header = None
- if self._trailer != b'':
- self._trailer = b''
-
- def dump(self, force=False):
- """
- Encodes the value using DER
-
- :param force:
- If the encoded contents already exist, clear them and regenerate
- to ensure they are in DER format instead of BER format
-
- :return:
- A byte string of the DER-encoded value
- """
-
- if force:
- native = self.native
- self.contents = None
- self.set(native)
-
- return Asn1Value.dump(self)
-
- def __ne__(self, other):
- return not self == other
-
- def __eq__(self, other):
- """
- :param other:
- The other Primitive to compare to
-
- :return:
- A boolean
- """
-
- if not isinstance(other, Primitive):
- return False
-
- if self.contents != other.contents:
- return False
-
- # We compare class tag numbers since object tag numbers could be
- # different due to implicit or explicit tagging
- if self.__class__.tag != other.__class__.tag:
- return False
-
- if self.__class__ == other.__class__ and self.contents == other.contents:
- return True
-
- # If the objects share a common base class that is not too low-level
- # then we can compare the contents
- self_bases = (set(self.__class__.__bases__) | set([self.__class__])) - set([Asn1Value, Primitive, ValueMap])
- other_bases = (set(other.__class__.__bases__) | set([other.__class__])) - set([Asn1Value, Primitive, ValueMap])
- if self_bases | other_bases:
- return self.contents == other.contents
-
- # When tagging is going on, do the extra work of constructing new
- # objects to see if the dumped representation are the same
- if self.implicit or self.explicit or other.implicit or other.explicit:
- return self.untag().dump() == other.untag().dump()
-
- return self.dump() == other.dump()
-
-
-class AbstractString(Constructable, Primitive):
- """
- A base class for all strings that have a known encoding. In general, we do
- not worry ourselves with confirming that the decoded values match a specific
- set of characters, only that they are decoded into a Python unicode string
- """
-
- # The Python encoding name to use when decoding or encoded the contents
- _encoding = 'latin1'
-
- # Instance attribute of (possibly-merged) unicode string
- _unicode = None
-
- def set(self, value):
- """
- Sets the value of the string
-
- :param value:
- A unicode string
- """
-
- if not isinstance(value, str_cls):
- raise TypeError(unwrap(
- '''
- %s value must be a unicode string, not %s
- ''',
- type_name(self),
- type_name(value)
- ))
-
- self._unicode = value
- self.contents = value.encode(self._encoding)
- self._header = None
- if self._indefinite:
- self._indefinite = False
- self.method = 0
- if self._trailer != b'':
- self._trailer = b''
-
- def __unicode__(self):
- """
- :return:
- A unicode string
- """
-
- if self.contents is None:
- return ''
- if self._unicode is None:
- self._unicode = self._merge_chunks().decode(self._encoding)
- return self._unicode
-
- def _copy(self, other, copy_func):
- """
- Copies the contents of another AbstractString object to itself
-
- :param object:
- Another instance of the same class
-
- :param copy_func:
- An reference of copy.copy() or copy.deepcopy() to use when copying
- lists, dicts and objects
- """
-
- super(AbstractString, self)._copy(other, copy_func)
- self._unicode = other._unicode
-
- @property
- def native(self):
- """
- The a native Python datatype representation of this value
-
- :return:
- A unicode string or None
- """
-
- if self.contents is None:
- return None
-
- return self.__unicode__()
-
-
-class Boolean(Primitive):
- """
- Represents a boolean in both ASN.1 and Python
- """
-
- tag = 1
-
- def set(self, value):
- """
- Sets the value of the object
-
- :param value:
- True, False or another value that works with bool()
- """
-
- self._native = bool(value)
- self.contents = b'\x00' if not value else b'\xff'
- self._header = None
- if self._trailer != b'':
- self._trailer = b''
-
- # Python 2
- def __nonzero__(self):
- """
- :return:
- True or False
- """
- return self.__bool__()
-
- def __bool__(self):
- """
- :return:
- True or False
- """
- return self.contents != b'\x00'
-
- @property
- def native(self):
- """
- The a native Python datatype representation of this value
-
- :return:
- True, False or None
- """
-
- if self.contents is None:
- return None
-
- if self._native is None:
- self._native = self.__bool__()
- return self._native
-
-
-class Integer(Primitive, ValueMap):
- """
- Represents an integer in both ASN.1 and Python
- """
-
- tag = 2
-
- def set(self, value):
- """
- Sets the value of the object
-
- :param value:
- An integer, or a unicode string if _map is set
-
- :raises:
- ValueError - when an invalid value is passed
- """
-
- if isinstance(value, str_cls):
- if self._map is None:
- raise ValueError(unwrap(
- '''
- %s value is a unicode string, but no _map provided
- ''',
- type_name(self)
- ))
-
- if value not in self._reverse_map:
- raise ValueError(unwrap(
- '''
- %s value, %s, is not present in the _map
- ''',
- type_name(self),
- value
- ))
-
- value = self._reverse_map[value]
-
- elif not isinstance(value, int_types):
- raise TypeError(unwrap(
- '''
- %s value must be an integer or unicode string when a name_map
- is provided, not %s
- ''',
- type_name(self),
- type_name(value)
- ))
-
- self._native = self._map[value] if self._map and value in self._map else value
-
- self.contents = int_to_bytes(value, signed=True)
- self._header = None
- if self._trailer != b'':
- self._trailer = b''
-
- def __int__(self):
- """
- :return:
- An integer
- """
- return int_from_bytes(self.contents, signed=True)
-
- @property
- def native(self):
- """
- The a native Python datatype representation of this value
-
- :return:
- An integer or None
- """
-
- if self.contents is None:
- return None
-
- if self._native is None:
- self._native = self.__int__()
- if self._map is not None and self._native in self._map:
- self._native = self._map[self._native]
- return self._native
-
-
-class BitString(Constructable, Castable, Primitive, ValueMap, object):
- """
- Represents a bit string from ASN.1 as a Python tuple of 1s and 0s
- """
-
- tag = 3
-
- _size = None
-
- # Used with _as_chunk() from Constructable
- _chunk = None
- _chunks_offset = 1
-
- def _setup(self):
- """
- Generates _reverse_map from _map
- """
-
- ValueMap._setup(self)
-
- cls = self.__class__
- if cls._map is not None:
- cls._size = max(self._map.keys()) + 1
-
- def set(self, value):
- """
- Sets the value of the object
-
- :param value:
- An integer or a tuple of integers 0 and 1
-
- :raises:
- ValueError - when an invalid value is passed
- """
-
- if isinstance(value, set):
- if self._map is None:
- raise ValueError(unwrap(
- '''
- %s._map has not been defined
- ''',
- type_name(self)
- ))
-
- bits = [0] * self._size
- self._native = value
- for index in range(0, self._size):
- key = self._map.get(index)
- if key is None:
- continue
- if key in value:
- bits[index] = 1
-
- value = ''.join(map(str_cls, bits))
-
- elif value.__class__ == tuple:
- if self._map is None:
- self._native = value
- else:
- self._native = set()
- for index, bit in enumerate(value):
- if bit:
- name = self._map.get(index, index)
- self._native.add(name)
- value = ''.join(map(str_cls, value))
-
- else:
- raise TypeError(unwrap(
- '''
- %s value must be a tuple of ones and zeros or a set of unicode
- strings, not %s
- ''',
- type_name(self),
- type_name(value)
- ))
-
- self._chunk = None
-
- if self._map is not None:
- if len(value) > self._size:
- raise ValueError(unwrap(
- '''
- %s value must be at most %s bits long, specified was %s long
- ''',
- type_name(self),
- self._size,
- len(value)
- ))
- # A NamedBitList must have trailing zero bit truncated. See
- # https://www.itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf
- # section 11.2,
- # https://tools.ietf.org/html/rfc5280#page-134 and
- # https://www.ietf.org/mail-archive/web/pkix/current/msg10443.html
- value = value.rstrip('0')
- size = len(value)
-
- size_mod = size % 8
- extra_bits = 0
- if size_mod != 0:
- extra_bits = 8 - size_mod
- value += '0' * extra_bits
-
- size_in_bytes = int(math.ceil(size / 8))
-
- if extra_bits:
- extra_bits_byte = int_to_bytes(extra_bits)
- else:
- extra_bits_byte = b'\x00'
-
- if value == '':
- value_bytes = b''
- else:
- value_bytes = int_to_bytes(int(value, 2))
- if len(value_bytes) != size_in_bytes:
- value_bytes = (b'\x00' * (size_in_bytes - len(value_bytes))) + value_bytes
-
- self.contents = extra_bits_byte + value_bytes
- self._header = None
- if self._indefinite:
- self._indefinite = False
- self.method = 0
- if self._trailer != b'':
- self._trailer = b''
-
- def __getitem__(self, key):
- """
- Retrieves a boolean version of one of the bits based on a name from the
- _map
-
- :param key:
- The unicode string of one of the bit names
-
- :raises:
- ValueError - when _map is not set or the key name is invalid
-
- :return:
- A boolean if the bit is set
- """
-
- is_int = isinstance(key, int_types)
- if not is_int:
- if not isinstance(self._map, dict):
- raise ValueError(unwrap(
- '''
- %s._map has not been defined
- ''',
- type_name(self)
- ))
-
- if key not in self._reverse_map:
- raise ValueError(unwrap(
- '''
- %s._map does not contain an entry for "%s"
- ''',
- type_name(self),
- key
- ))
-
- if self._native is None:
- self.native
-
- if self._map is None:
- if len(self._native) >= key + 1:
- return bool(self._native[key])
- return False
-
- if is_int:
- key = self._map.get(key, key)
-
- return key in self._native
-
- def __setitem__(self, key, value):
- """
- Sets one of the bits based on a name from the _map
-
- :param key:
- The unicode string of one of the bit names
-
- :param value:
- A boolean value
-
- :raises:
- ValueError - when _map is not set or the key name is invalid
- """
-
- is_int = isinstance(key, int_types)
- if not is_int:
- if self._map is None:
- raise ValueError(unwrap(
- '''
- %s._map has not been defined
- ''',
- type_name(self)
- ))
-
- if key not in self._reverse_map:
- raise ValueError(unwrap(
- '''
- %s._map does not contain an entry for "%s"
- ''',
- type_name(self),
- key
- ))
-
- if self._native is None:
- self.native
-
- if self._map is None:
- new_native = list(self._native)
- max_key = len(new_native) - 1
- if key > max_key:
- new_native.extend([0] * (key - max_key))
- new_native[key] = 1 if value else 0
- self._native = tuple(new_native)
-
- else:
- if is_int:
- key = self._map.get(key, key)
-
- if value:
- if key not in self._native:
- self._native.add(key)
- else:
- if key in self._native:
- self._native.remove(key)
-
- self.set(self._native)
-
- def _as_chunk(self):
- """
- Allows reconstructing indefinite length values
-
- :return:
- A tuple of integers
- """
-
- extra_bits = int_from_bytes(self.contents[0:1])
- bit_string = '{0:b}'.format(int_from_bytes(self.contents[1:]))
- byte_len = len(self.contents[1:])
- bit_len = len(bit_string)
-
- # Left-pad the bit string to a byte multiple to ensure we didn't
- # lose any zero bits on the left
- mod_bit_len = bit_len % 8
- if mod_bit_len != 0:
- bit_string = ('0' * (8 - mod_bit_len)) + bit_string
- bit_len = len(bit_string)
-
- if bit_len // 8 < byte_len:
- missing_bytes = byte_len - (bit_len // 8)
- bit_string = ('0' * (8 * missing_bytes)) + bit_string
-
- # Trim off the extra bits on the right used to fill the last byte
- if extra_bits > 0:
- bit_string = bit_string[0:0 - extra_bits]
-
- return tuple(map(int, tuple(bit_string)))
-
- @property
- def native(self):
- """
- The a native Python datatype representation of this value
-
- :return:
- If a _map is set, a set of names, or if no _map is set, a tuple of
- integers 1 and 0. None if no value.
- """
-
- # For BitString we default the value to be all zeros
- if self.contents is None:
- if self._map is None:
- self.set(())
- else:
- self.set(set())
-
- if self._native is None:
- bits = self._merge_chunks()
- if self._map:
- self._native = set()
- for index, bit in enumerate(bits):
- if bit:
- name = self._map.get(index, index)
- self._native.add(name)
- else:
- self._native = bits
- return self._native
-
-
-class OctetBitString(Constructable, Castable, Primitive):
- """
- Represents a bit string in ASN.1 as a Python byte string
- """
-
- tag = 3
-
- # Whenever dealing with octet-based bit strings, we really want the
- # bytes, so we just ignore the unused bits portion since it isn't
- # applicable to the current use case
- # unused_bits = struct.unpack('>B', self.contents[0:1])[0]
- _chunks_offset = 1
-
- # Instance attribute of (possibly-merged) byte string
- _bytes = None
-
- def set(self, value):
- """
- Sets the value of the object
-
- :param value:
- A byte string
-
- :raises:
- ValueError - when an invalid value is passed
- """
-
- if not isinstance(value, byte_cls):
- raise TypeError(unwrap(
- '''
- %s value must be a byte string, not %s
- ''',
- type_name(self),
- type_name(value)
- ))
-
- self._bytes = value
- # Set the unused bits to 0
- self.contents = b'\x00' + value
- self._header = None
- if self._indefinite:
- self._indefinite = False
- self.method = 0
- if self._trailer != b'':
- self._trailer = b''
-
- def __bytes__(self):
- """
- :return:
- A byte string
- """
-
- if self.contents is None:
- return b''
- if self._bytes is None:
- self._bytes = self._merge_chunks()
- return self._bytes
-
- def _copy(self, other, copy_func):
- """
- Copies the contents of another OctetBitString object to itself
-
- :param object:
- Another instance of the same class
-
- :param copy_func:
- An reference of copy.copy() or copy.deepcopy() to use when copying
- lists, dicts and objects
- """
-
- super(OctetBitString, self)._copy(other, copy_func)
- self._bytes = other._bytes
-
- @property
- def native(self):
- """
- The a native Python datatype representation of this value
-
- :return:
- A byte string or None
- """
-
- if self.contents is None:
- return None
-
- return self.__bytes__()
-
-
-class IntegerBitString(Constructable, Castable, Primitive):
- """
- Represents a bit string in ASN.1 as a Python integer
- """
-
- tag = 3
-
- _chunks_offset = 1
-
- def set(self, value):
- """
- Sets the value of the object
-
- :param value:
- An integer
-
- :raises:
- ValueError - when an invalid value is passed
- """
-
- if not isinstance(value, int_types):
- raise TypeError(unwrap(
- '''
- %s value must be an integer, not %s
- ''',
- type_name(self),
- type_name(value)
- ))
-
- self._native = value
- # Set the unused bits to 0
- self.contents = b'\x00' + int_to_bytes(value, signed=True)
- self._header = None
- if self._indefinite:
- self._indefinite = False
- self.method = 0
- if self._trailer != b'':
- self._trailer = b''
-
- def _as_chunk(self):
- """
- Allows reconstructing indefinite length values
-
- :return:
- A unicode string of bits - 1s and 0s
- """
-
- extra_bits = int_from_bytes(self.contents[0:1])
- bit_string = '{0:b}'.format(int_from_bytes(self.contents[1:]))
-
- # Ensure we have leading zeros since these chunks may be concatenated together
- mod_bit_len = len(bit_string) % 8
- if mod_bit_len != 0:
- bit_string = ('0' * (8 - mod_bit_len)) + bit_string
-
- if extra_bits > 0:
- return bit_string[0:0 - extra_bits]
-
- return bit_string
-
- @property
- def native(self):
- """
- The a native Python datatype representation of this value
-
- :return:
- An integer or None
- """
-
- if self.contents is None:
- return None
-
- if self._native is None:
- extra_bits = int_from_bytes(self.contents[0:1])
- # Fast path
- if not self._indefinite and extra_bits == 0:
- self._native = int_from_bytes(self.contents[1:])
- else:
- if self._indefinite and extra_bits > 0:
- raise ValueError('Constructed bit string has extra bits on indefinite container')
- self._native = int(self._merge_chunks(), 2)
- return self._native
-
-
-class OctetString(Constructable, Castable, Primitive):
- """
- Represents a byte string in both ASN.1 and Python
- """
-
- tag = 4
-
- # Instance attribute of (possibly-merged) byte string
- _bytes = None
-
- def set(self, value):
- """
- Sets the value of the object
-
- :param value:
- A byte string
- """
-
- if not isinstance(value, byte_cls):
- raise TypeError(unwrap(
- '''
- %s value must be a byte string, not %s
- ''',
- type_name(self),
- type_name(value)
- ))
-
- self._bytes = value
- self.contents = value
- self._header = None
- if self._indefinite:
- self._indefinite = False
- self.method = 0
- if self._trailer != b'':
- self._trailer = b''
-
- def __bytes__(self):
- """
- :return:
- A byte string
- """
-
- if self.contents is None:
- return b''
- if self._bytes is None:
- self._bytes = self._merge_chunks()
- return self._bytes
-
- def _copy(self, other, copy_func):
- """
- Copies the contents of another OctetString object to itself
-
- :param object:
- Another instance of the same class
-
- :param copy_func:
- An reference of copy.copy() or copy.deepcopy() to use when copying
- lists, dicts and objects
- """
-
- super(OctetString, self)._copy(other, copy_func)
- self._bytes = other._bytes
-
- @property
- def native(self):
- """
- The a native Python datatype representation of this value
-
- :return:
- A byte string or None
- """
-
- if self.contents is None:
- return None
-
- return self.__bytes__()
-
-
-class IntegerOctetString(Constructable, Castable, Primitive):
- """
- Represents a byte string in ASN.1 as a Python integer
- """
-
- tag = 4
-
- def set(self, value):
- """
- Sets the value of the object
-
- :param value:
- An integer
-
- :raises:
- ValueError - when an invalid value is passed
- """
-
- if not isinstance(value, int_types):
- raise TypeError(unwrap(
- '''
- %s value must be an integer, not %s
- ''',
- type_name(self),
- type_name(value)
- ))
-
- self._native = value
- self.contents = int_to_bytes(value, signed=False)
- self._header = None
- if self._indefinite:
- self._indefinite = False
- self.method = 0
- if self._trailer != b'':
- self._trailer = b''
-
- @property
- def native(self):
- """
- The a native Python datatype representation of this value
-
- :return:
- An integer or None
- """
-
- if self.contents is None:
- return None
-
- if self._native is None:
- self._native = int_from_bytes(self._merge_chunks())
- return self._native
-
-
-class ParsableOctetString(Constructable, Castable, Primitive):
-
- tag = 4
-
- _parsed = None
-
- # Instance attribute of (possibly-merged) byte string
- _bytes = None
-
- def __init__(self, value=None, parsed=None, **kwargs):
- """
- Allows providing a parsed object that will be serialized to get the
- byte string value
-
- :param value:
- A native Python datatype to initialize the object value with
-
- :param parsed:
- If value is None and this is an Asn1Value object, this will be
- set as the parsed value, and the value will be obtained by calling
- .dump() on this object.
- """
-
- set_parsed = False
- if value is None and parsed is not None and isinstance(parsed, Asn1Value):
- value = parsed.dump()
- set_parsed = True
-
- Primitive.__init__(self, value=value, **kwargs)
-
- if set_parsed:
- self._parsed = (parsed, parsed.__class__, None)
-
- def set(self, value):
- """
- Sets the value of the object
-
- :param value:
- A byte string
- """
-
- if not isinstance(value, byte_cls):
- raise TypeError(unwrap(
- '''
- %s value must be a byte string, not %s
- ''',
- type_name(self),
- type_name(value)
- ))
-
- self._bytes = value
- self.contents = value
- self._header = None
- if self._indefinite:
- self._indefinite = False
- self.method = 0
- if self._trailer != b'':
- self._trailer = b''
-
- def parse(self, spec=None, spec_params=None):
- """
- Parses the contents generically, or using a spec with optional params
-
- :param spec:
- A class derived from Asn1Value that defines what class_ and tag the
- value should have, and the semantics of the encoded value. The
- return value will be of this type. If omitted, the encoded value
- will be decoded using the standard universal tag based on the
- encoded tag number.
-
- :param spec_params:
- A dict of params to pass to the spec object
-
- :return:
- An object of the type spec, or if not present, a child of Asn1Value
- """
-
- if self._parsed is None or self._parsed[1:3] != (spec, spec_params):
- parsed_value, _ = _parse_build(self.__bytes__(), spec=spec, spec_params=spec_params)
- self._parsed = (parsed_value, spec, spec_params)
- return self._parsed[0]
-
- def __bytes__(self):
- """
- :return:
- A byte string
- """
-
- if self.contents is None:
- return b''
- if self._bytes is None:
- self._bytes = self._merge_chunks()
- return self._bytes
-
- def _copy(self, other, copy_func):
- """
- Copies the contents of another ParsableOctetString object to itself
-
- :param object:
- Another instance of the same class
-
- :param copy_func:
- An reference of copy.copy() or copy.deepcopy() to use when copying
- lists, dicts and objects
- """
-
- super(ParsableOctetString, self)._copy(other, copy_func)
- self._bytes = other._bytes
- self._parsed = copy_func(other._parsed)
-
- @property
- def native(self):
- """
- The a native Python datatype representation of this value
-
- :return:
- A byte string or None
- """
-
- if self.contents is None:
- return None
-
- if self._parsed is not None:
- return self._parsed[0].native
- else:
- return self.__bytes__()
-
- @property
- def parsed(self):
- """
- Returns the parsed object from .parse()
-
- :return:
- The object returned by .parse()
- """
-
- if self._parsed is None:
- self.parse()
-
- return self._parsed[0]
-
- def dump(self, force=False):
- """
- Encodes the value using DER
-
- :param force:
- If the encoded contents already exist, clear them and regenerate
- to ensure they are in DER format instead of BER format
-
- :return:
- A byte string of the DER-encoded value
- """
-
- if force:
- if self._parsed is not None:
- native = self.parsed.dump(force=force)
- else:
- native = self.native
- self.contents = None
- self.set(native)
-
- return Asn1Value.dump(self)
-
-
-class ParsableOctetBitString(ParsableOctetString):
-
- tag = 3
-
- # Whenever dealing with octet-based bit strings, we really want the
- # bytes, so we just ignore the unused bits portion since it isn't
- # applicable to the current use case
- # unused_bits = struct.unpack('>B', self.contents[0:1])[0]
- _chunks_offset = 1
-
- def set(self, value):
- """
- Sets the value of the object
-
- :param value:
- A byte string
-
- :raises:
- ValueError - when an invalid value is passed
- """
-
- if not isinstance(value, byte_cls):
- raise TypeError(unwrap(
- '''
- %s value must be a byte string, not %s
- ''',
- type_name(self),
- type_name(value)
- ))
-
- self._bytes = value
- # Set the unused bits to 0
- self.contents = b'\x00' + value
- self._header = None
- if self._indefinite:
- self._indefinite = False
- self.method = 0
- if self._trailer != b'':
- self._trailer = b''
-
-
-class Null(Primitive):
- """
- Represents a null value in ASN.1 as None in Python
- """
-
- tag = 5
-
- contents = b''
-
- def set(self, value):
- """
- Sets the value of the object
-
- :param value:
- None
- """
-
- self.contents = b''
-
- @property
- def native(self):
- """
- The a native Python datatype representation of this value
-
- :return:
- None
- """
-
- return None
-
-
-class ObjectIdentifier(Primitive, ValueMap):
- """
- Represents an object identifier in ASN.1 as a Python unicode dotted
- integer string
- """
-
- tag = 6
-
- # A unicode string of the dotted form of the object identifier
- _dotted = None
-
- @classmethod
- def map(cls, value):
- """
- Converts a dotted unicode string OID into a mapped unicode string
-
- :param value:
- A dotted unicode string OID
-
- :raises:
- ValueError - when no _map dict has been defined on the class
- TypeError - when value is not a unicode string
-
- :return:
- A mapped unicode string
- """
-
- if cls._map is None:
- raise ValueError(unwrap(
- '''
- %s._map has not been defined
- ''',
- type_name(cls)
- ))
-
- if not isinstance(value, str_cls):
- raise TypeError(unwrap(
- '''
- value must be a unicode string, not %s
- ''',
- type_name(value)
- ))
-
- return cls._map.get(value, value)
-
- @classmethod
- def unmap(cls, value):
- """
- Converts a mapped unicode string value into a dotted unicode string OID
-
- :param value:
- A mapped unicode string OR dotted unicode string OID
-
- :raises:
- ValueError - when no _map dict has been defined on the class or the value can't be unmapped
- TypeError - when value is not a unicode string
-
- :return:
- A dotted unicode string OID
- """
-
- if cls not in _SETUP_CLASSES:
- cls()._setup()
- _SETUP_CLASSES[cls] = True
-
- if cls._map is None:
- raise ValueError(unwrap(
- '''
- %s._map has not been defined
- ''',
- type_name(cls)
- ))
-
- if not isinstance(value, str_cls):
- raise TypeError(unwrap(
- '''
- value must be a unicode string, not %s
- ''',
- type_name(value)
- ))
-
- if value in cls._reverse_map:
- return cls._reverse_map[value]
-
- if not _OID_RE.match(value):
- raise ValueError(unwrap(
- '''
- %s._map does not contain an entry for "%s"
- ''',
- type_name(cls),
- value
- ))
-
- return value
-
- def set(self, value):
- """
- Sets the value of the object
-
- :param value:
- A unicode string. May be a dotted integer string, or if _map is
- provided, one of the mapped values.
-
- :raises:
- ValueError - when an invalid value is passed
- """
-
- if not isinstance(value, str_cls):
- raise TypeError(unwrap(
- '''
- %s value must be a unicode string, not %s
- ''',
- type_name(self),
- type_name(value)
- ))
-
- self._native = value
-
- if self._map is not None:
- if value in self._reverse_map:
- value = self._reverse_map[value]
-
- self.contents = b''
- first = None
- for index, part in enumerate(value.split('.')):
- part = int(part)
-
- # The first two parts are merged into a single byte
- if index == 0:
- first = part
- continue
- elif index == 1:
- part = (first * 40) + part
-
- encoded_part = chr_cls(0x7F & part)
- part = part >> 7
- while part > 0:
- encoded_part = chr_cls(0x80 | (0x7F & part)) + encoded_part
- part = part >> 7
- self.contents += encoded_part
-
- self._header = None
- if self._trailer != b'':
- self._trailer = b''
-
- def __unicode__(self):
- """
- :return:
- A unicode string
- """
-
- return self.dotted
-
- @property
- def dotted(self):
- """
- :return:
- A unicode string of the object identifier in dotted notation, thus
- ignoring any mapped value
- """
-
- if self._dotted is None:
- output = []
-
- part = 0
- for byte in self.contents:
- if _PY2:
- byte = ord(byte)
- part = part * 128
- part += byte & 127
- # Last byte in subidentifier has the eighth bit set to 0
- if byte & 0x80 == 0:
- if len(output) == 0:
- output.append(str_cls(part // 40))
- output.append(str_cls(part % 40))
- else:
- output.append(str_cls(part))
- part = 0
-
- self._dotted = '.'.join(output)
- return self._dotted
-
- @property
- def native(self):
- """
- The a native Python datatype representation of this value
-
- :return:
- A unicode string or None. If _map is not defined, the unicode string
- is a string of dotted integers. If _map is defined and the dotted
- string is present in the _map, the mapped value is returned.
- """
-
- if self.contents is None:
- return None
-
- if self._native is None:
- self._native = self.dotted
- if self._map is not None and self._native in self._map:
- self._native = self._map[self._native]
- return self._native
-
-
-class ObjectDescriptor(Primitive):
- """
- Represents an object descriptor from ASN.1 - no Python implementation
- """
-
- tag = 7
-
-
-class InstanceOf(Primitive):
- """
- Represents an instance from ASN.1 - no Python implementation
- """
-
- tag = 8
-
-
-class Real(Primitive):
- """
- Represents a real number from ASN.1 - no Python implementation
- """
-
- tag = 9
-
-
-class Enumerated(Integer):
- """
- Represents a enumerated list of integers from ASN.1 as a Python
- unicode string
- """
-
- tag = 10
-
- def set(self, value):
- """
- Sets the value of the object
-
- :param value:
- An integer or a unicode string from _map
-
- :raises:
- ValueError - when an invalid value is passed
- """
-
- if not isinstance(value, int_types) and not isinstance(value, str_cls):
- raise TypeError(unwrap(
- '''
- %s value must be an integer or a unicode string, not %s
- ''',
- type_name(self),
- type_name(value)
- ))
-
- if isinstance(value, str_cls):
- if value not in self._reverse_map:
- raise ValueError(unwrap(
- '''
- %s value "%s" is not a valid value
- ''',
- type_name(self),
- value
- ))
-
- value = self._reverse_map[value]
-
- elif value not in self._map:
- raise ValueError(unwrap(
- '''
- %s value %s is not a valid value
- ''',
- type_name(self),
- value
- ))
-
- Integer.set(self, value)
-
- @property
- def native(self):
- """
- The a native Python datatype representation of this value
-
- :return:
- A unicode string or None
- """
-
- if self.contents is None:
- return None
-
- if self._native is None:
- self._native = self._map[self.__int__()]
- return self._native
-
-
-class UTF8String(AbstractString):
- """
- Represents a UTF-8 string from ASN.1 as a Python unicode string
- """
-
- tag = 12
- _encoding = 'utf-8'
-
-
-class RelativeOid(ObjectIdentifier):
- """
- Represents an object identifier in ASN.1 as a Python unicode dotted
- integer string
- """
-
- tag = 13
-
-
-class Sequence(Asn1Value):
- """
- Represents a sequence of fields from ASN.1 as a Python object with a
- dict-like interface
- """
-
- tag = 16
-
- class_ = 0
- method = 1
-
- # A list of child objects, in order of _fields
- children = None
-
- # Sequence overrides .contents to be a property so that the mutated state
- # of child objects can be checked to ensure everything is up-to-date
- _contents = None
-
- # Variable to track if the object has been mutated
- _mutated = False
-
- # A list of tuples in one of the following forms.
- #
- # Option 1, a unicode string field name and a value class
- #
- # ("name", Asn1ValueClass)
- #
- # Option 2, same as Option 1, but with a dict of class params
- #
- # ("name", Asn1ValueClass, {'explicit': 5})
- _fields = []
-
- # A dict with keys being the name of a field and the value being a unicode
- # string of the method name on self to call to get the spec for that field
- _spec_callbacks = None
-
- # A dict that maps unicode string field names to an index in _fields
- _field_map = None
-
- # A list in the same order as _fields that has tuples in the form (class_, tag)
- _field_ids = None
-
- # An optional 2-element tuple that defines the field names of an OID field
- # and the field that the OID should be used to help decode. Works with the
- # _oid_specs attribute.
- _oid_pair = None
-
- # A dict with keys that are unicode string OID values and values that are
- # Asn1Value classes to use for decoding a variable-type field.
- _oid_specs = None
-
- # A 2-element tuple of the indexes in _fields of the OID and value fields
- _oid_nums = None
-
- # Predetermined field specs to optimize away calls to _determine_spec()
- _precomputed_specs = None
-
- def __init__(self, value=None, default=None, **kwargs):
- """
- Allows setting field values before passing everything else along to
- Asn1Value.__init__()
-
- :param value:
- A native Python datatype to initialize the object value with
-
- :param default:
- The default value if no value is specified
- """
-
- Asn1Value.__init__(self, **kwargs)
-
- check_existing = False
- if value is None and default is not None:
- check_existing = True
- if self.children is None:
- if self.contents is None:
- check_existing = False
- else:
- self._parse_children()
- value = default
-
- if value is not None:
- try:
- # Fields are iterated in definition order to allow things like
- # OID-based specs. Otherwise sometimes the value would be processed
- # before the OID field, resulting in invalid value object creation.
- if self._fields:
- keys = [info[0] for info in self._fields]
- unused_keys = set(value.keys())
- else:
- keys = value.keys()
- unused_keys = set(keys)
-
- for key in keys:
- # If we are setting defaults, but a real value has already
- # been set for the field, then skip it
- if check_existing:
- index = self._field_map[key]
- if index < len(self.children) and self.children[index] is not VOID:
- if key in unused_keys:
- unused_keys.remove(key)
- continue
-
- if key in value:
- self.__setitem__(key, value[key])
- unused_keys.remove(key)
-
- if len(unused_keys):
- raise ValueError(unwrap(
- '''
- One or more unknown fields was passed to the constructor
- of %s: %s
- ''',
- type_name(self),
- ', '.join(sorted(list(unused_keys)))
- ))
-
- except (ValueError, TypeError) as e:
- args = e.args[1:]
- e.args = (e.args[0] + '\n while constructing %s' % type_name(self),) + args
- raise e
-
- @property
- def contents(self):
- """
- :return:
- A byte string of the DER-encoded contents of the sequence
- """
-
- if self.children is None:
- return self._contents
-
- if self._is_mutated():
- self._set_contents()
-
- return self._contents
-
- @contents.setter
- def contents(self, value):
- """
- :param value:
- A byte string of the DER-encoded contents of the sequence
- """
-
- self._contents = value
-
- def _is_mutated(self):
- """
- :return:
- A boolean - if the sequence or any children (recursively) have been
- mutated
- """
-
- mutated = self._mutated
- if self.children is not None:
- for child in self.children:
- if isinstance(child, Sequence) or isinstance(child, SequenceOf):
- mutated = mutated or child._is_mutated()
-
- return mutated
-
- def _lazy_child(self, index):
- """
- Builds a child object if the child has only been parsed into a tuple so far
- """
-
- child = self.children[index]
- if child.__class__ == tuple:
- child = self.children[index] = _build(*child)
- return child
-
- def __len__(self):
- """
- :return:
- Integer
- """
- # We inline this check to prevent method invocation each time
- if self.children is None:
- self._parse_children()
-
- return len(self.children)
-
- def __getitem__(self, key):
- """
- Allows accessing fields by name or index
-
- :param key:
- A unicode string of the field name, or an integer of the field index
-
- :raises:
- KeyError - when a field name or index is invalid
-
- :return:
- The Asn1Value object of the field specified
- """
-
- # We inline this check to prevent method invocation each time
- if self.children is None:
- self._parse_children()
-
- if not isinstance(key, int_types):
- if key not in self._field_map:
- raise KeyError(unwrap(
- '''
- No field named "%s" defined for %s
- ''',
- key,
- type_name(self)
- ))
- key = self._field_map[key]
-
- if key >= len(self.children):
- raise KeyError(unwrap(
- '''
- No field numbered %s is present in this %s
- ''',
- key,
- type_name(self)
- ))
-
- try:
- return self._lazy_child(key)
-
- except (ValueError, TypeError) as e:
- args = e.args[1:]
- e.args = (e.args[0] + '\n while parsing %s' % type_name(self),) + args
- raise e
-
- def __setitem__(self, key, value):
- """
- Allows settings fields by name or index
-
- :param key:
- A unicode string of the field name, or an integer of the field index
-
- :param value:
- A native Python datatype to set the field value to. This method will
- construct the appropriate Asn1Value object from _fields.
-
- :raises:
- ValueError - when a field name or index is invalid
- """
-
- # We inline this check to prevent method invocation each time
- if self.children is None:
- self._parse_children()
-
- if not isinstance(key, int_types):
- if key not in self._field_map:
- raise KeyError(unwrap(
- '''
- No field named "%s" defined for %s
- ''',
- key,
- type_name(self)
- ))
- key = self._field_map[key]
-
- field_name, field_spec, value_spec, field_params, _ = self._determine_spec(key)
-
- new_value = self._make_value(field_name, field_spec, value_spec, field_params, value)
-
- invalid_value = False
- if isinstance(new_value, Any):
- invalid_value = new_value.parsed is None
- elif isinstance(new_value, Choice):
- invalid_value = new_value.chosen.contents is None
- else:
- invalid_value = new_value.contents is None
-
- if invalid_value:
- raise ValueError(unwrap(
- '''
- Value for field "%s" of %s is not set
- ''',
- field_name,
- type_name(self)
- ))
-
- self.children[key] = new_value
-
- if self._native is not None:
- self._native[self._fields[key][0]] = self.children[key].native
- self._mutated = True
-
- def __delitem__(self, key):
- """
- Allows deleting optional or default fields by name or index
-
- :param key:
- A unicode string of the field name, or an integer of the field index
-
- :raises:
- ValueError - when a field name or index is invalid, or the field is not optional or defaulted
- """
-
- # We inline this check to prevent method invocation each time
- if self.children is None:
- self._parse_children()
-
- if not isinstance(key, int_types):
- if key not in self._field_map:
- raise KeyError(unwrap(
- '''
- No field named "%s" defined for %s
- ''',
- key,
- type_name(self)
- ))
- key = self._field_map[key]
-
- name, _, params = self._fields[key]
- if not params or ('default' not in params and 'optional' not in params):
- raise ValueError(unwrap(
- '''
- Can not delete the value for the field "%s" of %s since it is
- not optional or defaulted
- ''',
- name,
- type_name(self)
- ))
-
- if 'optional' in params:
- self.children[key] = VOID
- if self._native is not None:
- self._native[name] = None
- else:
- self.__setitem__(key, None)
- self._mutated = True
-
- def __iter__(self):
- """
- :return:
- An iterator of field key names
- """
-
- for info in self._fields:
- yield info[0]
-
- def _set_contents(self, force=False):
- """
- Updates the .contents attribute of the value with the encoded value of
- all of the child objects
-
- :param force:
- Ensure all contents are in DER format instead of possibly using
- cached BER-encoded data
- """
-
- if self.children is None:
- self._parse_children()
-
- contents = BytesIO()
- for index, info in enumerate(self._fields):
- child = self.children[index]
- if child is None:
- child_dump = b''
- elif child.__class__ == tuple:
- if force:
- child_dump = self._lazy_child(index).dump(force=force)
- else:
- child_dump = child[3] + child[4] + child[5]
- else:
- child_dump = child.dump(force=force)
- # Skip values that are the same as the default
- if info[2] and 'default' in info[2]:
- default_value = info[1](**info[2])
- if default_value.dump() == child_dump:
- continue
- contents.write(child_dump)
- self._contents = contents.getvalue()
-
- self._header = None
- if self._trailer != b'':
- self._trailer = b''
-
- def _setup(self):
- """
- Generates _field_map, _field_ids and _oid_nums for use in parsing
- """
-
- cls = self.__class__
- cls._field_map = {}
- cls._field_ids = []
- cls._precomputed_specs = []
- for index, field in enumerate(cls._fields):
- if len(field) < 3:
- field = field + ({},)
- cls._fields[index] = field
- cls._field_map[field[0]] = index
- cls._field_ids.append(_build_id_tuple(field[2], field[1]))
-
- if cls._oid_pair is not None:
- cls._oid_nums = (cls._field_map[cls._oid_pair[0]], cls._field_map[cls._oid_pair[1]])
-
- for index, field in enumerate(cls._fields):
- has_callback = cls._spec_callbacks is not None and field[0] in cls._spec_callbacks
- is_mapped_oid = cls._oid_nums is not None and cls._oid_nums[1] == index
- if has_callback or is_mapped_oid:
- cls._precomputed_specs.append(None)
- else:
- cls._precomputed_specs.append((field[0], field[1], field[1], field[2], None))
-
- def _determine_spec(self, index):
- """
- Determine how a value for a field should be constructed
-
- :param index:
- The field number
-
- :return:
- A tuple containing the following elements:
- - unicode string of the field name
- - Asn1Value class of the field spec
- - Asn1Value class of the value spec
- - None or dict of params to pass to the field spec
- - None or Asn1Value class indicating the value spec was derived from an OID or a spec callback
- """
-
- name, field_spec, field_params = self._fields[index]
- value_spec = field_spec
- spec_override = None
-
- if self._spec_callbacks is not None and name in self._spec_callbacks:
- callback = self._spec_callbacks[name]
- spec_override = callback(self)
- if spec_override:
- # Allow a spec callback to specify both the base spec and
- # the override, for situations such as OctetString and parse_as
- if spec_override.__class__ == tuple and len(spec_override) == 2:
- field_spec, value_spec = spec_override
- if value_spec is None:
- value_spec = field_spec
- spec_override = None
- # When no field spec is specified, use a single return value as that
- elif field_spec is None:
- field_spec = spec_override
- value_spec = field_spec
- spec_override = None
- else:
- value_spec = spec_override
-
- elif self._oid_nums is not None and self._oid_nums[1] == index:
- oid = self._lazy_child(self._oid_nums[0]).native
- if oid in self._oid_specs:
- spec_override = self._oid_specs[oid]
- value_spec = spec_override
-
- return (name, field_spec, value_spec, field_params, spec_override)
-
- def _make_value(self, field_name, field_spec, value_spec, field_params, value):
- """
- Contructs an appropriate Asn1Value object for a field
-
- :param field_name:
- A unicode string of the field name
-
- :param field_spec:
- An Asn1Value class that is the field spec
-
- :param value_spec:
- An Asn1Value class that is the vaue spec
-
- :param field_params:
- None or a dict of params for the field spec
-
- :param value:
- The value to construct an Asn1Value object from
-
- :return:
- An instance of a child class of Asn1Value
- """
-
- if value is None and 'optional' in field_params:
- return VOID
-
- specs_different = field_spec != value_spec
- is_any = issubclass(field_spec, Any)
-
- if issubclass(value_spec, Choice):
- if not isinstance(value, Asn1Value):
- raise ValueError(unwrap(
- '''
- Can not set a native python value to %s, which has the
- choice type of %s - value must be an instance of Asn1Value
- ''',
- field_name,
- type_name(value_spec)
- ))
- if not isinstance(value, value_spec):
- wrapper = value_spec()
- wrapper.validate(value.class_, value.tag, value.contents)
- wrapper._parsed = value
- new_value = wrapper
- else:
- new_value = value
-
- elif isinstance(value, field_spec):
- new_value = value
- if specs_different:
- new_value.parse(value_spec)
-
- elif (not specs_different or is_any) and not isinstance(value, value_spec):
- new_value = value_spec(value, **field_params)
-
- else:
- if isinstance(value, value_spec):
- new_value = value
- else:
- new_value = value_spec(value)
-
- # For when the field is OctetString or OctetBitString with embedded
- # values we need to wrap the value in the field spec to get the
- # appropriate encoded value.
- if specs_different and not is_any:
- wrapper = field_spec(value=new_value.dump(), **field_params)
- wrapper._parsed = (new_value, new_value.__class__, None)
- new_value = wrapper
-
- new_value = _fix_tagging(new_value, field_params)
-
- return new_value
-
- def _parse_children(self, recurse=False):
- """
- Parses the contents and generates Asn1Value objects based on the
- definitions from _fields.
-
- :param recurse:
- If child objects that are Sequence or SequenceOf objects should
- be recursively parsed
-
- :raises:
- ValueError - when an error occurs parsing child objects
- """
-
- cls = self.__class__
- if self._contents is None:
- if self._fields:
- self.children = [VOID] * len(self._fields)
- for index, (_, _, params) in enumerate(self._fields):
- if 'default' in params:
- if cls._precomputed_specs[index]:
- field_name, field_spec, value_spec, field_params, _ = cls._precomputed_specs[index]
- else:
- field_name, field_spec, value_spec, field_params, _ = self._determine_spec(index)
- self.children[index] = self._make_value(field_name, field_spec, value_spec, field_params, None)
- return
-
- try:
- self.children = []
- contents_length = len(self._contents)
- child_pointer = 0
- field = 0
- field_len = len(self._fields)
- parts = None
- again = child_pointer < contents_length
- while again:
- if parts is None:
- parts, child_pointer = _parse(self._contents, contents_length, pointer=child_pointer)
- again = child_pointer < contents_length
-
- if field < field_len:
- _, field_spec, value_spec, field_params, spec_override = (
- cls._precomputed_specs[field] or self._determine_spec(field))
-
- # If the next value is optional or default, allow it to be absent
- if field_params and ('optional' in field_params or 'default' in field_params):
- if self._field_ids[field] != (parts[0], parts[2]) and field_spec != Any:
-
- # See if the value is a valid choice before assuming
- # that we have a missing optional or default value
- choice_match = False
- if issubclass(field_spec, Choice):
- try:
- tester = field_spec(**field_params)
- tester.validate(parts[0], parts[2], parts[4])
- choice_match = True
- except (ValueError):
- pass
-
- if not choice_match:
- if 'optional' in field_params:
- self.children.append(VOID)
- else:
- self.children.append(field_spec(**field_params))
- field += 1
- again = True
- continue
-
- if field_spec is None or (spec_override and issubclass(field_spec, Any)):
- field_spec = value_spec
- spec_override = None
-
- if spec_override:
- child = parts + (field_spec, field_params, value_spec)
- else:
- child = parts + (field_spec, field_params)
-
- # Handle situations where an optional or defaulted field definition is incorrect
- elif field_len > 0 and field + 1 <= field_len:
- missed_fields = []
- prev_field = field - 1
- while prev_field >= 0:
- prev_field_info = self._fields[prev_field]
- if len(prev_field_info) < 3:
- break
- if 'optional' in prev_field_info[2] or 'default' in prev_field_info[2]:
- missed_fields.append(prev_field_info[0])
- prev_field -= 1
- plural = 's' if len(missed_fields) > 1 else ''
- missed_field_names = ', '.join(missed_fields)
- raise ValueError(unwrap(
- '''
- Data for field %s (%s class, %s method, tag %s) does
- not match the field definition%s of %s
- ''',
- field + 1,
- CLASS_NUM_TO_NAME_MAP.get(parts[0]),
- METHOD_NUM_TO_NAME_MAP.get(parts[1]),
- parts[2],
- plural,
- missed_field_names
- ))
-
- else:
- child = parts
-
- if recurse:
- child = _build(*child)
- if isinstance(child, (Sequence, SequenceOf)):
- child._parse_children(recurse=True)
-
- self.children.append(child)
- field += 1
- parts = None
-
- index = len(self.children)
- while index < field_len:
- name, field_spec, field_params = self._fields[index]
- if 'default' in field_params:
- self.children.append(field_spec(**field_params))
- elif 'optional' in field_params:
- self.children.append(VOID)
- else:
- raise ValueError(unwrap(
- '''
- Field "%s" is missing from structure
- ''',
- name
- ))
- index += 1
-
- except (ValueError, TypeError) as e:
- args = e.args[1:]
- e.args = (e.args[0] + '\n while parsing %s' % type_name(self),) + args
- raise e
-
- def spec(self, field_name):
- """
- Determines the spec to use for the field specified. Depending on how
- the spec is determined (_oid_pair or _spec_callbacks), it may be
- necessary to set preceding field values before calling this. Usually
- specs, if dynamic, are controlled by a preceding ObjectIdentifier
- field.
-
- :param field_name:
- A unicode string of the field name to get the spec for
-
- :return:
- A child class of asn1crypto.core.Asn1Value that the field must be
- encoded using
- """
-
- if not isinstance(field_name, str_cls):
- raise TypeError(unwrap(
- '''
- field_name must be a unicode string, not %s
- ''',
- type_name(field_name)
- ))
-
- if self._fields is None:
- raise ValueError(unwrap(
- '''
- Unable to retrieve spec for field %s in the class %s because
- _fields has not been set
- ''',
- repr(field_name),
- type_name(self)
- ))
-
- index = self._field_map[field_name]
- info = self._determine_spec(index)
-
- return info[2]
-
- @property
- def native(self):
- """
- The a native Python datatype representation of this value
-
- :return:
- An OrderedDict or None. If an OrderedDict, all child values are
- recursively converted to native representation also.
- """
-
- if self.contents is None:
- return None
-
- if self._native is None:
- if self.children is None:
- self._parse_children(recurse=True)
- try:
- self._native = OrderedDict()
- for index, child in enumerate(self.children):
- if child.__class__ == tuple:
- child = _build(*child)
- self.children[index] = child
- try:
- name = self._fields[index][0]
- except (IndexError):
- name = str_cls(index)
- self._native[name] = child.native
- except (ValueError, TypeError) as e:
- args = e.args[1:]
- e.args = (e.args[0] + '\n while parsing %s' % type_name(self),) + args
- raise e
- return self._native
-
- def _copy(self, other, copy_func):
- """
- Copies the contents of another Sequence object to itself
-
- :param object:
- Another instance of the same class
-
- :param copy_func:
- An reference of copy.copy() or copy.deepcopy() to use when copying
- lists, dicts and objects
- """
-
- super(Sequence, self)._copy(other, copy_func)
- if self.children is not None:
- self.children = []
- for child in other.children:
- if child.__class__ == tuple:
- self.children.append(child)
- else:
- self.children.append(child.copy())
-
- def debug(self, nest_level=1):
- """
- Show the binary data and parsed data in a tree structure
- """
-
- if self.children is None:
- self._parse_children()
-
- prefix = ' ' * nest_level
- _basic_debug(prefix, self)
- for field_name in self:
- child = self._lazy_child(self._field_map[field_name])
- if child is not VOID:
- print('%s Field "%s"' % (prefix, field_name))
- child.debug(nest_level + 3)
-
- def dump(self, force=False):
- """
- Encodes the value using DER
-
- :param force:
- If the encoded contents already exist, clear them and regenerate
- to ensure they are in DER format instead of BER format
-
- :return:
- A byte string of the DER-encoded value
- """
-
- if force:
- self._set_contents(force=force)
-
- if self._fields and self.children is not None:
- for index, (field_name, _, params) in enumerate(self._fields):
- if self.children[index] is not VOID:
- continue
- if 'default' in params or 'optional' in params:
- continue
- raise ValueError(unwrap(
- '''
- Field "%s" is missing from structure
- ''',
- field_name
- ))
-
- return Asn1Value.dump(self)
-
-
-class SequenceOf(Asn1Value):
- """
- Represents a sequence (ordered) of a single type of values from ASN.1 as a
- Python object with a list-like interface
- """
-
- tag = 16
-
- class_ = 0
- method = 1
-
- # A list of child objects
- children = None
-
- # SequenceOf overrides .contents to be a property so that the mutated state
- # of child objects can be checked to ensure everything is up-to-date
- _contents = None
-
- # Variable to track if the object has been mutated
- _mutated = False
-
- # An Asn1Value class to use when parsing children
- _child_spec = None
-
- def __init__(self, value=None, default=None, contents=None, spec=None, **kwargs):
- """
- Allows setting child objects and the _child_spec via the spec parameter
- before passing everything else along to Asn1Value.__init__()
-
- :param value:
- A native Python datatype to initialize the object value with
-
- :param default:
- The default value if no value is specified
-
- :param contents:
- A byte string of the encoded contents of the value
-
- :param spec:
- A class derived from Asn1Value to use to parse children
- """
-
- if spec:
- self._child_spec = spec
-
- Asn1Value.__init__(self, **kwargs)
-
- try:
- if contents is not None:
- self.contents = contents
- else:
- if value is None and default is not None:
- value = default
-
- if value is not None:
- for index, child in enumerate(value):
- self.__setitem__(index, child)
-
- # Make sure a blank list is serialized
- if self.contents is None:
- self._set_contents()
-
- except (ValueError, TypeError) as e:
- args = e.args[1:]
- e.args = (e.args[0] + '\n while constructing %s' % type_name(self),) + args
- raise e
-
- @property
- def contents(self):
- """
- :return:
- A byte string of the DER-encoded contents of the sequence
- """
-
- if self.children is None:
- return self._contents
-
- if self._is_mutated():
- self._set_contents()
-
- return self._contents
-
- @contents.setter
- def contents(self, value):
- """
- :param value:
- A byte string of the DER-encoded contents of the sequence
- """
-
- self._contents = value
-
- def _is_mutated(self):
- """
- :return:
- A boolean - if the sequence or any children (recursively) have been
- mutated
- """
-
- mutated = self._mutated
- if self.children is not None:
- for child in self.children:
- if isinstance(child, Sequence) or isinstance(child, SequenceOf):
- mutated = mutated or child._is_mutated()
-
- return mutated
-
- def _lazy_child(self, index):
- """
- Builds a child object if the child has only been parsed into a tuple so far
- """
-
- child = self.children[index]
- if child.__class__ == tuple:
- child = _build(*child)
- self.children[index] = child
- return child
-
- def _make_value(self, value):
- """
- Constructs a _child_spec value from a native Python data type, or
- an appropriate Asn1Value object
-
- :param value:
- A native Python value, or some child of Asn1Value
-
- :return:
- An object of type _child_spec
- """
-
- if isinstance(value, self._child_spec):
- new_value = value
-
- elif issubclass(self._child_spec, Any):
- if isinstance(value, Asn1Value):
- new_value = value
- else:
- raise ValueError(unwrap(
- '''
- Can not set a native python value to %s where the
- _child_spec is Any - value must be an instance of Asn1Value
- ''',
- type_name(self)
- ))
-
- elif issubclass(self._child_spec, Choice):
- if not isinstance(value, Asn1Value):
- raise ValueError(unwrap(
- '''
- Can not set a native python value to %s where the
- _child_spec is the choice type %s - value must be an
- instance of Asn1Value
- ''',
- type_name(self),
- self._child_spec.__name__
- ))
- if not isinstance(value, self._child_spec):
- wrapper = self._child_spec()
- wrapper.validate(value.class_, value.tag, value.contents)
- wrapper._parsed = value
- value = wrapper
- new_value = value
-
- else:
- return self._child_spec(value=value)
-
- params = {}
- if self._child_spec.explicit:
- params['explicit'] = self._child_spec.explicit
- if self._child_spec.implicit:
- params['implicit'] = (self._child_spec.class_, self._child_spec.tag)
- return _fix_tagging(new_value, params)
-
- def __len__(self):
- """
- :return:
- An integer
- """
- # We inline this checks to prevent method invocation each time
- if self.children is None:
- self._parse_children()
-
- return len(self.children)
-
- def __getitem__(self, key):
- """
- Allows accessing children via index
-
- :param key:
- Integer index of child
- """
-
- # We inline this checks to prevent method invocation each time
- if self.children is None:
- self._parse_children()
-
- return self._lazy_child(key)
-
- def __setitem__(self, key, value):
- """
- Allows overriding a child via index
-
- :param key:
- Integer index of child
-
- :param value:
- Native python datatype that will be passed to _child_spec to create
- new child object
- """
-
- # We inline this checks to prevent method invocation each time
- if self.children is None:
- self._parse_children()
-
- new_value = self._make_value(value)
-
- # If adding at the end, create a space for the new value
- if key == len(self.children):
- self.children.append(None)
- if self._native is not None:
- self._native.append(None)
-
- self.children[key] = new_value
-
- if self._native is not None:
- self._native[key] = self.children[key].native
-
- self._mutated = True
-
- def __delitem__(self, key):
- """
- Allows removing a child via index
-
- :param key:
- Integer index of child
- """
-
- # We inline this checks to prevent method invocation each time
- if self.children is None:
- self._parse_children()
-
- self.children.pop(key)
- if self._native is not None:
- self._native.pop(key)
-
- self._mutated = True
-
- def __iter__(self):
- """
- :return:
- An iter() of child objects
- """
-
- # We inline this checks to prevent method invocation each time
- if self.children is None:
- self._parse_children()
-
- for index in range(0, len(self.children)):
- yield self._lazy_child(index)
-
- def __contains__(self, item):
- """
- :param item:
- An object of the type cls._child_spec
-
- :return:
- A boolean if the item is contained in this SequenceOf
- """
-
- if item is None or item is VOID:
- return False
-
- if not isinstance(item, self._child_spec):
- raise TypeError(unwrap(
- '''
- Checking membership in %s is only available for instances of
- %s, not %s
- ''',
- type_name(self),
- type_name(self._child_spec),
- type_name(item)
- ))
-
- for child in self:
- if child == item:
- return True
-
- return False
-
- def append(self, value):
- """
- Allows adding a child to the end of the sequence
-
- :param value:
- Native python datatype that will be passed to _child_spec to create
- new child object
- """
-
- # We inline this checks to prevent method invocation each time
- if self.children is None:
- self._parse_children()
-
- self.children.append(self._make_value(value))
-
- if self._native is not None:
- self._native.append(self.children[-1].native)
-
- self._mutated = True
-
- def _set_contents(self, force=False):
- """
- Encodes all child objects into the contents for this object
-
- :param force:
- Ensure all contents are in DER format instead of possibly using
- cached BER-encoded data
- """
-
- if self.children is None:
- self._parse_children()
-
- contents = BytesIO()
- for child in self:
- contents.write(child.dump(force=force))
- self._contents = contents.getvalue()
- self._header = None
- if self._trailer != b'':
- self._trailer = b''
-
- def _parse_children(self, recurse=False):
- """
- Parses the contents and generates Asn1Value objects based on the
- definitions from _child_spec.
-
- :param recurse:
- If child objects that are Sequence or SequenceOf objects should
- be recursively parsed
-
- :raises:
- ValueError - when an error occurs parsing child objects
- """
-
- try:
- self.children = []
- if self._contents is None:
- return
- contents_length = len(self._contents)
- child_pointer = 0
- while child_pointer < contents_length:
- parts, child_pointer = _parse(self._contents, contents_length, pointer=child_pointer)
- if self._child_spec:
- child = parts + (self._child_spec,)
- else:
- child = parts
- if recurse:
- child = _build(*child)
- if isinstance(child, (Sequence, SequenceOf)):
- child._parse_children(recurse=True)
- self.children.append(child)
- except (ValueError, TypeError) as e:
- args = e.args[1:]
- e.args = (e.args[0] + '\n while parsing %s' % type_name(self),) + args
- raise e
-
- def spec(self):
- """
- Determines the spec to use for child values.
-
- :return:
- A child class of asn1crypto.core.Asn1Value that child values must be
- encoded using
- """
-
- return self._child_spec
-
- @property
- def native(self):
- """
- The a native Python datatype representation of this value
-
- :return:
- A list or None. If a list, all child values are recursively
- converted to native representation also.
- """
-
- if self.contents is None:
- return None
-
- if self._native is None:
- if self.children is None:
- self._parse_children(recurse=True)
- try:
- self._native = [child.native for child in self]
- except (ValueError, TypeError) as e:
- args = e.args[1:]
- e.args = (e.args[0] + '\n while parsing %s' % type_name(self),) + args
- raise e
- return self._native
-
- def _copy(self, other, copy_func):
- """
- Copies the contents of another SequenceOf object to itself
-
- :param object:
- Another instance of the same class
-
- :param copy_func:
- An reference of copy.copy() or copy.deepcopy() to use when copying
- lists, dicts and objects
- """
-
- super(SequenceOf, self)._copy(other, copy_func)
- if self.children is not None:
- self.children = []
- for child in other.children:
- if child.__class__ == tuple:
- self.children.append(child)
- else:
- self.children.append(child.copy())
-
- def debug(self, nest_level=1):
- """
- Show the binary data and parsed data in a tree structure
- """
-
- if self.children is None:
- self._parse_children()
-
- prefix = ' ' * nest_level
- _basic_debug(prefix, self)
- for child in self:
- child.debug(nest_level + 1)
-
- def dump(self, force=False):
- """
- Encodes the value using DER
-
- :param force:
- If the encoded contents already exist, clear them and regenerate
- to ensure they are in DER format instead of BER format
-
- :return:
- A byte string of the DER-encoded value
- """
-
- if force:
- self._set_contents(force=force)
-
- return Asn1Value.dump(self)
-
-
-class Set(Sequence):
- """
- Represents a set of fields (unordered) from ASN.1 as a Python object with a
- dict-like interface
- """
-
- method = 1
- class_ = 0
- tag = 17
-
- # A dict of 2-element tuples in the form (class_, tag) as keys and integers
- # as values that are the index of the field in _fields
- _field_ids = None
-
- def _setup(self):
- """
- Generates _field_map, _field_ids and _oid_nums for use in parsing
- """
-
- cls = self.__class__
- cls._field_map = {}
- cls._field_ids = {}
- cls._precomputed_specs = []
- for index, field in enumerate(cls._fields):
- if len(field) < 3:
- field = field + ({},)
- cls._fields[index] = field
- cls._field_map[field[0]] = index
- cls._field_ids[_build_id_tuple(field[2], field[1])] = index
-
- if cls._oid_pair is not None:
- cls._oid_nums = (cls._field_map[cls._oid_pair[0]], cls._field_map[cls._oid_pair[1]])
-
- for index, field in enumerate(cls._fields):
- has_callback = cls._spec_callbacks is not None and field[0] in cls._spec_callbacks
- is_mapped_oid = cls._oid_nums is not None and cls._oid_nums[1] == index
- if has_callback or is_mapped_oid:
- cls._precomputed_specs.append(None)
- else:
- cls._precomputed_specs.append((field[0], field[1], field[1], field[2], None))
-
- def _parse_children(self, recurse=False):
- """
- Parses the contents and generates Asn1Value objects based on the
- definitions from _fields.
-
- :param recurse:
- If child objects that are Sequence or SequenceOf objects should
- be recursively parsed
-
- :raises:
- ValueError - when an error occurs parsing child objects
- """
-
- cls = self.__class__
- if self._contents is None:
- if self._fields:
- self.children = [VOID] * len(self._fields)
- for index, (_, _, params) in enumerate(self._fields):
- if 'default' in params:
- if cls._precomputed_specs[index]:
- field_name, field_spec, value_spec, field_params, _ = cls._precomputed_specs[index]
- else:
- field_name, field_spec, value_spec, field_params, _ = self._determine_spec(index)
- self.children[index] = self._make_value(field_name, field_spec, value_spec, field_params, None)
- return
-
- try:
- child_map = {}
- contents_length = len(self.contents)
- child_pointer = 0
- seen_field = 0
- while child_pointer < contents_length:
- parts, child_pointer = _parse(self.contents, contents_length, pointer=child_pointer)
-
- id_ = (parts[0], parts[2])
-
- field = self._field_ids.get(id_)
- if field is None:
- raise ValueError(unwrap(
- '''
- Data for field %s (%s class, %s method, tag %s) does
- not match any of the field definitions
- ''',
- seen_field,
- CLASS_NUM_TO_NAME_MAP.get(parts[0]),
- METHOD_NUM_TO_NAME_MAP.get(parts[1]),
- parts[2],
- ))
-
- _, field_spec, value_spec, field_params, spec_override = (
- cls._precomputed_specs[field] or self._determine_spec(field))
-
- if field_spec is None or (spec_override and issubclass(field_spec, Any)):
- field_spec = value_spec
- spec_override = None
-
- if spec_override:
- child = parts + (field_spec, field_params, value_spec)
- else:
- child = parts + (field_spec, field_params)
-
- if recurse:
- child = _build(*child)
- if isinstance(child, (Sequence, SequenceOf)):
- child._parse_children(recurse=True)
-
- child_map[field] = child
- seen_field += 1
-
- total_fields = len(self._fields)
-
- for index in range(0, total_fields):
- if index in child_map:
- continue
-
- name, field_spec, value_spec, field_params, spec_override = (
- cls._precomputed_specs[index] or self._determine_spec(index))
-
- if field_spec is None or (spec_override and issubclass(field_spec, Any)):
- field_spec = value_spec
- spec_override = None
-
- missing = False
-
- if not field_params:
- missing = True
- elif 'optional' not in field_params and 'default' not in field_params:
- missing = True
- elif 'optional' in field_params:
- child_map[index] = VOID
- elif 'default' in field_params:
- child_map[index] = field_spec(**field_params)
-
- if missing:
- raise ValueError(unwrap(
- '''
- Missing required field "%s" from %s
- ''',
- name,
- type_name(self)
- ))
-
- self.children = []
- for index in range(0, total_fields):
- self.children.append(child_map[index])
-
- except (ValueError, TypeError) as e:
- args = e.args[1:]
- e.args = (e.args[0] + '\n while parsing %s' % type_name(self),) + args
- raise e
-
- def _set_contents(self, force=False):
- """
- Encodes all child objects into the contents for this object.
-
- This method is overridden because a Set needs to be encoded by
- removing defaulted fields and then sorting the fields by tag.
-
- :param force:
- Ensure all contents are in DER format instead of possibly using
- cached BER-encoded data
- """
-
- if self.children is None:
- self._parse_children()
-
- child_tag_encodings = []
- for index, child in enumerate(self.children):
- child_encoding = child.dump(force=force)
-
- # Skip encoding defaulted children
- name, spec, field_params = self._fields[index]
- if 'default' in field_params:
- if spec(**field_params).dump() == child_encoding:
- continue
-
- child_tag_encodings.append((child.tag, child_encoding))
- child_tag_encodings.sort(key=lambda ct: ct[0])
-
- self._contents = b''.join([ct[1] for ct in child_tag_encodings])
- self._header = None
- if self._trailer != b'':
- self._trailer = b''
-
-
-class SetOf(SequenceOf):
- """
- Represents a set (unordered) of a single type of values from ASN.1 as a
- Python object with a list-like interface
- """
-
- tag = 17
-
- def _set_contents(self, force=False):
- """
- Encodes all child objects into the contents for this object.
-
- This method is overridden because a SetOf needs to be encoded by
- sorting the child encodings.
-
- :param force:
- Ensure all contents are in DER format instead of possibly using
- cached BER-encoded data
- """
-
- if self.children is None:
- self._parse_children()
-
- child_encodings = []
- for child in self:
- child_encodings.append(child.dump(force=force))
-
- self._contents = b''.join(sorted(child_encodings))
- self._header = None
- if self._trailer != b'':
- self._trailer = b''
-
-
-class EmbeddedPdv(Sequence):
- """
- A sequence structure
- """
-
- tag = 11
-
-
-class NumericString(AbstractString):
- """
- Represents a numeric string from ASN.1 as a Python unicode string
- """
-
- tag = 18
- _encoding = 'latin1'
-
-
-class PrintableString(AbstractString):
- """
- Represents a printable string from ASN.1 as a Python unicode string
- """
-
- tag = 19
- _encoding = 'latin1'
-
-
-class TeletexString(AbstractString):
- """
- Represents a teletex string from ASN.1 as a Python unicode string
- """
-
- tag = 20
- _encoding = 'teletex'
-
-
-class VideotexString(OctetString):
- """
- Represents a videotex string from ASN.1 as a Python byte string
- """
-
- tag = 21
-
-
-class IA5String(AbstractString):
- """
- Represents an IA5 string from ASN.1 as a Python unicode string
- """
-
- tag = 22
- _encoding = 'ascii'
-
-
-class AbstractTime(AbstractString):
- """
- Represents a time from ASN.1 as a Python datetime.datetime object
- """
-
- @property
- def native(self):
- """
- The a native Python datatype representation of this value
-
- :return:
- A datetime.datetime object in the UTC timezone or None
- """
-
- if self.contents is None:
- return None
-
- if self._native is None:
- string = str_cls(self)
- has_timezone = re.search('[-\\+]', string)
-
- # We don't know what timezone it is in, or it is UTC because of a Z
- # suffix, so we just assume UTC
- if not has_timezone:
- string = string.rstrip('Z')
- date = self._date_by_len(string)
- self._native = date.replace(tzinfo=timezone.utc)
-
- else:
- # Python 2 doesn't support the %z format code, so we have to manually
- # process the timezone offset.
- date = self._date_by_len(string[0:-5])
-
- hours = int(string[-4:-2])
- minutes = int(string[-2:])
- delta = timedelta(hours=abs(hours), minutes=minutes)
- if hours < 0:
- date -= delta
- else:
- date += delta
-
- self._native = date.replace(tzinfo=timezone.utc)
-
- return self._native
-
-
-class UTCTime(AbstractTime):
- """
- Represents a UTC time from ASN.1 as a Python datetime.datetime object in UTC
- """
-
- tag = 23
-
- def set(self, value):
- """
- Sets the value of the object
-
- :param value:
- A unicode string or a datetime.datetime object
-
- :raises:
- ValueError - when an invalid value is passed
- """
-
- if isinstance(value, datetime):
- value = value.strftime('%y%m%d%H%M%SZ')
- if _PY2:
- value = value.decode('ascii')
-
- AbstractString.set(self, value)
- # Set it to None and let the class take care of converting the next
- # time that .native is called
- self._native = None
-
- def _date_by_len(self, string):
- """
- Parses a date from a string based on its length
-
- :param string:
- A unicode string to parse
-
- :return:
- A datetime.datetime object or a unicode string
- """
-
- strlen = len(string)
-
- year_num = int(string[0:2])
- if year_num < 50:
- prefix = '20'
- else:
- prefix = '19'
-
- if strlen == 10:
- return datetime.strptime(prefix + string, '%Y%m%d%H%M')
-
- if strlen == 12:
- return datetime.strptime(prefix + string, '%Y%m%d%H%M%S')
-
- return string
-
-
-class GeneralizedTime(AbstractTime):
- """
- Represents a generalized time from ASN.1 as a Python datetime.datetime
- object or asn1crypto.util.extended_datetime object in UTC
- """
-
- tag = 24
-
- def set(self, value):
- """
- Sets the value of the object
-
- :param value:
- A unicode string, a datetime.datetime object or an
- asn1crypto.util.extended_datetime object
-
- :raises:
- ValueError - when an invalid value is passed
- """
-
- if isinstance(value, (datetime, extended_datetime)):
- value = value.strftime('%Y%m%d%H%M%SZ')
- if _PY2:
- value = value.decode('ascii')
-
- AbstractString.set(self, value)
- # Set it to None and let the class take care of converting the next
- # time that .native is called
- self._native = None
-
- def _date_by_len(self, string):
- """
- Parses a date from a string based on its length
-
- :param string:
- A unicode string to parse
-
- :return:
- A datetime.datetime object, asn1crypto.util.extended_datetime object or
- a unicode string
- """
-
- strlen = len(string)
-
- date_format = None
- if strlen == 10:
- date_format = '%Y%m%d%H'
- elif strlen == 12:
- date_format = '%Y%m%d%H%M'
- elif strlen == 14:
- date_format = '%Y%m%d%H%M%S'
- elif strlen == 18:
- date_format = '%Y%m%d%H%M%S.%f'
-
- if date_format:
- if len(string) >= 4 and string[0:4] == '0000':
- # Year 2000 shares a calendar with year 0, and is supported natively
- t = datetime.strptime('2000' + string[4:], date_format)
- return extended_datetime(
- 0,
- t.month,
- t.day,
- t.hour,
- t.minute,
- t.second,
- t.microsecond,
- t.tzinfo
- )
- return datetime.strptime(string, date_format)
-
- return string
-
-
-class GraphicString(AbstractString):
- """
- Represents a graphic string from ASN.1 as a Python unicode string
- """
-
- tag = 25
- # This is technically not correct since this type can contain any charset
- _encoding = 'latin1'
-
-
-class VisibleString(AbstractString):
- """
- Represents a visible string from ASN.1 as a Python unicode string
- """
-
- tag = 26
- _encoding = 'latin1'
-
-
-class GeneralString(AbstractString):
- """
- Represents a general string from ASN.1 as a Python unicode string
- """
-
- tag = 27
- # This is technically not correct since this type can contain any charset
- _encoding = 'latin1'
-
-
-class UniversalString(AbstractString):
- """
- Represents a universal string from ASN.1 as a Python unicode string
- """
-
- tag = 28
- _encoding = 'utf-32-be'
-
-
-class CharacterString(AbstractString):
- """
- Represents a character string from ASN.1 as a Python unicode string
- """
-
- tag = 29
- # This is technically not correct since this type can contain any charset
- _encoding = 'latin1'
-
-
-class BMPString(AbstractString):
- """
- Represents a BMP string from ASN.1 as a Python unicode string
- """
-
- tag = 30
- _encoding = 'utf-16-be'
-
-
-def _basic_debug(prefix, self):
- """
- Prints out basic information about an Asn1Value object. Extracted for reuse
- among different classes that customize the debug information.
-
- :param prefix:
- A unicode string of spaces to prefix output line with
-
- :param self:
- The object to print the debugging information about
- """
-
- print('%s%s Object #%s' % (prefix, type_name(self), id(self)))
- if self._header:
- print('%s Header: 0x%s' % (prefix, binascii.hexlify(self._header or b'').decode('utf-8')))
-
- has_header = self.method is not None and self.class_ is not None and self.tag is not None
- if has_header:
- method_name = METHOD_NUM_TO_NAME_MAP.get(self.method)
- class_name = CLASS_NUM_TO_NAME_MAP.get(self.class_)
-
- if self.explicit is not None:
- for class_, tag in self.explicit:
- print(
- '%s %s tag %s (explicitly tagged)' %
- (
- prefix,
- CLASS_NUM_TO_NAME_MAP.get(class_),
- tag
- )
- )
- if has_header:
- print('%s %s %s %s' % (prefix, method_name, class_name, self.tag))
-
- elif self.implicit:
- if has_header:
- print('%s %s %s tag %s (implicitly tagged)' % (prefix, method_name, class_name, self.tag))
-
- elif has_header:
- print('%s %s %s tag %s' % (prefix, method_name, class_name, self.tag))
-
- print('%s Data: 0x%s' % (prefix, binascii.hexlify(self.contents or b'').decode('utf-8')))
-
-
-def _tag_type_to_explicit_implicit(params):
- """
- Converts old-style "tag_type" and "tag" params to "explicit" and "implicit"
-
- :param params:
- A dict of parameters to convert from tag_type/tag to explicit/implicit
- """
-
- if 'tag_type' in params:
- if params['tag_type'] == 'explicit':
- params['explicit'] = (params.get('class', 2), params['tag'])
- elif params['tag_type'] == 'implicit':
- params['implicit'] = (params.get('class', 2), params['tag'])
- del params['tag_type']
- del params['tag']
- if 'class' in params:
- del params['class']
-
-
-def _fix_tagging(value, params):
- """
- Checks if a value is properly tagged based on the spec, and re/untags as
- necessary
-
- :param value:
- An Asn1Value object
-
- :param params:
- A dict of spec params
-
- :return:
- An Asn1Value that is properly tagged
- """
-
- _tag_type_to_explicit_implicit(params)
-
- retag = False
- if 'implicit' not in params:
- if value.implicit is not False:
- retag = True
- else:
- if isinstance(params['implicit'], tuple):
- class_, tag = params['implicit']
- else:
- tag = params['implicit']
- class_ = 'context'
- if value.implicit is False:
- retag = True
- elif value.class_ != CLASS_NAME_TO_NUM_MAP[class_] or value.tag != tag:
- retag = True
-
- if params.get('explicit') != value.explicit:
- retag = True
-
- if retag:
- return value.retag(params)
- return value
-
-
-def _build_id_tuple(params, spec):
- """
- Builds a 2-element tuple used to identify fields by grabbing the class_
- and tag from an Asn1Value class and the params dict being passed to it
-
- :param params:
- A dict of params to pass to spec
-
- :param spec:
- An Asn1Value class
-
- :return:
- A 2-element integer tuple in the form (class_, tag)
- """
-
- # Handle situations where the the spec is not known at setup time
- if spec is None:
- return (None, None)
-
- required_class = spec.class_
- required_tag = spec.tag
-
- _tag_type_to_explicit_implicit(params)
-
- if 'explicit' in params:
- if isinstance(params['explicit'], tuple):
- required_class, required_tag = params['explicit']
- else:
- required_class = 2
- required_tag = params['explicit']
- elif 'implicit' in params:
- if isinstance(params['implicit'], tuple):
- required_class, required_tag = params['implicit']
- else:
- required_class = 2
- required_tag = params['implicit']
- if required_class is not None and not isinstance(required_class, int_types):
- required_class = CLASS_NAME_TO_NUM_MAP[required_class]
-
- required_class = params.get('class_', required_class)
- required_tag = params.get('tag', required_tag)
-
- return (required_class, required_tag)
-
-
-_UNIVERSAL_SPECS = {
- 1: Boolean,
- 2: Integer,
- 3: BitString,
- 4: OctetString,
- 5: Null,
- 6: ObjectIdentifier,
- 7: ObjectDescriptor,
- 8: InstanceOf,
- 9: Real,
- 10: Enumerated,
- 11: EmbeddedPdv,
- 12: UTF8String,
- 13: RelativeOid,
- 16: Sequence,
- 17: Set,
- 18: NumericString,
- 19: PrintableString,
- 20: TeletexString,
- 21: VideotexString,
- 22: IA5String,
- 23: UTCTime,
- 24: GeneralizedTime,
- 25: GraphicString,
- 26: VisibleString,
- 27: GeneralString,
- 28: UniversalString,
- 29: CharacterString,
- 30: BMPString
-}
-
-
-def _build(class_, method, tag, header, contents, trailer, spec=None, spec_params=None, nested_spec=None):
- """
- Builds an Asn1Value object generically, or using a spec with optional params
-
- :param class_:
- An integer representing the ASN.1 class
-
- :param method:
- An integer representing the ASN.1 method
-
- :param tag:
- An integer representing the ASN.1 tag
-
- :param header:
- A byte string of the ASN.1 header (class, method, tag, length)
-
- :param contents:
- A byte string of the ASN.1 value
-
- :param trailer:
- A byte string of any ASN.1 trailer (only used by indefinite length encodings)
-
- :param spec:
- A class derived from Asn1Value that defines what class_ and tag the
- value should have, and the semantics of the encoded value. The
- return value will be of this type. If omitted, the encoded value
- will be decoded using the standard universal tag based on the
- encoded tag number.
-
- :param spec_params:
- A dict of params to pass to the spec object
-
- :param nested_spec:
- For certain Asn1Value classes (such as OctetString and BitString), the
- contents can be further parsed and interpreted as another Asn1Value.
- This parameter controls the spec for that sub-parsing.
-
- :return:
- An object of the type spec, or if not specified, a child of Asn1Value
- """
-
- if spec_params is not None:
- _tag_type_to_explicit_implicit(spec_params)
-
- if header is None:
- return VOID
-
- header_set = False
-
- # If an explicit specification was passed in, make sure it matches
- if spec is not None:
- # If there is explicit tagging and contents, we have to split
- # the header and trailer off before we do the parsing
- no_explicit = spec_params and 'no_explicit' in spec_params
- if not no_explicit and (spec.explicit or (spec_params and 'explicit' in spec_params)):
- if spec_params:
- value = spec(**spec_params)
- else:
- value = spec()
- original_explicit = value.explicit
- explicit_info = reversed(original_explicit)
- parsed_class = class_
- parsed_method = method
- parsed_tag = tag
- to_parse = contents
- explicit_header = header
- explicit_trailer = trailer or b''
- for expected_class, expected_tag in explicit_info:
- if parsed_class != expected_class:
- raise ValueError(unwrap(
- '''
- Error parsing %s - explicitly-tagged class should have been
- %s, but %s was found
- ''',
- type_name(value),
- CLASS_NUM_TO_NAME_MAP.get(expected_class),
- CLASS_NUM_TO_NAME_MAP.get(parsed_class, parsed_class)
- ))
- if parsed_method != 1:
- raise ValueError(unwrap(
- '''
- Error parsing %s - explicitly-tagged method should have
- been %s, but %s was found
- ''',
- type_name(value),
- METHOD_NUM_TO_NAME_MAP.get(1),
- METHOD_NUM_TO_NAME_MAP.get(parsed_method, parsed_method)
- ))
- if parsed_tag != expected_tag:
- raise ValueError(unwrap(
- '''
- Error parsing %s - explicitly-tagged tag should have been
- %s, but %s was found
- ''',
- type_name(value),
- expected_tag,
- parsed_tag
- ))
- info, _ = _parse(to_parse, len(to_parse))
- parsed_class, parsed_method, parsed_tag, parsed_header, to_parse, parsed_trailer = info
- explicit_header += parsed_header
- explicit_trailer = parsed_trailer + explicit_trailer
-
- value = _build(*info, spec=spec, spec_params={'no_explicit': True})
- value._header = explicit_header
- value._trailer = explicit_trailer
- value.explicit = original_explicit
- header_set = True
- else:
- if spec_params:
- value = spec(contents=contents, **spec_params)
- else:
- value = spec(contents=contents)
-
- if spec is Any:
- pass
-
- elif isinstance(value, Choice):
- value.validate(class_, tag, contents)
- try:
- # Force parsing the Choice now
- value.contents = header + value.contents
- header = b''
- value.parse()
- except (ValueError, TypeError) as e:
- args = e.args[1:]
- e.args = (e.args[0] + '\n while parsing %s' % type_name(value),) + args
- raise e
-
- else:
- if class_ != value.class_:
- raise ValueError(unwrap(
- '''
- Error parsing %s - class should have been %s, but %s was
- found
- ''',
- type_name(value),
- CLASS_NUM_TO_NAME_MAP.get(value.class_),
- CLASS_NUM_TO_NAME_MAP.get(class_, class_)
- ))
- if method != value.method:
- # Allow parsing a primitive method as constructed if the value
- # is indefinite length. This is to allow parsing BER.
- ber_indef = method == 1 and value.method == 0 and trailer == b'\x00\x00'
- if not ber_indef or not isinstance(value, Constructable):
- raise ValueError(unwrap(
- '''
- Error parsing %s - method should have been %s, but %s was found
- ''',
- type_name(value),
- METHOD_NUM_TO_NAME_MAP.get(value.method),
- METHOD_NUM_TO_NAME_MAP.get(method, method)
- ))
- else:
- value.method = method
- value._indefinite = True
- if tag != value.tag and tag != value._bad_tag:
- raise ValueError(unwrap(
- '''
- Error parsing %s - tag should have been %s, but %s was found
- ''',
- type_name(value),
- value.tag,
- tag
- ))
-
- # For explicitly tagged, un-speced parsings, we use a generic container
- # since we will be parsing the contents and discarding the outer object
- # anyway a little further on
- elif spec_params and 'explicit' in spec_params:
- original_value = Asn1Value(contents=contents, **spec_params)
- original_explicit = original_value.explicit
-
- to_parse = contents
- explicit_header = header
- explicit_trailer = trailer or b''
- for expected_class, expected_tag in reversed(original_explicit):
- info, _ = _parse(to_parse, len(to_parse))
- _, _, _, parsed_header, to_parse, parsed_trailer = info
- explicit_header += parsed_header
- explicit_trailer = parsed_trailer + explicit_trailer
- value = _build(*info, spec=spec, spec_params={'no_explicit': True})
- value._header = header + value._header
- value._trailer += trailer or b''
- value.explicit = original_explicit
- header_set = True
-
- # If no spec was specified, allow anything and just process what
- # is in the input data
- else:
- if tag not in _UNIVERSAL_SPECS:
- raise ValueError(unwrap(
- '''
- Unknown element - %s class, %s method, tag %s
- ''',
- CLASS_NUM_TO_NAME_MAP.get(class_),
- METHOD_NUM_TO_NAME_MAP.get(method),
- tag
- ))
-
- spec = _UNIVERSAL_SPECS[tag]
-
- value = spec(contents=contents, class_=class_)
- ber_indef = method == 1 and value.method == 0 and trailer == b'\x00\x00'
- if ber_indef and isinstance(value, Constructable):
- value._indefinite = True
- value.method = method
-
- if not header_set:
- value._header = header
- value._trailer = trailer or b''
-
- # Destroy any default value that our contents have overwritten
- value._native = None
-
- if nested_spec:
- try:
- value.parse(nested_spec)
- except (ValueError, TypeError) as e:
- args = e.args[1:]
- e.args = (e.args[0] + '\n while parsing %s' % type_name(value),) + args
- raise e
-
- return value
-
-
-def _parse_build(encoded_data, pointer=0, spec=None, spec_params=None, strict=False):
- """
- Parses a byte string generically, or using a spec with optional params
-
- :param encoded_data:
- A byte string that contains BER-encoded data
-
- :param pointer:
- The index in the byte string to parse from
-
- :param spec:
- A class derived from Asn1Value that defines what class_ and tag the
- value should have, and the semantics of the encoded value. The
- return value will be of this type. If omitted, the encoded value
- will be decoded using the standard universal tag based on the
- encoded tag number.
-
- :param spec_params:
- A dict of params to pass to the spec object
-
- :param strict:
- A boolean indicating if trailing data should be forbidden - if so, a
- ValueError will be raised when trailing data exists
-
- :return:
- A 2-element tuple:
- - 0: An object of the type spec, or if not specified, a child of Asn1Value
- - 1: An integer indicating how many bytes were consumed
- """
-
- encoded_len = len(encoded_data)
- info, new_pointer = _parse(encoded_data, encoded_len, pointer)
- if strict and new_pointer != pointer + encoded_len:
- extra_bytes = pointer + encoded_len - new_pointer
- raise ValueError('Extra data - %d bytes of trailing data were provided' % extra_bytes)
- return (_build(*info, spec=spec, spec_params=spec_params), new_pointer)
diff --git a/lib/asn1crypto/crl.py b/lib/asn1crypto/crl.py
deleted file mode 100644
index 84cb168393..0000000000
--- a/lib/asn1crypto/crl.py
+++ /dev/null
@@ -1,536 +0,0 @@
-# coding: utf-8
-
-"""
-ASN.1 type classes for certificate revocation lists (CRL). Exports the
-following items:
-
- - CertificateList()
-
-Other type classes are defined that help compose the types listed above.
-"""
-
-from __future__ import unicode_literals, division, absolute_import, print_function
-
-import hashlib
-
-from .algos import SignedDigestAlgorithm
-from .core import (
- Boolean,
- Enumerated,
- GeneralizedTime,
- Integer,
- ObjectIdentifier,
- OctetBitString,
- ParsableOctetString,
- Sequence,
- SequenceOf,
-)
-from .x509 import (
- AuthorityInfoAccessSyntax,
- AuthorityKeyIdentifier,
- CRLDistributionPoints,
- DistributionPointName,
- GeneralNames,
- Name,
- ReasonFlags,
- Time,
-)
-
-
-# The structures in this file are taken from https://tools.ietf.org/html/rfc5280
-
-
-class Version(Integer):
- _map = {
- 0: 'v1',
- 1: 'v2',
- 2: 'v3',
- }
-
-
-class IssuingDistributionPoint(Sequence):
- _fields = [
- ('distribution_point', DistributionPointName, {'explicit': 0, 'optional': True}),
- ('only_contains_user_certs', Boolean, {'implicit': 1, 'default': False}),
- ('only_contains_ca_certs', Boolean, {'implicit': 2, 'default': False}),
- ('only_some_reasons', ReasonFlags, {'implicit': 3, 'optional': True}),
- ('indirect_crl', Boolean, {'implicit': 4, 'default': False}),
- ('only_contains_attribute_certs', Boolean, {'implicit': 5, 'default': False}),
- ]
-
-
-class TBSCertListExtensionId(ObjectIdentifier):
- _map = {
- '2.5.29.18': 'issuer_alt_name',
- '2.5.29.20': 'crl_number',
- '2.5.29.27': 'delta_crl_indicator',
- '2.5.29.28': 'issuing_distribution_point',
- '2.5.29.35': 'authority_key_identifier',
- '2.5.29.46': 'freshest_crl',
- '1.3.6.1.5.5.7.1.1': 'authority_information_access',
- }
-
-
-class TBSCertListExtension(Sequence):
- _fields = [
- ('extn_id', TBSCertListExtensionId),
- ('critical', Boolean, {'default': False}),
- ('extn_value', ParsableOctetString),
- ]
-
- _oid_pair = ('extn_id', 'extn_value')
- _oid_specs = {
- 'issuer_alt_name': GeneralNames,
- 'crl_number': Integer,
- 'delta_crl_indicator': Integer,
- 'issuing_distribution_point': IssuingDistributionPoint,
- 'authority_key_identifier': AuthorityKeyIdentifier,
- 'freshest_crl': CRLDistributionPoints,
- 'authority_information_access': AuthorityInfoAccessSyntax,
- }
-
-
-class TBSCertListExtensions(SequenceOf):
- _child_spec = TBSCertListExtension
-
-
-class CRLReason(Enumerated):
- _map = {
- 0: 'unspecified',
- 1: 'key_compromise',
- 2: 'ca_compromise',
- 3: 'affiliation_changed',
- 4: 'superseded',
- 5: 'cessation_of_operation',
- 6: 'certificate_hold',
- 8: 'remove_from_crl',
- 9: 'privilege_withdrawn',
- 10: 'aa_compromise',
- }
-
- @property
- def human_friendly(self):
- """
- :return:
- A unicode string with revocation description that is suitable to
- show to end-users. Starts with a lower case letter and phrased in
- such a way that it makes sense after the phrase "because of" or
- "due to".
- """
-
- return {
- 'unspecified': 'an unspecified reason',
- 'key_compromise': 'a compromised key',
- 'ca_compromise': 'the CA being compromised',
- 'affiliation_changed': 'an affiliation change',
- 'superseded': 'certificate supersession',
- 'cessation_of_operation': 'a cessation of operation',
- 'certificate_hold': 'a certificate hold',
- 'remove_from_crl': 'removal from the CRL',
- 'privilege_withdrawn': 'privilege withdrawl',
- 'aa_compromise': 'the AA being compromised',
- }[self.native]
-
-
-class CRLEntryExtensionId(ObjectIdentifier):
- _map = {
- '2.5.29.21': 'crl_reason',
- '2.5.29.23': 'hold_instruction_code',
- '2.5.29.24': 'invalidity_date',
- '2.5.29.29': 'certificate_issuer',
- }
-
-
-class CRLEntryExtension(Sequence):
- _fields = [
- ('extn_id', CRLEntryExtensionId),
- ('critical', Boolean, {'default': False}),
- ('extn_value', ParsableOctetString),
- ]
-
- _oid_pair = ('extn_id', 'extn_value')
- _oid_specs = {
- 'crl_reason': CRLReason,
- 'hold_instruction_code': ObjectIdentifier,
- 'invalidity_date': GeneralizedTime,
- 'certificate_issuer': GeneralNames,
- }
-
-
-class CRLEntryExtensions(SequenceOf):
- _child_spec = CRLEntryExtension
-
-
-class RevokedCertificate(Sequence):
- _fields = [
- ('user_certificate', Integer),
- ('revocation_date', Time),
- ('crl_entry_extensions', CRLEntryExtensions, {'optional': True}),
- ]
-
- _processed_extensions = False
- _critical_extensions = None
- _crl_reason_value = None
- _invalidity_date_value = None
- _certificate_issuer_value = None
- _issuer_name = False
-
- def _set_extensions(self):
- """
- Sets common named extensions to private attributes and creates a list
- of critical extensions
- """
-
- self._critical_extensions = set()
-
- for extension in self['crl_entry_extensions']:
- name = extension['extn_id'].native
- attribute_name = '_%s_value' % name
- if hasattr(self, attribute_name):
- setattr(self, attribute_name, extension['extn_value'].parsed)
- if extension['critical'].native:
- self._critical_extensions.add(name)
-
- self._processed_extensions = True
-
- @property
- def critical_extensions(self):
- """
- Returns a set of the names (or OID if not a known extension) of the
- extensions marked as critical
-
- :return:
- A set of unicode strings
- """
-
- if not self._processed_extensions:
- self._set_extensions()
- return self._critical_extensions
-
- @property
- def crl_reason_value(self):
- """
- This extension indicates the reason that a certificate was revoked.
-
- :return:
- None or a CRLReason object
- """
-
- if self._processed_extensions is False:
- self._set_extensions()
- return self._crl_reason_value
-
- @property
- def invalidity_date_value(self):
- """
- This extension indicates the suspected date/time the private key was
- compromised or the certificate became invalid. This would usually be
- before the revocation date, which is when the CA processed the
- revocation.
-
- :return:
- None or a GeneralizedTime object
- """
-
- if self._processed_extensions is False:
- self._set_extensions()
- return self._invalidity_date_value
-
- @property
- def certificate_issuer_value(self):
- """
- This extension indicates the issuer of the certificate in question,
- and is used in indirect CRLs. CRL entries without this extension are
- for certificates issued from the last seen issuer.
-
- :return:
- None or an x509.GeneralNames object
- """
-
- if self._processed_extensions is False:
- self._set_extensions()
- return self._certificate_issuer_value
-
- @property
- def issuer_name(self):
- """
- :return:
- None, or an asn1crypto.x509.Name object for the issuer of the cert
- """
-
- if self._issuer_name is False:
- self._issuer_name = None
- if self.certificate_issuer_value:
- for general_name in self.certificate_issuer_value:
- if general_name.name == 'directory_name':
- self._issuer_name = general_name.chosen
- break
- return self._issuer_name
-
-
-class RevokedCertificates(SequenceOf):
- _child_spec = RevokedCertificate
-
-
-class TbsCertList(Sequence):
- _fields = [
- ('version', Version, {'optional': True}),
- ('signature', SignedDigestAlgorithm),
- ('issuer', Name),
- ('this_update', Time),
- ('next_update', Time, {'optional': True}),
- ('revoked_certificates', RevokedCertificates, {'optional': True}),
- ('crl_extensions', TBSCertListExtensions, {'explicit': 0, 'optional': True}),
- ]
-
-
-class CertificateList(Sequence):
- _fields = [
- ('tbs_cert_list', TbsCertList),
- ('signature_algorithm', SignedDigestAlgorithm),
- ('signature', OctetBitString),
- ]
-
- _processed_extensions = False
- _critical_extensions = None
- _issuer_alt_name_value = None
- _crl_number_value = None
- _delta_crl_indicator_value = None
- _issuing_distribution_point_value = None
- _authority_key_identifier_value = None
- _freshest_crl_value = None
- _authority_information_access_value = None
- _issuer_cert_urls = None
- _delta_crl_distribution_points = None
- _sha1 = None
- _sha256 = None
-
- def _set_extensions(self):
- """
- Sets common named extensions to private attributes and creates a list
- of critical extensions
- """
-
- self._critical_extensions = set()
-
- for extension in self['tbs_cert_list']['crl_extensions']:
- name = extension['extn_id'].native
- attribute_name = '_%s_value' % name
- if hasattr(self, attribute_name):
- setattr(self, attribute_name, extension['extn_value'].parsed)
- if extension['critical'].native:
- self._critical_extensions.add(name)
-
- self._processed_extensions = True
-
- @property
- def critical_extensions(self):
- """
- Returns a set of the names (or OID if not a known extension) of the
- extensions marked as critical
-
- :return:
- A set of unicode strings
- """
-
- if not self._processed_extensions:
- self._set_extensions()
- return self._critical_extensions
-
- @property
- def issuer_alt_name_value(self):
- """
- This extension allows associating one or more alternative names with
- the issuer of the CRL.
-
- :return:
- None or an x509.GeneralNames object
- """
-
- if self._processed_extensions is False:
- self._set_extensions()
- return self._issuer_alt_name_value
-
- @property
- def crl_number_value(self):
- """
- This extension adds a monotonically increasing number to the CRL and is
- used to distinguish different versions of the CRL.
-
- :return:
- None or an Integer object
- """
-
- if self._processed_extensions is False:
- self._set_extensions()
- return self._crl_number_value
-
- @property
- def delta_crl_indicator_value(self):
- """
- This extension indicates a CRL is a delta CRL, and contains the CRL
- number of the base CRL that it is a delta from.
-
- :return:
- None or an Integer object
- """
-
- if self._processed_extensions is False:
- self._set_extensions()
- return self._delta_crl_indicator_value
-
- @property
- def issuing_distribution_point_value(self):
- """
- This extension includes information about what types of revocations
- and certificates are part of the CRL.
-
- :return:
- None or an IssuingDistributionPoint object
- """
-
- if self._processed_extensions is False:
- self._set_extensions()
- return self._issuing_distribution_point_value
-
- @property
- def authority_key_identifier_value(self):
- """
- This extension helps in identifying the public key with which to
- validate the authenticity of the CRL.
-
- :return:
- None or an AuthorityKeyIdentifier object
- """
-
- if self._processed_extensions is False:
- self._set_extensions()
- return self._authority_key_identifier_value
-
- @property
- def freshest_crl_value(self):
- """
- This extension is used in complete CRLs to indicate where a delta CRL
- may be located.
-
- :return:
- None or a CRLDistributionPoints object
- """
-
- if self._processed_extensions is False:
- self._set_extensions()
- return self._freshest_crl_value
-
- @property
- def authority_information_access_value(self):
- """
- This extension is used to provide a URL with which to download the
- certificate used to sign this CRL.
-
- :return:
- None or an AuthorityInfoAccessSyntax object
- """
-
- if self._processed_extensions is False:
- self._set_extensions()
- return self._authority_information_access_value
-
- @property
- def issuer(self):
- """
- :return:
- An asn1crypto.x509.Name object for the issuer of the CRL
- """
-
- return self['tbs_cert_list']['issuer']
-
- @property
- def authority_key_identifier(self):
- """
- :return:
- None or a byte string of the key_identifier from the authority key
- identifier extension
- """
-
- if not self.authority_key_identifier_value:
- return None
-
- return self.authority_key_identifier_value['key_identifier'].native
-
- @property
- def issuer_cert_urls(self):
- """
- :return:
- A list of unicode strings that are URLs that should contain either
- an individual DER-encoded X.509 certificate, or a DER-encoded CMS
- message containing multiple certificates
- """
-
- if self._issuer_cert_urls is None:
- self._issuer_cert_urls = []
- if self.authority_information_access_value:
- for entry in self.authority_information_access_value:
- if entry['access_method'].native == 'ca_issuers':
- location = entry['access_location']
- if location.name != 'uniform_resource_identifier':
- continue
- url = location.native
- if url.lower()[0:7] == 'http://':
- self._issuer_cert_urls.append(url)
- return self._issuer_cert_urls
-
- @property
- def delta_crl_distribution_points(self):
- """
- Returns delta CRL URLs - only applies to complete CRLs
-
- :return:
- A list of zero or more DistributionPoint objects
- """
-
- if self._delta_crl_distribution_points is None:
- self._delta_crl_distribution_points = []
-
- if self.freshest_crl_value is not None:
- for distribution_point in self.freshest_crl_value:
- distribution_point_name = distribution_point['distribution_point']
- # RFC 5280 indicates conforming CA should not use the relative form
- if distribution_point_name.name == 'name_relative_to_crl_issuer':
- continue
- # This library is currently only concerned with HTTP-based CRLs
- for general_name in distribution_point_name.chosen:
- if general_name.name == 'uniform_resource_identifier':
- self._delta_crl_distribution_points.append(distribution_point)
-
- return self._delta_crl_distribution_points
-
- @property
- def signature(self):
- """
- :return:
- A byte string of the signature
- """
-
- return self['signature'].native
-
- @property
- def sha1(self):
- """
- :return:
- The SHA1 hash of the DER-encoded bytes of this certificate list
- """
-
- if self._sha1 is None:
- self._sha1 = hashlib.sha1(self.dump()).digest()
- return self._sha1
-
- @property
- def sha256(self):
- """
- :return:
- The SHA-256 hash of the DER-encoded bytes of this certificate list
- """
-
- if self._sha256 is None:
- self._sha256 = hashlib.sha256(self.dump()).digest()
- return self._sha256
diff --git a/lib/asn1crypto/csr.py b/lib/asn1crypto/csr.py
deleted file mode 100644
index 7ea2848190..0000000000
--- a/lib/asn1crypto/csr.py
+++ /dev/null
@@ -1,96 +0,0 @@
-# coding: utf-8
-
-"""
-ASN.1 type classes for certificate signing requests (CSR). Exports the
-following items:
-
- - CertificatationRequest()
-
-Other type classes are defined that help compose the types listed above.
-"""
-
-from __future__ import unicode_literals, division, absolute_import, print_function
-
-from .algos import SignedDigestAlgorithm
-from .core import (
- Any,
- Integer,
- ObjectIdentifier,
- OctetBitString,
- Sequence,
- SetOf,
-)
-from .keys import PublicKeyInfo
-from .x509 import DirectoryString, Extensions, Name
-
-
-# The structures in this file are taken from https://tools.ietf.org/html/rfc2986
-# and https://tools.ietf.org/html/rfc2985
-
-
-class Version(Integer):
- _map = {
- 0: 'v1',
- }
-
-
-class CSRAttributeType(ObjectIdentifier):
- _map = {
- '1.2.840.113549.1.9.7': 'challenge_password',
- '1.2.840.113549.1.9.9': 'extended_certificate_attributes',
- '1.2.840.113549.1.9.14': 'extension_request',
- }
-
-
-class SetOfDirectoryString(SetOf):
- _child_spec = DirectoryString
-
-
-class Attribute(Sequence):
- _fields = [
- ('type', ObjectIdentifier),
- ('values', SetOf, {'spec': Any}),
- ]
-
-
-class SetOfAttributes(SetOf):
- _child_spec = Attribute
-
-
-class SetOfExtensions(SetOf):
- _child_spec = Extensions
-
-
-class CRIAttribute(Sequence):
- _fields = [
- ('type', CSRAttributeType),
- ('values', Any),
- ]
-
- _oid_pair = ('type', 'values')
- _oid_specs = {
- 'challenge_password': SetOfDirectoryString,
- 'extended_certificate_attributes': SetOfAttributes,
- 'extension_request': SetOfExtensions,
- }
-
-
-class CRIAttributes(SetOf):
- _child_spec = CRIAttribute
-
-
-class CertificationRequestInfo(Sequence):
- _fields = [
- ('version', Version),
- ('subject', Name),
- ('subject_pk_info', PublicKeyInfo),
- ('attributes', CRIAttributes, {'implicit': 0, 'optional': True}),
- ]
-
-
-class CertificationRequest(Sequence):
- _fields = [
- ('certification_request_info', CertificationRequestInfo),
- ('signature_algorithm', SignedDigestAlgorithm),
- ('signature', OctetBitString),
- ]
diff --git a/lib/asn1crypto/keys.py b/lib/asn1crypto/keys.py
deleted file mode 100644
index 9a09a31417..0000000000
--- a/lib/asn1crypto/keys.py
+++ /dev/null
@@ -1,1249 +0,0 @@
-# coding: utf-8
-
-"""
-ASN.1 type classes for public and private keys. Exports the following items:
-
- - DSAPrivateKey()
- - ECPrivateKey()
- - EncryptedPrivateKeyInfo()
- - PrivateKeyInfo()
- - PublicKeyInfo()
- - RSAPrivateKey()
- - RSAPublicKey()
-
-Other type classes are defined that help compose the types listed above.
-"""
-
-from __future__ import unicode_literals, division, absolute_import, print_function
-
-import hashlib
-import math
-
-from ._elliptic_curve import (
- SECP192R1_BASE_POINT,
- SECP224R1_BASE_POINT,
- SECP256R1_BASE_POINT,
- SECP384R1_BASE_POINT,
- SECP521R1_BASE_POINT,
- PrimeCurve,
- PrimePoint,
-)
-from ._errors import unwrap
-from ._types import type_name, str_cls, byte_cls
-from .algos import _ForceNullParameters, DigestAlgorithm, EncryptionAlgorithm, RSAESOAEPParams
-from .core import (
- Any,
- Asn1Value,
- BitString,
- Choice,
- Integer,
- IntegerOctetString,
- Null,
- ObjectIdentifier,
- OctetBitString,
- OctetString,
- ParsableOctetString,
- ParsableOctetBitString,
- Sequence,
- SequenceOf,
- SetOf,
-)
-from .util import int_from_bytes, int_to_bytes
-
-
-class OtherPrimeInfo(Sequence):
- """
- Source: https://tools.ietf.org/html/rfc3447#page-46
- """
-
- _fields = [
- ('prime', Integer),
- ('exponent', Integer),
- ('coefficient', Integer),
- ]
-
-
-class OtherPrimeInfos(SequenceOf):
- """
- Source: https://tools.ietf.org/html/rfc3447#page-46
- """
-
- _child_spec = OtherPrimeInfo
-
-
-class RSAPrivateKeyVersion(Integer):
- """
- Original Name: Version
- Source: https://tools.ietf.org/html/rfc3447#page-45
- """
-
- _map = {
- 0: 'two-prime',
- 1: 'multi',
- }
-
-
-class RSAPrivateKey(Sequence):
- """
- Source: https://tools.ietf.org/html/rfc3447#page-45
- """
-
- _fields = [
- ('version', RSAPrivateKeyVersion),
- ('modulus', Integer),
- ('public_exponent', Integer),
- ('private_exponent', Integer),
- ('prime1', Integer),
- ('prime2', Integer),
- ('exponent1', Integer),
- ('exponent2', Integer),
- ('coefficient', Integer),
- ('other_prime_infos', OtherPrimeInfos, {'optional': True})
- ]
-
-
-class RSAPublicKey(Sequence):
- """
- Source: https://tools.ietf.org/html/rfc3447#page-44
- """
-
- _fields = [
- ('modulus', Integer),
- ('public_exponent', Integer)
- ]
-
-
-class DSAPrivateKey(Sequence):
- """
- The ASN.1 structure that OpenSSL uses to store a DSA private key that is
- not part of a PKCS#8 structure. Reversed engineered from english-language
- description on linked OpenSSL documentation page.
-
- Original Name: None
- Source: https://www.openssl.org/docs/apps/dsa.html
- """
-
- _fields = [
- ('version', Integer),
- ('p', Integer),
- ('q', Integer),
- ('g', Integer),
- ('public_key', Integer),
- ('private_key', Integer),
- ]
-
-
-class _ECPoint():
- """
- In both PublicKeyInfo and PrivateKeyInfo, the EC public key is a byte
- string that is encoded as a bit string. This class adds convenience
- methods for converting to and from the byte string to a pair of integers
- that are the X and Y coordinates.
- """
-
- @classmethod
- def from_coords(cls, x, y):
- """
- Creates an ECPoint object from the X and Y integer coordinates of the
- point
-
- :param x:
- The X coordinate, as an integer
-
- :param y:
- The Y coordinate, as an integer
-
- :return:
- An ECPoint object
- """
-
- x_bytes = int(math.ceil(math.log(x, 2) / 8.0))
- y_bytes = int(math.ceil(math.log(y, 2) / 8.0))
-
- num_bytes = max(x_bytes, y_bytes)
-
- byte_string = b'\x04'
- byte_string += int_to_bytes(x, width=num_bytes)
- byte_string += int_to_bytes(y, width=num_bytes)
-
- return cls(byte_string)
-
- def to_coords(self):
- """
- Returns the X and Y coordinates for this EC point, as native Python
- integers
-
- :return:
- A 2-element tuple containing integers (X, Y)
- """
-
- data = self.native
- first_byte = data[0:1]
-
- # Uncompressed
- if first_byte == b'\x04':
- remaining = data[1:]
- field_len = len(remaining) // 2
- x = int_from_bytes(remaining[0:field_len])
- y = int_from_bytes(remaining[field_len:])
- return (x, y)
-
- if first_byte not in set([b'\x02', b'\x03']):
- raise ValueError(unwrap(
- '''
- Invalid EC public key - first byte is incorrect
- '''
- ))
-
- raise ValueError(unwrap(
- '''
- Compressed representations of EC public keys are not supported due
- to patent US6252960
- '''
- ))
-
-
-class ECPoint(OctetString, _ECPoint):
-
- pass
-
-
-class ECPointBitString(OctetBitString, _ECPoint):
-
- pass
-
-
-class SpecifiedECDomainVersion(Integer):
- """
- Source: http://www.secg.org/sec1-v2.pdf page 104
- """
- _map = {
- 1: 'ecdpVer1',
- 2: 'ecdpVer2',
- 3: 'ecdpVer3',
- }
-
-
-class FieldType(ObjectIdentifier):
- """
- Original Name: None
- Source: http://www.secg.org/sec1-v2.pdf page 101
- """
-
- _map = {
- '1.2.840.10045.1.1': 'prime_field',
- '1.2.840.10045.1.2': 'characteristic_two_field',
- }
-
-
-class CharacteristicTwoBasis(ObjectIdentifier):
- """
- Original Name: None
- Source: http://www.secg.org/sec1-v2.pdf page 102
- """
-
- _map = {
- '1.2.840.10045.1.2.1.1': 'gn_basis',
- '1.2.840.10045.1.2.1.2': 'tp_basis',
- '1.2.840.10045.1.2.1.3': 'pp_basis',
- }
-
-
-class Pentanomial(Sequence):
- """
- Source: http://www.secg.org/sec1-v2.pdf page 102
- """
-
- _fields = [
- ('k1', Integer),
- ('k2', Integer),
- ('k3', Integer),
- ]
-
-
-class CharacteristicTwo(Sequence):
- """
- Original Name: Characteristic-two
- Source: http://www.secg.org/sec1-v2.pdf page 101
- """
-
- _fields = [
- ('m', Integer),
- ('basis', CharacteristicTwoBasis),
- ('parameters', Any),
- ]
-
- _oid_pair = ('basis', 'parameters')
- _oid_specs = {
- 'gn_basis': Null,
- 'tp_basis': Integer,
- 'pp_basis': Pentanomial,
- }
-
-
-class FieldID(Sequence):
- """
- Source: http://www.secg.org/sec1-v2.pdf page 100
- """
-
- _fields = [
- ('field_type', FieldType),
- ('parameters', Any),
- ]
-
- _oid_pair = ('field_type', 'parameters')
- _oid_specs = {
- 'prime_field': Integer,
- 'characteristic_two_field': CharacteristicTwo,
- }
-
-
-class Curve(Sequence):
- """
- Source: http://www.secg.org/sec1-v2.pdf page 104
- """
-
- _fields = [
- ('a', OctetString),
- ('b', OctetString),
- ('seed', OctetBitString, {'optional': True}),
- ]
-
-
-class SpecifiedECDomain(Sequence):
- """
- Source: http://www.secg.org/sec1-v2.pdf page 103
- """
-
- _fields = [
- ('version', SpecifiedECDomainVersion),
- ('field_id', FieldID),
- ('curve', Curve),
- ('base', ECPoint),
- ('order', Integer),
- ('cofactor', Integer, {'optional': True}),
- ('hash', DigestAlgorithm, {'optional': True}),
- ]
-
-
-class NamedCurve(ObjectIdentifier):
- """
- Various named curves
-
- Original Name: None
- Source: https://tools.ietf.org/html/rfc3279#page-23,
- https://tools.ietf.org/html/rfc5480#page-5
- """
-
- _map = {
- # https://tools.ietf.org/html/rfc3279#page-23
- '1.2.840.10045.3.0.1': 'c2pnb163v1',
- '1.2.840.10045.3.0.2': 'c2pnb163v2',
- '1.2.840.10045.3.0.3': 'c2pnb163v3',
- '1.2.840.10045.3.0.4': 'c2pnb176w1',
- '1.2.840.10045.3.0.5': 'c2tnb191v1',
- '1.2.840.10045.3.0.6': 'c2tnb191v2',
- '1.2.840.10045.3.0.7': 'c2tnb191v3',
- '1.2.840.10045.3.0.8': 'c2onb191v4',
- '1.2.840.10045.3.0.9': 'c2onb191v5',
- '1.2.840.10045.3.0.10': 'c2pnb208w1',
- '1.2.840.10045.3.0.11': 'c2tnb239v1',
- '1.2.840.10045.3.0.12': 'c2tnb239v2',
- '1.2.840.10045.3.0.13': 'c2tnb239v3',
- '1.2.840.10045.3.0.14': 'c2onb239v4',
- '1.2.840.10045.3.0.15': 'c2onb239v5',
- '1.2.840.10045.3.0.16': 'c2pnb272w1',
- '1.2.840.10045.3.0.17': 'c2pnb304w1',
- '1.2.840.10045.3.0.18': 'c2tnb359v1',
- '1.2.840.10045.3.0.19': 'c2pnb368w1',
- '1.2.840.10045.3.0.20': 'c2tnb431r1',
- '1.2.840.10045.3.1.2': 'prime192v2',
- '1.2.840.10045.3.1.3': 'prime192v3',
- '1.2.840.10045.3.1.4': 'prime239v1',
- '1.2.840.10045.3.1.5': 'prime239v2',
- '1.2.840.10045.3.1.6': 'prime239v3',
- # https://tools.ietf.org/html/rfc5480#page-5
- '1.3.132.0.1': 'sect163k1',
- '1.3.132.0.15': 'sect163r2',
- '1.2.840.10045.3.1.1': 'secp192r1',
- '1.3.132.0.33': 'secp224r1',
- '1.3.132.0.26': 'sect233k1',
- '1.2.840.10045.3.1.7': 'secp256r1',
- '1.3.132.0.27': 'sect233r1',
- '1.3.132.0.16': 'sect283k1',
- '1.3.132.0.17': 'sect283r1',
- '1.3.132.0.34': 'secp384r1',
- '1.3.132.0.36': 'sect409k1',
- '1.3.132.0.37': 'sect409r1',
- '1.3.132.0.35': 'secp521r1',
- '1.3.132.0.38': 'sect571k1',
- '1.3.132.0.39': 'sect571r1',
- }
-
-
-class ECDomainParameters(Choice):
- """
- Source: http://www.secg.org/sec1-v2.pdf page 102
- """
-
- _alternatives = [
- ('specified', SpecifiedECDomain),
- ('named', NamedCurve),
- ('implicit_ca', Null),
- ]
-
-
-class ECPrivateKeyVersion(Integer):
- """
- Original Name: None
- Source: http://www.secg.org/sec1-v2.pdf page 108
- """
-
- _map = {
- 1: 'ecPrivkeyVer1',
- }
-
-
-class ECPrivateKey(Sequence):
- """
- Source: http://www.secg.org/sec1-v2.pdf page 108
- """
-
- _fields = [
- ('version', ECPrivateKeyVersion),
- ('private_key', IntegerOctetString),
- ('parameters', ECDomainParameters, {'explicit': 0, 'optional': True}),
- ('public_key', ECPointBitString, {'explicit': 1, 'optional': True}),
- ]
-
-
-class DSAParams(Sequence):
- """
- Parameters for a DSA public or private key
-
- Original Name: Dss-Parms
- Source: https://tools.ietf.org/html/rfc3279#page-9
- """
-
- _fields = [
- ('p', Integer),
- ('q', Integer),
- ('g', Integer),
- ]
-
-
-class Attribute(Sequence):
- """
- Source: https://www.itu.int/rec/dologin_pub.asp?lang=e&id=T-REC-X.501-198811-S!!PDF-E&type=items page 8
- """
-
- _fields = [
- ('type', ObjectIdentifier),
- ('values', SetOf, {'spec': Any}),
- ]
-
-
-class Attributes(SetOf):
- """
- Source: https://tools.ietf.org/html/rfc5208#page-3
- """
-
- _child_spec = Attribute
-
-
-class PrivateKeyAlgorithmId(ObjectIdentifier):
- """
- These OIDs for various public keys are reused when storing private keys
- inside of a PKCS#8 structure
-
- Original Name: None
- Source: https://tools.ietf.org/html/rfc3279
- """
-
- _map = {
- # https://tools.ietf.org/html/rfc3279#page-19
- '1.2.840.113549.1.1.1': 'rsa',
- # https://tools.ietf.org/html/rfc3279#page-18
- '1.2.840.10040.4.1': 'dsa',
- # https://tools.ietf.org/html/rfc3279#page-13
- '1.2.840.10045.2.1': 'ec',
- }
-
-
-class PrivateKeyAlgorithm(_ForceNullParameters, Sequence):
- """
- Original Name: PrivateKeyAlgorithmIdentifier
- Source: https://tools.ietf.org/html/rfc5208#page-3
- """
-
- _fields = [
- ('algorithm', PrivateKeyAlgorithmId),
- ('parameters', Any, {'optional': True}),
- ]
-
- _oid_pair = ('algorithm', 'parameters')
- _oid_specs = {
- 'dsa': DSAParams,
- 'ec': ECDomainParameters,
- }
-
-
-class PrivateKeyInfo(Sequence):
- """
- Source: https://tools.ietf.org/html/rfc5208#page-3
- """
-
- _fields = [
- ('version', Integer),
- ('private_key_algorithm', PrivateKeyAlgorithm),
- ('private_key', ParsableOctetString),
- ('attributes', Attributes, {'implicit': 0, 'optional': True}),
- ]
-
- def _private_key_spec(self):
- algorithm = self['private_key_algorithm']['algorithm'].native
- return {
- 'rsa': RSAPrivateKey,
- 'dsa': Integer,
- 'ec': ECPrivateKey,
- }[algorithm]
-
- _spec_callbacks = {
- 'private_key': _private_key_spec
- }
-
- _algorithm = None
- _bit_size = None
- _public_key = None
- _fingerprint = None
-
- @classmethod
- def wrap(cls, private_key, algorithm):
- """
- Wraps a private key in a PrivateKeyInfo structure
-
- :param private_key:
- A byte string or Asn1Value object of the private key
-
- :param algorithm:
- A unicode string of "rsa", "dsa" or "ec"
-
- :return:
- A PrivateKeyInfo object
- """
-
- if not isinstance(private_key, byte_cls) and not isinstance(private_key, Asn1Value):
- raise TypeError(unwrap(
- '''
- private_key must be a byte string or Asn1Value, not %s
- ''',
- type_name(private_key)
- ))
-
- if algorithm == 'rsa':
- if not isinstance(private_key, RSAPrivateKey):
- private_key = RSAPrivateKey.load(private_key)
- params = Null()
- elif algorithm == 'dsa':
- if not isinstance(private_key, DSAPrivateKey):
- private_key = DSAPrivateKey.load(private_key)
- params = DSAParams()
- params['p'] = private_key['p']
- params['q'] = private_key['q']
- params['g'] = private_key['g']
- public_key = private_key['public_key']
- private_key = private_key['private_key']
- elif algorithm == 'ec':
- if not isinstance(private_key, ECPrivateKey):
- private_key = ECPrivateKey.load(private_key)
- else:
- private_key = private_key.copy()
- params = private_key['parameters']
- del private_key['parameters']
- else:
- raise ValueError(unwrap(
- '''
- algorithm must be one of "rsa", "dsa", "ec", not %s
- ''',
- repr(algorithm)
- ))
-
- private_key_algo = PrivateKeyAlgorithm()
- private_key_algo['algorithm'] = PrivateKeyAlgorithmId(algorithm)
- private_key_algo['parameters'] = params
-
- container = cls()
- container._algorithm = algorithm
- container['version'] = Integer(0)
- container['private_key_algorithm'] = private_key_algo
- container['private_key'] = private_key
-
- # Here we save the DSA public key if possible since it is not contained
- # within the PKCS#8 structure for a DSA key
- if algorithm == 'dsa':
- container._public_key = public_key
-
- return container
-
- def _compute_public_key(self):
- """
- Computes the public key corresponding to the current private key.
-
- :return:
- For RSA keys, an RSAPublicKey object. For DSA keys, an Integer
- object. For EC keys, an ECPointBitString.
- """
-
- if self.algorithm == 'dsa':
- params = self['private_key_algorithm']['parameters']
- return Integer(pow(
- params['g'].native,
- self['private_key'].parsed.native,
- params['p'].native
- ))
-
- if self.algorithm == 'rsa':
- key = self['private_key'].parsed
- return RSAPublicKey({
- 'modulus': key['modulus'],
- 'public_exponent': key['public_exponent'],
- })
-
- if self.algorithm == 'ec':
- curve_type, details = self.curve
-
- if curve_type == 'implicit_ca':
- raise ValueError(unwrap(
- '''
- Unable to compute public key for EC key using Implicit CA
- parameters
- '''
- ))
-
- if curve_type == 'specified':
- if details['field_id']['field_type'] == 'characteristic_two_field':
- raise ValueError(unwrap(
- '''
- Unable to compute public key for EC key over a
- characteristic two field
- '''
- ))
-
- curve = PrimeCurve(
- details['field_id']['parameters'],
- int_from_bytes(details['curve']['a']),
- int_from_bytes(details['curve']['b'])
- )
- base_x, base_y = self['private_key_algorithm']['parameters'].chosen['base'].to_coords()
- base_point = PrimePoint(curve, base_x, base_y)
-
- elif curve_type == 'named':
- if details not in ('secp192r1', 'secp224r1', 'secp256r1', 'secp384r1', 'secp521r1'):
- raise ValueError(unwrap(
- '''
- Unable to compute public key for EC named curve %s,
- parameters not currently included
- ''',
- details
- ))
-
- base_point = {
- 'secp192r1': SECP192R1_BASE_POINT,
- 'secp224r1': SECP224R1_BASE_POINT,
- 'secp256r1': SECP256R1_BASE_POINT,
- 'secp384r1': SECP384R1_BASE_POINT,
- 'secp521r1': SECP521R1_BASE_POINT,
- }[details]
-
- public_point = base_point * self['private_key'].parsed['private_key'].native
- return ECPointBitString.from_coords(public_point.x, public_point.y)
-
- def unwrap(self):
- """
- Unwraps the private key into an RSAPrivateKey, DSAPrivateKey or
- ECPrivateKey object
-
- :return:
- An RSAPrivateKey, DSAPrivateKey or ECPrivateKey object
- """
-
- if self.algorithm == 'rsa':
- return self['private_key'].parsed
-
- if self.algorithm == 'dsa':
- params = self['private_key_algorithm']['parameters']
- return DSAPrivateKey({
- 'version': 0,
- 'p': params['p'],
- 'q': params['q'],
- 'g': params['g'],
- 'public_key': self.public_key,
- 'private_key': self['private_key'].parsed,
- })
-
- if self.algorithm == 'ec':
- output = self['private_key'].parsed
- output['parameters'] = self['private_key_algorithm']['parameters']
- output['public_key'] = self.public_key
- return output
-
- @property
- def curve(self):
- """
- Returns information about the curve used for an EC key
-
- :raises:
- ValueError - when the key is not an EC key
-
- :return:
- A two-element tuple, with the first element being a unicode string
- of "implicit_ca", "specified" or "named". If the first element is
- "implicit_ca", the second is None. If "specified", the second is
- an OrderedDict that is the native version of SpecifiedECDomain. If
- "named", the second is a unicode string of the curve name.
- """
-
- if self.algorithm != 'ec':
- raise ValueError(unwrap(
- '''
- Only EC keys have a curve, this key is %s
- ''',
- self.algorithm.upper()
- ))
-
- params = self['private_key_algorithm']['parameters']
- chosen = params.chosen
-
- if params.name == 'implicit_ca':
- value = None
- else:
- value = chosen.native
-
- return (params.name, value)
-
- @property
- def hash_algo(self):
- """
- Returns the name of the family of hash algorithms used to generate a
- DSA key
-
- :raises:
- ValueError - when the key is not a DSA key
-
- :return:
- A unicode string of "sha1" or "sha2"
- """
-
- if self.algorithm != 'dsa':
- raise ValueError(unwrap(
- '''
- Only DSA keys are generated using a hash algorithm, this key is
- %s
- ''',
- self.algorithm.upper()
- ))
-
- byte_len = math.log(self['private_key_algorithm']['parameters']['q'].native, 2) / 8
-
- return 'sha1' if byte_len <= 20 else 'sha2'
-
- @property
- def algorithm(self):
- """
- :return:
- A unicode string of "rsa", "dsa" or "ec"
- """
-
- if self._algorithm is None:
- self._algorithm = self['private_key_algorithm']['algorithm'].native
- return self._algorithm
-
- @property
- def bit_size(self):
- """
- :return:
- The bit size of the private key, as an integer
- """
-
- if self._bit_size is None:
- if self.algorithm == 'rsa':
- prime = self['private_key'].parsed['modulus'].native
- elif self.algorithm == 'dsa':
- prime = self['private_key_algorithm']['parameters']['p'].native
- elif self.algorithm == 'ec':
- prime = self['private_key'].parsed['private_key'].native
- self._bit_size = int(math.ceil(math.log(prime, 2)))
- modulus = self._bit_size % 8
- if modulus != 0:
- self._bit_size += 8 - modulus
- return self._bit_size
-
- @property
- def byte_size(self):
- """
- :return:
- The byte size of the private key, as an integer
- """
-
- return int(math.ceil(self.bit_size / 8))
-
- @property
- def public_key(self):
- """
- :return:
- If an RSA key, an RSAPublicKey object. If a DSA key, an Integer
- object. If an EC key, an ECPointBitString object.
- """
-
- if self._public_key is None:
- if self.algorithm == 'ec':
- key = self['private_key'].parsed
- if key['public_key']:
- self._public_key = key['public_key'].untag()
- else:
- self._public_key = self._compute_public_key()
- else:
- self._public_key = self._compute_public_key()
-
- return self._public_key
-
- @property
- def public_key_info(self):
- """
- :return:
- A PublicKeyInfo object derived from this private key.
- """
-
- return PublicKeyInfo({
- 'algorithm': {
- 'algorithm': self.algorithm,
- 'parameters': self['private_key_algorithm']['parameters']
- },
- 'public_key': self.public_key
- })
-
- @property
- def fingerprint(self):
- """
- Creates a fingerprint that can be compared with a public key to see if
- the two form a pair.
-
- This fingerprint is not compatible with fingerprints generated by any
- other software.
-
- :return:
- A byte string that is a sha256 hash of selected components (based
- on the key type)
- """
-
- if self._fingerprint is None:
- params = self['private_key_algorithm']['parameters']
- key = self['private_key'].parsed
-
- if self.algorithm == 'rsa':
- to_hash = '%d:%d' % (
- key['modulus'].native,
- key['public_exponent'].native,
- )
-
- elif self.algorithm == 'dsa':
- public_key = self.public_key
- to_hash = '%d:%d:%d:%d' % (
- params['p'].native,
- params['q'].native,
- params['g'].native,
- public_key.native,
- )
-
- elif self.algorithm == 'ec':
- public_key = key['public_key'].native
- if public_key is None:
- public_key = self.public_key.native
-
- if params.name == 'named':
- to_hash = '%s:' % params.chosen.native
- to_hash = to_hash.encode('utf-8')
- to_hash += public_key
-
- elif params.name == 'implicit_ca':
- to_hash = public_key
-
- elif params.name == 'specified':
- to_hash = '%s:' % params.chosen['field_id']['parameters'].native
- to_hash = to_hash.encode('utf-8')
- to_hash += b':' + params.chosen['curve']['a'].native
- to_hash += b':' + params.chosen['curve']['b'].native
- to_hash += public_key
-
- if isinstance(to_hash, str_cls):
- to_hash = to_hash.encode('utf-8')
-
- self._fingerprint = hashlib.sha256(to_hash).digest()
-
- return self._fingerprint
-
-
-class EncryptedPrivateKeyInfo(Sequence):
- """
- Source: https://tools.ietf.org/html/rfc5208#page-4
- """
-
- _fields = [
- ('encryption_algorithm', EncryptionAlgorithm),
- ('encrypted_data', OctetString),
- ]
-
-
-# These structures are from https://tools.ietf.org/html/rfc3279
-
-class ValidationParms(Sequence):
- """
- Source: https://tools.ietf.org/html/rfc3279#page-10
- """
-
- _fields = [
- ('seed', BitString),
- ('pgen_counter', Integer),
- ]
-
-
-class DomainParameters(Sequence):
- """
- Source: https://tools.ietf.org/html/rfc3279#page-10
- """
-
- _fields = [
- ('p', Integer),
- ('g', Integer),
- ('q', Integer),
- ('j', Integer, {'optional': True}),
- ('validation_params', ValidationParms, {'optional': True}),
- ]
-
-
-class PublicKeyAlgorithmId(ObjectIdentifier):
- """
- Original Name: None
- Source: https://tools.ietf.org/html/rfc3279
- """
-
- _map = {
- # https://tools.ietf.org/html/rfc3279#page-19
- '1.2.840.113549.1.1.1': 'rsa',
- # https://tools.ietf.org/html/rfc3447#page-47
- '1.2.840.113549.1.1.7': 'rsaes_oaep',
- # https://tools.ietf.org/html/rfc3279#page-18
- '1.2.840.10040.4.1': 'dsa',
- # https://tools.ietf.org/html/rfc3279#page-13
- '1.2.840.10045.2.1': 'ec',
- # https://tools.ietf.org/html/rfc3279#page-10
- '1.2.840.10046.2.1': 'dh',
- }
-
-
-class PublicKeyAlgorithm(_ForceNullParameters, Sequence):
- """
- Original Name: AlgorithmIdentifier
- Source: https://tools.ietf.org/html/rfc5280#page-18
- """
-
- _fields = [
- ('algorithm', PublicKeyAlgorithmId),
- ('parameters', Any, {'optional': True}),
- ]
-
- _oid_pair = ('algorithm', 'parameters')
- _oid_specs = {
- 'dsa': DSAParams,
- 'ec': ECDomainParameters,
- 'dh': DomainParameters,
- 'rsaes_oaep': RSAESOAEPParams,
- }
-
-
-class PublicKeyInfo(Sequence):
- """
- Original Name: SubjectPublicKeyInfo
- Source: https://tools.ietf.org/html/rfc5280#page-17
- """
-
- _fields = [
- ('algorithm', PublicKeyAlgorithm),
- ('public_key', ParsableOctetBitString),
- ]
-
- def _public_key_spec(self):
- algorithm = self['algorithm']['algorithm'].native
- return {
- 'rsa': RSAPublicKey,
- 'rsaes_oaep': RSAPublicKey,
- 'dsa': Integer,
- # We override the field spec with ECPoint so that users can easily
- # decompose the byte string into the constituent X and Y coords
- 'ec': (ECPointBitString, None),
- 'dh': Integer,
- }[algorithm]
-
- _spec_callbacks = {
- 'public_key': _public_key_spec
- }
-
- _algorithm = None
- _bit_size = None
- _fingerprint = None
- _sha1 = None
- _sha256 = None
-
- @classmethod
- def wrap(cls, public_key, algorithm):
- """
- Wraps a public key in a PublicKeyInfo structure
-
- :param public_key:
- A byte string or Asn1Value object of the public key
-
- :param algorithm:
- A unicode string of "rsa"
-
- :return:
- A PublicKeyInfo object
- """
-
- if not isinstance(public_key, byte_cls) and not isinstance(public_key, Asn1Value):
- raise TypeError(unwrap(
- '''
- public_key must be a byte string or Asn1Value, not %s
- ''',
- type_name(public_key)
- ))
-
- if algorithm != 'rsa':
- raise ValueError(unwrap(
- '''
- algorithm must "rsa", not %s
- ''',
- repr(algorithm)
- ))
-
- algo = PublicKeyAlgorithm()
- algo['algorithm'] = PublicKeyAlgorithmId(algorithm)
- algo['parameters'] = Null()
-
- container = cls()
- container['algorithm'] = algo
- if isinstance(public_key, Asn1Value):
- public_key = public_key.untag().dump()
- container['public_key'] = ParsableOctetBitString(public_key)
-
- return container
-
- def unwrap(self):
- """
- Unwraps an RSA public key into an RSAPublicKey object. Does not support
- DSA or EC public keys since they do not have an unwrapped form.
-
- :return:
- An RSAPublicKey object
- """
-
- if self.algorithm == 'rsa':
- return self['public_key'].parsed
-
- key_type = self.algorithm.upper()
- a_an = 'an' if key_type == 'EC' else 'a'
- raise ValueError(unwrap(
- '''
- Only RSA public keys may be unwrapped - this key is %s %s public
- key
- ''',
- a_an,
- key_type
- ))
-
- @property
- def curve(self):
- """
- Returns information about the curve used for an EC key
-
- :raises:
- ValueError - when the key is not an EC key
-
- :return:
- A two-element tuple, with the first element being a unicode string
- of "implicit_ca", "specified" or "named". If the first element is
- "implicit_ca", the second is None. If "specified", the second is
- an OrderedDict that is the native version of SpecifiedECDomain. If
- "named", the second is a unicode string of the curve name.
- """
-
- if self.algorithm != 'ec':
- raise ValueError(unwrap(
- '''
- Only EC keys have a curve, this key is %s
- ''',
- self.algorithm.upper()
- ))
-
- params = self['algorithm']['parameters']
- chosen = params.chosen
-
- if params.name == 'implicit_ca':
- value = None
- else:
- value = chosen.native
-
- return (params.name, value)
-
- @property
- def hash_algo(self):
- """
- Returns the name of the family of hash algorithms used to generate a
- DSA key
-
- :raises:
- ValueError - when the key is not a DSA key
-
- :return:
- A unicode string of "sha1" or "sha2" or None if no parameters are
- present
- """
-
- if self.algorithm != 'dsa':
- raise ValueError(unwrap(
- '''
- Only DSA keys are generated using a hash algorithm, this key is
- %s
- ''',
- self.algorithm.upper()
- ))
-
- parameters = self['algorithm']['parameters']
- if parameters.native is None:
- return None
-
- byte_len = math.log(parameters['q'].native, 2) / 8
-
- return 'sha1' if byte_len <= 20 else 'sha2'
-
- @property
- def algorithm(self):
- """
- :return:
- A unicode string of "rsa", "dsa" or "ec"
- """
-
- if self._algorithm is None:
- self._algorithm = self['algorithm']['algorithm'].native
- return self._algorithm
-
- @property
- def bit_size(self):
- """
- :return:
- The bit size of the public key, as an integer
- """
-
- if self._bit_size is None:
- if self.algorithm == 'ec':
- self._bit_size = ((len(self['public_key'].native) - 1) / 2) * 8
- else:
- if self.algorithm == 'rsa':
- prime = self['public_key'].parsed['modulus'].native
- elif self.algorithm == 'dsa':
- prime = self['algorithm']['parameters']['p'].native
- self._bit_size = int(math.ceil(math.log(prime, 2)))
- modulus = self._bit_size % 8
- if modulus != 0:
- self._bit_size += 8 - modulus
-
- return self._bit_size
-
- @property
- def byte_size(self):
- """
- :return:
- The byte size of the public key, as an integer
- """
-
- return int(math.ceil(self.bit_size / 8))
-
- @property
- def sha1(self):
- """
- :return:
- The SHA1 hash of the DER-encoded bytes of this public key info
- """
-
- if self._sha1 is None:
- self._sha1 = hashlib.sha1(byte_cls(self['public_key'])).digest()
- return self._sha1
-
- @property
- def sha256(self):
- """
- :return:
- The SHA-256 hash of the DER-encoded bytes of this public key info
- """
-
- if self._sha256 is None:
- self._sha256 = hashlib.sha256(byte_cls(self['public_key'])).digest()
- return self._sha256
-
- @property
- def fingerprint(self):
- """
- Creates a fingerprint that can be compared with a private key to see if
- the two form a pair.
-
- This fingerprint is not compatible with fingerprints generated by any
- other software.
-
- :return:
- A byte string that is a sha256 hash of selected components (based
- on the key type)
- """
-
- if self._fingerprint is None:
- key_type = self['algorithm']['algorithm'].native
- params = self['algorithm']['parameters']
-
- if key_type == 'rsa':
- key = self['public_key'].parsed
- to_hash = '%d:%d' % (
- key['modulus'].native,
- key['public_exponent'].native,
- )
-
- elif key_type == 'dsa':
- key = self['public_key'].parsed
- to_hash = '%d:%d:%d:%d' % (
- params['p'].native,
- params['q'].native,
- params['g'].native,
- key.native,
- )
-
- elif key_type == 'ec':
- key = self['public_key']
-
- if params.name == 'named':
- to_hash = '%s:' % params.chosen.native
- to_hash = to_hash.encode('utf-8')
- to_hash += key.native
-
- elif params.name == 'implicit_ca':
- to_hash = key.native
-
- elif params.name == 'specified':
- to_hash = '%s:' % params.chosen['field_id']['parameters'].native
- to_hash = to_hash.encode('utf-8')
- to_hash += b':' + params.chosen['curve']['a'].native
- to_hash += b':' + params.chosen['curve']['b'].native
- to_hash += key.native
-
- if isinstance(to_hash, str_cls):
- to_hash = to_hash.encode('utf-8')
-
- self._fingerprint = hashlib.sha256(to_hash).digest()
-
- return self._fingerprint
diff --git a/lib/asn1crypto/ocsp.py b/lib/asn1crypto/ocsp.py
deleted file mode 100644
index f18d8e83f7..0000000000
--- a/lib/asn1crypto/ocsp.py
+++ /dev/null
@@ -1,652 +0,0 @@
-# coding: utf-8
-
-"""
-ASN.1 type classes for the online certificate status protocol (OCSP). Exports
-the following items:
-
- - OCSPRequest()
- - OCSPResponse()
-
-Other type classes are defined that help compose the types listed above.
-"""
-
-from __future__ import unicode_literals, division, absolute_import, print_function
-
-from .algos import DigestAlgorithm, SignedDigestAlgorithm
-from .core import (
- Boolean,
- Choice,
- Enumerated,
- GeneralizedTime,
- IA5String,
- Integer,
- Null,
- ObjectIdentifier,
- OctetBitString,
- OctetString,
- ParsableOctetString,
- Sequence,
- SequenceOf,
-)
-from .crl import AuthorityInfoAccessSyntax, CRLReason
-from .keys import PublicKeyAlgorithm
-from .x509 import Certificate, GeneralName, GeneralNames, Name
-
-
-# The structures in this file are taken from https://tools.ietf.org/html/rfc6960
-
-
-class Version(Integer):
- _map = {
- 0: 'v1'
- }
-
-
-class CertId(Sequence):
- _fields = [
- ('hash_algorithm', DigestAlgorithm),
- ('issuer_name_hash', OctetString),
- ('issuer_key_hash', OctetString),
- ('serial_number', Integer),
- ]
-
-
-class ServiceLocator(Sequence):
- _fields = [
- ('issuer', Name),
- ('locator', AuthorityInfoAccessSyntax),
- ]
-
-
-class RequestExtensionId(ObjectIdentifier):
- _map = {
- '1.3.6.1.5.5.7.48.1.7': 'service_locator',
- }
-
-
-class RequestExtension(Sequence):
- _fields = [
- ('extn_id', RequestExtensionId),
- ('critical', Boolean, {'default': False}),
- ('extn_value', ParsableOctetString),
- ]
-
- _oid_pair = ('extn_id', 'extn_value')
- _oid_specs = {
- 'service_locator': ServiceLocator,
- }
-
-
-class RequestExtensions(SequenceOf):
- _child_spec = RequestExtension
-
-
-class Request(Sequence):
- _fields = [
- ('req_cert', CertId),
- ('single_request_extensions', RequestExtensions, {'explicit': 0, 'optional': True}),
- ]
-
- _processed_extensions = False
- _critical_extensions = None
- _service_locator_value = None
-
- def _set_extensions(self):
- """
- Sets common named extensions to private attributes and creates a list
- of critical extensions
- """
-
- self._critical_extensions = set()
-
- for extension in self['single_request_extensions']:
- name = extension['extn_id'].native
- attribute_name = '_%s_value' % name
- if hasattr(self, attribute_name):
- setattr(self, attribute_name, extension['extn_value'].parsed)
- if extension['critical'].native:
- self._critical_extensions.add(name)
-
- self._processed_extensions = True
-
- @property
- def critical_extensions(self):
- """
- Returns a set of the names (or OID if not a known extension) of the
- extensions marked as critical
-
- :return:
- A set of unicode strings
- """
-
- if not self._processed_extensions:
- self._set_extensions()
- return self._critical_extensions
-
- @property
- def service_locator_value(self):
- """
- This extension is used when communicating with an OCSP responder that
- acts as a proxy for OCSP requests
-
- :return:
- None or a ServiceLocator object
- """
-
- if self._processed_extensions is False:
- self._set_extensions()
- return self._service_locator_value
-
-
-class Requests(SequenceOf):
- _child_spec = Request
-
-
-class ResponseType(ObjectIdentifier):
- _map = {
- '1.3.6.1.5.5.7.48.1.1': 'basic_ocsp_response',
- }
-
-
-class AcceptableResponses(SequenceOf):
- _child_spec = ResponseType
-
-
-class PreferredSignatureAlgorithm(Sequence):
- _fields = [
- ('sig_identifier', SignedDigestAlgorithm),
- ('cert_identifier', PublicKeyAlgorithm, {'optional': True}),
- ]
-
-
-class PreferredSignatureAlgorithms(SequenceOf):
- _child_spec = PreferredSignatureAlgorithm
-
-
-class TBSRequestExtensionId(ObjectIdentifier):
- _map = {
- '1.3.6.1.5.5.7.48.1.2': 'nonce',
- '1.3.6.1.5.5.7.48.1.4': 'acceptable_responses',
- '1.3.6.1.5.5.7.48.1.8': 'preferred_signature_algorithms',
- }
-
-
-class TBSRequestExtension(Sequence):
- _fields = [
- ('extn_id', TBSRequestExtensionId),
- ('critical', Boolean, {'default': False}),
- ('extn_value', ParsableOctetString),
- ]
-
- _oid_pair = ('extn_id', 'extn_value')
- _oid_specs = {
- 'nonce': OctetString,
- 'acceptable_responses': AcceptableResponses,
- 'preferred_signature_algorithms': PreferredSignatureAlgorithms,
- }
-
-
-class TBSRequestExtensions(SequenceOf):
- _child_spec = TBSRequestExtension
-
-
-class TBSRequest(Sequence):
- _fields = [
- ('version', Version, {'explicit': 0, 'default': 'v1'}),
- ('requestor_name', GeneralName, {'explicit': 1, 'optional': True}),
- ('request_list', Requests),
- ('request_extensions', TBSRequestExtensions, {'explicit': 2, 'optional': True}),
- ]
-
-
-class Certificates(SequenceOf):
- _child_spec = Certificate
-
-
-class Signature(Sequence):
- _fields = [
- ('signature_algorithm', SignedDigestAlgorithm),
- ('signature', OctetBitString),
- ('certs', Certificates, {'explicit': 0, 'optional': True}),
- ]
-
-
-class OCSPRequest(Sequence):
- _fields = [
- ('tbs_request', TBSRequest),
- ('optional_signature', Signature, {'explicit': 0, 'optional': True}),
- ]
-
- _processed_extensions = False
- _critical_extensions = None
- _nonce_value = None
- _acceptable_responses_value = None
- _preferred_signature_algorithms_value = None
-
- def _set_extensions(self):
- """
- Sets common named extensions to private attributes and creates a list
- of critical extensions
- """
-
- self._critical_extensions = set()
-
- for extension in self['tbs_request']['request_extensions']:
- name = extension['extn_id'].native
- attribute_name = '_%s_value' % name
- if hasattr(self, attribute_name):
- setattr(self, attribute_name, extension['extn_value'].parsed)
- if extension['critical'].native:
- self._critical_extensions.add(name)
-
- self._processed_extensions = True
-
- @property
- def critical_extensions(self):
- """
- Returns a set of the names (or OID if not a known extension) of the
- extensions marked as critical
-
- :return:
- A set of unicode strings
- """
-
- if not self._processed_extensions:
- self._set_extensions()
- return self._critical_extensions
-
- @property
- def nonce_value(self):
- """
- This extension is used to prevent replay attacks by including a unique,
- random value with each request/response pair
-
- :return:
- None or an OctetString object
- """
-
- if self._processed_extensions is False:
- self._set_extensions()
- return self._nonce_value
-
- @property
- def acceptable_responses_value(self):
- """
- This extension is used to allow the client and server to communicate
- with alternative response formats other than just basic_ocsp_response,
- although no other formats are defined in the standard.
-
- :return:
- None or an AcceptableResponses object
- """
-
- if self._processed_extensions is False:
- self._set_extensions()
- return self._acceptable_responses_value
-
- @property
- def preferred_signature_algorithms_value(self):
- """
- This extension is used by the client to define what signature algorithms
- are preferred, including both the hash algorithm and the public key
- algorithm, with a level of detail down to even the public key algorithm
- parameters, such as curve name.
-
- :return:
- None or a PreferredSignatureAlgorithms object
- """
-
- if self._processed_extensions is False:
- self._set_extensions()
- return self._preferred_signature_algorithms_value
-
-
-class OCSPResponseStatus(Enumerated):
- _map = {
- 0: 'successful',
- 1: 'malformed_request',
- 2: 'internal_error',
- 3: 'try_later',
- 5: 'sign_required',
- 6: 'unauthorized',
- }
-
-
-class ResponderId(Choice):
- _alternatives = [
- ('by_name', Name, {'explicit': 1}),
- ('by_key', OctetString, {'explicit': 2}),
- ]
-
-
-class RevokedInfo(Sequence):
- _fields = [
- ('revocation_time', GeneralizedTime),
- ('revocation_reason', CRLReason, {'explicit': 0, 'optional': True}),
- ]
-
-
-class CertStatus(Choice):
- _alternatives = [
- ('good', Null, {'implicit': 0}),
- ('revoked', RevokedInfo, {'implicit': 1}),
- ('unknown', Null, {'implicit': 2}),
- ]
-
-
-class CrlId(Sequence):
- _fields = [
- ('crl_url', IA5String, {'explicit': 0, 'optional': True}),
- ('crl_num', Integer, {'explicit': 1, 'optional': True}),
- ('crl_time', GeneralizedTime, {'explicit': 2, 'optional': True}),
- ]
-
-
-class SingleResponseExtensionId(ObjectIdentifier):
- _map = {
- '1.3.6.1.5.5.7.48.1.3': 'crl',
- '1.3.6.1.5.5.7.48.1.6': 'archive_cutoff',
- # These are CRLEntryExtension values from
- # https://tools.ietf.org/html/rfc5280
- '2.5.29.21': 'crl_reason',
- '2.5.29.24': 'invalidity_date',
- '2.5.29.29': 'certificate_issuer',
- # https://tools.ietf.org/html/rfc6962.html#page-13
- '1.3.6.1.4.1.11129.2.4.5': 'signed_certificate_timestamp_list',
- }
-
-
-class SingleResponseExtension(Sequence):
- _fields = [
- ('extn_id', SingleResponseExtensionId),
- ('critical', Boolean, {'default': False}),
- ('extn_value', ParsableOctetString),
- ]
-
- _oid_pair = ('extn_id', 'extn_value')
- _oid_specs = {
- 'crl': CrlId,
- 'archive_cutoff': GeneralizedTime,
- 'crl_reason': CRLReason,
- 'invalidity_date': GeneralizedTime,
- 'certificate_issuer': GeneralNames,
- 'signed_certificate_timestamp_list': OctetString,
- }
-
-
-class SingleResponseExtensions(SequenceOf):
- _child_spec = SingleResponseExtension
-
-
-class SingleResponse(Sequence):
- _fields = [
- ('cert_id', CertId),
- ('cert_status', CertStatus),
- ('this_update', GeneralizedTime),
- ('next_update', GeneralizedTime, {'explicit': 0, 'optional': True}),
- ('single_extensions', SingleResponseExtensions, {'explicit': 1, 'optional': True}),
- ]
-
- _processed_extensions = False
- _critical_extensions = None
- _crl_value = None
- _archive_cutoff_value = None
- _crl_reason_value = None
- _invalidity_date_value = None
- _certificate_issuer_value = None
-
- def _set_extensions(self):
- """
- Sets common named extensions to private attributes and creates a list
- of critical extensions
- """
-
- self._critical_extensions = set()
-
- for extension in self['single_extensions']:
- name = extension['extn_id'].native
- attribute_name = '_%s_value' % name
- if hasattr(self, attribute_name):
- setattr(self, attribute_name, extension['extn_value'].parsed)
- if extension['critical'].native:
- self._critical_extensions.add(name)
-
- self._processed_extensions = True
-
- @property
- def critical_extensions(self):
- """
- Returns a set of the names (or OID if not a known extension) of the
- extensions marked as critical
-
- :return:
- A set of unicode strings
- """
-
- if not self._processed_extensions:
- self._set_extensions()
- return self._critical_extensions
-
- @property
- def crl_value(self):
- """
- This extension is used to locate the CRL that a certificate's revocation
- is contained within.
-
- :return:
- None or a CrlId object
- """
-
- if self._processed_extensions is False:
- self._set_extensions()
- return self._crl_value
-
- @property
- def archive_cutoff_value(self):
- """
- This extension is used to indicate the date at which an archived
- (historical) certificate status entry will no longer be available.
-
- :return:
- None or a GeneralizedTime object
- """
-
- if self._processed_extensions is False:
- self._set_extensions()
- return self._archive_cutoff_value
-
- @property
- def crl_reason_value(self):
- """
- This extension indicates the reason that a certificate was revoked.
-
- :return:
- None or a CRLReason object
- """
-
- if self._processed_extensions is False:
- self._set_extensions()
- return self._crl_reason_value
-
- @property
- def invalidity_date_value(self):
- """
- This extension indicates the suspected date/time the private key was
- compromised or the certificate became invalid. This would usually be
- before the revocation date, which is when the CA processed the
- revocation.
-
- :return:
- None or a GeneralizedTime object
- """
-
- if self._processed_extensions is False:
- self._set_extensions()
- return self._invalidity_date_value
-
- @property
- def certificate_issuer_value(self):
- """
- This extension indicates the issuer of the certificate in question.
-
- :return:
- None or an x509.GeneralNames object
- """
-
- if self._processed_extensions is False:
- self._set_extensions()
- return self._certificate_issuer_value
-
-
-class Responses(SequenceOf):
- _child_spec = SingleResponse
-
-
-class ResponseDataExtensionId(ObjectIdentifier):
- _map = {
- '1.3.6.1.5.5.7.48.1.2': 'nonce',
- '1.3.6.1.5.5.7.48.1.9': 'extended_revoke',
- }
-
-
-class ResponseDataExtension(Sequence):
- _fields = [
- ('extn_id', ResponseDataExtensionId),
- ('critical', Boolean, {'default': False}),
- ('extn_value', ParsableOctetString),
- ]
-
- _oid_pair = ('extn_id', 'extn_value')
- _oid_specs = {
- 'nonce': OctetString,
- 'extended_revoke': Null,
- }
-
-
-class ResponseDataExtensions(SequenceOf):
- _child_spec = ResponseDataExtension
-
-
-class ResponseData(Sequence):
- _fields = [
- ('version', Version, {'explicit': 0, 'default': 'v1'}),
- ('responder_id', ResponderId),
- ('produced_at', GeneralizedTime),
- ('responses', Responses),
- ('response_extensions', ResponseDataExtensions, {'explicit': 1, 'optional': True}),
- ]
-
-
-class BasicOCSPResponse(Sequence):
- _fields = [
- ('tbs_response_data', ResponseData),
- ('signature_algorithm', SignedDigestAlgorithm),
- ('signature', OctetBitString),
- ('certs', Certificates, {'explicit': 0, 'optional': True}),
- ]
-
-
-class ResponseBytes(Sequence):
- _fields = [
- ('response_type', ResponseType),
- ('response', ParsableOctetString),
- ]
-
- _oid_pair = ('response_type', 'response')
- _oid_specs = {
- 'basic_ocsp_response': BasicOCSPResponse,
- }
-
-
-class OCSPResponse(Sequence):
- _fields = [
- ('response_status', OCSPResponseStatus),
- ('response_bytes', ResponseBytes, {'explicit': 0, 'optional': True}),
- ]
-
- _processed_extensions = False
- _critical_extensions = None
- _nonce_value = None
- _extended_revoke_value = None
-
- def _set_extensions(self):
- """
- Sets common named extensions to private attributes and creates a list
- of critical extensions
- """
-
- self._critical_extensions = set()
-
- for extension in self['response_bytes']['response'].parsed['tbs_response_data']['response_extensions']:
- name = extension['extn_id'].native
- attribute_name = '_%s_value' % name
- if hasattr(self, attribute_name):
- setattr(self, attribute_name, extension['extn_value'].parsed)
- if extension['critical'].native:
- self._critical_extensions.add(name)
-
- self._processed_extensions = True
-
- @property
- def critical_extensions(self):
- """
- Returns a set of the names (or OID if not a known extension) of the
- extensions marked as critical
-
- :return:
- A set of unicode strings
- """
-
- if not self._processed_extensions:
- self._set_extensions()
- return self._critical_extensions
-
- @property
- def nonce_value(self):
- """
- This extension is used to prevent replay attacks on the request/response
- exchange
-
- :return:
- None or an OctetString object
- """
-
- if self._processed_extensions is False:
- self._set_extensions()
- return self._nonce_value
-
- @property
- def extended_revoke_value(self):
- """
- This extension is used to signal that the responder will return a
- "revoked" status for non-issued certificates.
-
- :return:
- None or a Null object (if present)
- """
-
- if self._processed_extensions is False:
- self._set_extensions()
- return self._extended_revoke_value
-
- @property
- def basic_ocsp_response(self):
- """
- A shortcut into the BasicOCSPResponse sequence
-
- :return:
- None or an asn1crypto.ocsp.BasicOCSPResponse object
- """
-
- return self['response_bytes']['response'].parsed
-
- @property
- def response_data(self):
- """
- A shortcut into the parsed, ResponseData sequence
-
- :return:
- None or an asn1crypto.ocsp.ResponseData object
- """
-
- return self['response_bytes']['response'].parsed['tbs_response_data']
diff --git a/lib/asn1crypto/parser.py b/lib/asn1crypto/parser.py
deleted file mode 100644
index 07f53ab07b..0000000000
--- a/lib/asn1crypto/parser.py
+++ /dev/null
@@ -1,289 +0,0 @@
-# coding: utf-8
-
-"""
-Functions for parsing and dumping using the ASN.1 DER encoding. Exports the
-following items:
-
- - emit()
- - parse()
- - peek()
-
-Other type classes are defined that help compose the types listed above.
-"""
-
-from __future__ import unicode_literals, division, absolute_import, print_function
-
-import sys
-
-from ._types import byte_cls, chr_cls, type_name
-from .util import int_from_bytes, int_to_bytes
-
-_PY2 = sys.version_info <= (3,)
-_INSUFFICIENT_DATA_MESSAGE = 'Insufficient data - %s bytes requested but only %s available'
-
-
-def emit(class_, method, tag, contents):
- """
- Constructs a byte string of an ASN.1 DER-encoded value
-
- This is typically not useful. Instead, use one of the standard classes from
- asn1crypto.core, or construct a new class with specific fields, and call the
- .dump() method.
-
- :param class_:
- An integer ASN.1 class value: 0 (universal), 1 (application),
- 2 (context), 3 (private)
-
- :param method:
- An integer ASN.1 method value: 0 (primitive), 1 (constructed)
-
- :param tag:
- An integer ASN.1 tag value
-
- :param contents:
- A byte string of the encoded byte contents
-
- :return:
- A byte string of the ASN.1 DER value (header and contents)
- """
-
- if not isinstance(class_, int):
- raise TypeError('class_ must be an integer, not %s' % type_name(class_))
-
- if class_ < 0 or class_ > 3:
- raise ValueError('class_ must be one of 0, 1, 2 or 3, not %s' % class_)
-
- if not isinstance(method, int):
- raise TypeError('method must be an integer, not %s' % type_name(method))
-
- if method < 0 or method > 1:
- raise ValueError('method must be 0 or 1, not %s' % method)
-
- if not isinstance(tag, int):
- raise TypeError('tag must be an integer, not %s' % type_name(tag))
-
- if tag < 0:
- raise ValueError('tag must be greater than zero, not %s' % tag)
-
- if not isinstance(contents, byte_cls):
- raise TypeError('contents must be a byte string, not %s' % type_name(contents))
-
- return _dump_header(class_, method, tag, contents) + contents
-
-
-def parse(contents, strict=False):
- """
- Parses a byte string of ASN.1 BER/DER-encoded data.
-
- This is typically not useful. Instead, use one of the standard classes from
- asn1crypto.core, or construct a new class with specific fields, and call the
- .load() class method.
-
- :param contents:
- A byte string of BER/DER-encoded data
-
- :param strict:
- A boolean indicating if trailing data should be forbidden - if so, a
- ValueError will be raised when trailing data exists
-
- :raises:
- ValueError - when the contents do not contain an ASN.1 header or are truncated in some way
- TypeError - when contents is not a byte string
-
- :return:
- A 6-element tuple:
- - 0: integer class (0 to 3)
- - 1: integer method
- - 2: integer tag
- - 3: byte string header
- - 4: byte string content
- - 5: byte string trailer
- """
-
- if not isinstance(contents, byte_cls):
- raise TypeError('contents must be a byte string, not %s' % type_name(contents))
-
- contents_len = len(contents)
- info, consumed = _parse(contents, contents_len)
- if strict and consumed != contents_len:
- raise ValueError('Extra data - %d bytes of trailing data were provided' % (contents_len - consumed))
- return info
-
-
-def peek(contents):
- """
- Parses a byte string of ASN.1 BER/DER-encoded data to find the length
-
- This is typically used to look into an encoded value to see how long the
- next chunk of ASN.1-encoded data is. Primarily it is useful when a
- value is a concatenation of multiple values.
-
- :param contents:
- A byte string of BER/DER-encoded data
-
- :raises:
- ValueError - when the contents do not contain an ASN.1 header or are truncated in some way
- TypeError - when contents is not a byte string
-
- :return:
- An integer with the number of bytes occupied by the ASN.1 value
- """
-
- if not isinstance(contents, byte_cls):
- raise TypeError('contents must be a byte string, not %s' % type_name(contents))
-
- info, consumed = _parse(contents, len(contents))
- return consumed
-
-
-def _parse(encoded_data, data_len, pointer=0, lengths_only=False):
- """
- Parses a byte string into component parts
-
- :param encoded_data:
- A byte string that contains BER-encoded data
-
- :param data_len:
- The integer length of the encoded data
-
- :param pointer:
- The index in the byte string to parse from
-
- :param lengths_only:
- A boolean to cause the call to return a 2-element tuple of the integer
- number of bytes in the header and the integer number of bytes in the
- contents. Internal use only.
-
- :return:
- A 2-element tuple:
- - 0: A tuple of (class_, method, tag, header, content, trailer)
- - 1: An integer indicating how many bytes were consumed
- """
-
- if data_len < pointer + 2:
- raise ValueError(_INSUFFICIENT_DATA_MESSAGE % (2, data_len - pointer))
-
- start = pointer
- first_octet = ord(encoded_data[pointer]) if _PY2 else encoded_data[pointer]
- pointer += 1
-
- tag = first_octet & 31
- # Base 128 length using 8th bit as continuation indicator
- if tag == 31:
- tag = 0
- while True:
- num = ord(encoded_data[pointer]) if _PY2 else encoded_data[pointer]
- pointer += 1
- tag *= 128
- tag += num & 127
- if num >> 7 == 0:
- break
-
- length_octet = ord(encoded_data[pointer]) if _PY2 else encoded_data[pointer]
- pointer += 1
-
- if length_octet >> 7 == 0:
- if lengths_only:
- return (pointer, pointer + (length_octet & 127))
- contents_end = pointer + (length_octet & 127)
-
- else:
- length_octets = length_octet & 127
- if length_octets:
- pointer += length_octets
- contents_end = pointer + int_from_bytes(encoded_data[pointer - length_octets:pointer], signed=False)
- if lengths_only:
- return (pointer, contents_end)
-
- else:
- # To properly parse indefinite length values, we need to scan forward
- # parsing headers until we find a value with a length of zero. If we
- # just scanned looking for \x00\x00, nested indefinite length values
- # would not work.
- contents_end = pointer
- # Unfortunately we need to understand the contents of the data to
- # properly scan forward, which bleeds some representation info into
- # the parser. This condition handles the unused bits byte in
- # constructed bit strings.
- if tag == 3:
- contents_end += 1
- while contents_end < data_len:
- sub_header_end, contents_end = _parse(encoded_data, data_len, contents_end, lengths_only=True)
- if contents_end == sub_header_end and encoded_data[contents_end - 2:contents_end] == b'\x00\x00':
- break
- if lengths_only:
- return (pointer, contents_end)
- if contents_end > data_len:
- raise ValueError(_INSUFFICIENT_DATA_MESSAGE % (contents_end, data_len))
- return (
- (
- first_octet >> 6,
- (first_octet >> 5) & 1,
- tag,
- encoded_data[start:pointer],
- encoded_data[pointer:contents_end - 2],
- b'\x00\x00'
- ),
- contents_end
- )
-
- if contents_end > data_len:
- raise ValueError(_INSUFFICIENT_DATA_MESSAGE % (contents_end, data_len))
- return (
- (
- first_octet >> 6,
- (first_octet >> 5) & 1,
- tag,
- encoded_data[start:pointer],
- encoded_data[pointer:contents_end],
- b''
- ),
- contents_end
- )
-
-
-def _dump_header(class_, method, tag, contents):
- """
- Constructs the header bytes for an ASN.1 object
-
- :param class_:
- An integer ASN.1 class value: 0 (universal), 1 (application),
- 2 (context), 3 (private)
-
- :param method:
- An integer ASN.1 method value: 0 (primitive), 1 (constructed)
-
- :param tag:
- An integer ASN.1 tag value
-
- :param contents:
- A byte string of the encoded byte contents
-
- :return:
- A byte string of the ASN.1 DER header
- """
-
- header = b''
-
- id_num = 0
- id_num |= class_ << 6
- id_num |= method << 5
-
- if tag >= 31:
- header += chr_cls(id_num | 31)
- while tag > 0:
- continuation_bit = 0x80 if tag > 0x7F else 0
- header += chr_cls(continuation_bit | (tag & 0x7F))
- tag = tag >> 7
- else:
- header += chr_cls(id_num | tag)
-
- length = len(contents)
- if length <= 127:
- header += chr_cls(length)
- else:
- length_bytes = int_to_bytes(length)
- header += chr_cls(0x80 | len(length_bytes))
- header += length_bytes
-
- return header
diff --git a/lib/asn1crypto/pdf.py b/lib/asn1crypto/pdf.py
deleted file mode 100644
index b72c886ce5..0000000000
--- a/lib/asn1crypto/pdf.py
+++ /dev/null
@@ -1,84 +0,0 @@
-# coding: utf-8
-
-"""
-ASN.1 type classes for PDF signature structures. Adds extra oid mapping and
-value parsing to asn1crypto.x509.Extension() and asn1crypto.xms.CMSAttribute().
-"""
-
-from __future__ import unicode_literals, division, absolute_import, print_function
-
-from .cms import CMSAttributeType, CMSAttribute
-from .core import (
- Boolean,
- Integer,
- Null,
- ObjectIdentifier,
- OctetString,
- Sequence,
- SequenceOf,
- SetOf,
-)
-from .crl import CertificateList
-from .ocsp import OCSPResponse
-from .x509 import (
- Extension,
- ExtensionId,
- GeneralName,
- KeyPurposeId,
-)
-
-
-class AdobeArchiveRevInfo(Sequence):
- _fields = [
- ('version', Integer)
- ]
-
-
-class AdobeTimestamp(Sequence):
- _fields = [
- ('version', Integer),
- ('location', GeneralName),
- ('requires_auth', Boolean, {'optional': True, 'default': False}),
- ]
-
-
-class OtherRevInfo(Sequence):
- _fields = [
- ('type', ObjectIdentifier),
- ('value', OctetString),
- ]
-
-
-class SequenceOfCertificateList(SequenceOf):
- _child_spec = CertificateList
-
-
-class SequenceOfOCSPResponse(SequenceOf):
- _child_spec = OCSPResponse
-
-
-class SequenceOfOtherRevInfo(SequenceOf):
- _child_spec = OtherRevInfo
-
-
-class RevocationInfoArchival(Sequence):
- _fields = [
- ('crl', SequenceOfCertificateList, {'explicit': 0, 'optional': True}),
- ('ocsp', SequenceOfOCSPResponse, {'explicit': 1, 'optional': True}),
- ('other_rev_info', SequenceOfOtherRevInfo, {'explicit': 2, 'optional': True}),
- ]
-
-
-class SetOfRevocationInfoArchival(SetOf):
- _child_spec = RevocationInfoArchival
-
-
-ExtensionId._map['1.2.840.113583.1.1.9.2'] = 'adobe_archive_rev_info'
-ExtensionId._map['1.2.840.113583.1.1.9.1'] = 'adobe_timestamp'
-ExtensionId._map['1.2.840.113583.1.1.10'] = 'adobe_ppklite_credential'
-Extension._oid_specs['adobe_archive_rev_info'] = AdobeArchiveRevInfo
-Extension._oid_specs['adobe_timestamp'] = AdobeTimestamp
-Extension._oid_specs['adobe_ppklite_credential'] = Null
-KeyPurposeId._map['1.2.840.113583.1.1.5'] = 'pdf_signing'
-CMSAttributeType._map['1.2.840.113583.1.1.8'] = 'adobe_revocation_info_archival'
-CMSAttribute._oid_specs['adobe_revocation_info_archival'] = SetOfRevocationInfoArchival
diff --git a/lib/asn1crypto/pem.py b/lib/asn1crypto/pem.py
deleted file mode 100644
index 511ea4b50d..0000000000
--- a/lib/asn1crypto/pem.py
+++ /dev/null
@@ -1,222 +0,0 @@
-# coding: utf-8
-
-"""
-Encoding DER to PEM and decoding PEM to DER. Exports the following items:
-
- - armor()
- - detect()
- - unarmor()
-
-"""
-
-from __future__ import unicode_literals, division, absolute_import, print_function
-
-import base64
-import re
-import sys
-
-from ._errors import unwrap
-from ._types import type_name as _type_name, str_cls, byte_cls
-
-if sys.version_info < (3,):
- from cStringIO import StringIO as BytesIO
-else:
- from io import BytesIO
-
-
-def detect(byte_string):
- """
- Detect if a byte string seems to contain a PEM-encoded block
-
- :param byte_string:
- A byte string to look through
-
- :return:
- A boolean, indicating if a PEM-encoded block is contained in the byte
- string
- """
-
- if not isinstance(byte_string, byte_cls):
- raise TypeError(unwrap(
- '''
- byte_string must be a byte string, not %s
- ''',
- _type_name(byte_string)
- ))
-
- return byte_string.find(b'-----BEGIN') != -1 or byte_string.find(b'---- BEGIN') != -1
-
-
-def armor(type_name, der_bytes, headers=None):
- """
- Armors a DER-encoded byte string in PEM
-
- :param type_name:
- A unicode string that will be capitalized and placed in the header
- and footer of the block. E.g. "CERTIFICATE", "PRIVATE KEY", etc. This
- will appear as "-----BEGIN CERTIFICATE-----" and
- "-----END CERTIFICATE-----".
-
- :param der_bytes:
- A byte string to be armored
-
- :param headers:
- An OrderedDict of the header lines to write after the BEGIN line
-
- :return:
- A byte string of the PEM block
- """
-
- if not isinstance(der_bytes, byte_cls):
- raise TypeError(unwrap(
- '''
- der_bytes must be a byte string, not %s
- ''' % _type_name(der_bytes)
- ))
-
- if not isinstance(type_name, str_cls):
- raise TypeError(unwrap(
- '''
- type_name must be a unicode string, not %s
- ''',
- _type_name(type_name)
- ))
-
- type_name = type_name.upper().encode('ascii')
-
- output = BytesIO()
- output.write(b'-----BEGIN ')
- output.write(type_name)
- output.write(b'-----\n')
- if headers:
- for key in headers:
- output.write(key.encode('ascii'))
- output.write(b': ')
- output.write(headers[key].encode('ascii'))
- output.write(b'\n')
- output.write(b'\n')
- b64_bytes = base64.b64encode(der_bytes)
- b64_len = len(b64_bytes)
- i = 0
- while i < b64_len:
- output.write(b64_bytes[i:i + 64])
- output.write(b'\n')
- i += 64
- output.write(b'-----END ')
- output.write(type_name)
- output.write(b'-----\n')
-
- return output.getvalue()
-
-
-def _unarmor(pem_bytes):
- """
- Convert a PEM-encoded byte string into one or more DER-encoded byte strings
-
- :param pem_bytes:
- A byte string of the PEM-encoded data
-
- :raises:
- ValueError - when the pem_bytes do not appear to be PEM-encoded bytes
-
- :return:
- A generator of 3-element tuples in the format: (object_type, headers,
- der_bytes). The object_type is a unicode string of what is between
- "-----BEGIN " and "-----". Examples include: "CERTIFICATE",
- "PUBLIC KEY", "PRIVATE KEY". The headers is a dict containing any lines
- in the form "Name: Value" that are right after the begin line.
- """
-
- if not isinstance(pem_bytes, byte_cls):
- raise TypeError(unwrap(
- '''
- pem_bytes must be a byte string, not %s
- ''',
- _type_name(pem_bytes)
- ))
-
- # Valid states include: "trash", "headers", "body"
- state = 'trash'
- headers = {}
- base64_data = b''
- object_type = None
-
- found_start = False
- found_end = False
-
- for line in pem_bytes.splitlines(False):
- if line == b'':
- continue
-
- if state == "trash":
- # Look for a starting line since some CA cert bundle show the cert
- # into in a parsed format above each PEM block
- type_name_match = re.match(b'^(?:---- |-----)BEGIN ([A-Z0-9 ]+)(?: ----|-----)', line)
- if not type_name_match:
- continue
- object_type = type_name_match.group(1).decode('ascii')
-
- found_start = True
- state = 'headers'
- continue
-
- if state == 'headers':
- if line.find(b':') == -1:
- state = 'body'
- else:
- decoded_line = line.decode('ascii')
- name, value = decoded_line.split(':', 1)
- headers[name] = value.strip()
- continue
-
- if state == 'body':
- if line[0:5] in (b'-----', b'---- '):
- der_bytes = base64.b64decode(base64_data)
-
- yield (object_type, headers, der_bytes)
-
- state = 'trash'
- headers = {}
- base64_data = b''
- object_type = None
- found_end = True
- continue
-
- base64_data += line
-
- if not found_start or not found_end:
- raise ValueError(unwrap(
- '''
- pem_bytes does not appear to contain PEM-encoded data - no
- BEGIN/END combination found
- '''
- ))
-
-
-def unarmor(pem_bytes, multiple=False):
- """
- Convert a PEM-encoded byte string into a DER-encoded byte string
-
- :param pem_bytes:
- A byte string of the PEM-encoded data
-
- :param multiple:
- If True, function will return a generator
-
- :raises:
- ValueError - when the pem_bytes do not appear to be PEM-encoded bytes
-
- :return:
- A 3-element tuple (object_name, headers, der_bytes). The object_name is
- a unicode string of what is between "-----BEGIN " and "-----". Examples
- include: "CERTIFICATE", "PUBLIC KEY", "PRIVATE KEY". The headers is a
- dict containing any lines in the form "Name: Value" that are right
- after the begin line.
- """
-
- generator = _unarmor(pem_bytes)
-
- if not multiple:
- return next(generator)
-
- return generator
diff --git a/lib/asn1crypto/pkcs12.py b/lib/asn1crypto/pkcs12.py
deleted file mode 100644
index 7ebcefeb31..0000000000
--- a/lib/asn1crypto/pkcs12.py
+++ /dev/null
@@ -1,193 +0,0 @@
-# coding: utf-8
-
-"""
-ASN.1 type classes for PKCS#12 files. Exports the following items:
-
- - CertBag()
- - CrlBag()
- - Pfx()
- - SafeBag()
- - SecretBag()
-
-Other type classes are defined that help compose the types listed above.
-"""
-
-from __future__ import unicode_literals, division, absolute_import, print_function
-
-from .algos import DigestInfo
-from .cms import ContentInfo, SignedData
-from .core import (
- Any,
- BMPString,
- Integer,
- ObjectIdentifier,
- OctetString,
- ParsableOctetString,
- Sequence,
- SequenceOf,
- SetOf,
-)
-from .keys import PrivateKeyInfo, EncryptedPrivateKeyInfo
-from .x509 import Certificate, KeyPurposeId
-
-
-# The structures in this file are taken from https://tools.ietf.org/html/rfc7292
-
-class MacData(Sequence):
- _fields = [
- ('mac', DigestInfo),
- ('mac_salt', OctetString),
- ('iterations', Integer, {'default': 1}),
- ]
-
-
-class Version(Integer):
- _map = {
- 3: 'v3'
- }
-
-
-class AttributeType(ObjectIdentifier):
- _map = {
- # https://tools.ietf.org/html/rfc2985#page-18
- '1.2.840.113549.1.9.20': 'friendly_name',
- '1.2.840.113549.1.9.21': 'local_key_id',
- # https://support.microsoft.com/en-us/kb/287547
- '1.3.6.1.4.1.311.17.1': 'microsoft_local_machine_keyset',
- # https://github.com/frohoff/jdk8u-dev-jdk/blob/master/src/share/classes/sun/security/pkcs12/PKCS12KeyStore.java
- # this is a set of OIDs, representing key usage, the usual value is a SET of one element OID 2.5.29.37.0
- '2.16.840.1.113894.746875.1.1': 'trusted_key_usage',
- }
-
-
-class SetOfAny(SetOf):
- _child_spec = Any
-
-
-class SetOfBMPString(SetOf):
- _child_spec = BMPString
-
-
-class SetOfOctetString(SetOf):
- _child_spec = OctetString
-
-
-class SetOfKeyPurposeId(SetOf):
- _child_spec = KeyPurposeId
-
-
-class Attribute(Sequence):
- _fields = [
- ('type', AttributeType),
- ('values', None),
- ]
-
- _oid_specs = {
- 'friendly_name': SetOfBMPString,
- 'local_key_id': SetOfOctetString,
- 'microsoft_csp_name': SetOfBMPString,
- 'trusted_key_usage': SetOfKeyPurposeId,
- }
-
- def _values_spec(self):
- return self._oid_specs.get(self['type'].native, SetOfAny)
-
- _spec_callbacks = {
- 'values': _values_spec
- }
-
-
-class Attributes(SetOf):
- _child_spec = Attribute
-
-
-class Pfx(Sequence):
- _fields = [
- ('version', Version),
- ('auth_safe', ContentInfo),
- ('mac_data', MacData, {'optional': True})
- ]
-
- _authenticated_safe = None
-
- @property
- def authenticated_safe(self):
- if self._authenticated_safe is None:
- content = self['auth_safe']['content']
- if isinstance(content, SignedData):
- content = content['content_info']['content']
- self._authenticated_safe = AuthenticatedSafe.load(content.native)
- return self._authenticated_safe
-
-
-class AuthenticatedSafe(SequenceOf):
- _child_spec = ContentInfo
-
-
-class BagId(ObjectIdentifier):
- _map = {
- '1.2.840.113549.1.12.10.1.1': 'key_bag',
- '1.2.840.113549.1.12.10.1.2': 'pkcs8_shrouded_key_bag',
- '1.2.840.113549.1.12.10.1.3': 'cert_bag',
- '1.2.840.113549.1.12.10.1.4': 'crl_bag',
- '1.2.840.113549.1.12.10.1.5': 'secret_bag',
- '1.2.840.113549.1.12.10.1.6': 'safe_contents',
- }
-
-
-class CertId(ObjectIdentifier):
- _map = {
- '1.2.840.113549.1.9.22.1': 'x509',
- '1.2.840.113549.1.9.22.2': 'sdsi',
- }
-
-
-class CertBag(Sequence):
- _fields = [
- ('cert_id', CertId),
- ('cert_value', ParsableOctetString, {'explicit': 0}),
- ]
-
- _oid_pair = ('cert_id', 'cert_value')
- _oid_specs = {
- 'x509': Certificate,
- }
-
-
-class CrlBag(Sequence):
- _fields = [
- ('crl_id', ObjectIdentifier),
- ('crl_value', OctetString, {'explicit': 0}),
- ]
-
-
-class SecretBag(Sequence):
- _fields = [
- ('secret_type_id', ObjectIdentifier),
- ('secret_value', OctetString, {'explicit': 0}),
- ]
-
-
-class SafeContents(SequenceOf):
- pass
-
-
-class SafeBag(Sequence):
- _fields = [
- ('bag_id', BagId),
- ('bag_value', Any, {'explicit': 0}),
- ('bag_attributes', Attributes, {'optional': True}),
- ]
-
- _oid_pair = ('bag_id', 'bag_value')
- _oid_specs = {
- 'key_bag': PrivateKeyInfo,
- 'pkcs8_shrouded_key_bag': EncryptedPrivateKeyInfo,
- 'cert_bag': CertBag,
- 'crl_bag': CrlBag,
- 'secret_bag': SecretBag,
- 'safe_contents': SafeContents
- }
-
-
-SafeContents._child_spec = SafeBag
diff --git a/lib/asn1crypto/tsp.py b/lib/asn1crypto/tsp.py
deleted file mode 100644
index bd40810412..0000000000
--- a/lib/asn1crypto/tsp.py
+++ /dev/null
@@ -1,310 +0,0 @@
-# coding: utf-8
-
-"""
-ASN.1 type classes for the time stamp protocol (TSP). Exports the following
-items:
-
- - TimeStampReq()
- - TimeStampResp()
-
-Also adds TimeStampedData() support to asn1crypto.cms.ContentInfo(),
-TimeStampedData() and TSTInfo() support to
-asn1crypto.cms.EncapsulatedContentInfo() and some oids and value parsers to
-asn1crypto.cms.CMSAttribute().
-
-Other type classes are defined that help compose the types listed above.
-"""
-
-from __future__ import unicode_literals, division, absolute_import, print_function
-
-from .algos import DigestAlgorithm
-from .cms import (
- CMSAttribute,
- CMSAttributeType,
- ContentInfo,
- ContentType,
- EncapsulatedContentInfo,
-)
-from .core import (
- Any,
- BitString,
- Boolean,
- Choice,
- GeneralizedTime,
- IA5String,
- Integer,
- ObjectIdentifier,
- OctetString,
- Sequence,
- SequenceOf,
- SetOf,
- UTF8String,
-)
-from .crl import CertificateList
-from .x509 import (
- Attributes,
- CertificatePolicies,
- GeneralName,
- GeneralNames,
-)
-
-
-# The structures in this file are based on https://tools.ietf.org/html/rfc3161,
-# https://tools.ietf.org/html/rfc4998, https://tools.ietf.org/html/rfc5544,
-# https://tools.ietf.org/html/rfc5035, https://tools.ietf.org/html/rfc2634
-
-class Version(Integer):
- _map = {
- 0: 'v0',
- 1: 'v1',
- 2: 'v2',
- 3: 'v3',
- 4: 'v4',
- 5: 'v5',
- }
-
-
-class MessageImprint(Sequence):
- _fields = [
- ('hash_algorithm', DigestAlgorithm),
- ('hashed_message', OctetString),
- ]
-
-
-class Accuracy(Sequence):
- _fields = [
- ('seconds', Integer, {'optional': True}),
- ('millis', Integer, {'implicit': 0, 'optional': True}),
- ('micros', Integer, {'implicit': 1, 'optional': True}),
- ]
-
-
-class Extension(Sequence):
- _fields = [
- ('extn_id', ObjectIdentifier),
- ('critical', Boolean, {'default': False}),
- ('extn_value', OctetString),
- ]
-
-
-class Extensions(SequenceOf):
- _child_spec = Extension
-
-
-class TSTInfo(Sequence):
- _fields = [
- ('version', Version),
- ('policy', ObjectIdentifier),
- ('message_imprint', MessageImprint),
- ('serial_number', Integer),
- ('gen_time', GeneralizedTime),
- ('accuracy', Accuracy, {'optional': True}),
- ('ordering', Boolean, {'default': False}),
- ('nonce', Integer, {'optional': True}),
- ('tsa', GeneralName, {'explicit': 0, 'optional': True}),
- ('extensions', Extensions, {'implicit': 1, 'optional': True}),
- ]
-
-
-class TimeStampReq(Sequence):
- _fields = [
- ('version', Version),
- ('message_imprint', MessageImprint),
- ('req_policy', ObjectIdentifier, {'optional': True}),
- ('nonce', Integer, {'optional': True}),
- ('cert_req', Boolean, {'default': False}),
- ('extensions', Extensions, {'implicit': 0, 'optional': True}),
- ]
-
-
-class PKIStatus(Integer):
- _map = {
- 0: 'granted',
- 1: 'granted_with_mods',
- 2: 'rejection',
- 3: 'waiting',
- 4: 'revocation_warning',
- 5: 'revocation_notification',
- }
-
-
-class PKIFreeText(SequenceOf):
- _child_spec = UTF8String
-
-
-class PKIFailureInfo(BitString):
- _map = {
- 0: 'bad_alg',
- 2: 'bad_request',
- 5: 'bad_data_format',
- 14: 'time_not_available',
- 15: 'unaccepted_policy',
- 16: 'unaccepted_extensions',
- 17: 'add_info_not_available',
- 25: 'system_failure',
- }
-
-
-class PKIStatusInfo(Sequence):
- _fields = [
- ('status', PKIStatus),
- ('status_string', PKIFreeText, {'optional': True}),
- ('fail_info', PKIFailureInfo, {'optional': True}),
- ]
-
-
-class TimeStampResp(Sequence):
- _fields = [
- ('status', PKIStatusInfo),
- ('time_stamp_token', ContentInfo),
- ]
-
-
-class MetaData(Sequence):
- _fields = [
- ('hash_protected', Boolean),
- ('file_name', UTF8String, {'optional': True}),
- ('media_type', IA5String, {'optional': True}),
- ('other_meta_data', Attributes, {'optional': True}),
- ]
-
-
-class TimeStampAndCRL(SequenceOf):
- _fields = [
- ('time_stamp', EncapsulatedContentInfo),
- ('crl', CertificateList, {'optional': True}),
- ]
-
-
-class TimeStampTokenEvidence(SequenceOf):
- _child_spec = TimeStampAndCRL
-
-
-class DigestAlgorithms(SequenceOf):
- _child_spec = DigestAlgorithm
-
-
-class EncryptionInfo(Sequence):
- _fields = [
- ('encryption_info_type', ObjectIdentifier),
- ('encryption_info_value', Any),
- ]
-
-
-class PartialHashtree(SequenceOf):
- _child_spec = OctetString
-
-
-class PartialHashtrees(SequenceOf):
- _child_spec = PartialHashtree
-
-
-class ArchiveTimeStamp(Sequence):
- _fields = [
- ('digest_algorithm', DigestAlgorithm, {'implicit': 0, 'optional': True}),
- ('attributes', Attributes, {'implicit': 1, 'optional': True}),
- ('reduced_hashtree', PartialHashtrees, {'implicit': 2, 'optional': True}),
- ('time_stamp', ContentInfo),
- ]
-
-
-class ArchiveTimeStampSequence(SequenceOf):
- _child_spec = ArchiveTimeStamp
-
-
-class EvidenceRecord(Sequence):
- _fields = [
- ('version', Version),
- ('digest_algorithms', DigestAlgorithms),
- ('crypto_infos', Attributes, {'implicit': 0, 'optional': True}),
- ('encryption_info', EncryptionInfo, {'implicit': 1, 'optional': True}),
- ('archive_time_stamp_sequence', ArchiveTimeStampSequence),
- ]
-
-
-class OtherEvidence(Sequence):
- _fields = [
- ('oe_type', ObjectIdentifier),
- ('oe_value', Any),
- ]
-
-
-class Evidence(Choice):
- _alternatives = [
- ('tst_evidence', TimeStampTokenEvidence, {'implicit': 0}),
- ('ers_evidence', EvidenceRecord, {'implicit': 1}),
- ('other_evidence', OtherEvidence, {'implicit': 2}),
- ]
-
-
-class TimeStampedData(Sequence):
- _fields = [
- ('version', Version),
- ('data_uri', IA5String, {'optional': True}),
- ('meta_data', MetaData, {'optional': True}),
- ('content', OctetString, {'optional': True}),
- ('temporal_evidence', Evidence),
- ]
-
-
-class IssuerSerial(Sequence):
- _fields = [
- ('issuer', GeneralNames),
- ('serial_number', Integer),
- ]
-
-
-class ESSCertID(Sequence):
- _fields = [
- ('cert_hash', OctetString),
- ('issuer_serial', IssuerSerial, {'optional': True}),
- ]
-
-
-class ESSCertIDs(SequenceOf):
- _child_spec = ESSCertID
-
-
-class SigningCertificate(Sequence):
- _fields = [
- ('certs', ESSCertIDs),
- ('policies', CertificatePolicies, {'optional': True}),
- ]
-
-
-class SetOfSigningCertificates(SetOf):
- _child_spec = SigningCertificate
-
-
-class ESSCertIDv2(Sequence):
- _fields = [
- ('hash_algorithm', DigestAlgorithm, {'default': {'algorithm': 'sha256'}}),
- ('cert_hash', OctetString),
- ('issuer_serial', IssuerSerial, {'optional': True}),
- ]
-
-
-class ESSCertIDv2s(SequenceOf):
- _child_spec = ESSCertIDv2
-
-
-class SigningCertificateV2(Sequence):
- _fields = [
- ('certs', ESSCertIDv2s),
- ('policies', CertificatePolicies, {'optional': True}),
- ]
-
-
-class SetOfSigningCertificatesV2(SetOf):
- _child_spec = SigningCertificateV2
-
-
-EncapsulatedContentInfo._oid_specs['tst_info'] = TSTInfo
-EncapsulatedContentInfo._oid_specs['timestamped_data'] = TimeStampedData
-ContentInfo._oid_specs['timestamped_data'] = TimeStampedData
-ContentType._map['1.2.840.113549.1.9.16.1.4'] = 'tst_info'
-ContentType._map['1.2.840.113549.1.9.16.1.31'] = 'timestamped_data'
-CMSAttributeType._map['1.2.840.113549.1.9.16.2.12'] = 'signing_certificate'
-CMSAttribute._oid_specs['signing_certificate'] = SetOfSigningCertificates
-CMSAttributeType._map['1.2.840.113549.1.9.16.2.47'] = 'signing_certificate_v2'
-CMSAttribute._oid_specs['signing_certificate_v2'] = SetOfSigningCertificatesV2
diff --git a/lib/asn1crypto/util.py b/lib/asn1crypto/util.py
deleted file mode 100644
index 2e55ef8583..0000000000
--- a/lib/asn1crypto/util.py
+++ /dev/null
@@ -1,712 +0,0 @@
-# coding: utf-8
-
-"""
-Miscellaneous data helpers, including functions for converting integers to and
-from bytes and UTC timezone. Exports the following items:
-
- - OrderedDict()
- - int_from_bytes()
- - int_to_bytes()
- - timezone.utc
- - inet_ntop()
- - inet_pton()
- - uri_to_iri()
- - iri_to_uri()
-"""
-
-from __future__ import unicode_literals, division, absolute_import, print_function
-
-import math
-import sys
-from datetime import datetime, date, time
-
-from ._errors import unwrap
-from ._iri import iri_to_uri, uri_to_iri # noqa
-from ._ordereddict import OrderedDict # noqa
-from ._types import type_name
-
-if sys.platform == 'win32':
- from ._inet import inet_ntop, inet_pton
-else:
- from socket import inet_ntop, inet_pton # noqa
-
-
-# Python 2
-if sys.version_info <= (3,):
-
- from datetime import timedelta, tzinfo
-
- py2 = True
-
- def int_to_bytes(value, signed=False, width=None):
- """
- Converts an integer to a byte string
-
- :param value:
- The integer to convert
-
- :param signed:
- If the byte string should be encoded using two's complement
-
- :param width:
- None == auto, otherwise an integer of the byte width for the return
- value
-
- :return:
- A byte string
- """
-
- # Handle negatives in two's complement
- is_neg = False
- if signed and value < 0:
- is_neg = True
- bits = int(math.ceil(len('%x' % abs(value)) / 2.0) * 8)
- value = (value + (1 << bits)) % (1 << bits)
-
- hex_str = '%x' % value
- if len(hex_str) & 1:
- hex_str = '0' + hex_str
-
- output = hex_str.decode('hex')
-
- if signed and not is_neg and ord(output[0:1]) & 0x80:
- output = b'\x00' + output
-
- if width is not None:
- if is_neg:
- pad_char = b'\xFF'
- else:
- pad_char = b'\x00'
- output = (pad_char * (width - len(output))) + output
- elif is_neg and ord(output[0:1]) & 0x80 == 0:
- output = b'\xFF' + output
-
- return output
-
- def int_from_bytes(value, signed=False):
- """
- Converts a byte string to an integer
-
- :param value:
- The byte string to convert
-
- :param signed:
- If the byte string should be interpreted using two's complement
-
- :return:
- An integer
- """
-
- if value == b'':
- return 0
-
- num = long(value.encode("hex"), 16) # noqa
-
- if not signed:
- return num
-
- # Check for sign bit and handle two's complement
- if ord(value[0:1]) & 0x80:
- bit_len = len(value) * 8
- return num - (1 << bit_len)
-
- return num
-
- class utc(tzinfo): # noqa
-
- def tzname(self, _):
- return b'UTC+00:00'
-
- def utcoffset(self, _):
- return timedelta(0)
-
- def dst(self, _):
- return timedelta(0)
-
- class timezone(): # noqa
-
- utc = utc()
-
-
-# Python 3
-else:
-
- from datetime import timezone # noqa
-
- py2 = False
-
- def int_to_bytes(value, signed=False, width=None):
- """
- Converts an integer to a byte string
-
- :param value:
- The integer to convert
-
- :param signed:
- If the byte string should be encoded using two's complement
-
- :param width:
- None == auto, otherwise an integer of the byte width for the return
- value
-
- :return:
- A byte string
- """
-
- if width is None:
- if signed:
- if value < 0:
- bits_required = abs(value + 1).bit_length()
- else:
- bits_required = value.bit_length()
- if bits_required % 8 == 0:
- bits_required += 1
- else:
- bits_required = value.bit_length()
- width = math.ceil(bits_required / 8) or 1
- return value.to_bytes(width, byteorder='big', signed=signed)
-
- def int_from_bytes(value, signed=False):
- """
- Converts a byte string to an integer
-
- :param value:
- The byte string to convert
-
- :param signed:
- If the byte string should be interpreted using two's complement
-
- :return:
- An integer
- """
-
- return int.from_bytes(value, 'big', signed=signed)
-
-
-_DAYS_PER_MONTH_YEAR_0 = {
- 1: 31,
- 2: 29, # Year 0 was a leap year
- 3: 31,
- 4: 30,
- 5: 31,
- 6: 30,
- 7: 31,
- 8: 31,
- 9: 30,
- 10: 31,
- 11: 30,
- 12: 31
-}
-
-
-class extended_date(object):
- """
- A datetime.date-like object that can represent the year 0. This is just
- to handle 0000-01-01 found in some certificates.
- """
-
- year = None
- month = None
- day = None
-
- def __init__(self, year, month, day):
- """
- :param year:
- The integer 0
-
- :param month:
- An integer from 1 to 12
-
- :param day:
- An integer from 1 to 31
- """
-
- if year != 0:
- raise ValueError('year must be 0')
-
- if month < 1 or month > 12:
- raise ValueError('month is out of range')
-
- if day < 0 or day > _DAYS_PER_MONTH_YEAR_0[month]:
- raise ValueError('day is out of range')
-
- self.year = year
- self.month = month
- self.day = day
-
- def _format(self, format):
- """
- Performs strftime(), always returning a unicode string
-
- :param format:
- A strftime() format string
-
- :return:
- A unicode string of the formatted date
- """
-
- format = format.replace('%Y', '0000')
- # Year 0 is 1BC and a leap year. Leap years repeat themselves
- # every 28 years. Because of adjustments and the proleptic gregorian
- # calendar, the simplest way to format is to substitute year 2000.
- temp = date(2000, self.month, self.day)
- if '%c' in format:
- c_out = temp.strftime('%c')
- # Handle full years
- c_out = c_out.replace('2000', '0000')
- c_out = c_out.replace('%', '%%')
- format = format.replace('%c', c_out)
- if '%x' in format:
- x_out = temp.strftime('%x')
- # Handle formats such as 08/16/2000 or 16.08.2000
- x_out = x_out.replace('2000', '0000')
- x_out = x_out.replace('%', '%%')
- format = format.replace('%x', x_out)
- return temp.strftime(format)
-
- def isoformat(self):
- """
- Formats the date as %Y-%m-%d
-
- :return:
- The date formatted to %Y-%m-%d as a unicode string in Python 3
- and a byte string in Python 2
- """
-
- return self.strftime('0000-%m-%d')
-
- def strftime(self, format):
- """
- Formats the date using strftime()
-
- :param format:
- The strftime() format string
-
- :return:
- The formatted date as a unicode string in Python 3 and a byte
- string in Python 2
- """
-
- output = self._format(format)
- if py2:
- return output.encode('utf-8')
- return output
-
- def replace(self, year=None, month=None, day=None):
- """
- Returns a new datetime.date or asn1crypto.util.extended_date
- object with the specified components replaced
-
- :return:
- A datetime.date or asn1crypto.util.extended_date object
- """
-
- if year is None:
- year = self.year
- if month is None:
- month = self.month
- if day is None:
- day = self.day
-
- if year > 0:
- cls = date
- else:
- cls = extended_date
-
- return cls(
- year,
- month,
- day
- )
-
- def __str__(self):
- if py2:
- return self.__bytes__()
- else:
- return self.__unicode__()
-
- def __bytes__(self):
- return self.__unicode__().encode('utf-8')
-
- def __unicode__(self):
- return self._format('%Y-%m-%d')
-
- def __eq__(self, other):
- if not isinstance(other, self.__class__):
- return False
- return self.__cmp__(other) == 0
-
- def __ne__(self, other):
- return not self.__eq__(other)
-
- def _comparison_error(self, other):
- raise TypeError(unwrap(
- '''
- An asn1crypto.util.extended_date object can only be compared to
- an asn1crypto.util.extended_date or datetime.date object, not %s
- ''',
- type_name(other)
- ))
-
- def __cmp__(self, other):
- if isinstance(other, date):
- return -1
-
- if not isinstance(other, self.__class__):
- self._comparison_error(other)
-
- st = (
- self.year,
- self.month,
- self.day
- )
- ot = (
- other.year,
- other.month,
- other.day
- )
-
- if st < ot:
- return -1
- if st > ot:
- return 1
- return 0
-
- def __lt__(self, other):
- return self.__cmp__(other) < 0
-
- def __le__(self, other):
- return self.__cmp__(other) <= 0
-
- def __gt__(self, other):
- return self.__cmp__(other) > 0
-
- def __ge__(self, other):
- return self.__cmp__(other) >= 0
-
-
-class extended_datetime(object):
- """
- A datetime.datetime-like object that can represent the year 0. This is just
- to handle 0000-01-01 found in some certificates.
- """
-
- year = None
- month = None
- day = None
- hour = None
- minute = None
- second = None
- microsecond = None
- tzinfo = None
-
- def __init__(self, year, month, day, hour=0, minute=0, second=0, microsecond=0, tzinfo=None):
- """
- :param year:
- The integer 0
-
- :param month:
- An integer from 1 to 12
-
- :param day:
- An integer from 1 to 31
-
- :param hour:
- An integer from 0 to 23
-
- :param minute:
- An integer from 0 to 59
-
- :param second:
- An integer from 0 to 59
-
- :param microsecond:
- An integer from 0 to 999999
- """
-
- if year != 0:
- raise ValueError('year must be 0')
-
- if month < 1 or month > 12:
- raise ValueError('month is out of range')
-
- if day < 0 or day > _DAYS_PER_MONTH_YEAR_0[month]:
- raise ValueError('day is out of range')
-
- if hour < 0 or hour > 23:
- raise ValueError('hour is out of range')
-
- if minute < 0 or minute > 59:
- raise ValueError('minute is out of range')
-
- if second < 0 or second > 59:
- raise ValueError('second is out of range')
-
- if microsecond < 0 or microsecond > 999999:
- raise ValueError('microsecond is out of range')
-
- self.year = year
- self.month = month
- self.day = day
- self.hour = hour
- self.minute = minute
- self.second = second
- self.microsecond = microsecond
- self.tzinfo = tzinfo
-
- def date(self):
- """
- :return:
- An asn1crypto.util.extended_date of the date
- """
-
- return extended_date(self.year, self.month, self.day)
-
- def time(self):
- """
- :return:
- A datetime.time object of the time
- """
-
- return time(self.hour, self.minute, self.second, self.microsecond, self.tzinfo)
-
- def utcoffset(self):
- """
- :return:
- None or a datetime.timedelta() of the offset from UTC
- """
-
- if self.tzinfo is None:
- return None
- return self.tzinfo.utcoffset(self.replace(year=2000))
-
- def dst(self):
- """
- :return:
- None or a datetime.timedelta() of the daylight savings time offset
- """
-
- if self.tzinfo is None:
- return None
- return self.tzinfo.dst(self.replace(year=2000))
-
- def tzname(self):
- """
- :return:
- None or the name of the timezone as a unicode string in Python 3
- and a byte string in Python 2
- """
-
- if self.tzinfo is None:
- return None
- return self.tzinfo.tzname(self.replace(year=2000))
-
- def _format(self, format):
- """
- Performs strftime(), always returning a unicode string
-
- :param format:
- A strftime() format string
-
- :return:
- A unicode string of the formatted datetime
- """
-
- format = format.replace('%Y', '0000')
- # Year 0 is 1BC and a leap year. Leap years repeat themselves
- # every 28 years. Because of adjustments and the proleptic gregorian
- # calendar, the simplest way to format is to substitute year 2000.
- temp = datetime(
- 2000,
- self.month,
- self.day,
- self.hour,
- self.minute,
- self.second,
- self.microsecond,
- self.tzinfo
- )
- if '%c' in format:
- c_out = temp.strftime('%c')
- # Handle full years
- c_out = c_out.replace('2000', '0000')
- c_out = c_out.replace('%', '%%')
- format = format.replace('%c', c_out)
- if '%x' in format:
- x_out = temp.strftime('%x')
- # Handle formats such as 08/16/2000 or 16.08.2000
- x_out = x_out.replace('2000', '0000')
- x_out = x_out.replace('%', '%%')
- format = format.replace('%x', x_out)
- return temp.strftime(format)
-
- def isoformat(self, sep='T'):
- """
- Formats the date as "%Y-%m-%d %H:%M:%S" with the sep param between the
- date and time portions
-
- :param set:
- A single character of the separator to place between the date and
- time
-
- :return:
- The formatted datetime as a unicode string in Python 3 and a byte
- string in Python 2
- """
-
- if self.microsecond == 0:
- return self.strftime('0000-%%m-%%d%s%%H:%%M:%%S' % sep)
- return self.strftime('0000-%%m-%%d%s%%H:%%M:%%S.%%f' % sep)
-
- def strftime(self, format):
- """
- Formats the date using strftime()
-
- :param format:
- The strftime() format string
-
- :return:
- The formatted date as a unicode string in Python 3 and a byte
- string in Python 2
- """
-
- output = self._format(format)
- if py2:
- return output.encode('utf-8')
- return output
-
- def replace(self, year=None, month=None, day=None, hour=None, minute=None,
- second=None, microsecond=None, tzinfo=None):
- """
- Returns a new datetime.datetime or asn1crypto.util.extended_datetime
- object with the specified components replaced
-
- :return:
- A datetime.datetime or asn1crypto.util.extended_datetime object
- """
-
- if year is None:
- year = self.year
- if month is None:
- month = self.month
- if day is None:
- day = self.day
- if hour is None:
- hour = self.hour
- if minute is None:
- minute = self.minute
- if second is None:
- second = self.second
- if microsecond is None:
- microsecond = self.microsecond
- if tzinfo is None:
- tzinfo = self.tzinfo
-
- if year > 0:
- cls = datetime
- else:
- cls = extended_datetime
-
- return cls(
- year,
- month,
- day,
- hour,
- minute,
- second,
- microsecond,
- tzinfo
- )
-
- def __str__(self):
- if py2:
- return self.__bytes__()
- else:
- return self.__unicode__()
-
- def __bytes__(self):
- return self.__unicode__().encode('utf-8')
-
- def __unicode__(self):
- format = '%Y-%m-%d %H:%M:%S'
- if self.microsecond != 0:
- format += '.%f'
- return self._format(format)
-
- def __eq__(self, other):
- if not isinstance(other, self.__class__):
- return False
- return self.__cmp__(other) == 0
-
- def __ne__(self, other):
- return not self.__eq__(other)
-
- def _comparison_error(self, other):
- """
- Raises a TypeError about the other object not being suitable for
- comparison
-
- :param other:
- The object being compared to
- """
-
- raise TypeError(unwrap(
- '''
- An asn1crypto.util.extended_datetime object can only be compared to
- an asn1crypto.util.extended_datetime or datetime.datetime object,
- not %s
- ''',
- type_name(other)
- ))
-
- def __cmp__(self, other):
- so = self.utcoffset()
- oo = other.utcoffset()
-
- if (so is not None and oo is None) or (so is None and oo is not None):
- raise TypeError("can't compare offset-naive and offset-aware datetimes")
-
- if isinstance(other, datetime):
- return -1
-
- if not isinstance(other, self.__class__):
- self._comparison_error(other)
-
- st = (
- self.year,
- self.month,
- self.day,
- self.hour,
- self.minute,
- self.second,
- self.microsecond,
- so
- )
- ot = (
- other.year,
- other.month,
- other.day,
- other.hour,
- other.minute,
- other.second,
- other.microsecond,
- oo
- )
-
- if st < ot:
- return -1
- if st > ot:
- return 1
- return 0
-
- def __lt__(self, other):
- return self.__cmp__(other) < 0
-
- def __le__(self, other):
- return self.__cmp__(other) <= 0
-
- def __gt__(self, other):
- return self.__cmp__(other) > 0
-
- def __ge__(self, other):
- return self.__cmp__(other) >= 0
diff --git a/lib/asn1crypto/version.py b/lib/asn1crypto/version.py
deleted file mode 100644
index 2ce2408607..0000000000
--- a/lib/asn1crypto/version.py
+++ /dev/null
@@ -1,6 +0,0 @@
-# coding: utf-8
-from __future__ import unicode_literals, division, absolute_import, print_function
-
-
-__version__ = '0.24.0'
-__version_info__ = (0, 24, 0)
diff --git a/lib/asn1crypto/x509.py b/lib/asn1crypto/x509.py
deleted file mode 100644
index 5a572a397d..0000000000
--- a/lib/asn1crypto/x509.py
+++ /dev/null
@@ -1,3002 +0,0 @@
-# coding: utf-8
-
-"""
-ASN.1 type classes for X.509 certificates. Exports the following items:
-
- - Attributes()
- - Certificate()
- - Extensions()
- - GeneralName()
- - GeneralNames()
- - Name()
-
-Other type classes are defined that help compose the types listed above.
-"""
-
-from __future__ import unicode_literals, division, absolute_import, print_function
-
-from contextlib import contextmanager
-from encodings import idna # noqa
-import hashlib
-import re
-import socket
-import stringprep
-import sys
-import unicodedata
-
-from ._errors import unwrap
-from ._iri import iri_to_uri, uri_to_iri
-from ._ordereddict import OrderedDict
-from ._types import type_name, str_cls, bytes_to_list
-from .algos import AlgorithmIdentifier, AnyAlgorithmIdentifier, DigestAlgorithm, SignedDigestAlgorithm
-from .core import (
- Any,
- BitString,
- BMPString,
- Boolean,
- Choice,
- Concat,
- Enumerated,
- GeneralizedTime,
- GeneralString,
- IA5String,
- Integer,
- Null,
- NumericString,
- ObjectIdentifier,
- OctetBitString,
- OctetString,
- ParsableOctetString,
- PrintableString,
- Sequence,
- SequenceOf,
- Set,
- SetOf,
- TeletexString,
- UniversalString,
- UTCTime,
- UTF8String,
- VisibleString,
- VOID,
-)
-from .keys import PublicKeyInfo
-from .util import int_to_bytes, int_from_bytes, inet_ntop, inet_pton
-
-
-# The structures in this file are taken from https://tools.ietf.org/html/rfc5280
-# and a few other supplementary sources, mostly due to extra supported
-# extension and name OIDs
-
-
-class DNSName(IA5String):
-
- _encoding = 'idna'
- _bad_tag = 19
-
- def __ne__(self, other):
- return not self == other
-
- def __eq__(self, other):
- """
- Equality as defined by https://tools.ietf.org/html/rfc5280#section-7.2
-
- :param other:
- Another DNSName object
-
- :return:
- A boolean
- """
-
- if not isinstance(other, DNSName):
- return False
-
- return self.__unicode__().lower() == other.__unicode__().lower()
-
- def set(self, value):
- """
- Sets the value of the DNS name
-
- :param value:
- A unicode string
- """
-
- if not isinstance(value, str_cls):
- raise TypeError(unwrap(
- '''
- %s value must be a unicode string, not %s
- ''',
- type_name(self),
- type_name(value)
- ))
-
- if value.startswith('.'):
- encoded_value = b'.' + value[1:].encode(self._encoding)
- else:
- encoded_value = value.encode(self._encoding)
-
- self._unicode = value
- self.contents = encoded_value
- self._header = None
- if self._trailer != b'':
- self._trailer = b''
-
-
-class URI(IA5String):
-
- def set(self, value):
- """
- Sets the value of the string
-
- :param value:
- A unicode string
- """
-
- if not isinstance(value, str_cls):
- raise TypeError(unwrap(
- '''
- %s value must be a unicode string, not %s
- ''',
- type_name(self),
- type_name(value)
- ))
-
- self._unicode = value
- self.contents = iri_to_uri(value)
- self._header = None
- if self._trailer != b'':
- self._trailer = b''
-
- def __ne__(self, other):
- return not self == other
-
- def __eq__(self, other):
- """
- Equality as defined by https://tools.ietf.org/html/rfc5280#section-7.4
-
- :param other:
- Another URI object
-
- :return:
- A boolean
- """
-
- if not isinstance(other, URI):
- return False
-
- return iri_to_uri(self.native) == iri_to_uri(other.native)
-
- def __unicode__(self):
- """
- :return:
- A unicode string
- """
-
- if self.contents is None:
- return ''
- if self._unicode is None:
- self._unicode = uri_to_iri(self._merge_chunks())
- return self._unicode
-
-
-class EmailAddress(IA5String):
-
- _contents = None
-
- # If the value has gone through the .set() method, thus normalizing it
- _normalized = False
-
- @property
- def contents(self):
- """
- :return:
- A byte string of the DER-encoded contents of the sequence
- """
-
- return self._contents
-
- @contents.setter
- def contents(self, value):
- """
- :param value:
- A byte string of the DER-encoded contents of the sequence
- """
-
- self._normalized = False
- self._contents = value
-
- def set(self, value):
- """
- Sets the value of the string
-
- :param value:
- A unicode string
- """
-
- if not isinstance(value, str_cls):
- raise TypeError(unwrap(
- '''
- %s value must be a unicode string, not %s
- ''',
- type_name(self),
- type_name(value)
- ))
-
- if value.find('@') != -1:
- mailbox, hostname = value.rsplit('@', 1)
- encoded_value = mailbox.encode('ascii') + b'@' + hostname.encode('idna')
- else:
- encoded_value = value.encode('ascii')
-
- self._normalized = True
- self._unicode = value
- self.contents = encoded_value
- self._header = None
- if self._trailer != b'':
- self._trailer = b''
-
- def __unicode__(self):
- """
- :return:
- A unicode string
- """
-
- if self._unicode is None:
- contents = self._merge_chunks()
- if contents.find(b'@') == -1:
- self._unicode = contents.decode('ascii')
- else:
- mailbox, hostname = contents.rsplit(b'@', 1)
- self._unicode = mailbox.decode('ascii') + '@' + hostname.decode('idna')
- return self._unicode
-
- def __ne__(self, other):
- return not self == other
-
- def __eq__(self, other):
- """
- Equality as defined by https://tools.ietf.org/html/rfc5280#section-7.5
-
- :param other:
- Another EmailAddress object
-
- :return:
- A boolean
- """
-
- if not isinstance(other, EmailAddress):
- return False
-
- if not self._normalized:
- self.set(self.native)
- if not other._normalized:
- other.set(other.native)
-
- if self._contents.find(b'@') == -1 or other._contents.find(b'@') == -1:
- return self._contents == other._contents
-
- other_mailbox, other_hostname = other._contents.rsplit(b'@', 1)
- mailbox, hostname = self._contents.rsplit(b'@', 1)
-
- if mailbox != other_mailbox:
- return False
-
- if hostname.lower() != other_hostname.lower():
- return False
-
- return True
-
-
-class IPAddress(OctetString):
- def parse(self, spec=None, spec_params=None):
- """
- This method is not applicable to IP addresses
- """
-
- raise ValueError(unwrap(
- '''
- IP address values can not be parsed
- '''
- ))
-
- def set(self, value):
- """
- Sets the value of the object
-
- :param value:
- A unicode string containing an IPv4 address, IPv4 address with CIDR,
- an IPv6 address or IPv6 address with CIDR
- """
-
- if not isinstance(value, str_cls):
- raise TypeError(unwrap(
- '''
- %s value must be a unicode string, not %s
- ''',
- type_name(self),
- type_name(value)
- ))
-
- original_value = value
-
- has_cidr = value.find('/') != -1
- cidr = 0
- if has_cidr:
- parts = value.split('/', 1)
- value = parts[0]
- cidr = int(parts[1])
- if cidr < 0:
- raise ValueError(unwrap(
- '''
- %s value contains a CIDR range less than 0
- ''',
- type_name(self)
- ))
-
- if value.find(':') != -1:
- family = socket.AF_INET6
- if cidr > 128:
- raise ValueError(unwrap(
- '''
- %s value contains a CIDR range bigger than 128, the maximum
- value for an IPv6 address
- ''',
- type_name(self)
- ))
- cidr_size = 128
- else:
- family = socket.AF_INET
- if cidr > 32:
- raise ValueError(unwrap(
- '''
- %s value contains a CIDR range bigger than 32, the maximum
- value for an IPv4 address
- ''',
- type_name(self)
- ))
- cidr_size = 32
-
- cidr_bytes = b''
- if has_cidr:
- cidr_mask = '1' * cidr
- cidr_mask += '0' * (cidr_size - len(cidr_mask))
- cidr_bytes = int_to_bytes(int(cidr_mask, 2))
- cidr_bytes = (b'\x00' * ((cidr_size // 8) - len(cidr_bytes))) + cidr_bytes
-
- self._native = original_value
- self.contents = inet_pton(family, value) + cidr_bytes
- self._bytes = self.contents
- self._header = None
- if self._trailer != b'':
- self._trailer = b''
-
- @property
- def native(self):
- """
- The a native Python datatype representation of this value
-
- :return:
- A unicode string or None
- """
-
- if self.contents is None:
- return None
-
- if self._native is None:
- byte_string = self.__bytes__()
- byte_len = len(byte_string)
- cidr_int = None
- if byte_len in set([32, 16]):
- value = inet_ntop(socket.AF_INET6, byte_string[0:16])
- if byte_len > 16:
- cidr_int = int_from_bytes(byte_string[16:])
- elif byte_len in set([8, 4]):
- value = inet_ntop(socket.AF_INET, byte_string[0:4])
- if byte_len > 4:
- cidr_int = int_from_bytes(byte_string[4:])
- if cidr_int is not None:
- cidr_bits = '{0:b}'.format(cidr_int)
- cidr = len(cidr_bits.rstrip('0'))
- value = value + '/' + str_cls(cidr)
- self._native = value
- return self._native
-
- def __ne__(self, other):
- return not self == other
-
- def __eq__(self, other):
- """
- :param other:
- Another IPAddress object
-
- :return:
- A boolean
- """
-
- if not isinstance(other, IPAddress):
- return False
-
- return self.__bytes__() == other.__bytes__()
-
-
-class Attribute(Sequence):
- _fields = [
- ('type', ObjectIdentifier),
- ('values', SetOf, {'spec': Any}),
- ]
-
-
-class Attributes(SequenceOf):
- _child_spec = Attribute
-
-
-class KeyUsage(BitString):
- _map = {
- 0: 'digital_signature',
- 1: 'non_repudiation',
- 2: 'key_encipherment',
- 3: 'data_encipherment',
- 4: 'key_agreement',
- 5: 'key_cert_sign',
- 6: 'crl_sign',
- 7: 'encipher_only',
- 8: 'decipher_only',
- }
-
-
-class PrivateKeyUsagePeriod(Sequence):
- _fields = [
- ('not_before', GeneralizedTime, {'implicit': 0, 'optional': True}),
- ('not_after', GeneralizedTime, {'implicit': 1, 'optional': True}),
- ]
-
-
-class NotReallyTeletexString(TeletexString):
- """
- OpenSSL (and probably some other libraries) puts ISO-8859-1
- into TeletexString instead of ITU T.61. We use Windows-1252 when
- decoding since it is a superset of ISO-8859-1, and less likely to
- cause encoding issues, but we stay strict with encoding to prevent
- us from creating bad data.
- """
-
- _decoding_encoding = 'cp1252'
-
- def __unicode__(self):
- """
- :return:
- A unicode string
- """
-
- if self.contents is None:
- return ''
- if self._unicode is None:
- self._unicode = self._merge_chunks().decode(self._decoding_encoding)
- return self._unicode
-
-
-@contextmanager
-def strict_teletex():
- try:
- NotReallyTeletexString._decoding_encoding = 'teletex'
- yield
- finally:
- NotReallyTeletexString._decoding_encoding = 'cp1252'
-
-
-class DirectoryString(Choice):
- _alternatives = [
- ('teletex_string', NotReallyTeletexString),
- ('printable_string', PrintableString),
- ('universal_string', UniversalString),
- ('utf8_string', UTF8String),
- ('bmp_string', BMPString),
- # This is an invalid/bad alternative, but some broken certs use it
- ('ia5_string', IA5String),
- ]
-
-
-class NameType(ObjectIdentifier):
- _map = {
- '2.5.4.3': 'common_name',
- '2.5.4.4': 'surname',
- '2.5.4.5': 'serial_number',
- '2.5.4.6': 'country_name',
- '2.5.4.7': 'locality_name',
- '2.5.4.8': 'state_or_province_name',
- '2.5.4.9': 'street_address',
- '2.5.4.10': 'organization_name',
- '2.5.4.11': 'organizational_unit_name',
- '2.5.4.12': 'title',
- '2.5.4.15': 'business_category',
- '2.5.4.17': 'postal_code',
- '2.5.4.20': 'telephone_number',
- '2.5.4.41': 'name',
- '2.5.4.42': 'given_name',
- '2.5.4.43': 'initials',
- '2.5.4.44': 'generation_qualifier',
- '2.5.4.45': 'unique_identifier',
- '2.5.4.46': 'dn_qualifier',
- '2.5.4.65': 'pseudonym',
- '2.5.4.97': 'organization_identifier',
- # https://www.trustedcomputinggroup.org/wp-content/uploads/Credential_Profile_EK_V2.0_R14_published.pdf
- '2.23.133.2.1': 'tpm_manufacturer',
- '2.23.133.2.2': 'tpm_model',
- '2.23.133.2.3': 'tpm_version',
- '2.23.133.2.4': 'platform_manufacturer',
- '2.23.133.2.5': 'platform_model',
- '2.23.133.2.6': 'platform_version',
- # https://tools.ietf.org/html/rfc2985#page-26
- '1.2.840.113549.1.9.1': 'email_address',
- # Page 10 of https://cabforum.org/wp-content/uploads/EV-V1_5_5.pdf
- '1.3.6.1.4.1.311.60.2.1.1': 'incorporation_locality',
- '1.3.6.1.4.1.311.60.2.1.2': 'incorporation_state_or_province',
- '1.3.6.1.4.1.311.60.2.1.3': 'incorporation_country',
- # https://tools.ietf.org/html/rfc2247#section-4
- '0.9.2342.19200300.100.1.25': 'domain_component',
- # http://www.alvestrand.no/objectid/0.2.262.1.10.7.20.html
- '0.2.262.1.10.7.20': 'name_distinguisher',
- }
-
- # This order is largely based on observed order seen in EV certs from
- # Symantec and DigiCert. Some of the uncommon name-related fields are
- # just placed in what seems like a reasonable order.
- preferred_order = [
- 'incorporation_country',
- 'incorporation_state_or_province',
- 'incorporation_locality',
- 'business_category',
- 'serial_number',
- 'country_name',
- 'postal_code',
- 'state_or_province_name',
- 'locality_name',
- 'street_address',
- 'organization_name',
- 'organizational_unit_name',
- 'title',
- 'common_name',
- 'initials',
- 'generation_qualifier',
- 'surname',
- 'given_name',
- 'name',
- 'pseudonym',
- 'dn_qualifier',
- 'telephone_number',
- 'email_address',
- 'domain_component',
- 'name_distinguisher',
- 'organization_identifier',
- 'tpm_manufacturer',
- 'tpm_model',
- 'tpm_version',
- 'platform_manufacturer',
- 'platform_model',
- 'platform_version',
- ]
-
- @classmethod
- def preferred_ordinal(cls, attr_name):
- """
- Returns an ordering value for a particular attribute key.
-
- Unrecognized attributes and OIDs will be sorted lexically at the end.
-
- :return:
- An orderable value.
-
- """
-
- attr_name = cls.map(attr_name)
- if attr_name in cls.preferred_order:
- ordinal = cls.preferred_order.index(attr_name)
- else:
- ordinal = len(cls.preferred_order)
-
- return (ordinal, attr_name)
-
- @property
- def human_friendly(self):
- """
- :return:
- A human-friendly unicode string to display to users
- """
-
- return {
- 'common_name': 'Common Name',
- 'surname': 'Surname',
- 'serial_number': 'Serial Number',
- 'country_name': 'Country',
- 'locality_name': 'Locality',
- 'state_or_province_name': 'State/Province',
- 'street_address': 'Street Address',
- 'organization_name': 'Organization',
- 'organizational_unit_name': 'Organizational Unit',
- 'title': 'Title',
- 'business_category': 'Business Category',
- 'postal_code': 'Postal Code',
- 'telephone_number': 'Telephone Number',
- 'name': 'Name',
- 'given_name': 'Given Name',
- 'initials': 'Initials',
- 'generation_qualifier': 'Generation Qualifier',
- 'unique_identifier': 'Unique Identifier',
- 'dn_qualifier': 'DN Qualifier',
- 'pseudonym': 'Pseudonym',
- 'email_address': 'Email Address',
- 'incorporation_locality': 'Incorporation Locality',
- 'incorporation_state_or_province': 'Incorporation State/Province',
- 'incorporation_country': 'Incorporation Country',
- 'domain_component': 'Domain Component',
- 'name_distinguisher': 'Name Distinguisher',
- 'organization_identifier': 'Organization Identifier',
- 'tpm_manufacturer': 'TPM Manufacturer',
- 'tpm_model': 'TPM Model',
- 'tpm_version': 'TPM Version',
- 'platform_manufacturer': 'Platform Manufacturer',
- 'platform_model': 'Platform Model',
- 'platform_version': 'Platform Version',
- }.get(self.native, self.native)
-
-
-class NameTypeAndValue(Sequence):
- _fields = [
- ('type', NameType),
- ('value', Any),
- ]
-
- _oid_pair = ('type', 'value')
- _oid_specs = {
- 'common_name': DirectoryString,
- 'surname': DirectoryString,
- 'serial_number': DirectoryString,
- 'country_name': DirectoryString,
- 'locality_name': DirectoryString,
- 'state_or_province_name': DirectoryString,
- 'street_address': DirectoryString,
- 'organization_name': DirectoryString,
- 'organizational_unit_name': DirectoryString,
- 'title': DirectoryString,
- 'business_category': DirectoryString,
- 'postal_code': DirectoryString,
- 'telephone_number': PrintableString,
- 'name': DirectoryString,
- 'given_name': DirectoryString,
- 'initials': DirectoryString,
- 'generation_qualifier': DirectoryString,
- 'unique_identifier': OctetBitString,
- 'dn_qualifier': DirectoryString,
- 'pseudonym': DirectoryString,
- # https://tools.ietf.org/html/rfc2985#page-26
- 'email_address': EmailAddress,
- # Page 10 of https://cabforum.org/wp-content/uploads/EV-V1_5_5.pdf
- 'incorporation_locality': DirectoryString,
- 'incorporation_state_or_province': DirectoryString,
- 'incorporation_country': DirectoryString,
- 'domain_component': DNSName,
- 'name_distinguisher': DirectoryString,
- 'organization_identifier': DirectoryString,
- 'tpm_manufacturer': UTF8String,
- 'tpm_model': UTF8String,
- 'tpm_version': UTF8String,
- 'platform_manufacturer': UTF8String,
- 'platform_model': UTF8String,
- 'platform_version': UTF8String,
- }
-
- _prepped = None
-
- @property
- def prepped_value(self):
- """
- Returns the value after being processed by the internationalized string
- preparation as specified by RFC 5280
-
- :return:
- A unicode string
- """
-
- if self._prepped is None:
- self._prepped = self._ldap_string_prep(self['value'].native)
- return self._prepped
-
- def __ne__(self, other):
- return not self == other
-
- def __eq__(self, other):
- """
- Equality as defined by https://tools.ietf.org/html/rfc5280#section-7.1
-
- :param other:
- Another NameTypeAndValue object
-
- :return:
- A boolean
- """
-
- if not isinstance(other, NameTypeAndValue):
- return False
-
- if other['type'].native != self['type'].native:
- return False
-
- return other.prepped_value == self.prepped_value
-
- def _ldap_string_prep(self, string):
- """
- Implements the internationalized string preparation algorithm from
- RFC 4518. https://tools.ietf.org/html/rfc4518#section-2
-
- :param string:
- A unicode string to prepare
-
- :return:
- A prepared unicode string, ready for comparison
- """
-
- # Map step
- string = re.sub('[\u00ad\u1806\u034f\u180b-\u180d\ufe0f-\uff00\ufffc]+', '', string)
- string = re.sub('[\u0009\u000a\u000b\u000c\u000d\u0085]', ' ', string)
- if sys.maxunicode == 0xffff:
- # Some installs of Python 2.7 don't support 8-digit unicode escape
- # ranges, so we have to break them into pieces
- # Original was: \U0001D173-\U0001D17A and \U000E0020-\U000E007F
- string = re.sub('\ud834[\udd73-\udd7a]|\udb40[\udc20-\udc7f]|\U000e0001', '', string)
- else:
- string = re.sub('[\U0001D173-\U0001D17A\U000E0020-\U000E007F\U000e0001]', '', string)
- string = re.sub(
- '[\u0000-\u0008\u000e-\u001f\u007f-\u0084\u0086-\u009f\u06dd\u070f\u180e\u200c-\u200f'
- '\u202a-\u202e\u2060-\u2063\u206a-\u206f\ufeff\ufff9-\ufffb]+',
- '',
- string
- )
- string = string.replace('\u200b', '')
- string = re.sub('[\u00a0\u1680\u2000-\u200a\u2028-\u2029\u202f\u205f\u3000]', ' ', string)
-
- string = ''.join(map(stringprep.map_table_b2, string))
-
- # Normalize step
- string = unicodedata.normalize('NFKC', string)
-
- # Prohibit step
- for char in string:
- if stringprep.in_table_a1(char):
- raise ValueError(unwrap(
- '''
- X.509 Name objects may not contain unassigned code points
- '''
- ))
-
- if stringprep.in_table_c8(char):
- raise ValueError(unwrap(
- '''
- X.509 Name objects may not contain change display or
- zzzzdeprecated characters
- '''
- ))
-
- if stringprep.in_table_c3(char):
- raise ValueError(unwrap(
- '''
- X.509 Name objects may not contain private use characters
- '''
- ))
-
- if stringprep.in_table_c4(char):
- raise ValueError(unwrap(
- '''
- X.509 Name objects may not contain non-character code points
- '''
- ))
-
- if stringprep.in_table_c5(char):
- raise ValueError(unwrap(
- '''
- X.509 Name objects may not contain surrogate code points
- '''
- ))
-
- if char == '\ufffd':
- raise ValueError(unwrap(
- '''
- X.509 Name objects may not contain the replacement character
- '''
- ))
-
- # Check bidirectional step - here we ensure that we are not mixing
- # left-to-right and right-to-left text in the string
- has_r_and_al_cat = False
- has_l_cat = False
- for char in string:
- if stringprep.in_table_d1(char):
- has_r_and_al_cat = True
- elif stringprep.in_table_d2(char):
- has_l_cat = True
-
- if has_r_and_al_cat:
- first_is_r_and_al = stringprep.in_table_d1(string[0])
- last_is_r_and_al = stringprep.in_table_d1(string[-1])
-
- if has_l_cat or not first_is_r_and_al or not last_is_r_and_al:
- raise ValueError(unwrap(
- '''
- X.509 Name object contains a malformed bidirectional
- sequence
- '''
- ))
-
- # Insignificant space handling step
- string = ' ' + re.sub(' +', ' ', string).strip() + ' '
-
- return string
-
-
-class RelativeDistinguishedName(SetOf):
- _child_spec = NameTypeAndValue
-
- @property
- def hashable(self):
- """
- :return:
- A unicode string that can be used as a dict key or in a set
- """
-
- output = []
- values = self._get_values(self)
- for key in sorted(values.keys()):
- output.append('%s: %s' % (key, values[key]))
- # Unit separator is used here since the normalization process for
- # values moves any such character, and the keys are all dotted integers
- # or under_score_words
- return '\x1F'.join(output)
-
- def __ne__(self, other):
- return not self == other
-
- def __eq__(self, other):
- """
- Equality as defined by https://tools.ietf.org/html/rfc5280#section-7.1
-
- :param other:
- Another RelativeDistinguishedName object
-
- :return:
- A boolean
- """
-
- if not isinstance(other, RelativeDistinguishedName):
- return False
-
- if len(self) != len(other):
- return False
-
- self_types = self._get_types(self)
- other_types = self._get_types(other)
-
- if self_types != other_types:
- return False
-
- self_values = self._get_values(self)
- other_values = self._get_values(other)
-
- for type_name_ in self_types:
- if self_values[type_name_] != other_values[type_name_]:
- return False
-
- return True
-
- def _get_types(self, rdn):
- """
- Returns a set of types contained in an RDN
-
- :param rdn:
- A RelativeDistinguishedName object
-
- :return:
- A set object with unicode strings of NameTypeAndValue type field
- values
- """
-
- return set([ntv['type'].native for ntv in rdn])
-
- def _get_values(self, rdn):
- """
- Returns a dict of prepped values contained in an RDN
-
- :param rdn:
- A RelativeDistinguishedName object
-
- :return:
- A dict object with unicode strings of NameTypeAndValue value field
- values that have been prepped for comparison
- """
-
- output = {}
- [output.update([(ntv['type'].native, ntv.prepped_value)]) for ntv in rdn]
- return output
-
-
-class RDNSequence(SequenceOf):
- _child_spec = RelativeDistinguishedName
-
- @property
- def hashable(self):
- """
- :return:
- A unicode string that can be used as a dict key or in a set
- """
-
- # Record separator is used here since the normalization process for
- # values moves any such character, and the keys are all dotted integers
- # or under_score_words
- return '\x1E'.join(rdn.hashable for rdn in self)
-
- def __ne__(self, other):
- return not self == other
-
- def __eq__(self, other):
- """
- Equality as defined by https://tools.ietf.org/html/rfc5280#section-7.1
-
- :param other:
- Another RDNSequence object
-
- :return:
- A boolean
- """
-
- if not isinstance(other, RDNSequence):
- return False
-
- if len(self) != len(other):
- return False
-
- for index, self_rdn in enumerate(self):
- if other[index] != self_rdn:
- return False
-
- return True
-
-
-class Name(Choice):
- _alternatives = [
- ('', RDNSequence),
- ]
-
- _human_friendly = None
- _sha1 = None
- _sha256 = None
-
- @classmethod
- def build(cls, name_dict, use_printable=False):
- """
- Creates a Name object from a dict of unicode string keys and values.
- The keys should be from NameType._map, or a dotted-integer OID unicode
- string.
-
- :param name_dict:
- A dict of name information, e.g. {"common_name": "Will Bond",
- "country_name": "US", "organization": "Codex Non Sufficit LC"}
-
- :param use_printable:
- A bool - if PrintableString should be used for encoding instead of
- UTF8String. This is for backwards compatibility with old software.
-
- :return:
- An x509.Name object
- """
-
- rdns = []
- if not use_printable:
- encoding_name = 'utf8_string'
- encoding_class = UTF8String
- else:
- encoding_name = 'printable_string'
- encoding_class = PrintableString
-
- # Sort the attributes according to NameType.preferred_order
- name_dict = OrderedDict(
- sorted(
- name_dict.items(),
- key=lambda item: NameType.preferred_ordinal(item[0])
- )
- )
-
- for attribute_name, attribute_value in name_dict.items():
- attribute_name = NameType.map(attribute_name)
- if attribute_name == 'email_address':
- value = EmailAddress(attribute_value)
- elif attribute_name == 'domain_component':
- value = DNSName(attribute_value)
- elif attribute_name in set(['dn_qualifier', 'country_name', 'serial_number']):
- value = DirectoryString(
- name='printable_string',
- value=PrintableString(attribute_value)
- )
- else:
- value = DirectoryString(
- name=encoding_name,
- value=encoding_class(attribute_value)
- )
-
- rdns.append(RelativeDistinguishedName([
- NameTypeAndValue({
- 'type': attribute_name,
- 'value': value
- })
- ]))
-
- return cls(name='', value=RDNSequence(rdns))
-
- @property
- def hashable(self):
- """
- :return:
- A unicode string that can be used as a dict key or in a set
- """
-
- return self.chosen.hashable
-
- def __len__(self):
- return len(self.chosen)
-
- def __ne__(self, other):
- return not self == other
-
- def __eq__(self, other):
- """
- Equality as defined by https://tools.ietf.org/html/rfc5280#section-7.1
-
- :param other:
- Another Name object
-
- :return:
- A boolean
- """
-
- if not isinstance(other, Name):
- return False
- return self.chosen == other.chosen
-
- @property
- def native(self):
- if self._native is None:
- self._native = OrderedDict()
- for rdn in self.chosen.native:
- for type_val in rdn:
- field_name = type_val['type']
- if field_name in self._native:
- existing = self._native[field_name]
- if not isinstance(existing, list):
- existing = self._native[field_name] = [existing]
- existing.append(type_val['value'])
- else:
- self._native[field_name] = type_val['value']
- return self._native
-
- @property
- def human_friendly(self):
- """
- :return:
- A human-friendly unicode string containing the parts of the name
- """
-
- if self._human_friendly is None:
- data = OrderedDict()
- last_field = None
- for rdn in self.chosen:
- for type_val in rdn:
- field_name = type_val['type'].human_friendly
- last_field = field_name
- if field_name in data:
- data[field_name] = [data[field_name]]
- data[field_name].append(type_val['value'])
- else:
- data[field_name] = type_val['value']
- to_join = []
- keys = data.keys()
- if last_field == 'Country':
- keys = reversed(list(keys))
- for key in keys:
- value = data[key]
- native_value = self._recursive_humanize(value)
- to_join.append('%s: %s' % (key, native_value))
-
- has_comma = False
- for element in to_join:
- if element.find(',') != -1:
- has_comma = True
- break
-
- separator = ', ' if not has_comma else '; '
- self._human_friendly = separator.join(to_join[::-1])
-
- return self._human_friendly
-
- def _recursive_humanize(self, value):
- """
- Recursively serializes data compiled from the RDNSequence
-
- :param value:
- An Asn1Value object, or a list of Asn1Value objects
-
- :return:
- A unicode string
- """
-
- if isinstance(value, list):
- return', '.join(
- reversed([self._recursive_humanize(sub_value) for sub_value in value])
- )
- return value.native
-
- @property
- def sha1(self):
- """
- :return:
- The SHA1 hash of the DER-encoded bytes of this name
- """
-
- if self._sha1 is None:
- self._sha1 = hashlib.sha1(self.dump()).digest()
- return self._sha1
-
- @property
- def sha256(self):
- """
- :return:
- The SHA-256 hash of the DER-encoded bytes of this name
- """
-
- if self._sha256 is None:
- self._sha256 = hashlib.sha256(self.dump()).digest()
- return self._sha256
-
-
-class AnotherName(Sequence):
- _fields = [
- ('type_id', ObjectIdentifier),
- ('value', Any, {'explicit': 0}),
- ]
-
-
-class CountryName(Choice):
- class_ = 1
- tag = 1
-
- _alternatives = [
- ('x121_dcc_code', NumericString),
- ('iso_3166_alpha2_code', PrintableString),
- ]
-
-
-class AdministrationDomainName(Choice):
- class_ = 1
- tag = 2
-
- _alternatives = [
- ('numeric', NumericString),
- ('printable', PrintableString),
- ]
-
-
-class PrivateDomainName(Choice):
- _alternatives = [
- ('numeric', NumericString),
- ('printable', PrintableString),
- ]
-
-
-class PersonalName(Set):
- _fields = [
- ('surname', PrintableString, {'implicit': 0}),
- ('given_name', PrintableString, {'implicit': 1, 'optional': True}),
- ('initials', PrintableString, {'implicit': 2, 'optional': True}),
- ('generation_qualifier', PrintableString, {'implicit': 3, 'optional': True}),
- ]
-
-
-class TeletexPersonalName(Set):
- _fields = [
- ('surname', TeletexString, {'implicit': 0}),
- ('given_name', TeletexString, {'implicit': 1, 'optional': True}),
- ('initials', TeletexString, {'implicit': 2, 'optional': True}),
- ('generation_qualifier', TeletexString, {'implicit': 3, 'optional': True}),
- ]
-
-
-class OrganizationalUnitNames(SequenceOf):
- _child_spec = PrintableString
-
-
-class TeletexOrganizationalUnitNames(SequenceOf):
- _child_spec = TeletexString
-
-
-class BuiltInStandardAttributes(Sequence):
- _fields = [
- ('country_name', CountryName, {'optional': True}),
- ('administration_domain_name', AdministrationDomainName, {'optional': True}),
- ('network_address', NumericString, {'implicit': 0, 'optional': True}),
- ('terminal_identifier', PrintableString, {'implicit': 1, 'optional': True}),
- ('private_domain_name', PrivateDomainName, {'explicit': 2, 'optional': True}),
- ('organization_name', PrintableString, {'implicit': 3, 'optional': True}),
- ('numeric_user_identifier', NumericString, {'implicit': 4, 'optional': True}),
- ('personal_name', PersonalName, {'implicit': 5, 'optional': True}),
- ('organizational_unit_names', OrganizationalUnitNames, {'implicit': 6, 'optional': True}),
- ]
-
-
-class BuiltInDomainDefinedAttribute(Sequence):
- _fields = [
- ('type', PrintableString),
- ('value', PrintableString),
- ]
-
-
-class BuiltInDomainDefinedAttributes(SequenceOf):
- _child_spec = BuiltInDomainDefinedAttribute
-
-
-class TeletexDomainDefinedAttribute(Sequence):
- _fields = [
- ('type', TeletexString),
- ('value', TeletexString),
- ]
-
-
-class TeletexDomainDefinedAttributes(SequenceOf):
- _child_spec = TeletexDomainDefinedAttribute
-
-
-class PhysicalDeliveryCountryName(Choice):
- _alternatives = [
- ('x121_dcc_code', NumericString),
- ('iso_3166_alpha2_code', PrintableString),
- ]
-
-
-class PostalCode(Choice):
- _alternatives = [
- ('numeric_code', NumericString),
- ('printable_code', PrintableString),
- ]
-
-
-class PDSParameter(Set):
- _fields = [
- ('printable_string', PrintableString, {'optional': True}),
- ('teletex_string', TeletexString, {'optional': True}),
- ]
-
-
-class PrintableAddress(SequenceOf):
- _child_spec = PrintableString
-
-
-class UnformattedPostalAddress(Set):
- _fields = [
- ('printable_address', PrintableAddress, {'optional': True}),
- ('teletex_string', TeletexString, {'optional': True}),
- ]
-
-
-class E1634Address(Sequence):
- _fields = [
- ('number', NumericString, {'implicit': 0}),
- ('sub_address', NumericString, {'implicit': 1, 'optional': True}),
- ]
-
-
-class NAddresses(SetOf):
- _child_spec = OctetString
-
-
-class PresentationAddress(Sequence):
- _fields = [
- ('p_selector', OctetString, {'explicit': 0, 'optional': True}),
- ('s_selector', OctetString, {'explicit': 1, 'optional': True}),
- ('t_selector', OctetString, {'explicit': 2, 'optional': True}),
- ('n_addresses', NAddresses, {'explicit': 3}),
- ]
-
-
-class ExtendedNetworkAddress(Choice):
- _alternatives = [
- ('e163_4_address', E1634Address),
- ('psap_address', PresentationAddress, {'implicit': 0})
- ]
-
-
-class TerminalType(Integer):
- _map = {
- 3: 'telex',
- 4: 'teletex',
- 5: 'g3_facsimile',
- 6: 'g4_facsimile',
- 7: 'ia5_terminal',
- 8: 'videotex',
- }
-
-
-class ExtensionAttributeType(Integer):
- _map = {
- 1: 'common_name',
- 2: 'teletex_common_name',
- 3: 'teletex_organization_name',
- 4: 'teletex_personal_name',
- 5: 'teletex_organization_unit_names',
- 6: 'teletex_domain_defined_attributes',
- 7: 'pds_name',
- 8: 'physical_delivery_country_name',
- 9: 'postal_code',
- 10: 'physical_delivery_office_name',
- 11: 'physical_delivery_office_number',
- 12: 'extension_of_address_components',
- 13: 'physical_delivery_personal_name',
- 14: 'physical_delivery_organization_name',
- 15: 'extension_physical_delivery_address_components',
- 16: 'unformatted_postal_address',
- 17: 'street_address',
- 18: 'post_office_box_address',
- 19: 'poste_restante_address',
- 20: 'unique_postal_name',
- 21: 'local_postal_attributes',
- 22: 'extended_network_address',
- 23: 'terminal_type',
- }
-
-
-class ExtensionAttribute(Sequence):
- _fields = [
- ('extension_attribute_type', ExtensionAttributeType, {'implicit': 0}),
- ('extension_attribute_value', Any, {'explicit': 1}),
- ]
-
- _oid_pair = ('extension_attribute_type', 'extension_attribute_value')
- _oid_specs = {
- 'common_name': PrintableString,
- 'teletex_common_name': TeletexString,
- 'teletex_organization_name': TeletexString,
- 'teletex_personal_name': TeletexPersonalName,
- 'teletex_organization_unit_names': TeletexOrganizationalUnitNames,
- 'teletex_domain_defined_attributes': TeletexDomainDefinedAttributes,
- 'pds_name': PrintableString,
- 'physical_delivery_country_name': PhysicalDeliveryCountryName,
- 'postal_code': PostalCode,
- 'physical_delivery_office_name': PDSParameter,
- 'physical_delivery_office_number': PDSParameter,
- 'extension_of_address_components': PDSParameter,
- 'physical_delivery_personal_name': PDSParameter,
- 'physical_delivery_organization_name': PDSParameter,
- 'extension_physical_delivery_address_components': PDSParameter,
- 'unformatted_postal_address': UnformattedPostalAddress,
- 'street_address': PDSParameter,
- 'post_office_box_address': PDSParameter,
- 'poste_restante_address': PDSParameter,
- 'unique_postal_name': PDSParameter,
- 'local_postal_attributes': PDSParameter,
- 'extended_network_address': ExtendedNetworkAddress,
- 'terminal_type': TerminalType,
- }
-
-
-class ExtensionAttributes(SequenceOf):
- _child_spec = ExtensionAttribute
-
-
-class ORAddress(Sequence):
- _fields = [
- ('built_in_standard_attributes', BuiltInStandardAttributes),
- ('built_in_domain_defined_attributes', BuiltInDomainDefinedAttributes, {'optional': True}),
- ('extension_attributes', ExtensionAttributes, {'optional': True}),
- ]
-
-
-class EDIPartyName(Sequence):
- _fields = [
- ('name_assigner', DirectoryString, {'implicit': 0, 'optional': True}),
- ('party_name', DirectoryString, {'implicit': 1}),
- ]
-
-
-class GeneralName(Choice):
- _alternatives = [
- ('other_name', AnotherName, {'implicit': 0}),
- ('rfc822_name', EmailAddress, {'implicit': 1}),
- ('dns_name', DNSName, {'implicit': 2}),
- ('x400_address', ORAddress, {'implicit': 3}),
- ('directory_name', Name, {'explicit': 4}),
- ('edi_party_name', EDIPartyName, {'implicit': 5}),
- ('uniform_resource_identifier', URI, {'implicit': 6}),
- ('ip_address', IPAddress, {'implicit': 7}),
- ('registered_id', ObjectIdentifier, {'implicit': 8}),
- ]
-
- def __ne__(self, other):
- return not self == other
-
- def __eq__(self, other):
- """
- Does not support other_name, x400_address or edi_party_name
-
- :param other:
- The other GeneralName to compare to
-
- :return:
- A boolean
- """
-
- if self.name in ('other_name', 'x400_address', 'edi_party_name'):
- raise ValueError(unwrap(
- '''
- Comparison is not supported for GeneralName objects of
- choice %s
- ''',
- self.name
- ))
-
- if other.name in ('other_name', 'x400_address', 'edi_party_name'):
- raise ValueError(unwrap(
- '''
- Comparison is not supported for GeneralName objects of choice
- %s''',
- other.name
- ))
-
- if self.name != other.name:
- return False
-
- return self.chosen == other.chosen
-
-
-class GeneralNames(SequenceOf):
- _child_spec = GeneralName
-
-
-class Time(Choice):
- _alternatives = [
- ('utc_time', UTCTime),
- ('general_time', GeneralizedTime),
- ]
-
-
-class Validity(Sequence):
- _fields = [
- ('not_before', Time),
- ('not_after', Time),
- ]
-
-
-class BasicConstraints(Sequence):
- _fields = [
- ('ca', Boolean, {'default': False}),
- ('path_len_constraint', Integer, {'optional': True}),
- ]
-
-
-class AuthorityKeyIdentifier(Sequence):
- _fields = [
- ('key_identifier', OctetString, {'implicit': 0, 'optional': True}),
- ('authority_cert_issuer', GeneralNames, {'implicit': 1, 'optional': True}),
- ('authority_cert_serial_number', Integer, {'implicit': 2, 'optional': True}),
- ]
-
-
-class DistributionPointName(Choice):
- _alternatives = [
- ('full_name', GeneralNames, {'implicit': 0}),
- ('name_relative_to_crl_issuer', RelativeDistinguishedName, {'implicit': 1}),
- ]
-
-
-class ReasonFlags(BitString):
- _map = {
- 0: 'unused',
- 1: 'key_compromise',
- 2: 'ca_compromise',
- 3: 'affiliation_changed',
- 4: 'superseded',
- 5: 'cessation_of_operation',
- 6: 'certificate_hold',
- 7: 'privilege_withdrawn',
- 8: 'aa_compromise',
- }
-
-
-class GeneralSubtree(Sequence):
- _fields = [
- ('base', GeneralName),
- ('minimum', Integer, {'implicit': 0, 'default': 0}),
- ('maximum', Integer, {'implicit': 1, 'optional': True}),
- ]
-
-
-class GeneralSubtrees(SequenceOf):
- _child_spec = GeneralSubtree
-
-
-class NameConstraints(Sequence):
- _fields = [
- ('permitted_subtrees', GeneralSubtrees, {'implicit': 0, 'optional': True}),
- ('excluded_subtrees', GeneralSubtrees, {'implicit': 1, 'optional': True}),
- ]
-
-
-class DistributionPoint(Sequence):
- _fields = [
- ('distribution_point', DistributionPointName, {'explicit': 0, 'optional': True}),
- ('reasons', ReasonFlags, {'implicit': 1, 'optional': True}),
- ('crl_issuer', GeneralNames, {'implicit': 2, 'optional': True}),
- ]
-
- _url = False
-
- @property
- def url(self):
- """
- :return:
- None or a unicode string of the distribution point's URL
- """
-
- if self._url is False:
- self._url = None
- name = self['distribution_point']
- if name.name != 'full_name':
- raise ValueError(unwrap(
- '''
- CRL distribution points that are relative to the issuer are
- not supported
- '''
- ))
-
- for general_name in name.chosen:
- if general_name.name == 'uniform_resource_identifier':
- url = general_name.native
- if url.lower().startswith(('http://', 'https://', 'ldap://', 'ldaps://')):
- self._url = url
- break
-
- return self._url
-
-
-class CRLDistributionPoints(SequenceOf):
- _child_spec = DistributionPoint
-
-
-class DisplayText(Choice):
- _alternatives = [
- ('ia5_string', IA5String),
- ('visible_string', VisibleString),
- ('bmp_string', BMPString),
- ('utf8_string', UTF8String),
- ]
-
-
-class NoticeNumbers(SequenceOf):
- _child_spec = Integer
-
-
-class NoticeReference(Sequence):
- _fields = [
- ('organization', DisplayText),
- ('notice_numbers', NoticeNumbers),
- ]
-
-
-class UserNotice(Sequence):
- _fields = [
- ('notice_ref', NoticeReference, {'optional': True}),
- ('explicit_text', DisplayText, {'optional': True}),
- ]
-
-
-class PolicyQualifierId(ObjectIdentifier):
- _map = {
- '1.3.6.1.5.5.7.2.1': 'certification_practice_statement',
- '1.3.6.1.5.5.7.2.2': 'user_notice',
- }
-
-
-class PolicyQualifierInfo(Sequence):
- _fields = [
- ('policy_qualifier_id', PolicyQualifierId),
- ('qualifier', Any),
- ]
-
- _oid_pair = ('policy_qualifier_id', 'qualifier')
- _oid_specs = {
- 'certification_practice_statement': IA5String,
- 'user_notice': UserNotice,
- }
-
-
-class PolicyQualifierInfos(SequenceOf):
- _child_spec = PolicyQualifierInfo
-
-
-class PolicyIdentifier(ObjectIdentifier):
- _map = {
- '2.5.29.32.0': 'any_policy',
- }
-
-
-class PolicyInformation(Sequence):
- _fields = [
- ('policy_identifier', PolicyIdentifier),
- ('policy_qualifiers', PolicyQualifierInfos, {'optional': True})
- ]
-
-
-class CertificatePolicies(SequenceOf):
- _child_spec = PolicyInformation
-
-
-class PolicyMapping(Sequence):
- _fields = [
- ('issuer_domain_policy', PolicyIdentifier),
- ('subject_domain_policy', PolicyIdentifier),
- ]
-
-
-class PolicyMappings(SequenceOf):
- _child_spec = PolicyMapping
-
-
-class PolicyConstraints(Sequence):
- _fields = [
- ('require_explicit_policy', Integer, {'implicit': 0, 'optional': True}),
- ('inhibit_policy_mapping', Integer, {'implicit': 1, 'optional': True}),
- ]
-
-
-class KeyPurposeId(ObjectIdentifier):
- _map = {
- # https://tools.ietf.org/html/rfc5280#page-45
- '2.5.29.37.0': 'any_extended_key_usage',
- '1.3.6.1.5.5.7.3.1': 'server_auth',
- '1.3.6.1.5.5.7.3.2': 'client_auth',
- '1.3.6.1.5.5.7.3.3': 'code_signing',
- '1.3.6.1.5.5.7.3.4': 'email_protection',
- '1.3.6.1.5.5.7.3.5': 'ipsec_end_system',
- '1.3.6.1.5.5.7.3.6': 'ipsec_tunnel',
- '1.3.6.1.5.5.7.3.7': 'ipsec_user',
- '1.3.6.1.5.5.7.3.8': 'time_stamping',
- '1.3.6.1.5.5.7.3.9': 'ocsp_signing',
- # http://tools.ietf.org/html/rfc3029.html#page-9
- '1.3.6.1.5.5.7.3.10': 'dvcs',
- # http://tools.ietf.org/html/rfc6268.html#page-16
- '1.3.6.1.5.5.7.3.13': 'eap_over_ppp',
- '1.3.6.1.5.5.7.3.14': 'eap_over_lan',
- # https://tools.ietf.org/html/rfc5055#page-76
- '1.3.6.1.5.5.7.3.15': 'scvp_server',
- '1.3.6.1.5.5.7.3.16': 'scvp_client',
- # https://tools.ietf.org/html/rfc4945#page-31
- '1.3.6.1.5.5.7.3.17': 'ipsec_ike',
- # https://tools.ietf.org/html/rfc5415#page-38
- '1.3.6.1.5.5.7.3.18': 'capwap_ac',
- '1.3.6.1.5.5.7.3.19': 'capwap_wtp',
- # https://tools.ietf.org/html/rfc5924#page-8
- '1.3.6.1.5.5.7.3.20': 'sip_domain',
- # https://tools.ietf.org/html/rfc6187#page-7
- '1.3.6.1.5.5.7.3.21': 'secure_shell_client',
- '1.3.6.1.5.5.7.3.22': 'secure_shell_server',
- # https://tools.ietf.org/html/rfc6494#page-7
- '1.3.6.1.5.5.7.3.23': 'send_router',
- '1.3.6.1.5.5.7.3.24': 'send_proxied_router',
- '1.3.6.1.5.5.7.3.25': 'send_owner',
- '1.3.6.1.5.5.7.3.26': 'send_proxied_owner',
- # https://tools.ietf.org/html/rfc6402#page-10
- '1.3.6.1.5.5.7.3.27': 'cmc_ca',
- '1.3.6.1.5.5.7.3.28': 'cmc_ra',
- '1.3.6.1.5.5.7.3.29': 'cmc_archive',
- # https://tools.ietf.org/html/draft-ietf-sidr-bgpsec-pki-profiles-15#page-6
- '1.3.6.1.5.5.7.3.30': 'bgpspec_router',
- # https://msdn.microsoft.com/en-us/library/windows/desktop/aa378132(v=vs.85).aspx
- # and https://support.microsoft.com/en-us/kb/287547
- '1.3.6.1.4.1.311.10.3.1': 'microsoft_trust_list_signing',
- '1.3.6.1.4.1.311.10.3.2': 'microsoft_time_stamp_signing',
- '1.3.6.1.4.1.311.10.3.3': 'microsoft_server_gated',
- '1.3.6.1.4.1.311.10.3.3.1': 'microsoft_serialized',
- '1.3.6.1.4.1.311.10.3.4': 'microsoft_efs',
- '1.3.6.1.4.1.311.10.3.4.1': 'microsoft_efs_recovery',
- '1.3.6.1.4.1.311.10.3.5': 'microsoft_whql',
- '1.3.6.1.4.1.311.10.3.6': 'microsoft_nt5',
- '1.3.6.1.4.1.311.10.3.7': 'microsoft_oem_whql',
- '1.3.6.1.4.1.311.10.3.8': 'microsoft_embedded_nt',
- '1.3.6.1.4.1.311.10.3.9': 'microsoft_root_list_signer',
- '1.3.6.1.4.1.311.10.3.10': 'microsoft_qualified_subordination',
- '1.3.6.1.4.1.311.10.3.11': 'microsoft_key_recovery',
- '1.3.6.1.4.1.311.10.3.12': 'microsoft_document_signing',
- '1.3.6.1.4.1.311.10.3.13': 'microsoft_lifetime_signing',
- '1.3.6.1.4.1.311.10.3.14': 'microsoft_mobile_device_software',
- # https://support.microsoft.com/en-us/help/287547/object-ids-associated-with-microsoft-cryptography
- '1.3.6.1.4.1.311.20.2.2': 'microsoft_smart_card_logon',
- # https://opensource.apple.com/source
- # - /Security/Security-57031.40.6/Security/libsecurity_keychain/lib/SecPolicy.cpp
- # - /libsecurity_cssm/libsecurity_cssm-36064/lib/oidsalg.c
- '1.2.840.113635.100.1.2': 'apple_x509_basic',
- '1.2.840.113635.100.1.3': 'apple_ssl',
- '1.2.840.113635.100.1.4': 'apple_local_cert_gen',
- '1.2.840.113635.100.1.5': 'apple_csr_gen',
- '1.2.840.113635.100.1.6': 'apple_revocation_crl',
- '1.2.840.113635.100.1.7': 'apple_revocation_ocsp',
- '1.2.840.113635.100.1.8': 'apple_smime',
- '1.2.840.113635.100.1.9': 'apple_eap',
- '1.2.840.113635.100.1.10': 'apple_software_update_signing',
- '1.2.840.113635.100.1.11': 'apple_ipsec',
- '1.2.840.113635.100.1.12': 'apple_ichat',
- '1.2.840.113635.100.1.13': 'apple_resource_signing',
- '1.2.840.113635.100.1.14': 'apple_pkinit_client',
- '1.2.840.113635.100.1.15': 'apple_pkinit_server',
- '1.2.840.113635.100.1.16': 'apple_code_signing',
- '1.2.840.113635.100.1.17': 'apple_package_signing',
- '1.2.840.113635.100.1.18': 'apple_id_validation',
- '1.2.840.113635.100.1.20': 'apple_time_stamping',
- '1.2.840.113635.100.1.21': 'apple_revocation',
- '1.2.840.113635.100.1.22': 'apple_passbook_signing',
- '1.2.840.113635.100.1.23': 'apple_mobile_store',
- '1.2.840.113635.100.1.24': 'apple_escrow_service',
- '1.2.840.113635.100.1.25': 'apple_profile_signer',
- '1.2.840.113635.100.1.26': 'apple_qa_profile_signer',
- '1.2.840.113635.100.1.27': 'apple_test_mobile_store',
- '1.2.840.113635.100.1.28': 'apple_otapki_signer',
- '1.2.840.113635.100.1.29': 'apple_test_otapki_signer',
- '1.2.840.113625.100.1.30': 'apple_id_validation_record_signing_policy',
- '1.2.840.113625.100.1.31': 'apple_smp_encryption',
- '1.2.840.113625.100.1.32': 'apple_test_smp_encryption',
- '1.2.840.113635.100.1.33': 'apple_server_authentication',
- '1.2.840.113635.100.1.34': 'apple_pcs_escrow_service',
- # http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.201-2.pdf
- '2.16.840.1.101.3.6.8': 'piv_card_authentication',
- '2.16.840.1.101.3.6.7': 'piv_content_signing',
- # https://tools.ietf.org/html/rfc4556.html
- '1.3.6.1.5.2.3.4': 'pkinit_kpclientauth',
- '1.3.6.1.5.2.3.5': 'pkinit_kpkdc',
- # https://www.adobe.com/devnet-docs/acrobatetk/tools/DigSig/changes.html
- '1.2.840.113583.1.1.5': 'adobe_authentic_documents_trust',
- # https://www.idmanagement.gov/wp-content/uploads/sites/1171/uploads/fpki-pivi-cert-profiles.pdf
- '2.16.840.1.101.3.8.7': 'fpki_pivi_content_signing'
- }
-
-
-class ExtKeyUsageSyntax(SequenceOf):
- _child_spec = KeyPurposeId
-
-
-class AccessMethod(ObjectIdentifier):
- _map = {
- '1.3.6.1.5.5.7.48.1': 'ocsp',
- '1.3.6.1.5.5.7.48.2': 'ca_issuers',
- '1.3.6.1.5.5.7.48.3': 'time_stamping',
- '1.3.6.1.5.5.7.48.5': 'ca_repository',
- }
-
-
-class AccessDescription(Sequence):
- _fields = [
- ('access_method', AccessMethod),
- ('access_location', GeneralName),
- ]
-
-
-class AuthorityInfoAccessSyntax(SequenceOf):
- _child_spec = AccessDescription
-
-
-class SubjectInfoAccessSyntax(SequenceOf):
- _child_spec = AccessDescription
-
-
-# https://tools.ietf.org/html/rfc7633
-class Features(SequenceOf):
- _child_spec = Integer
-
-
-class EntrustVersionInfo(Sequence):
- _fields = [
- ('entrust_vers', GeneralString),
- ('entrust_info_flags', BitString)
- ]
-
-
-class NetscapeCertificateType(BitString):
- _map = {
- 0: 'ssl_client',
- 1: 'ssl_server',
- 2: 'email',
- 3: 'object_signing',
- 4: 'reserved',
- 5: 'ssl_ca',
- 6: 'email_ca',
- 7: 'object_signing_ca',
- }
-
-
-class Version(Integer):
- _map = {
- 0: 'v1',
- 1: 'v2',
- 2: 'v3',
- }
-
-
-class TPMSpecification(Sequence):
- _fields = [
- ('family', UTF8String),
- ('level', Integer),
- ('revision', Integer),
- ]
-
-
-class SetOfTPMSpecification(SetOf):
- _child_spec = TPMSpecification
-
-
-class TCGSpecificationVersion(Sequence):
- _fields = [
- ('major_version', Integer),
- ('minor_version', Integer),
- ('revision', Integer),
- ]
-
-
-class TCGPlatformSpecification(Sequence):
- _fields = [
- ('version', TCGSpecificationVersion),
- ('platform_class', OctetString),
- ]
-
-
-class SetOfTCGPlatformSpecification(SetOf):
- _child_spec = TCGPlatformSpecification
-
-
-class EKGenerationType(Enumerated):
- _map = {
- 0: 'internal',
- 1: 'injected',
- 2: 'internal_revocable',
- 3: 'injected_revocable',
- }
-
-
-class EKGenerationLocation(Enumerated):
- _map = {
- 0: 'tpm_manufacturer',
- 1: 'platform_manufacturer',
- 2: 'ek_cert_signer',
- }
-
-
-class EKCertificateGenerationLocation(Enumerated):
- _map = {
- 0: 'tpm_manufacturer',
- 1: 'platform_manufacturer',
- 2: 'ek_cert_signer',
- }
-
-
-class EvaluationAssuranceLevel(Enumerated):
- _map = {
- 1: 'level1',
- 2: 'level2',
- 3: 'level3',
- 4: 'level4',
- 5: 'level5',
- 6: 'level6',
- 7: 'level7',
- }
-
-
-class EvaluationStatus(Enumerated):
- _map = {
- 0: 'designed_to_meet',
- 1: 'evaluation_in_progress',
- 2: 'evaluation_completed',
- }
-
-
-class StrengthOfFunction(Enumerated):
- _map = {
- 0: 'basic',
- 1: 'medium',
- 2: 'high',
- }
-
-
-class URIReference(Sequence):
- _fields = [
- ('uniform_resource_identifier', IA5String),
- ('hash_algorithm', DigestAlgorithm, {'optional': True}),
- ('hash_value', BitString, {'optional': True}),
- ]
-
-
-class CommonCriteriaMeasures(Sequence):
- _fields = [
- ('version', IA5String),
- ('assurance_level', EvaluationAssuranceLevel),
- ('evaluation_status', EvaluationStatus),
- ('plus', Boolean, {'default': False}),
- ('strengh_of_function', StrengthOfFunction, {'implicit': 0, 'optional': True}),
- ('profile_oid', ObjectIdentifier, {'implicit': 1, 'optional': True}),
- ('profile_url', URIReference, {'implicit': 2, 'optional': True}),
- ('target_oid', ObjectIdentifier, {'implicit': 3, 'optional': True}),
- ('target_uri', URIReference, {'implicit': 4, 'optional': True}),
- ]
-
-
-class SecurityLevel(Enumerated):
- _map = {
- 1: 'level1',
- 2: 'level2',
- 3: 'level3',
- 4: 'level4',
- }
-
-
-class FIPSLevel(Sequence):
- _fields = [
- ('version', IA5String),
- ('level', SecurityLevel),
- ('plus', Boolean, {'default': False}),
- ]
-
-
-class TPMSecurityAssertions(Sequence):
- _fields = [
- ('version', Version, {'default': 'v1'}),
- ('field_upgradable', Boolean, {'default': False}),
- ('ek_generation_type', EKGenerationType, {'implicit': 0, 'optional': True}),
- ('ek_generation_location', EKGenerationLocation, {'implicit': 1, 'optional': True}),
- ('ek_certificate_generation_location', EKCertificateGenerationLocation, {'implicit': 2, 'optional': True}),
- ('cc_info', CommonCriteriaMeasures, {'implicit': 3, 'optional': True}),
- ('fips_level', FIPSLevel, {'implicit': 4, 'optional': True}),
- ('iso_9000_certified', Boolean, {'implicit': 5, 'default': False}),
- ('iso_9000_uri', IA5String, {'optional': True}),
- ]
-
-
-class SetOfTPMSecurityAssertions(SetOf):
- _child_spec = TPMSecurityAssertions
-
-
-class SubjectDirectoryAttributeId(ObjectIdentifier):
- _map = {
- # https://tools.ietf.org/html/rfc2256#page-11
- '2.5.4.52': 'supported_algorithms',
- # https://www.trustedcomputinggroup.org/wp-content/uploads/Credential_Profile_EK_V2.0_R14_published.pdf
- '2.23.133.2.16': 'tpm_specification',
- '2.23.133.2.17': 'tcg_platform_specification',
- '2.23.133.2.18': 'tpm_security_assertions',
- # https://tools.ietf.org/html/rfc3739#page-18
- '1.3.6.1.5.5.7.9.1': 'pda_date_of_birth',
- '1.3.6.1.5.5.7.9.2': 'pda_place_of_birth',
- '1.3.6.1.5.5.7.9.3': 'pda_gender',
- '1.3.6.1.5.5.7.9.4': 'pda_country_of_citizenship',
- '1.3.6.1.5.5.7.9.5': 'pda_country_of_residence',
- # https://holtstrom.com/michael/tools/asn1decoder.php
- '1.2.840.113533.7.68.29': 'entrust_user_role',
- }
-
-
-class SetOfGeneralizedTime(SetOf):
- _child_spec = GeneralizedTime
-
-
-class SetOfDirectoryString(SetOf):
- _child_spec = DirectoryString
-
-
-class SetOfPrintableString(SetOf):
- _child_spec = PrintableString
-
-
-class SupportedAlgorithm(Sequence):
- _fields = [
- ('algorithm_identifier', AnyAlgorithmIdentifier),
- ('intended_usage', KeyUsage, {'explicit': 0, 'optional': True}),
- ('intended_certificate_policies', CertificatePolicies, {'explicit': 1, 'optional': True}),
- ]
-
-
-class SetOfSupportedAlgorithm(SetOf):
- _child_spec = SupportedAlgorithm
-
-
-class SubjectDirectoryAttribute(Sequence):
- _fields = [
- ('type', SubjectDirectoryAttributeId),
- ('values', Any),
- ]
-
- _oid_pair = ('type', 'values')
- _oid_specs = {
- 'supported_algorithms': SetOfSupportedAlgorithm,
- 'tpm_specification': SetOfTPMSpecification,
- 'tcg_platform_specification': SetOfTCGPlatformSpecification,
- 'tpm_security_assertions': SetOfTPMSecurityAssertions,
- 'pda_date_of_birth': SetOfGeneralizedTime,
- 'pda_place_of_birth': SetOfDirectoryString,
- 'pda_gender': SetOfPrintableString,
- 'pda_country_of_citizenship': SetOfPrintableString,
- 'pda_country_of_residence': SetOfPrintableString,
- }
-
- def _values_spec(self):
- type_ = self['type'].native
- if type_ in self._oid_specs:
- return self._oid_specs[type_]
- return SetOf
-
- _spec_callbacks = {
- 'values': _values_spec
- }
-
-
-class SubjectDirectoryAttributes(SequenceOf):
- _child_spec = SubjectDirectoryAttribute
-
-
-class ExtensionId(ObjectIdentifier):
- _map = {
- '2.5.29.9': 'subject_directory_attributes',
- '2.5.29.14': 'key_identifier',
- '2.5.29.15': 'key_usage',
- '2.5.29.16': 'private_key_usage_period',
- '2.5.29.17': 'subject_alt_name',
- '2.5.29.18': 'issuer_alt_name',
- '2.5.29.19': 'basic_constraints',
- '2.5.29.30': 'name_constraints',
- '2.5.29.31': 'crl_distribution_points',
- '2.5.29.32': 'certificate_policies',
- '2.5.29.33': 'policy_mappings',
- '2.5.29.35': 'authority_key_identifier',
- '2.5.29.36': 'policy_constraints',
- '2.5.29.37': 'extended_key_usage',
- '2.5.29.46': 'freshest_crl',
- '2.5.29.54': 'inhibit_any_policy',
- '1.3.6.1.5.5.7.1.1': 'authority_information_access',
- '1.3.6.1.5.5.7.1.11': 'subject_information_access',
- # https://tools.ietf.org/html/rfc7633
- '1.3.6.1.5.5.7.1.24': 'tls_feature',
- '1.3.6.1.5.5.7.48.1.5': 'ocsp_no_check',
- '1.2.840.113533.7.65.0': 'entrust_version_extension',
- '2.16.840.1.113730.1.1': 'netscape_certificate_type',
- # https://tools.ietf.org/html/rfc6962.html#page-14
- '1.3.6.1.4.1.11129.2.4.2': 'signed_certificate_timestamp_list',
- }
-
-
-class Extension(Sequence):
- _fields = [
- ('extn_id', ExtensionId),
- ('critical', Boolean, {'default': False}),
- ('extn_value', ParsableOctetString),
- ]
-
- _oid_pair = ('extn_id', 'extn_value')
- _oid_specs = {
- 'subject_directory_attributes': SubjectDirectoryAttributes,
- 'key_identifier': OctetString,
- 'key_usage': KeyUsage,
- 'private_key_usage_period': PrivateKeyUsagePeriod,
- 'subject_alt_name': GeneralNames,
- 'issuer_alt_name': GeneralNames,
- 'basic_constraints': BasicConstraints,
- 'name_constraints': NameConstraints,
- 'crl_distribution_points': CRLDistributionPoints,
- 'certificate_policies': CertificatePolicies,
- 'policy_mappings': PolicyMappings,
- 'authority_key_identifier': AuthorityKeyIdentifier,
- 'policy_constraints': PolicyConstraints,
- 'extended_key_usage': ExtKeyUsageSyntax,
- 'freshest_crl': CRLDistributionPoints,
- 'inhibit_any_policy': Integer,
- 'authority_information_access': AuthorityInfoAccessSyntax,
- 'subject_information_access': SubjectInfoAccessSyntax,
- 'tls_feature': Features,
- 'ocsp_no_check': Null,
- 'entrust_version_extension': EntrustVersionInfo,
- 'netscape_certificate_type': NetscapeCertificateType,
- 'signed_certificate_timestamp_list': OctetString,
- }
-
-
-class Extensions(SequenceOf):
- _child_spec = Extension
-
-
-class TbsCertificate(Sequence):
- _fields = [
- ('version', Version, {'explicit': 0, 'default': 'v1'}),
- ('serial_number', Integer),
- ('signature', SignedDigestAlgorithm),
- ('issuer', Name),
- ('validity', Validity),
- ('subject', Name),
- ('subject_public_key_info', PublicKeyInfo),
- ('issuer_unique_id', OctetBitString, {'implicit': 1, 'optional': True}),
- ('subject_unique_id', OctetBitString, {'implicit': 2, 'optional': True}),
- ('extensions', Extensions, {'explicit': 3, 'optional': True}),
- ]
-
-
-class Certificate(Sequence):
- _fields = [
- ('tbs_certificate', TbsCertificate),
- ('signature_algorithm', SignedDigestAlgorithm),
- ('signature_value', OctetBitString),
- ]
-
- _processed_extensions = False
- _critical_extensions = None
- _subject_directory_attributes = None
- _key_identifier_value = None
- _key_usage_value = None
- _subject_alt_name_value = None
- _issuer_alt_name_value = None
- _basic_constraints_value = None
- _name_constraints_value = None
- _crl_distribution_points_value = None
- _certificate_policies_value = None
- _policy_mappings_value = None
- _authority_key_identifier_value = None
- _policy_constraints_value = None
- _freshest_crl_value = None
- _inhibit_any_policy_value = None
- _extended_key_usage_value = None
- _authority_information_access_value = None
- _subject_information_access_value = None
- _private_key_usage_period_value = None
- _tls_feature_value = None
- _ocsp_no_check_value = None
- _issuer_serial = None
- _authority_issuer_serial = False
- _crl_distribution_points = None
- _delta_crl_distribution_points = None
- _valid_domains = None
- _valid_ips = None
- _self_issued = None
- _self_signed = None
- _sha1 = None
- _sha256 = None
-
- def _set_extensions(self):
- """
- Sets common named extensions to private attributes and creates a list
- of critical extensions
- """
-
- self._critical_extensions = set()
-
- for extension in self['tbs_certificate']['extensions']:
- name = extension['extn_id'].native
- attribute_name = '_%s_value' % name
- if hasattr(self, attribute_name):
- setattr(self, attribute_name, extension['extn_value'].parsed)
- if extension['critical'].native:
- self._critical_extensions.add(name)
-
- self._processed_extensions = True
-
- @property
- def critical_extensions(self):
- """
- Returns a set of the names (or OID if not a known extension) of the
- extensions marked as critical
-
- :return:
- A set of unicode strings
- """
-
- if not self._processed_extensions:
- self._set_extensions()
- return self._critical_extensions
-
- @property
- def private_key_usage_period_value(self):
- """
- This extension is used to constrain the period over which the subject
- private key may be used
-
- :return:
- None or a PrivateKeyUsagePeriod object
- """
-
- if not self._processed_extensions:
- self._set_extensions()
- return self._private_key_usage_period_value
-
- @property
- def subject_directory_attributes_value(self):
- """
- This extension is used to contain additional identification attributes
- about the subject.
-
- :return:
- None or a SubjectDirectoryAttributes object
- """
-
- if not self._processed_extensions:
- self._set_extensions()
- return self._subject_directory_attributes
-
- @property
- def key_identifier_value(self):
- """
- This extension is used to help in creating certificate validation paths.
- It contains an identifier that should generally, but is not guaranteed
- to, be unique.
-
- :return:
- None or an OctetString object
- """
-
- if not self._processed_extensions:
- self._set_extensions()
- return self._key_identifier_value
-
- @property
- def key_usage_value(self):
- """
- This extension is used to define the purpose of the public key
- contained within the certificate.
-
- :return:
- None or a KeyUsage
- """
-
- if not self._processed_extensions:
- self._set_extensions()
- return self._key_usage_value
-
- @property
- def subject_alt_name_value(self):
- """
- This extension allows for additional names to be associate with the
- subject of the certificate. While it may contain a whole host of
- possible names, it is usually used to allow certificates to be used
- with multiple different domain names.
-
- :return:
- None or a GeneralNames object
- """
-
- if not self._processed_extensions:
- self._set_extensions()
- return self._subject_alt_name_value
-
- @property
- def issuer_alt_name_value(self):
- """
- This extension allows associating one or more alternative names with
- the issuer of the certificate.
-
- :return:
- None or an x509.GeneralNames object
- """
-
- if not self._processed_extensions:
- self._set_extensions()
- return self._issuer_alt_name_value
-
- @property
- def basic_constraints_value(self):
- """
- This extension is used to determine if the subject of the certificate
- is a CA, and if so, what the maximum number of intermediate CA certs
- after this are, before an end-entity certificate is found.
-
- :return:
- None or a BasicConstraints object
- """
-
- if not self._processed_extensions:
- self._set_extensions()
- return self._basic_constraints_value
-
- @property
- def name_constraints_value(self):
- """
- This extension is used in CA certificates, and is used to limit the
- possible names of certificates issued.
-
- :return:
- None or a NameConstraints object
- """
-
- if not self._processed_extensions:
- self._set_extensions()
- return self._name_constraints_value
-
- @property
- def crl_distribution_points_value(self):
- """
- This extension is used to help in locating the CRL for this certificate.
-
- :return:
- None or a CRLDistributionPoints object
- extension
- """
-
- if not self._processed_extensions:
- self._set_extensions()
- return self._crl_distribution_points_value
-
- @property
- def certificate_policies_value(self):
- """
- This extension defines policies in CA certificates under which
- certificates may be issued. In end-entity certificates, the inclusion
- of a policy indicates the issuance of the certificate follows the
- policy.
-
- :return:
- None or a CertificatePolicies object
- """
-
- if not self._processed_extensions:
- self._set_extensions()
- return self._certificate_policies_value
-
- @property
- def policy_mappings_value(self):
- """
- This extension allows mapping policy OIDs to other OIDs. This is used
- to allow different policies to be treated as equivalent in the process
- of validation.
-
- :return:
- None or a PolicyMappings object
- """
-
- if not self._processed_extensions:
- self._set_extensions()
- return self._policy_mappings_value
-
- @property
- def authority_key_identifier_value(self):
- """
- This extension helps in identifying the public key with which to
- validate the authenticity of the certificate.
-
- :return:
- None or an AuthorityKeyIdentifier object
- """
-
- if not self._processed_extensions:
- self._set_extensions()
- return self._authority_key_identifier_value
-
- @property
- def policy_constraints_value(self):
- """
- This extension is used to control if policy mapping is allowed and
- when policies are required.
-
- :return:
- None or a PolicyConstraints object
- """
-
- if not self._processed_extensions:
- self._set_extensions()
- return self._policy_constraints_value
-
- @property
- def freshest_crl_value(self):
- """
- This extension is used to help locate any available delta CRLs
-
- :return:
- None or an CRLDistributionPoints object
- """
-
- if not self._processed_extensions:
- self._set_extensions()
- return self._freshest_crl_value
-
- @property
- def inhibit_any_policy_value(self):
- """
- This extension is used to prevent mapping of the any policy to
- specific requirements
-
- :return:
- None or a Integer object
- """
-
- if not self._processed_extensions:
- self._set_extensions()
- return self._inhibit_any_policy_value
-
- @property
- def extended_key_usage_value(self):
- """
- This extension is used to define additional purposes for the public key
- beyond what is contained in the basic constraints.
-
- :return:
- None or an ExtKeyUsageSyntax object
- """
-
- if not self._processed_extensions:
- self._set_extensions()
- return self._extended_key_usage_value
-
- @property
- def authority_information_access_value(self):
- """
- This extension is used to locate the CA certificate used to sign this
- certificate, or the OCSP responder for this certificate.
-
- :return:
- None or an AuthorityInfoAccessSyntax object
- """
-
- if not self._processed_extensions:
- self._set_extensions()
- return self._authority_information_access_value
-
- @property
- def subject_information_access_value(self):
- """
- This extension is used to access information about the subject of this
- certificate.
-
- :return:
- None or a SubjectInfoAccessSyntax object
- """
-
- if not self._processed_extensions:
- self._set_extensions()
- return self._subject_information_access_value
-
- @property
- def tls_feature_value(self):
- """
- This extension is used to list the TLS features a server must respond
- with if a client initiates a request supporting them.
-
- :return:
- None or a Features object
- """
-
- if not self._processed_extensions:
- self._set_extensions()
- return self._tls_feature_value
-
- @property
- def ocsp_no_check_value(self):
- """
- This extension is used on certificates of OCSP responders, indicating
- that revocation information for the certificate should never need to
- be verified, thus preventing possible loops in path validation.
-
- :return:
- None or a Null object (if present)
- """
-
- if not self._processed_extensions:
- self._set_extensions()
- return self._ocsp_no_check_value
-
- @property
- def signature(self):
- """
- :return:
- A byte string of the signature
- """
-
- return self['signature_value'].native
-
- @property
- def signature_algo(self):
- """
- :return:
- A unicode string of "rsassa_pkcs1v15", "rsassa_pss", "dsa", "ecdsa"
- """
-
- return self['signature_algorithm'].signature_algo
-
- @property
- def hash_algo(self):
- """
- :return:
- A unicode string of "md2", "md5", "sha1", "sha224", "sha256",
- "sha384", "sha512", "sha512_224", "sha512_256"
- """
-
- return self['signature_algorithm'].hash_algo
-
- @property
- def public_key(self):
- """
- :return:
- The PublicKeyInfo object for this certificate
- """
-
- return self['tbs_certificate']['subject_public_key_info']
-
- @property
- def subject(self):
- """
- :return:
- The Name object for the subject of this certificate
- """
-
- return self['tbs_certificate']['subject']
-
- @property
- def issuer(self):
- """
- :return:
- The Name object for the issuer of this certificate
- """
-
- return self['tbs_certificate']['issuer']
-
- @property
- def serial_number(self):
- """
- :return:
- An integer of the certificate's serial number
- """
-
- return self['tbs_certificate']['serial_number'].native
-
- @property
- def key_identifier(self):
- """
- :return:
- None or a byte string of the certificate's key identifier from the
- key identifier extension
- """
-
- if not self.key_identifier_value:
- return None
-
- return self.key_identifier_value.native
-
- @property
- def issuer_serial(self):
- """
- :return:
- A byte string of the SHA-256 hash of the issuer concatenated with
- the ascii character ":", concatenated with the serial number as
- an ascii string
- """
-
- if self._issuer_serial is None:
- self._issuer_serial = self.issuer.sha256 + b':' + str_cls(self.serial_number).encode('ascii')
- return self._issuer_serial
-
- @property
- def authority_key_identifier(self):
- """
- :return:
- None or a byte string of the key_identifier from the authority key
- identifier extension
- """
-
- if not self.authority_key_identifier_value:
- return None
-
- return self.authority_key_identifier_value['key_identifier'].native
-
- @property
- def authority_issuer_serial(self):
- """
- :return:
- None or a byte string of the SHA-256 hash of the isser from the
- authority key identifier extension concatenated with the ascii
- character ":", concatenated with the serial number from the
- authority key identifier extension as an ascii string
- """
-
- if self._authority_issuer_serial is False:
- akiv = self.authority_key_identifier_value
- if akiv and akiv['authority_cert_issuer'].native:
- issuer = self.authority_key_identifier_value['authority_cert_issuer'][0].chosen
- # We untag the element since it is tagged via being a choice from GeneralName
- issuer = issuer.untag()
- authority_serial = self.authority_key_identifier_value['authority_cert_serial_number'].native
- self._authority_issuer_serial = issuer.sha256 + b':' + str_cls(authority_serial).encode('ascii')
- else:
- self._authority_issuer_serial = None
- return self._authority_issuer_serial
-
- @property
- def crl_distribution_points(self):
- """
- Returns complete CRL URLs - does not include delta CRLs
-
- :return:
- A list of zero or more DistributionPoint objects
- """
-
- if self._crl_distribution_points is None:
- self._crl_distribution_points = self._get_http_crl_distribution_points(self.crl_distribution_points_value)
- return self._crl_distribution_points
-
- @property
- def delta_crl_distribution_points(self):
- """
- Returns delta CRL URLs - does not include complete CRLs
-
- :return:
- A list of zero or more DistributionPoint objects
- """
-
- if self._delta_crl_distribution_points is None:
- self._delta_crl_distribution_points = self._get_http_crl_distribution_points(self.freshest_crl_value)
- return self._delta_crl_distribution_points
-
- def _get_http_crl_distribution_points(self, crl_distribution_points):
- """
- Fetches the DistributionPoint object for non-relative, HTTP CRLs
- referenced by the certificate
-
- :param crl_distribution_points:
- A CRLDistributionPoints object to grab the DistributionPoints from
-
- :return:
- A list of zero or more DistributionPoint objects
- """
-
- output = []
-
- if crl_distribution_points is None:
- return []
-
- for distribution_point in crl_distribution_points:
- distribution_point_name = distribution_point['distribution_point']
- if distribution_point_name is VOID:
- continue
- # RFC 5280 indicates conforming CA should not use the relative form
- if distribution_point_name.name == 'name_relative_to_crl_issuer':
- continue
- # This library is currently only concerned with HTTP-based CRLs
- for general_name in distribution_point_name.chosen:
- if general_name.name == 'uniform_resource_identifier':
- output.append(distribution_point)
-
- return output
-
- @property
- def ocsp_urls(self):
- """
- :return:
- A list of zero or more unicode strings of the OCSP URLs for this
- cert
- """
-
- if not self.authority_information_access_value:
- return []
-
- output = []
- for entry in self.authority_information_access_value:
- if entry['access_method'].native == 'ocsp':
- location = entry['access_location']
- if location.name != 'uniform_resource_identifier':
- continue
- url = location.native
- if url.lower().startswith(('http://', 'https://', 'ldap://', 'ldaps://')):
- output.append(url)
- return output
-
- @property
- def valid_domains(self):
- """
- :return:
- A list of unicode strings of valid domain names for the certificate.
- Wildcard certificates will have a domain in the form: *.example.com
- """
-
- if self._valid_domains is None:
- self._valid_domains = []
-
- # For the subject alt name extension, we can look at the name of
- # the choice selected since it distinguishes between domain names,
- # email addresses, IPs, etc
- if self.subject_alt_name_value:
- for general_name in self.subject_alt_name_value:
- if general_name.name == 'dns_name' and general_name.native not in self._valid_domains:
- self._valid_domains.append(general_name.native)
-
- # If there was no subject alt name extension, and the common name
- # in the subject looks like a domain, that is considered the valid
- # list. This is done because according to
- # https://tools.ietf.org/html/rfc6125#section-6.4.4, the common
- # name should not be used if the subject alt name is present.
- else:
- pattern = re.compile('^(\\*\\.)?(?:[a-zA-Z0-9](?:[a-zA-Z0-9\\-]*[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,}$')
- for rdn in self.subject.chosen:
- for name_type_value in rdn:
- if name_type_value['type'].native == 'common_name':
- value = name_type_value['value'].native
- if pattern.match(value):
- self._valid_domains.append(value)
-
- return self._valid_domains
-
- @property
- def valid_ips(self):
- """
- :return:
- A list of unicode strings of valid IP addresses for the certificate
- """
-
- if self._valid_ips is None:
- self._valid_ips = []
-
- if self.subject_alt_name_value:
- for general_name in self.subject_alt_name_value:
- if general_name.name == 'ip_address':
- self._valid_ips.append(general_name.native)
-
- return self._valid_ips
-
- @property
- def ca(self):
- """
- :return;
- A boolean - if the certificate is marked as a CA
- """
-
- return self.basic_constraints_value and self.basic_constraints_value['ca'].native
-
- @property
- def max_path_length(self):
- """
- :return;
- None or an integer of the maximum path length
- """
-
- if not self.ca:
- return None
- return self.basic_constraints_value['path_len_constraint'].native
-
- @property
- def self_issued(self):
- """
- :return:
- A boolean - if the certificate is self-issued, as defined by RFC
- 5280
- """
-
- if self._self_issued is None:
- self._self_issued = self.subject == self.issuer
- return self._self_issued
-
- @property
- def self_signed(self):
- """
- :return:
- A unicode string of "no" or "maybe". The "maybe" result will
- be returned if the certificate issuer and subject are the same.
- If a key identifier and authority key identifier are present,
- they will need to match otherwise "no" will be returned.
-
- To verify is a certificate is truly self-signed, the signature
- will need to be verified. See the certvalidator package for
- one possible solution.
- """
-
- if self._self_signed is None:
- self._self_signed = 'no'
- if self.self_issued:
- if self.key_identifier:
- if not self.authority_key_identifier:
- self._self_signed = 'maybe'
- elif self.authority_key_identifier == self.key_identifier:
- self._self_signed = 'maybe'
- else:
- self._self_signed = 'maybe'
- return self._self_signed
-
- @property
- def sha1(self):
- """
- :return:
- The SHA-1 hash of the DER-encoded bytes of this complete certificate
- """
-
- if self._sha1 is None:
- self._sha1 = hashlib.sha1(self.dump()).digest()
- return self._sha1
-
- @property
- def sha1_fingerprint(self):
- """
- :return:
- A unicode string of the SHA-1 hash, formatted using hex encoding
- with a space between each pair of characters, all uppercase
- """
-
- return ' '.join('%02X' % c for c in bytes_to_list(self.sha1))
-
- @property
- def sha256(self):
- """
- :return:
- The SHA-256 hash of the DER-encoded bytes of this complete
- certificate
- """
-
- if self._sha256 is None:
- self._sha256 = hashlib.sha256(self.dump()).digest()
- return self._sha256
-
- @property
- def sha256_fingerprint(self):
- """
- :return:
- A unicode string of the SHA-256 hash, formatted using hex encoding
- with a space between each pair of characters, all uppercase
- """
-
- return ' '.join('%02X' % c for c in bytes_to_list(self.sha256))
-
- def is_valid_domain_ip(self, domain_ip):
- """
- Check if a domain name or IP address is valid according to the
- certificate
-
- :param domain_ip:
- A unicode string of a domain name or IP address
-
- :return:
- A boolean - if the domain or IP is valid for the certificate
- """
-
- if not isinstance(domain_ip, str_cls):
- raise TypeError(unwrap(
- '''
- domain_ip must be a unicode string, not %s
- ''',
- type_name(domain_ip)
- ))
-
- encoded_domain_ip = domain_ip.encode('idna').decode('ascii').lower()
-
- is_ipv6 = encoded_domain_ip.find(':') != -1
- is_ipv4 = not is_ipv6 and re.match('^\\d+\\.\\d+\\.\\d+\\.\\d+$', encoded_domain_ip)
- is_domain = not is_ipv6 and not is_ipv4
-
- # Handle domain name checks
- if is_domain:
- if not self.valid_domains:
- return False
-
- domain_labels = encoded_domain_ip.split('.')
-
- for valid_domain in self.valid_domains:
- encoded_valid_domain = valid_domain.encode('idna').decode('ascii').lower()
- valid_domain_labels = encoded_valid_domain.split('.')
-
- # The domain must be equal in label length to match
- if len(valid_domain_labels) != len(domain_labels):
- continue
-
- if valid_domain_labels == domain_labels:
- return True
-
- is_wildcard = self._is_wildcard_domain(encoded_valid_domain)
- if is_wildcard and self._is_wildcard_match(domain_labels, valid_domain_labels):
- return True
-
- return False
-
- # Handle IP address checks
- if not self.valid_ips:
- return False
-
- family = socket.AF_INET if is_ipv4 else socket.AF_INET6
- normalized_ip = inet_pton(family, encoded_domain_ip)
-
- for valid_ip in self.valid_ips:
- valid_family = socket.AF_INET if valid_ip.find('.') != -1 else socket.AF_INET6
- normalized_valid_ip = inet_pton(valid_family, valid_ip)
-
- if normalized_valid_ip == normalized_ip:
- return True
-
- return False
-
- def _is_wildcard_domain(self, domain):
- """
- Checks if a domain is a valid wildcard according to
- https://tools.ietf.org/html/rfc6125#section-6.4.3
-
- :param domain:
- A unicode string of the domain name, where any U-labels from an IDN
- have been converted to A-labels
-
- :return:
- A boolean - if the domain is a valid wildcard domain
- """
-
- # The * character must be present for a wildcard match, and if there is
- # most than one, it is an invalid wildcard specification
- if domain.count('*') != 1:
- return False
-
- labels = domain.lower().split('.')
-
- if not labels:
- return False
-
- # Wildcards may only appear in the left-most label
- if labels[0].find('*') == -1:
- return False
-
- # Wildcards may not be embedded in an A-label from an IDN
- if labels[0][0:4] == 'xn--':
- return False
-
- return True
-
- def _is_wildcard_match(self, domain_labels, valid_domain_labels):
- """
- Determines if the labels in a domain are a match for labels from a
- wildcard valid domain name
-
- :param domain_labels:
- A list of unicode strings, with A-label form for IDNs, of the labels
- in the domain name to check
-
- :param valid_domain_labels:
- A list of unicode strings, with A-label form for IDNs, of the labels
- in a wildcard domain pattern
-
- :return:
- A boolean - if the domain matches the valid domain
- """
-
- first_domain_label = domain_labels[0]
- other_domain_labels = domain_labels[1:]
-
- wildcard_label = valid_domain_labels[0]
- other_valid_domain_labels = valid_domain_labels[1:]
-
- # The wildcard is only allowed in the first label, so if
- # The subsequent labels are not equal, there is no match
- if other_domain_labels != other_valid_domain_labels:
- return False
-
- if wildcard_label == '*':
- return True
-
- wildcard_regex = re.compile('^' + wildcard_label.replace('*', '.*') + '$')
- if wildcard_regex.match(first_domain_label):
- return True
-
- return False
-
-
-# The structures are taken from the OpenSSL source file x_x509a.c, and specify
-# extra information that is added to X.509 certificates to store trust
-# information about the certificate.
-
-class KeyPurposeIdentifiers(SequenceOf):
- _child_spec = KeyPurposeId
-
-
-class SequenceOfAlgorithmIdentifiers(SequenceOf):
- _child_spec = AlgorithmIdentifier
-
-
-class CertificateAux(Sequence):
- _fields = [
- ('trust', KeyPurposeIdentifiers, {'optional': True}),
- ('reject', KeyPurposeIdentifiers, {'implicit': 0, 'optional': True}),
- ('alias', UTF8String, {'optional': True}),
- ('keyid', OctetString, {'optional': True}),
- ('other', SequenceOfAlgorithmIdentifiers, {'implicit': 1, 'optional': True}),
- ]
-
-
-class TrustedCertificate(Concat):
- _child_specs = [Certificate, CertificateAux]
diff --git a/lib/attr/__init__.py b/lib/attr/__init__.py
deleted file mode 100644
index debfd57b0f..0000000000
--- a/lib/attr/__init__.py
+++ /dev/null
@@ -1,65 +0,0 @@
-from __future__ import absolute_import, division, print_function
-
-from functools import partial
-
-from . import converters, exceptions, filters, validators
-from ._config import get_run_validators, set_run_validators
-from ._funcs import asdict, assoc, astuple, evolve, has
-from ._make import (
- NOTHING,
- Attribute,
- Factory,
- attrib,
- attrs,
- fields,
- fields_dict,
- make_class,
- validate,
-)
-
-
-__version__ = "18.2.0"
-
-__title__ = "attrs"
-__description__ = "Classes Without Boilerplate"
-__url__ = "https://www.attrs.org/"
-__uri__ = __url__
-__doc__ = __description__ + " <" + __uri__ + ">"
-
-__author__ = "Hynek Schlawack"
-__email__ = "hs@ox.cx"
-
-__license__ = "MIT"
-__copyright__ = "Copyright (c) 2015 Hynek Schlawack"
-
-
-s = attributes = attrs
-ib = attr = attrib
-dataclass = partial(attrs, auto_attribs=True) # happy Easter ;)
-
-__all__ = [
- "Attribute",
- "Factory",
- "NOTHING",
- "asdict",
- "assoc",
- "astuple",
- "attr",
- "attrib",
- "attributes",
- "attrs",
- "converters",
- "evolve",
- "exceptions",
- "fields",
- "fields_dict",
- "filters",
- "get_run_validators",
- "has",
- "ib",
- "make_class",
- "s",
- "set_run_validators",
- "validate",
- "validators",
-]
diff --git a/lib/attr/__init__.pyi b/lib/attr/__init__.pyi
deleted file mode 100644
index 492fb85ede..0000000000
--- a/lib/attr/__init__.pyi
+++ /dev/null
@@ -1,252 +0,0 @@
-from typing import (
- Any,
- Callable,
- Dict,
- Generic,
- List,
- Optional,
- Sequence,
- Mapping,
- Tuple,
- Type,
- TypeVar,
- Union,
- overload,
-)
-
-# `import X as X` is required to make these public
-from . import exceptions as exceptions
-from . import filters as filters
-from . import converters as converters
-from . import validators as validators
-
-_T = TypeVar("_T")
-_C = TypeVar("_C", bound=type)
-
-_ValidatorType = Callable[[Any, Attribute, _T], Any]
-_ConverterType = Callable[[Any], _T]
-_FilterType = Callable[[Attribute, Any], bool]
-# FIXME: in reality, if multiple validators are passed they must be in a list or tuple,
-# but those are invariant and so would prevent subtypes of _ValidatorType from working
-# when passed in a list or tuple.
-_ValidatorArgType = Union[_ValidatorType[_T], Sequence[_ValidatorType[_T]]]
-
-# _make --
-
-NOTHING: object
-
-# NOTE: Factory lies about its return type to make this possible: `x: List[int] = Factory(list)`
-# Work around mypy issue #4554 in the common case by using an overload.
-@overload
-def Factory(factory: Callable[[], _T]) -> _T: ...
-@overload
-def Factory(
- factory: Union[Callable[[Any], _T], Callable[[], _T]],
- takes_self: bool = ...,
-) -> _T: ...
-
-class Attribute(Generic[_T]):
- name: str
- default: Optional[_T]
- validator: Optional[_ValidatorType[_T]]
- repr: bool
- cmp: bool
- hash: Optional[bool]
- init: bool
- converter: Optional[_ConverterType[_T]]
- metadata: Dict[Any, Any]
- type: Optional[Type[_T]]
- kw_only: bool
- def __lt__(self, x: Attribute) -> bool: ...
- def __le__(self, x: Attribute) -> bool: ...
- def __gt__(self, x: Attribute) -> bool: ...
- def __ge__(self, x: Attribute) -> bool: ...
-
-# NOTE: We had several choices for the annotation to use for type arg:
-# 1) Type[_T]
-# - Pros: Handles simple cases correctly
-# - Cons: Might produce less informative errors in the case of conflicting TypeVars
-# e.g. `attr.ib(default='bad', type=int)`
-# 2) Callable[..., _T]
-# - Pros: Better error messages than #1 for conflicting TypeVars
-# - Cons: Terrible error messages for validator checks.
-# e.g. attr.ib(type=int, validator=validate_str)
-# -> error: Cannot infer function type argument
-# 3) type (and do all of the work in the mypy plugin)
-# - Pros: Simple here, and we could customize the plugin with our own errors.
-# - Cons: Would need to write mypy plugin code to handle all the cases.
-# We chose option #1.
-
-# `attr` lies about its return type to make the following possible:
-# attr() -> Any
-# attr(8) -> int
-# attr(validator=) -> Whatever the callable expects.
-# This makes this type of assignments possible:
-# x: int = attr(8)
-#
-# This form catches explicit None or no default but with no other arguments returns Any.
-@overload
-def attrib(
- default: None = ...,
- validator: None = ...,
- repr: bool = ...,
- cmp: bool = ...,
- hash: Optional[bool] = ...,
- init: bool = ...,
- convert: None = ...,
- metadata: Optional[Mapping[Any, Any]] = ...,
- type: None = ...,
- converter: None = ...,
- factory: None = ...,
- kw_only: bool = ...,
-) -> Any: ...
-
-# This form catches an explicit None or no default and infers the type from the other arguments.
-@overload
-def attrib(
- default: None = ...,
- validator: Optional[_ValidatorArgType[_T]] = ...,
- repr: bool = ...,
- cmp: bool = ...,
- hash: Optional[bool] = ...,
- init: bool = ...,
- convert: Optional[_ConverterType[_T]] = ...,
- metadata: Optional[Mapping[Any, Any]] = ...,
- type: Optional[Type[_T]] = ...,
- converter: Optional[_ConverterType[_T]] = ...,
- factory: Optional[Callable[[], _T]] = ...,
- kw_only: bool = ...,
-) -> _T: ...
-
-# This form catches an explicit default argument.
-@overload
-def attrib(
- default: _T,
- validator: Optional[_ValidatorArgType[_T]] = ...,
- repr: bool = ...,
- cmp: bool = ...,
- hash: Optional[bool] = ...,
- init: bool = ...,
- convert: Optional[_ConverterType[_T]] = ...,
- metadata: Optional[Mapping[Any, Any]] = ...,
- type: Optional[Type[_T]] = ...,
- converter: Optional[_ConverterType[_T]] = ...,
- factory: Optional[Callable[[], _T]] = ...,
- kw_only: bool = ...,
-) -> _T: ...
-
-# This form covers type=non-Type: e.g. forward references (str), Any
-@overload
-def attrib(
- default: Optional[_T] = ...,
- validator: Optional[_ValidatorArgType[_T]] = ...,
- repr: bool = ...,
- cmp: bool = ...,
- hash: Optional[bool] = ...,
- init: bool = ...,
- convert: Optional[_ConverterType[_T]] = ...,
- metadata: Optional[Mapping[Any, Any]] = ...,
- type: object = ...,
- converter: Optional[_ConverterType[_T]] = ...,
- factory: Optional[Callable[[], _T]] = ...,
- kw_only: bool = ...,
-) -> Any: ...
-@overload
-def attrs(
- maybe_cls: _C,
- these: Optional[Dict[str, Any]] = ...,
- repr_ns: Optional[str] = ...,
- repr: bool = ...,
- cmp: bool = ...,
- hash: Optional[bool] = ...,
- init: bool = ...,
- slots: bool = ...,
- frozen: bool = ...,
- weakref_slot: bool = ...,
- str: bool = ...,
- auto_attribs: bool = ...,
- kw_only: bool = ...,
- cache_hash: bool = ...,
-) -> _C: ...
-@overload
-def attrs(
- maybe_cls: None = ...,
- these: Optional[Dict[str, Any]] = ...,
- repr_ns: Optional[str] = ...,
- repr: bool = ...,
- cmp: bool = ...,
- hash: Optional[bool] = ...,
- init: bool = ...,
- slots: bool = ...,
- frozen: bool = ...,
- weakref_slot: bool = ...,
- str: bool = ...,
- auto_attribs: bool = ...,
- kw_only: bool = ...,
- cache_hash: bool = ...,
-) -> Callable[[_C], _C]: ...
-
-# TODO: add support for returning NamedTuple from the mypy plugin
-class _Fields(Tuple[Attribute, ...]):
- def __getattr__(self, name: str) -> Attribute: ...
-
-def fields(cls: type) -> _Fields: ...
-def fields_dict(cls: type) -> Dict[str, Attribute]: ...
-def validate(inst: Any) -> None: ...
-
-# TODO: add support for returning a proper attrs class from the mypy plugin
-# we use Any instead of _CountingAttr so that e.g. `make_class('Foo', [attr.ib()])` is valid
-def make_class(
- name: str,
- attrs: Union[List[str], Tuple[str, ...], Dict[str, Any]],
- bases: Tuple[type, ...] = ...,
- repr_ns: Optional[str] = ...,
- repr: bool = ...,
- cmp: bool = ...,
- hash: Optional[bool] = ...,
- init: bool = ...,
- slots: bool = ...,
- frozen: bool = ...,
- weakref_slot: bool = ...,
- str: bool = ...,
- auto_attribs: bool = ...,
- kw_only: bool = ...,
- cache_hash: bool = ...,
-) -> type: ...
-
-# _funcs --
-
-# TODO: add support for returning TypedDict from the mypy plugin
-# FIXME: asdict/astuple do not honor their factory args. waiting on one of these:
-# https://github.com/python/mypy/issues/4236
-# https://github.com/python/typing/issues/253
-def asdict(
- inst: Any,
- recurse: bool = ...,
- filter: Optional[_FilterType] = ...,
- dict_factory: Type[Mapping[Any, Any]] = ...,
- retain_collection_types: bool = ...,
-) -> Dict[str, Any]: ...
-
-# TODO: add support for returning NamedTuple from the mypy plugin
-def astuple(
- inst: Any,
- recurse: bool = ...,
- filter: Optional[_FilterType] = ...,
- tuple_factory: Type[Sequence] = ...,
- retain_collection_types: bool = ...,
-) -> Tuple[Any, ...]: ...
-def has(cls: type) -> bool: ...
-def assoc(inst: _T, **changes: Any) -> _T: ...
-def evolve(inst: _T, **changes: Any) -> _T: ...
-
-# _config --
-
-def set_run_validators(run: bool) -> None: ...
-def get_run_validators() -> bool: ...
-
-# aliases --
-
-s = attributes = attrs
-ib = attr = attrib
-dataclass = attrs # Technically, partial(attrs, auto_attribs=True) ;)
diff --git a/lib/attr/_compat.py b/lib/attr/_compat.py
deleted file mode 100644
index 5bb065932c..0000000000
--- a/lib/attr/_compat.py
+++ /dev/null
@@ -1,163 +0,0 @@
-from __future__ import absolute_import, division, print_function
-
-import platform
-import sys
-import types
-import warnings
-
-
-PY2 = sys.version_info[0] == 2
-PYPY = platform.python_implementation() == "PyPy"
-
-
-if PYPY or sys.version_info[:2] >= (3, 6):
- ordered_dict = dict
-else:
- from collections import OrderedDict
-
- ordered_dict = OrderedDict
-
-
-if PY2:
- from UserDict import IterableUserDict
-
- # We 'bundle' isclass instead of using inspect as importing inspect is
- # fairly expensive (order of 10-15 ms for a modern machine in 2016)
- def isclass(klass):
- return isinstance(klass, (type, types.ClassType))
-
- # TYPE is used in exceptions, repr(int) is different on Python 2 and 3.
- TYPE = "type"
-
- def iteritems(d):
- return d.iteritems()
-
- # Python 2 is bereft of a read-only dict proxy, so we make one!
- class ReadOnlyDict(IterableUserDict):
- """
- Best-effort read-only dict wrapper.
- """
-
- def __setitem__(self, key, val):
- # We gently pretend we're a Python 3 mappingproxy.
- raise TypeError(
- "'mappingproxy' object does not support item assignment"
- )
-
- def update(self, _):
- # We gently pretend we're a Python 3 mappingproxy.
- raise AttributeError(
- "'mappingproxy' object has no attribute 'update'"
- )
-
- def __delitem__(self, _):
- # We gently pretend we're a Python 3 mappingproxy.
- raise TypeError(
- "'mappingproxy' object does not support item deletion"
- )
-
- def clear(self):
- # We gently pretend we're a Python 3 mappingproxy.
- raise AttributeError(
- "'mappingproxy' object has no attribute 'clear'"
- )
-
- def pop(self, key, default=None):
- # We gently pretend we're a Python 3 mappingproxy.
- raise AttributeError(
- "'mappingproxy' object has no attribute 'pop'"
- )
-
- def popitem(self):
- # We gently pretend we're a Python 3 mappingproxy.
- raise AttributeError(
- "'mappingproxy' object has no attribute 'popitem'"
- )
-
- def setdefault(self, key, default=None):
- # We gently pretend we're a Python 3 mappingproxy.
- raise AttributeError(
- "'mappingproxy' object has no attribute 'setdefault'"
- )
-
- def __repr__(self):
- # Override to be identical to the Python 3 version.
- return "mappingproxy(" + repr(self.data) + ")"
-
- def metadata_proxy(d):
- res = ReadOnlyDict()
- res.data.update(d) # We blocked update, so we have to do it like this.
- return res
-
-
-else:
-
- def isclass(klass):
- return isinstance(klass, type)
-
- TYPE = "class"
-
- def iteritems(d):
- return d.items()
-
- def metadata_proxy(d):
- return types.MappingProxyType(dict(d))
-
-
-def import_ctypes():
- """
- Moved into a function for testability.
- """
- import ctypes
-
- return ctypes
-
-
-if not PY2:
-
- def just_warn(*args, **kw):
- """
- We only warn on Python 3 because we are not aware of any concrete
- consequences of not setting the cell on Python 2.
- """
- warnings.warn(
- "Missing ctypes. Some features like bare super() or accessing "
- "__class__ will not work with slots classes.",
- RuntimeWarning,
- stacklevel=2,
- )
-
-
-else:
-
- def just_warn(*args, **kw): # pragma: nocover
- """
- We only warn on Python 3 because we are not aware of any concrete
- consequences of not setting the cell on Python 2.
- """
-
-
-def make_set_closure_cell():
- """
- Moved into a function for testability.
- """
- if PYPY: # pragma: no cover
-
- def set_closure_cell(cell, value):
- cell.__setstate__((value,))
-
- else:
- try:
- ctypes = import_ctypes()
-
- set_closure_cell = ctypes.pythonapi.PyCell_Set
- set_closure_cell.argtypes = (ctypes.py_object, ctypes.py_object)
- set_closure_cell.restype = ctypes.c_int
- except Exception:
- # We try best effort to set the cell, but sometimes it's not
- # possible. For example on Jython or on GAE.
- set_closure_cell = just_warn
- return set_closure_cell
-
-
-set_closure_cell = make_set_closure_cell()
diff --git a/lib/attr/_config.py b/lib/attr/_config.py
deleted file mode 100644
index 8ec920962d..0000000000
--- a/lib/attr/_config.py
+++ /dev/null
@@ -1,23 +0,0 @@
-from __future__ import absolute_import, division, print_function
-
-
-__all__ = ["set_run_validators", "get_run_validators"]
-
-_run_validators = True
-
-
-def set_run_validators(run):
- """
- Set whether or not validators are run. By default, they are run.
- """
- if not isinstance(run, bool):
- raise TypeError("'run' must be bool.")
- global _run_validators
- _run_validators = run
-
-
-def get_run_validators():
- """
- Return whether or not validators are run.
- """
- return _run_validators
diff --git a/lib/attr/_funcs.py b/lib/attr/_funcs.py
deleted file mode 100644
index b61d239412..0000000000
--- a/lib/attr/_funcs.py
+++ /dev/null
@@ -1,290 +0,0 @@
-from __future__ import absolute_import, division, print_function
-
-import copy
-
-from ._compat import iteritems
-from ._make import NOTHING, _obj_setattr, fields
-from .exceptions import AttrsAttributeNotFoundError
-
-
-def asdict(
- inst,
- recurse=True,
- filter=None,
- dict_factory=dict,
- retain_collection_types=False,
-):
- """
- Return the ``attrs`` attribute values of *inst* as a dict.
-
- Optionally recurse into other ``attrs``-decorated classes.
-
- :param inst: Instance of an ``attrs``-decorated class.
- :param bool recurse: Recurse into classes that are also
- ``attrs``-decorated.
- :param callable filter: A callable whose return code determines whether an
- attribute or element is included (``True``) or dropped (``False``). Is
- called with the :class:`attr.Attribute` as the first argument and the
- value as the second argument.
- :param callable dict_factory: A callable to produce dictionaries from. For
- example, to produce ordered dictionaries instead of normal Python
- dictionaries, pass in ``collections.OrderedDict``.
- :param bool retain_collection_types: Do not convert to ``list`` when
- encountering an attribute whose type is ``tuple`` or ``set``. Only
- meaningful if ``recurse`` is ``True``.
-
- :rtype: return type of *dict_factory*
-
- :raise attr.exceptions.NotAnAttrsClassError: If *cls* is not an ``attrs``
- class.
-
- .. versionadded:: 16.0.0 *dict_factory*
- .. versionadded:: 16.1.0 *retain_collection_types*
- """
- attrs = fields(inst.__class__)
- rv = dict_factory()
- for a in attrs:
- v = getattr(inst, a.name)
- if filter is not None and not filter(a, v):
- continue
- if recurse is True:
- if has(v.__class__):
- rv[a.name] = asdict(
- v, True, filter, dict_factory, retain_collection_types
- )
- elif isinstance(v, (tuple, list, set)):
- cf = v.__class__ if retain_collection_types is True else list
- rv[a.name] = cf(
- [
- _asdict_anything(
- i, filter, dict_factory, retain_collection_types
- )
- for i in v
- ]
- )
- elif isinstance(v, dict):
- df = dict_factory
- rv[a.name] = df(
- (
- _asdict_anything(
- kk, filter, df, retain_collection_types
- ),
- _asdict_anything(
- vv, filter, df, retain_collection_types
- ),
- )
- for kk, vv in iteritems(v)
- )
- else:
- rv[a.name] = v
- else:
- rv[a.name] = v
- return rv
-
-
-def _asdict_anything(val, filter, dict_factory, retain_collection_types):
- """
- ``asdict`` only works on attrs instances, this works on anything.
- """
- if getattr(val.__class__, "__attrs_attrs__", None) is not None:
- # Attrs class.
- rv = asdict(val, True, filter, dict_factory, retain_collection_types)
- elif isinstance(val, (tuple, list, set)):
- cf = val.__class__ if retain_collection_types is True else list
- rv = cf(
- [
- _asdict_anything(
- i, filter, dict_factory, retain_collection_types
- )
- for i in val
- ]
- )
- elif isinstance(val, dict):
- df = dict_factory
- rv = df(
- (
- _asdict_anything(kk, filter, df, retain_collection_types),
- _asdict_anything(vv, filter, df, retain_collection_types),
- )
- for kk, vv in iteritems(val)
- )
- else:
- rv = val
- return rv
-
-
-def astuple(
- inst,
- recurse=True,
- filter=None,
- tuple_factory=tuple,
- retain_collection_types=False,
-):
- """
- Return the ``attrs`` attribute values of *inst* as a tuple.
-
- Optionally recurse into other ``attrs``-decorated classes.
-
- :param inst: Instance of an ``attrs``-decorated class.
- :param bool recurse: Recurse into classes that are also
- ``attrs``-decorated.
- :param callable filter: A callable whose return code determines whether an
- attribute or element is included (``True``) or dropped (``False``). Is
- called with the :class:`attr.Attribute` as the first argument and the
- value as the second argument.
- :param callable tuple_factory: A callable to produce tuples from. For
- example, to produce lists instead of tuples.
- :param bool retain_collection_types: Do not convert to ``list``
- or ``dict`` when encountering an attribute which type is
- ``tuple``, ``dict`` or ``set``. Only meaningful if ``recurse`` is
- ``True``.
-
- :rtype: return type of *tuple_factory*
-
- :raise attr.exceptions.NotAnAttrsClassError: If *cls* is not an ``attrs``
- class.
-
- .. versionadded:: 16.2.0
- """
- attrs = fields(inst.__class__)
- rv = []
- retain = retain_collection_types # Very long. :/
- for a in attrs:
- v = getattr(inst, a.name)
- if filter is not None and not filter(a, v):
- continue
- if recurse is True:
- if has(v.__class__):
- rv.append(
- astuple(
- v,
- recurse=True,
- filter=filter,
- tuple_factory=tuple_factory,
- retain_collection_types=retain,
- )
- )
- elif isinstance(v, (tuple, list, set)):
- cf = v.__class__ if retain is True else list
- rv.append(
- cf(
- [
- astuple(
- j,
- recurse=True,
- filter=filter,
- tuple_factory=tuple_factory,
- retain_collection_types=retain,
- )
- if has(j.__class__)
- else j
- for j in v
- ]
- )
- )
- elif isinstance(v, dict):
- df = v.__class__ if retain is True else dict
- rv.append(
- df(
- (
- astuple(
- kk,
- tuple_factory=tuple_factory,
- retain_collection_types=retain,
- )
- if has(kk.__class__)
- else kk,
- astuple(
- vv,
- tuple_factory=tuple_factory,
- retain_collection_types=retain,
- )
- if has(vv.__class__)
- else vv,
- )
- for kk, vv in iteritems(v)
- )
- )
- else:
- rv.append(v)
- else:
- rv.append(v)
- return rv if tuple_factory is list else tuple_factory(rv)
-
-
-def has(cls):
- """
- Check whether *cls* is a class with ``attrs`` attributes.
-
- :param type cls: Class to introspect.
- :raise TypeError: If *cls* is not a class.
-
- :rtype: :class:`bool`
- """
- return getattr(cls, "__attrs_attrs__", None) is not None
-
-
-def assoc(inst, **changes):
- """
- Copy *inst* and apply *changes*.
-
- :param inst: Instance of a class with ``attrs`` attributes.
- :param changes: Keyword changes in the new copy.
-
- :return: A copy of inst with *changes* incorporated.
-
- :raise attr.exceptions.AttrsAttributeNotFoundError: If *attr_name* couldn't
- be found on *cls*.
- :raise attr.exceptions.NotAnAttrsClassError: If *cls* is not an ``attrs``
- class.
-
- .. deprecated:: 17.1.0
- Use :func:`evolve` instead.
- """
- import warnings
-
- warnings.warn(
- "assoc is deprecated and will be removed after 2018/01.",
- DeprecationWarning,
- stacklevel=2,
- )
- new = copy.copy(inst)
- attrs = fields(inst.__class__)
- for k, v in iteritems(changes):
- a = getattr(attrs, k, NOTHING)
- if a is NOTHING:
- raise AttrsAttributeNotFoundError(
- "{k} is not an attrs attribute on {cl}.".format(
- k=k, cl=new.__class__
- )
- )
- _obj_setattr(new, k, v)
- return new
-
-
-def evolve(inst, **changes):
- """
- Create a new instance, based on *inst* with *changes* applied.
-
- :param inst: Instance of a class with ``attrs`` attributes.
- :param changes: Keyword changes in the new copy.
-
- :return: A copy of inst with *changes* incorporated.
-
- :raise TypeError: If *attr_name* couldn't be found in the class
- ``__init__``.
- :raise attr.exceptions.NotAnAttrsClassError: If *cls* is not an ``attrs``
- class.
-
- .. versionadded:: 17.1.0
- """
- cls = inst.__class__
- attrs = fields(cls)
- for a in attrs:
- if not a.init:
- continue
- attr_name = a.name # To deal with private attributes.
- init_name = attr_name if attr_name[0] != "_" else attr_name[1:]
- if init_name not in changes:
- changes[init_name] = getattr(inst, attr_name)
- return cls(**changes)
diff --git a/lib/attr/_make.py b/lib/attr/_make.py
deleted file mode 100644
index f7fd05e739..0000000000
--- a/lib/attr/_make.py
+++ /dev/null
@@ -1,2034 +0,0 @@
-from __future__ import absolute_import, division, print_function
-
-import copy
-import hashlib
-import linecache
-import sys
-import threading
-import warnings
-
-from operator import itemgetter
-
-from . import _config
-from ._compat import (
- PY2,
- isclass,
- iteritems,
- metadata_proxy,
- ordered_dict,
- set_closure_cell,
-)
-from .exceptions import (
- DefaultAlreadySetError,
- FrozenInstanceError,
- NotAnAttrsClassError,
- PythonTooOldError,
- UnannotatedAttributeError,
-)
-
-
-# This is used at least twice, so cache it here.
-_obj_setattr = object.__setattr__
-_init_converter_pat = "__attr_converter_{}"
-_init_factory_pat = "__attr_factory_{}"
-_tuple_property_pat = (
- " {attr_name} = _attrs_property(_attrs_itemgetter({index}))"
-)
-_classvar_prefixes = ("typing.ClassVar", "t.ClassVar", "ClassVar")
-# we don't use a double-underscore prefix because that triggers
-# name mangling when trying to create a slot for the field
-# (when slots=True)
-_hash_cache_field = "_attrs_cached_hash"
-
-_empty_metadata_singleton = metadata_proxy({})
-
-
-class _Nothing(object):
- """
- Sentinel class to indicate the lack of a value when ``None`` is ambiguous.
-
- ``_Nothing`` is a singleton. There is only ever one of it.
- """
-
- _singleton = None
-
- def __new__(cls):
- if _Nothing._singleton is None:
- _Nothing._singleton = super(_Nothing, cls).__new__(cls)
- return _Nothing._singleton
-
- def __repr__(self):
- return "NOTHING"
-
-
-NOTHING = _Nothing()
-"""
-Sentinel to indicate the lack of a value when ``None`` is ambiguous.
-"""
-
-
-def attrib(
- default=NOTHING,
- validator=None,
- repr=True,
- cmp=True,
- hash=None,
- init=True,
- convert=None,
- metadata=None,
- type=None,
- converter=None,
- factory=None,
- kw_only=False,
-):
- """
- Create a new attribute on a class.
-
- .. warning::
-
- Does *not* do anything unless the class is also decorated with
- :func:`attr.s`!
-
- :param default: A value that is used if an ``attrs``-generated ``__init__``
- is used and no value is passed while instantiating or the attribute is
- excluded using ``init=False``.
-
- If the value is an instance of :class:`Factory`, its callable will be
- used to construct a new value (useful for mutable data types like lists
- or dicts).
-
- If a default is not set (or set manually to ``attr.NOTHING``), a value
- *must* be supplied when instantiating; otherwise a :exc:`TypeError`
- will be raised.
-
- The default can also be set using decorator notation as shown below.
-
- :type default: Any value.
-
- :param callable factory: Syntactic sugar for
- ``default=attr.Factory(callable)``.
-
- :param validator: :func:`callable` that is called by ``attrs``-generated
- ``__init__`` methods after the instance has been initialized. They
- receive the initialized instance, the :class:`Attribute`, and the
- passed value.
-
- The return value is *not* inspected so the validator has to throw an
- exception itself.
-
- If a ``list`` is passed, its items are treated as validators and must
- all pass.
-
- Validators can be globally disabled and re-enabled using
- :func:`get_run_validators`.
-
- The validator can also be set using decorator notation as shown below.
-
- :type validator: ``callable`` or a ``list`` of ``callable``\\ s.
-
- :param bool repr: Include this attribute in the generated ``__repr__``
- method.
- :param bool cmp: Include this attribute in the generated comparison methods
- (``__eq__`` et al).
- :param hash: Include this attribute in the generated ``__hash__``
- method. If ``None`` (default), mirror *cmp*'s value. This is the
- correct behavior according the Python spec. Setting this value to
- anything else than ``None`` is *discouraged*.
- :type hash: ``bool`` or ``None``
- :param bool init: Include this attribute in the generated ``__init__``
- method. It is possible to set this to ``False`` and set a default
- value. In that case this attributed is unconditionally initialized
- with the specified default value or factory.
- :param callable converter: :func:`callable` that is called by
- ``attrs``-generated ``__init__`` methods to converter attribute's value
- to the desired format. It is given the passed-in value, and the
- returned value will be used as the new value of the attribute. The
- value is converted before being passed to the validator, if any.
- :param metadata: An arbitrary mapping, to be used by third-party
- components. See :ref:`extending_metadata`.
- :param type: The type of the attribute. In Python 3.6 or greater, the
- preferred method to specify the type is using a variable annotation
- (see `PEP 526 `_).
- This argument is provided for backward compatibility.
- Regardless of the approach used, the type will be stored on
- ``Attribute.type``.
-
- Please note that ``attrs`` doesn't do anything with this metadata by
- itself. You can use it as part of your own code or for
- :doc:`static type checking `.
- :param kw_only: Make this attribute keyword-only (Python 3+)
- in the generated ``__init__`` (if ``init`` is ``False``, this
- parameter is ignored).
-
- .. versionadded:: 15.2.0 *convert*
- .. versionadded:: 16.3.0 *metadata*
- .. versionchanged:: 17.1.0 *validator* can be a ``list`` now.
- .. versionchanged:: 17.1.0
- *hash* is ``None`` and therefore mirrors *cmp* by default.
- .. versionadded:: 17.3.0 *type*
- .. deprecated:: 17.4.0 *convert*
- .. versionadded:: 17.4.0 *converter* as a replacement for the deprecated
- *convert* to achieve consistency with other noun-based arguments.
- .. versionadded:: 18.1.0
- ``factory=f`` is syntactic sugar for ``default=attr.Factory(f)``.
- .. versionadded:: 18.2.0 *kw_only*
- """
- if hash is not None and hash is not True and hash is not False:
- raise TypeError(
- "Invalid value for hash. Must be True, False, or None."
- )
-
- if convert is not None:
- if converter is not None:
- raise RuntimeError(
- "Can't pass both `convert` and `converter`. "
- "Please use `converter` only."
- )
- warnings.warn(
- "The `convert` argument is deprecated in favor of `converter`. "
- "It will be removed after 2019/01.",
- DeprecationWarning,
- stacklevel=2,
- )
- converter = convert
-
- if factory is not None:
- if default is not NOTHING:
- raise ValueError(
- "The `default` and `factory` arguments are mutually "
- "exclusive."
- )
- if not callable(factory):
- raise ValueError("The `factory` argument must be a callable.")
- default = Factory(factory)
-
- if metadata is None:
- metadata = {}
-
- return _CountingAttr(
- default=default,
- validator=validator,
- repr=repr,
- cmp=cmp,
- hash=hash,
- init=init,
- converter=converter,
- metadata=metadata,
- type=type,
- kw_only=kw_only,
- )
-
-
-def _make_attr_tuple_class(cls_name, attr_names):
- """
- Create a tuple subclass to hold `Attribute`s for an `attrs` class.
-
- The subclass is a bare tuple with properties for names.
-
- class MyClassAttributes(tuple):
- __slots__ = ()
- x = property(itemgetter(0))
- """
- attr_class_name = "{}Attributes".format(cls_name)
- attr_class_template = [
- "class {}(tuple):".format(attr_class_name),
- " __slots__ = ()",
- ]
- if attr_names:
- for i, attr_name in enumerate(attr_names):
- attr_class_template.append(
- _tuple_property_pat.format(index=i, attr_name=attr_name)
- )
- else:
- attr_class_template.append(" pass")
- globs = {"_attrs_itemgetter": itemgetter, "_attrs_property": property}
- eval(compile("\n".join(attr_class_template), "", "exec"), globs)
-
- return globs[attr_class_name]
-
-
-# Tuple class for extracted attributes from a class definition.
-# `base_attrs` is a subset of `attrs`.
-_Attributes = _make_attr_tuple_class(
- "_Attributes",
- [
- # all attributes to build dunder methods for
- "attrs",
- # attributes that have been inherited
- "base_attrs",
- # map inherited attributes to their originating classes
- "base_attrs_map",
- ],
-)
-
-
-def _is_class_var(annot):
- """
- Check whether *annot* is a typing.ClassVar.
-
- The string comparison hack is used to avoid evaluating all string
- annotations which would put attrs-based classes at a performance
- disadvantage compared to plain old classes.
- """
- return str(annot).startswith(_classvar_prefixes)
-
-
-def _get_annotations(cls):
- """
- Get annotations for *cls*.
- """
- anns = getattr(cls, "__annotations__", None)
- if anns is None:
- return {}
-
- # Verify that the annotations aren't merely inherited.
- for base_cls in cls.__mro__[1:]:
- if anns is getattr(base_cls, "__annotations__", None):
- return {}
-
- return anns
-
-
-def _counter_getter(e):
- """
- Key function for sorting to avoid re-creating a lambda for every class.
- """
- return e[1].counter
-
-
-def _transform_attrs(cls, these, auto_attribs, kw_only):
- """
- Transform all `_CountingAttr`s on a class into `Attribute`s.
-
- If *these* is passed, use that and don't look for them on the class.
-
- Return an `_Attributes`.
- """
- cd = cls.__dict__
- anns = _get_annotations(cls)
-
- if these is not None:
- ca_list = [(name, ca) for name, ca in iteritems(these)]
-
- if not isinstance(these, ordered_dict):
- ca_list.sort(key=_counter_getter)
- elif auto_attribs is True:
- ca_names = {
- name
- for name, attr in cd.items()
- if isinstance(attr, _CountingAttr)
- }
- ca_list = []
- annot_names = set()
- for attr_name, type in anns.items():
- if _is_class_var(type):
- continue
- annot_names.add(attr_name)
- a = cd.get(attr_name, NOTHING)
- if not isinstance(a, _CountingAttr):
- if a is NOTHING:
- a = attrib()
- else:
- a = attrib(default=a)
- ca_list.append((attr_name, a))
-
- unannotated = ca_names - annot_names
- if len(unannotated) > 0:
- raise UnannotatedAttributeError(
- "The following `attr.ib`s lack a type annotation: "
- + ", ".join(
- sorted(unannotated, key=lambda n: cd.get(n).counter)
- )
- + "."
- )
- else:
- ca_list = sorted(
- (
- (name, attr)
- for name, attr in cd.items()
- if isinstance(attr, _CountingAttr)
- ),
- key=lambda e: e[1].counter,
- )
-
- own_attrs = [
- Attribute.from_counting_attr(
- name=attr_name, ca=ca, type=anns.get(attr_name)
- )
- for attr_name, ca in ca_list
- ]
-
- base_attrs = []
- base_attr_map = {} # A dictionary of base attrs to their classes.
- taken_attr_names = {a.name: a for a in own_attrs}
-
- # Traverse the MRO and collect attributes.
- for base_cls in cls.__mro__[1:-1]:
- sub_attrs = getattr(base_cls, "__attrs_attrs__", None)
- if sub_attrs is not None:
- for a in sub_attrs:
- prev_a = taken_attr_names.get(a.name)
- # Only add an attribute if it hasn't been defined before. This
- # allows for overwriting attribute definitions by subclassing.
- if prev_a is None:
- base_attrs.append(a)
- taken_attr_names[a.name] = a
- base_attr_map[a.name] = base_cls
-
- attr_names = [a.name for a in base_attrs + own_attrs]
-
- AttrsClass = _make_attr_tuple_class(cls.__name__, attr_names)
-
- if kw_only:
- own_attrs = [a._assoc(kw_only=True) for a in own_attrs]
- base_attrs = [a._assoc(kw_only=True) for a in base_attrs]
-
- attrs = AttrsClass(base_attrs + own_attrs)
-
- had_default = False
- was_kw_only = False
- for a in attrs:
- if (
- was_kw_only is False
- and had_default is True
- and a.default is NOTHING
- and a.init is True
- and a.kw_only is False
- ):
- raise ValueError(
- "No mandatory attributes allowed after an attribute with a "
- "default value or factory. Attribute in question: %r" % (a,)
- )
- elif (
- had_default is False
- and a.default is not NOTHING
- and a.init is not False
- and
- # Keyword-only attributes without defaults can be specified
- # after keyword-only attributes with defaults.
- a.kw_only is False
- ):
- had_default = True
- if was_kw_only is True and a.kw_only is False:
- raise ValueError(
- "Non keyword-only attributes are not allowed after a "
- "keyword-only attribute. Attribute in question: {a!r}".format(
- a=a
- )
- )
- if was_kw_only is False and a.init is True and a.kw_only is True:
- was_kw_only = True
-
- return _Attributes((attrs, base_attrs, base_attr_map))
-
-
-def _frozen_setattrs(self, name, value):
- """
- Attached to frozen classes as __setattr__.
- """
- raise FrozenInstanceError()
-
-
-def _frozen_delattrs(self, name):
- """
- Attached to frozen classes as __delattr__.
- """
- raise FrozenInstanceError()
-
-
-class _ClassBuilder(object):
- """
- Iteratively build *one* class.
- """
-
- __slots__ = (
- "_cls",
- "_cls_dict",
- "_attrs",
- "_base_names",
- "_attr_names",
- "_slots",
- "_frozen",
- "_weakref_slot",
- "_cache_hash",
- "_has_post_init",
- "_delete_attribs",
- "_base_attr_map",
- )
-
- def __init__(
- self,
- cls,
- these,
- slots,
- frozen,
- weakref_slot,
- auto_attribs,
- kw_only,
- cache_hash,
- ):
- attrs, base_attrs, base_map = _transform_attrs(
- cls, these, auto_attribs, kw_only
- )
-
- self._cls = cls
- self._cls_dict = dict(cls.__dict__) if slots else {}
- self._attrs = attrs
- self._base_names = set(a.name for a in base_attrs)
- self._base_attr_map = base_map
- self._attr_names = tuple(a.name for a in attrs)
- self._slots = slots
- self._frozen = frozen or _has_frozen_base_class(cls)
- self._weakref_slot = weakref_slot
- self._cache_hash = cache_hash
- self._has_post_init = bool(getattr(cls, "__attrs_post_init__", False))
- self._delete_attribs = not bool(these)
-
- self._cls_dict["__attrs_attrs__"] = self._attrs
-
- if frozen:
- self._cls_dict["__setattr__"] = _frozen_setattrs
- self._cls_dict["__delattr__"] = _frozen_delattrs
-
- def __repr__(self):
- return "<_ClassBuilder(cls={cls})>".format(cls=self._cls.__name__)
-
- def build_class(self):
- """
- Finalize class based on the accumulated configuration.
-
- Builder cannot be used after calling this method.
- """
- if self._slots is True:
- return self._create_slots_class()
- else:
- return self._patch_original_class()
-
- def _patch_original_class(self):
- """
- Apply accumulated methods and return the class.
- """
- cls = self._cls
- base_names = self._base_names
-
- # Clean class of attribute definitions (`attr.ib()`s).
- if self._delete_attribs:
- for name in self._attr_names:
- if (
- name not in base_names
- and getattr(cls, name, None) is not None
- ):
- try:
- delattr(cls, name)
- except AttributeError:
- # This can happen if a base class defines a class
- # variable and we want to set an attribute with the
- # same name by using only a type annotation.
- pass
-
- # Attach our dunder methods.
- for name, value in self._cls_dict.items():
- setattr(cls, name, value)
-
- return cls
-
- def _create_slots_class(self):
- """
- Build and return a new class with a `__slots__` attribute.
- """
- base_names = self._base_names
- cd = {
- k: v
- for k, v in iteritems(self._cls_dict)
- if k not in tuple(self._attr_names) + ("__dict__", "__weakref__")
- }
-
- weakref_inherited = False
-
- # Traverse the MRO to check for an existing __weakref__.
- for base_cls in self._cls.__mro__[1:-1]:
- if "__weakref__" in getattr(base_cls, "__dict__", ()):
- weakref_inherited = True
- break
-
- names = self._attr_names
- if (
- self._weakref_slot
- and "__weakref__" not in getattr(self._cls, "__slots__", ())
- and "__weakref__" not in names
- and not weakref_inherited
- ):
- names += ("__weakref__",)
-
- # We only add the names of attributes that aren't inherited.
- # Settings __slots__ to inherited attributes wastes memory.
- slot_names = [name for name in names if name not in base_names]
- if self._cache_hash:
- slot_names.append(_hash_cache_field)
- cd["__slots__"] = tuple(slot_names)
-
- qualname = getattr(self._cls, "__qualname__", None)
- if qualname is not None:
- cd["__qualname__"] = qualname
-
- # __weakref__ is not writable.
- state_attr_names = tuple(
- an for an in self._attr_names if an != "__weakref__"
- )
-
- def slots_getstate(self):
- """
- Automatically created by attrs.
- """
- return tuple(getattr(self, name) for name in state_attr_names)
-
- def slots_setstate(self, state):
- """
- Automatically created by attrs.
- """
- __bound_setattr = _obj_setattr.__get__(self, Attribute)
- for name, value in zip(state_attr_names, state):
- __bound_setattr(name, value)
-
- # slots and frozen require __getstate__/__setstate__ to work
- cd["__getstate__"] = slots_getstate
- cd["__setstate__"] = slots_setstate
-
- # Create new class based on old class and our methods.
- cls = type(self._cls)(self._cls.__name__, self._cls.__bases__, cd)
-
- # The following is a fix for
- # https://github.com/python-attrs/attrs/issues/102. On Python 3,
- # if a method mentions `__class__` or uses the no-arg super(), the
- # compiler will bake a reference to the class in the method itself
- # as `method.__closure__`. Since we replace the class with a
- # clone, we rewrite these references so it keeps working.
- for item in cls.__dict__.values():
- if isinstance(item, (classmethod, staticmethod)):
- # Class- and staticmethods hide their functions inside.
- # These might need to be rewritten as well.
- closure_cells = getattr(item.__func__, "__closure__", None)
- else:
- closure_cells = getattr(item, "__closure__", None)
-
- if not closure_cells: # Catch None or the empty list.
- continue
- for cell in closure_cells:
- if cell.cell_contents is self._cls:
- set_closure_cell(cell, cls)
-
- return cls
-
- def add_repr(self, ns):
- self._cls_dict["__repr__"] = self._add_method_dunders(
- _make_repr(self._attrs, ns=ns)
- )
- return self
-
- def add_str(self):
- repr = self._cls_dict.get("__repr__")
- if repr is None:
- raise ValueError(
- "__str__ can only be generated if a __repr__ exists."
- )
-
- def __str__(self):
- return self.__repr__()
-
- self._cls_dict["__str__"] = self._add_method_dunders(__str__)
- return self
-
- def make_unhashable(self):
- self._cls_dict["__hash__"] = None
- return self
-
- def add_hash(self):
- self._cls_dict["__hash__"] = self._add_method_dunders(
- _make_hash(
- self._attrs, frozen=self._frozen, cache_hash=self._cache_hash
- )
- )
-
- return self
-
- def add_init(self):
- self._cls_dict["__init__"] = self._add_method_dunders(
- _make_init(
- self._attrs,
- self._has_post_init,
- self._frozen,
- self._slots,
- self._cache_hash,
- self._base_attr_map,
- )
- )
-
- return self
-
- def add_cmp(self):
- cd = self._cls_dict
-
- cd["__eq__"], cd["__ne__"], cd["__lt__"], cd["__le__"], cd[
- "__gt__"
- ], cd["__ge__"] = (
- self._add_method_dunders(meth) for meth in _make_cmp(self._attrs)
- )
-
- return self
-
- def _add_method_dunders(self, method):
- """
- Add __module__ and __qualname__ to a *method* if possible.
- """
- try:
- method.__module__ = self._cls.__module__
- except AttributeError:
- pass
-
- try:
- method.__qualname__ = ".".join(
- (self._cls.__qualname__, method.__name__)
- )
- except AttributeError:
- pass
-
- return method
-
-
-def attrs(
- maybe_cls=None,
- these=None,
- repr_ns=None,
- repr=True,
- cmp=True,
- hash=None,
- init=True,
- slots=False,
- frozen=False,
- weakref_slot=True,
- str=False,
- auto_attribs=False,
- kw_only=False,
- cache_hash=False,
-):
- r"""
- A class decorator that adds `dunder
- `_\ -methods according to the
- specified attributes using :func:`attr.ib` or the *these* argument.
-
- :param these: A dictionary of name to :func:`attr.ib` mappings. This is
- useful to avoid the definition of your attributes within the class body
- because you can't (e.g. if you want to add ``__repr__`` methods to
- Django models) or don't want to.
-
- If *these* is not ``None``, ``attrs`` will *not* search the class body
- for attributes and will *not* remove any attributes from it.
-
- If *these* is an ordered dict (:class:`dict` on Python 3.6+,
- :class:`collections.OrderedDict` otherwise), the order is deduced from
- the order of the attributes inside *these*. Otherwise the order
- of the definition of the attributes is used.
-
- :type these: :class:`dict` of :class:`str` to :func:`attr.ib`
-
- :param str repr_ns: When using nested classes, there's no way in Python 2
- to automatically detect that. Therefore it's possible to set the
- namespace explicitly for a more meaningful ``repr`` output.
- :param bool repr: Create a ``__repr__`` method with a human readable
- representation of ``attrs`` attributes..
- :param bool str: Create a ``__str__`` method that is identical to
- ``__repr__``. This is usually not necessary except for
- :class:`Exception`\ s.
- :param bool cmp: Create ``__eq__``, ``__ne__``, ``__lt__``, ``__le__``,
- ``__gt__``, and ``__ge__`` methods that compare the class as if it were
- a tuple of its ``attrs`` attributes. But the attributes are *only*
- compared, if the types of both classes are *identical*!
- :param hash: If ``None`` (default), the ``__hash__`` method is generated
- according how *cmp* and *frozen* are set.
-
- 1. If *both* are True, ``attrs`` will generate a ``__hash__`` for you.
- 2. If *cmp* is True and *frozen* is False, ``__hash__`` will be set to
- None, marking it unhashable (which it is).
- 3. If *cmp* is False, ``__hash__`` will be left untouched meaning the
- ``__hash__`` method of the base class will be used (if base class is
- ``object``, this means it will fall back to id-based hashing.).
-
- Although not recommended, you can decide for yourself and force
- ``attrs`` to create one (e.g. if the class is immutable even though you
- didn't freeze it programmatically) by passing ``True`` or not. Both of
- these cases are rather special and should be used carefully.
-
- See the `Python documentation \
- `_
- and the `GitHub issue that led to the default behavior \
- `_ for more details.
- :type hash: ``bool`` or ``None``
- :param bool init: Create a ``__init__`` method that initializes the
- ``attrs`` attributes. Leading underscores are stripped for the
- argument name. If a ``__attrs_post_init__`` method exists on the
- class, it will be called after the class is fully initialized.
- :param bool slots: Create a slots_-style class that's more
- memory-efficient. See :ref:`slots` for further ramifications.
- :param bool frozen: Make instances immutable after initialization. If
- someone attempts to modify a frozen instance,
- :exc:`attr.exceptions.FrozenInstanceError` is raised.
-
- Please note:
-
- 1. This is achieved by installing a custom ``__setattr__`` method
- on your class so you can't implement an own one.
-
- 2. True immutability is impossible in Python.
-
- 3. This *does* have a minor a runtime performance :ref:`impact
- ` when initializing new instances. In other words:
- ``__init__`` is slightly slower with ``frozen=True``.
-
- 4. If a class is frozen, you cannot modify ``self`` in
- ``__attrs_post_init__`` or a self-written ``__init__``. You can
- circumvent that limitation by using
- ``object.__setattr__(self, "attribute_name", value)``.
-
- .. _slots: https://docs.python.org/3/reference/datamodel.html#slots
- :param bool weakref_slot: Make instances weak-referenceable. This has no
- effect unless ``slots`` is also enabled.
- :param bool auto_attribs: If True, collect `PEP 526`_-annotated attributes
- (Python 3.6 and later only) from the class body.
-
- In this case, you **must** annotate every field. If ``attrs``
- encounters a field that is set to an :func:`attr.ib` but lacks a type
- annotation, an :exc:`attr.exceptions.UnannotatedAttributeError` is
- raised. Use ``field_name: typing.Any = attr.ib(...)`` if you don't
- want to set a type.
-
- If you assign a value to those attributes (e.g. ``x: int = 42``), that
- value becomes the default value like if it were passed using
- ``attr.ib(default=42)``. Passing an instance of :class:`Factory` also
- works as expected.
-
- Attributes annotated as :data:`typing.ClassVar` are **ignored**.
-
- .. _`PEP 526`: https://www.python.org/dev/peps/pep-0526/
- :param bool kw_only: Make all attributes keyword-only (Python 3+)
- in the generated ``__init__`` (if ``init`` is ``False``, this
- parameter is ignored).
- :param bool cache_hash: Ensure that the object's hash code is computed
- only once and stored on the object. If this is set to ``True``,
- hashing must be either explicitly or implicitly enabled for this
- class. If the hash code is cached, then no attributes of this
- class which participate in hash code computation may be mutated
- after object creation.
-
-
- .. versionadded:: 16.0.0 *slots*
- .. versionadded:: 16.1.0 *frozen*
- .. versionadded:: 16.3.0 *str*
- .. versionadded:: 16.3.0 Support for ``__attrs_post_init__``.
- .. versionchanged:: 17.1.0
- *hash* supports ``None`` as value which is also the default now.
- .. versionadded:: 17.3.0 *auto_attribs*
- .. versionchanged:: 18.1.0
- If *these* is passed, no attributes are deleted from the class body.
- .. versionchanged:: 18.1.0 If *these* is ordered, the order is retained.
- .. versionadded:: 18.2.0 *weakref_slot*
- .. deprecated:: 18.2.0
- ``__lt__``, ``__le__``, ``__gt__``, and ``__ge__`` now raise a
- :class:`DeprecationWarning` if the classes compared are subclasses of
- each other. ``__eq`` and ``__ne__`` never tried to compared subclasses
- to each other.
- .. versionadded:: 18.2.0 *kw_only*
- .. versionadded:: 18.2.0 *cache_hash*
- """
-
- def wrap(cls):
- if getattr(cls, "__class__", None) is None:
- raise TypeError("attrs only works with new-style classes.")
-
- builder = _ClassBuilder(
- cls,
- these,
- slots,
- frozen,
- weakref_slot,
- auto_attribs,
- kw_only,
- cache_hash,
- )
-
- if repr is True:
- builder.add_repr(repr_ns)
- if str is True:
- builder.add_str()
- if cmp is True:
- builder.add_cmp()
-
- if hash is not True and hash is not False and hash is not None:
- # Can't use `hash in` because 1 == True for example.
- raise TypeError(
- "Invalid value for hash. Must be True, False, or None."
- )
- elif hash is False or (hash is None and cmp is False):
- if cache_hash:
- raise TypeError(
- "Invalid value for cache_hash. To use hash caching,"
- " hashing must be either explicitly or implicitly "
- "enabled."
- )
- elif hash is True or (hash is None and cmp is True and frozen is True):
- builder.add_hash()
- else:
- if cache_hash:
- raise TypeError(
- "Invalid value for cache_hash. To use hash caching,"
- " hashing must be either explicitly or implicitly "
- "enabled."
- )
- builder.make_unhashable()
-
- if init is True:
- builder.add_init()
- else:
- if cache_hash:
- raise TypeError(
- "Invalid value for cache_hash. To use hash caching,"
- " init must be True."
- )
-
- return builder.build_class()
-
- # maybe_cls's type depends on the usage of the decorator. It's a class
- # if it's used as `@attrs` but ``None`` if used as `@attrs()`.
- if maybe_cls is None:
- return wrap
- else:
- return wrap(maybe_cls)
-
-
-_attrs = attrs
-"""
-Internal alias so we can use it in functions that take an argument called
-*attrs*.
-"""
-
-
-if PY2:
-
- def _has_frozen_base_class(cls):
- """
- Check whether *cls* has a frozen ancestor by looking at its
- __setattr__.
- """
- return (
- getattr(cls.__setattr__, "__module__", None)
- == _frozen_setattrs.__module__
- and cls.__setattr__.__name__ == _frozen_setattrs.__name__
- )
-
-
-else:
-
- def _has_frozen_base_class(cls):
- """
- Check whether *cls* has a frozen ancestor by looking at its
- __setattr__.
- """
- return cls.__setattr__ == _frozen_setattrs
-
-
-def _attrs_to_tuple(obj, attrs):
- """
- Create a tuple of all values of *obj*'s *attrs*.
- """
- return tuple(getattr(obj, a.name) for a in attrs)
-
-
-def _make_hash(attrs, frozen, cache_hash):
- attrs = tuple(
- a
- for a in attrs
- if a.hash is True or (a.hash is None and a.cmp is True)
- )
-
- tab = " "
-
- # We cache the generated hash methods for the same kinds of attributes.
- sha1 = hashlib.sha1()
- sha1.update(repr(attrs).encode("utf-8"))
- unique_filename = "" % (sha1.hexdigest(),)
- type_hash = hash(unique_filename)
-
- method_lines = ["def __hash__(self):"]
-
- def append_hash_computation_lines(prefix, indent):
- """
- Generate the code for actually computing the hash code.
- Below this will either be returned directly or used to compute
- a value which is then cached, depending on the value of cache_hash
- """
- method_lines.extend(
- [indent + prefix + "hash((", indent + " %d," % (type_hash,)]
- )
-
- for a in attrs:
- method_lines.append(indent + " self.%s," % a.name)
-
- method_lines.append(indent + " ))")
-
- if cache_hash:
- method_lines.append(tab + "if self.%s is None:" % _hash_cache_field)
- if frozen:
- append_hash_computation_lines(
- "object.__setattr__(self, '%s', " % _hash_cache_field, tab * 2
- )
- method_lines.append(tab * 2 + ")") # close __setattr__
- else:
- append_hash_computation_lines(
- "self.%s = " % _hash_cache_field, tab * 2
- )
- method_lines.append(tab + "return self.%s" % _hash_cache_field)
- else:
- append_hash_computation_lines("return ", tab)
-
- script = "\n".join(method_lines)
- globs = {}
- locs = {}
- bytecode = compile(script, unique_filename, "exec")
- eval(bytecode, globs, locs)
-
- # In order of debuggers like PDB being able to step through the code,
- # we add a fake linecache entry.
- linecache.cache[unique_filename] = (
- len(script),
- None,
- script.splitlines(True),
- unique_filename,
- )
-
- return locs["__hash__"]
-
-
-def _add_hash(cls, attrs):
- """
- Add a hash method to *cls*.
- """
- cls.__hash__ = _make_hash(attrs, frozen=False, cache_hash=False)
- return cls
-
-
-def __ne__(self, other):
- """
- Check equality and either forward a NotImplemented or return the result
- negated.
- """
- result = self.__eq__(other)
- if result is NotImplemented:
- return NotImplemented
-
- return not result
-
-
-WARNING_CMP_ISINSTANCE = (
- "Comparision of subclasses using __%s__ is deprecated and will be removed "
- "in 2019."
-)
-
-
-def _make_cmp(attrs):
- attrs = [a for a in attrs if a.cmp]
-
- # We cache the generated eq methods for the same kinds of attributes.
- sha1 = hashlib.sha1()
- sha1.update(repr(attrs).encode("utf-8"))
- unique_filename = "" % (sha1.hexdigest(),)
- lines = [
- "def __eq__(self, other):",
- " if other.__class__ is not self.__class__:",
- " return NotImplemented",
- ]
- # We can't just do a big self.x = other.x and... clause due to
- # irregularities like nan == nan is false but (nan,) == (nan,) is true.
- if attrs:
- lines.append(" return (")
- others = [" ) == ("]
- for a in attrs:
- lines.append(" self.%s," % (a.name,))
- others.append(" other.%s," % (a.name,))
-
- lines += others + [" )"]
- else:
- lines.append(" return True")
-
- script = "\n".join(lines)
- globs = {}
- locs = {}
- bytecode = compile(script, unique_filename, "exec")
- eval(bytecode, globs, locs)
-
- # In order of debuggers like PDB being able to step through the code,
- # we add a fake linecache entry.
- linecache.cache[unique_filename] = (
- len(script),
- None,
- script.splitlines(True),
- unique_filename,
- )
- eq = locs["__eq__"]
- ne = __ne__
-
- def attrs_to_tuple(obj):
- """
- Save us some typing.
- """
- return _attrs_to_tuple(obj, attrs)
-
- def __lt__(self, other):
- """
- Automatically created by attrs.
- """
- if isinstance(other, self.__class__):
- if other.__class__ is not self.__class__:
- warnings.warn(
- WARNING_CMP_ISINSTANCE % ("lt",), DeprecationWarning
- )
- return attrs_to_tuple(self) < attrs_to_tuple(other)
- else:
- return NotImplemented
-
- def __le__(self, other):
- """
- Automatically created by attrs.
- """
- if isinstance(other, self.__class__):
- if other.__class__ is not self.__class__:
- warnings.warn(
- WARNING_CMP_ISINSTANCE % ("le",), DeprecationWarning
- )
- return attrs_to_tuple(self) <= attrs_to_tuple(other)
- else:
- return NotImplemented
-
- def __gt__(self, other):
- """
- Automatically created by attrs.
- """
- if isinstance(other, self.__class__):
- if other.__class__ is not self.__class__:
- warnings.warn(
- WARNING_CMP_ISINSTANCE % ("gt",), DeprecationWarning
- )
- return attrs_to_tuple(self) > attrs_to_tuple(other)
- else:
- return NotImplemented
-
- def __ge__(self, other):
- """
- Automatically created by attrs.
- """
- if isinstance(other, self.__class__):
- if other.__class__ is not self.__class__:
- warnings.warn(
- WARNING_CMP_ISINSTANCE % ("ge",), DeprecationWarning
- )
- return attrs_to_tuple(self) >= attrs_to_tuple(other)
- else:
- return NotImplemented
-
- return eq, ne, __lt__, __le__, __gt__, __ge__
-
-
-def _add_cmp(cls, attrs=None):
- """
- Add comparison methods to *cls*.
- """
- if attrs is None:
- attrs = cls.__attrs_attrs__
-
- cls.__eq__, cls.__ne__, cls.__lt__, cls.__le__, cls.__gt__, cls.__ge__ = _make_cmp( # noqa
- attrs
- )
-
- return cls
-
-
-_already_repring = threading.local()
-
-
-def _make_repr(attrs, ns):
- """
- Make a repr method for *attr_names* adding *ns* to the full name.
- """
- attr_names = tuple(a.name for a in attrs if a.repr)
-
- def __repr__(self):
- """
- Automatically created by attrs.
- """
- try:
- working_set = _already_repring.working_set
- except AttributeError:
- working_set = set()
- _already_repring.working_set = working_set
-
- if id(self) in working_set:
- return "..."
- real_cls = self.__class__
- if ns is None:
- qualname = getattr(real_cls, "__qualname__", None)
- if qualname is not None:
- class_name = qualname.rsplit(">.", 1)[-1]
- else:
- class_name = real_cls.__name__
- else:
- class_name = ns + "." + real_cls.__name__
-
- # Since 'self' remains on the stack (i.e.: strongly referenced) for the
- # duration of this call, it's safe to depend on id(...) stability, and
- # not need to track the instance and therefore worry about properties
- # like weakref- or hash-ability.
- working_set.add(id(self))
- try:
- result = [class_name, "("]
- first = True
- for name in attr_names:
- if first:
- first = False
- else:
- result.append(", ")
- result.extend((name, "=", repr(getattr(self, name, NOTHING))))
- return "".join(result) + ")"
- finally:
- working_set.remove(id(self))
-
- return __repr__
-
-
-def _add_repr(cls, ns=None, attrs=None):
- """
- Add a repr method to *cls*.
- """
- if attrs is None:
- attrs = cls.__attrs_attrs__
-
- cls.__repr__ = _make_repr(attrs, ns)
- return cls
-
-
-def _make_init(attrs, post_init, frozen, slots, cache_hash, base_attr_map):
- attrs = [a for a in attrs if a.init or a.default is not NOTHING]
-
- # We cache the generated init methods for the same kinds of attributes.
- sha1 = hashlib.sha1()
- sha1.update(repr(attrs).encode("utf-8"))
- unique_filename = "".format(sha1.hexdigest())
-
- script, globs, annotations = _attrs_to_init_script(
- attrs, frozen, slots, post_init, cache_hash, base_attr_map
- )
- locs = {}
- bytecode = compile(script, unique_filename, "exec")
- attr_dict = dict((a.name, a) for a in attrs)
- globs.update({"NOTHING": NOTHING, "attr_dict": attr_dict})
- if frozen is True:
- # Save the lookup overhead in __init__ if we need to circumvent
- # immutability.
- globs["_cached_setattr"] = _obj_setattr
- eval(bytecode, globs, locs)
-
- # In order of debuggers like PDB being able to step through the code,
- # we add a fake linecache entry.
- linecache.cache[unique_filename] = (
- len(script),
- None,
- script.splitlines(True),
- unique_filename,
- )
-
- __init__ = locs["__init__"]
- __init__.__annotations__ = annotations
- return __init__
-
-
-def _add_init(cls, frozen):
- """
- Add a __init__ method to *cls*. If *frozen* is True, make it immutable.
- """
- cls.__init__ = _make_init(
- cls.__attrs_attrs__,
- getattr(cls, "__attrs_post_init__", False),
- frozen,
- _is_slot_cls(cls),
- cache_hash=False,
- base_attr_map={},
- )
- return cls
-
-
-def fields(cls):
- """
- Return the tuple of ``attrs`` attributes for a class.
-
- The tuple also allows accessing the fields by their names (see below for
- examples).
-
- :param type cls: Class to introspect.
-
- :raise TypeError: If *cls* is not a class.
- :raise attr.exceptions.NotAnAttrsClassError: If *cls* is not an ``attrs``
- class.
-
- :rtype: tuple (with name accessors) of :class:`attr.Attribute`
-
- .. versionchanged:: 16.2.0 Returned tuple allows accessing the fields
- by name.
- """
- if not isclass(cls):
- raise TypeError("Passed object must be a class.")
- attrs = getattr(cls, "__attrs_attrs__", None)
- if attrs is None:
- raise NotAnAttrsClassError(
- "{cls!r} is not an attrs-decorated class.".format(cls=cls)
- )
- return attrs
-
-
-def fields_dict(cls):
- """
- Return an ordered dictionary of ``attrs`` attributes for a class, whose
- keys are the attribute names.
-
- :param type cls: Class to introspect.
-
- :raise TypeError: If *cls* is not a class.
- :raise attr.exceptions.NotAnAttrsClassError: If *cls* is not an ``attrs``
- class.
-
- :rtype: an ordered dict where keys are attribute names and values are
- :class:`attr.Attribute`\\ s. This will be a :class:`dict` if it's
- naturally ordered like on Python 3.6+ or an
- :class:`~collections.OrderedDict` otherwise.
-
- .. versionadded:: 18.1.0
- """
- if not isclass(cls):
- raise TypeError("Passed object must be a class.")
- attrs = getattr(cls, "__attrs_attrs__", None)
- if attrs is None:
- raise NotAnAttrsClassError(
- "{cls!r} is not an attrs-decorated class.".format(cls=cls)
- )
- return ordered_dict(((a.name, a) for a in attrs))
-
-
-def validate(inst):
- """
- Validate all attributes on *inst* that have a validator.
-
- Leaves all exceptions through.
-
- :param inst: Instance of a class with ``attrs`` attributes.
- """
- if _config._run_validators is False:
- return
-
- for a in fields(inst.__class__):
- v = a.validator
- if v is not None:
- v(inst, a, getattr(inst, a.name))
-
-
-def _is_slot_cls(cls):
- return "__slots__" in cls.__dict__
-
-
-def _is_slot_attr(a_name, base_attr_map):
- """
- Check if the attribute name comes from a slot class.
- """
- return a_name in base_attr_map and _is_slot_cls(base_attr_map[a_name])
-
-
-def _attrs_to_init_script(
- attrs, frozen, slots, post_init, cache_hash, base_attr_map
-):
- """
- Return a script of an initializer for *attrs* and a dict of globals.
-
- The globals are expected by the generated script.
-
- If *frozen* is True, we cannot set the attributes directly so we use
- a cached ``object.__setattr__``.
- """
- lines = []
- any_slot_ancestors = any(
- _is_slot_attr(a.name, base_attr_map) for a in attrs
- )
- if frozen is True:
- if slots is True:
- lines.append(
- # Circumvent the __setattr__ descriptor to save one lookup per
- # assignment.
- # Note _setattr will be used again below if cache_hash is True
- "_setattr = _cached_setattr.__get__(self, self.__class__)"
- )
-
- def fmt_setter(attr_name, value_var):
- return "_setattr('%(attr_name)s', %(value_var)s)" % {
- "attr_name": attr_name,
- "value_var": value_var,
- }
-
- def fmt_setter_with_converter(attr_name, value_var):
- conv_name = _init_converter_pat.format(attr_name)
- return "_setattr('%(attr_name)s', %(conv)s(%(value_var)s))" % {
- "attr_name": attr_name,
- "value_var": value_var,
- "conv": conv_name,
- }
-
- else:
- # Dict frozen classes assign directly to __dict__.
- # But only if the attribute doesn't come from an ancestor slot
- # class.
- # Note _inst_dict will be used again below if cache_hash is True
- lines.append("_inst_dict = self.__dict__")
- if any_slot_ancestors:
- lines.append(
- # Circumvent the __setattr__ descriptor to save one lookup
- # per assignment.
- "_setattr = _cached_setattr.__get__(self, self.__class__)"
- )
-
- def fmt_setter(attr_name, value_var):
- if _is_slot_attr(attr_name, base_attr_map):
- res = "_setattr('%(attr_name)s', %(value_var)s)" % {
- "attr_name": attr_name,
- "value_var": value_var,
- }
- else:
- res = "_inst_dict['%(attr_name)s'] = %(value_var)s" % {
- "attr_name": attr_name,
- "value_var": value_var,
- }
- return res
-
- def fmt_setter_with_converter(attr_name, value_var):
- conv_name = _init_converter_pat.format(attr_name)
- if _is_slot_attr(attr_name, base_attr_map):
- tmpl = "_setattr('%(attr_name)s', %(c)s(%(value_var)s))"
- else:
- tmpl = "_inst_dict['%(attr_name)s'] = %(c)s(%(value_var)s)"
- return tmpl % {
- "attr_name": attr_name,
- "value_var": value_var,
- "c": conv_name,
- }
-
- else:
- # Not frozen.
- def fmt_setter(attr_name, value):
- return "self.%(attr_name)s = %(value)s" % {
- "attr_name": attr_name,
- "value": value,
- }
-
- def fmt_setter_with_converter(attr_name, value_var):
- conv_name = _init_converter_pat.format(attr_name)
- return "self.%(attr_name)s = %(conv)s(%(value_var)s)" % {
- "attr_name": attr_name,
- "value_var": value_var,
- "conv": conv_name,
- }
-
- args = []
- kw_only_args = []
- attrs_to_validate = []
-
- # This is a dictionary of names to validator and converter callables.
- # Injecting this into __init__ globals lets us avoid lookups.
- names_for_globals = {}
- annotations = {"return": None}
-
- for a in attrs:
- if a.validator:
- attrs_to_validate.append(a)
- attr_name = a.name
- arg_name = a.name.lstrip("_")
- has_factory = isinstance(a.default, Factory)
- if has_factory and a.default.takes_self:
- maybe_self = "self"
- else:
- maybe_self = ""
- if a.init is False:
- if has_factory:
- init_factory_name = _init_factory_pat.format(a.name)
- if a.converter is not None:
- lines.append(
- fmt_setter_with_converter(
- attr_name,
- init_factory_name + "({0})".format(maybe_self),
- )
- )
- conv_name = _init_converter_pat.format(a.name)
- names_for_globals[conv_name] = a.converter
- else:
- lines.append(
- fmt_setter(
- attr_name,
- init_factory_name + "({0})".format(maybe_self),
- )
- )
- names_for_globals[init_factory_name] = a.default.factory
- else:
- if a.converter is not None:
- lines.append(
- fmt_setter_with_converter(
- attr_name,
- "attr_dict['{attr_name}'].default".format(
- attr_name=attr_name
- ),
- )
- )
- conv_name = _init_converter_pat.format(a.name)
- names_for_globals[conv_name] = a.converter
- else:
- lines.append(
- fmt_setter(
- attr_name,
- "attr_dict['{attr_name}'].default".format(
- attr_name=attr_name
- ),
- )
- )
- elif a.default is not NOTHING and not has_factory:
- arg = "{arg_name}=attr_dict['{attr_name}'].default".format(
- arg_name=arg_name, attr_name=attr_name
- )
- if a.kw_only:
- kw_only_args.append(arg)
- else:
- args.append(arg)
- if a.converter is not None:
- lines.append(fmt_setter_with_converter(attr_name, arg_name))
- names_for_globals[
- _init_converter_pat.format(a.name)
- ] = a.converter
- else:
- lines.append(fmt_setter(attr_name, arg_name))
- elif has_factory:
- arg = "{arg_name}=NOTHING".format(arg_name=arg_name)
- if a.kw_only:
- kw_only_args.append(arg)
- else:
- args.append(arg)
- lines.append(
- "if {arg_name} is not NOTHING:".format(arg_name=arg_name)
- )
- init_factory_name = _init_factory_pat.format(a.name)
- if a.converter is not None:
- lines.append(
- " " + fmt_setter_with_converter(attr_name, arg_name)
- )
- lines.append("else:")
- lines.append(
- " "
- + fmt_setter_with_converter(
- attr_name,
- init_factory_name + "({0})".format(maybe_self),
- )
- )
- names_for_globals[
- _init_converter_pat.format(a.name)
- ] = a.converter
- else:
- lines.append(" " + fmt_setter(attr_name, arg_name))
- lines.append("else:")
- lines.append(
- " "
- + fmt_setter(
- attr_name,
- init_factory_name + "({0})".format(maybe_self),
- )
- )
- names_for_globals[init_factory_name] = a.default.factory
- else:
- if a.kw_only:
- kw_only_args.append(arg_name)
- else:
- args.append(arg_name)
- if a.converter is not None:
- lines.append(fmt_setter_with_converter(attr_name, arg_name))
- names_for_globals[
- _init_converter_pat.format(a.name)
- ] = a.converter
- else:
- lines.append(fmt_setter(attr_name, arg_name))
-
- if a.init is True and a.converter is None and a.type is not None:
- annotations[arg_name] = a.type
-
- if attrs_to_validate: # we can skip this if there are no validators.
- names_for_globals["_config"] = _config
- lines.append("if _config._run_validators is True:")
- for a in attrs_to_validate:
- val_name = "__attr_validator_{}".format(a.name)
- attr_name = "__attr_{}".format(a.name)
- lines.append(
- " {}(self, {}, self.{})".format(val_name, attr_name, a.name)
- )
- names_for_globals[val_name] = a.validator
- names_for_globals[attr_name] = a
- if post_init:
- lines.append("self.__attrs_post_init__()")
-
- # because this is set only after __attrs_post_init is called, a crash
- # will result if post-init tries to access the hash code. This seemed
- # preferable to setting this beforehand, in which case alteration to
- # field values during post-init combined with post-init accessing the
- # hash code would result in silent bugs.
- if cache_hash:
- if frozen:
- if slots:
- # if frozen and slots, then _setattr defined above
- init_hash_cache = "_setattr('%s', %s)"
- else:
- # if frozen and not slots, then _inst_dict defined above
- init_hash_cache = "_inst_dict['%s'] = %s"
- else:
- init_hash_cache = "self.%s = %s"
- lines.append(init_hash_cache % (_hash_cache_field, "None"))
-
- args = ", ".join(args)
- if kw_only_args:
- if PY2:
- raise PythonTooOldError(
- "Keyword-only arguments only work on Python 3 and later."
- )
-
- args += "{leading_comma}*, {kw_only_args}".format(
- leading_comma=", " if args else "",
- kw_only_args=", ".join(kw_only_args),
- )
- return (
- """\
-def __init__(self, {args}):
- {lines}
-""".format(
- args=args, lines="\n ".join(lines) if lines else "pass"
- ),
- names_for_globals,
- annotations,
- )
-
-
-class Attribute(object):
- """
- *Read-only* representation of an attribute.
-
- :attribute name: The name of the attribute.
-
- Plus *all* arguments of :func:`attr.ib`.
-
- For the version history of the fields, see :func:`attr.ib`.
- """
-
- __slots__ = (
- "name",
- "default",
- "validator",
- "repr",
- "cmp",
- "hash",
- "init",
- "metadata",
- "type",
- "converter",
- "kw_only",
- )
-
- def __init__(
- self,
- name,
- default,
- validator,
- repr,
- cmp,
- hash,
- init,
- convert=None,
- metadata=None,
- type=None,
- converter=None,
- kw_only=False,
- ):
- # Cache this descriptor here to speed things up later.
- bound_setattr = _obj_setattr.__get__(self, Attribute)
-
- # Despite the big red warning, people *do* instantiate `Attribute`
- # themselves.
- if convert is not None:
- if converter is not None:
- raise RuntimeError(
- "Can't pass both `convert` and `converter`. "
- "Please use `converter` only."
- )
- warnings.warn(
- "The `convert` argument is deprecated in favor of `converter`."
- " It will be removed after 2019/01.",
- DeprecationWarning,
- stacklevel=2,
- )
- converter = convert
-
- bound_setattr("name", name)
- bound_setattr("default", default)
- bound_setattr("validator", validator)
- bound_setattr("repr", repr)
- bound_setattr("cmp", cmp)
- bound_setattr("hash", hash)
- bound_setattr("init", init)
- bound_setattr("converter", converter)
- bound_setattr(
- "metadata",
- (
- metadata_proxy(metadata)
- if metadata
- else _empty_metadata_singleton
- ),
- )
- bound_setattr("type", type)
- bound_setattr("kw_only", kw_only)
-
- def __setattr__(self, name, value):
- raise FrozenInstanceError()
-
- @property
- def convert(self):
- warnings.warn(
- "The `convert` attribute is deprecated in favor of `converter`. "
- "It will be removed after 2019/01.",
- DeprecationWarning,
- stacklevel=2,
- )
- return self.converter
-
- @classmethod
- def from_counting_attr(cls, name, ca, type=None):
- # type holds the annotated value. deal with conflicts:
- if type is None:
- type = ca.type
- elif ca.type is not None:
- raise ValueError(
- "Type annotation and type argument cannot both be present"
- )
- inst_dict = {
- k: getattr(ca, k)
- for k in Attribute.__slots__
- if k
- not in (
- "name",
- "validator",
- "default",
- "type",
- "convert",
- ) # exclude methods and deprecated alias
- }
- return cls(
- name=name,
- validator=ca._validator,
- default=ca._default,
- type=type,
- **inst_dict
- )
-
- # Don't use attr.assoc since fields(Attribute) doesn't work
- def _assoc(self, **changes):
- """
- Copy *self* and apply *changes*.
- """
- new = copy.copy(self)
-
- new._setattrs(changes.items())
-
- return new
-
- # Don't use _add_pickle since fields(Attribute) doesn't work
- def __getstate__(self):
- """
- Play nice with pickle.
- """
- return tuple(
- getattr(self, name) if name != "metadata" else dict(self.metadata)
- for name in self.__slots__
- )
-
- def __setstate__(self, state):
- """
- Play nice with pickle.
- """
- self._setattrs(zip(self.__slots__, state))
-
- def _setattrs(self, name_values_pairs):
- bound_setattr = _obj_setattr.__get__(self, Attribute)
- for name, value in name_values_pairs:
- if name != "metadata":
- bound_setattr(name, value)
- else:
- bound_setattr(
- name,
- metadata_proxy(value)
- if value
- else _empty_metadata_singleton,
- )
-
-
-_a = [
- Attribute(
- name=name,
- default=NOTHING,
- validator=None,
- repr=True,
- cmp=True,
- hash=(name != "metadata"),
- init=True,
- )
- for name in Attribute.__slots__
- if name != "convert" # XXX: remove once `convert` is gone
-]
-
-Attribute = _add_hash(
- _add_cmp(_add_repr(Attribute, attrs=_a), attrs=_a),
- attrs=[a for a in _a if a.hash],
-)
-
-
-class _CountingAttr(object):
- """
- Intermediate representation of attributes that uses a counter to preserve
- the order in which the attributes have been defined.
-
- *Internal* data structure of the attrs library. Running into is most
- likely the result of a bug like a forgotten `@attr.s` decorator.
- """
-
- __slots__ = (
- "counter",
- "_default",
- "repr",
- "cmp",
- "hash",
- "init",
- "metadata",
- "_validator",
- "converter",
- "type",
- "kw_only",
- )
- __attrs_attrs__ = tuple(
- Attribute(
- name=name,
- default=NOTHING,
- validator=None,
- repr=True,
- cmp=True,
- hash=True,
- init=True,
- kw_only=False,
- )
- for name in ("counter", "_default", "repr", "cmp", "hash", "init")
- ) + (
- Attribute(
- name="metadata",
- default=None,
- validator=None,
- repr=True,
- cmp=True,
- hash=False,
- init=True,
- kw_only=False,
- ),
- )
- cls_counter = 0
-
- def __init__(
- self,
- default,
- validator,
- repr,
- cmp,
- hash,
- init,
- converter,
- metadata,
- type,
- kw_only,
- ):
- _CountingAttr.cls_counter += 1
- self.counter = _CountingAttr.cls_counter
- self._default = default
- # If validator is a list/tuple, wrap it using helper validator.
- if validator and isinstance(validator, (list, tuple)):
- self._validator = and_(*validator)
- else:
- self._validator = validator
- self.repr = repr
- self.cmp = cmp
- self.hash = hash
- self.init = init
- self.converter = converter
- self.metadata = metadata
- self.type = type
- self.kw_only = kw_only
-
- def validator(self, meth):
- """
- Decorator that adds *meth* to the list of validators.
-
- Returns *meth* unchanged.
-
- .. versionadded:: 17.1.0
- """
- if self._validator is None:
- self._validator = meth
- else:
- self._validator = and_(self._validator, meth)
- return meth
-
- def default(self, meth):
- """
- Decorator that allows to set the default for an attribute.
-
- Returns *meth* unchanged.
-
- :raises DefaultAlreadySetError: If default has been set before.
-
- .. versionadded:: 17.1.0
- """
- if self._default is not NOTHING:
- raise DefaultAlreadySetError()
-
- self._default = Factory(meth, takes_self=True)
-
- return meth
-
-
-_CountingAttr = _add_cmp(_add_repr(_CountingAttr))
-
-
-@attrs(slots=True, init=False, hash=True)
-class Factory(object):
- """
- Stores a factory callable.
-
- If passed as the default value to :func:`attr.ib`, the factory is used to
- generate a new value.
-
- :param callable factory: A callable that takes either none or exactly one
- mandatory positional argument depending on *takes_self*.
- :param bool takes_self: Pass the partially initialized instance that is
- being initialized as a positional argument.
-
- .. versionadded:: 17.1.0 *takes_self*
- """
-
- factory = attrib()
- takes_self = attrib()
-
- def __init__(self, factory, takes_self=False):
- """
- `Factory` is part of the default machinery so if we want a default
- value here, we have to implement it ourselves.
- """
- self.factory = factory
- self.takes_self = takes_self
-
-
-def make_class(name, attrs, bases=(object,), **attributes_arguments):
- """
- A quick way to create a new class called *name* with *attrs*.
-
- :param name: The name for the new class.
- :type name: str
-
- :param attrs: A list of names or a dictionary of mappings of names to
- attributes.
-
- If *attrs* is a list or an ordered dict (:class:`dict` on Python 3.6+,
- :class:`collections.OrderedDict` otherwise), the order is deduced from
- the order of the names or attributes inside *attrs*. Otherwise the
- order of the definition of the attributes is used.
- :type attrs: :class:`list` or :class:`dict`
-
- :param tuple bases: Classes that the new class will subclass.
-
- :param attributes_arguments: Passed unmodified to :func:`attr.s`.
-
- :return: A new class with *attrs*.
- :rtype: type
-
- .. versionadded:: 17.1.0 *bases*
- .. versionchanged:: 18.1.0 If *attrs* is ordered, the order is retained.
- """
- if isinstance(attrs, dict):
- cls_dict = attrs
- elif isinstance(attrs, (list, tuple)):
- cls_dict = dict((a, attrib()) for a in attrs)
- else:
- raise TypeError("attrs argument must be a dict or a list.")
-
- post_init = cls_dict.pop("__attrs_post_init__", None)
- type_ = type(
- name,
- bases,
- {} if post_init is None else {"__attrs_post_init__": post_init},
- )
- # For pickling to work, the __module__ variable needs to be set to the
- # frame where the class is created. Bypass this step in environments where
- # sys._getframe is not defined (Jython for example) or sys._getframe is not
- # defined for arguments greater than 0 (IronPython).
- try:
- type_.__module__ = sys._getframe(1).f_globals.get(
- "__name__", "__main__"
- )
- except (AttributeError, ValueError):
- pass
-
- return _attrs(these=cls_dict, **attributes_arguments)(type_)
-
-
-# These are required by within this module so we define them here and merely
-# import into .validators.
-
-
-@attrs(slots=True, hash=True)
-class _AndValidator(object):
- """
- Compose many validators to a single one.
- """
-
- _validators = attrib()
-
- def __call__(self, inst, attr, value):
- for v in self._validators:
- v(inst, attr, value)
-
-
-def and_(*validators):
- """
- A validator that composes multiple validators into one.
-
- When called on a value, it runs all wrapped validators.
-
- :param validators: Arbitrary number of validators.
- :type validators: callables
-
- .. versionadded:: 17.1.0
- """
- vals = []
- for validator in validators:
- vals.extend(
- validator._validators
- if isinstance(validator, _AndValidator)
- else [validator]
- )
-
- return _AndValidator(tuple(vals))
diff --git a/lib/attr/converters.py b/lib/attr/converters.py
deleted file mode 100644
index 37c4a07a06..0000000000
--- a/lib/attr/converters.py
+++ /dev/null
@@ -1,78 +0,0 @@
-"""
-Commonly useful converters.
-"""
-
-from __future__ import absolute_import, division, print_function
-
-from ._make import NOTHING, Factory
-
-
-def optional(converter):
- """
- A converter that allows an attribute to be optional. An optional attribute
- is one which can be set to ``None``.
-
- :param callable converter: the converter that is used for non-``None``
- values.
-
- .. versionadded:: 17.1.0
- """
-
- def optional_converter(val):
- if val is None:
- return None
- return converter(val)
-
- return optional_converter
-
-
-def default_if_none(default=NOTHING, factory=None):
- """
- A converter that allows to replace ``None`` values by *default* or the
- result of *factory*.
-
- :param default: Value to be used if ``None`` is passed. Passing an instance
- of :class:`attr.Factory` is supported, however the ``takes_self`` option
- is *not*.
- :param callable factory: A callable that takes not parameters whose result
- is used if ``None`` is passed.
-
- :raises TypeError: If **neither** *default* or *factory* is passed.
- :raises TypeError: If **both** *default* and *factory* are passed.
- :raises ValueError: If an instance of :class:`attr.Factory` is passed with
- ``takes_self=True``.
-
- .. versionadded:: 18.2.0
- """
- if default is NOTHING and factory is None:
- raise TypeError("Must pass either `default` or `factory`.")
-
- if default is not NOTHING and factory is not None:
- raise TypeError(
- "Must pass either `default` or `factory` but not both."
- )
-
- if factory is not None:
- default = Factory(factory)
-
- if isinstance(default, Factory):
- if default.takes_self:
- raise ValueError(
- "`takes_self` is not supported by default_if_none."
- )
-
- def default_if_none_converter(val):
- if val is not None:
- return val
-
- return default.factory()
-
- else:
-
- def default_if_none_converter(val):
- if val is not None:
- return val
-
- return default
-
- return default_if_none_converter
diff --git a/lib/attr/converters.pyi b/lib/attr/converters.pyi
deleted file mode 100644
index 63b2a3866e..0000000000
--- a/lib/attr/converters.pyi
+++ /dev/null
@@ -1,12 +0,0 @@
-from typing import TypeVar, Optional, Callable, overload
-from . import _ConverterType
-
-_T = TypeVar("_T")
-
-def optional(
- converter: _ConverterType[_T]
-) -> _ConverterType[Optional[_T]]: ...
-@overload
-def default_if_none(default: _T) -> _ConverterType[_T]: ...
-@overload
-def default_if_none(*, factory: Callable[[], _T]) -> _ConverterType[_T]: ...
diff --git a/lib/attr/exceptions.py b/lib/attr/exceptions.py
deleted file mode 100644
index b12e41e97a..0000000000
--- a/lib/attr/exceptions.py
+++ /dev/null
@@ -1,57 +0,0 @@
-from __future__ import absolute_import, division, print_function
-
-
-class FrozenInstanceError(AttributeError):
- """
- A frozen/immutable instance has been attempted to be modified.
-
- It mirrors the behavior of ``namedtuples`` by using the same error message
- and subclassing :exc:`AttributeError`.
-
- .. versionadded:: 16.1.0
- """
-
- msg = "can't set attribute"
- args = [msg]
-
-
-class AttrsAttributeNotFoundError(ValueError):
- """
- An ``attrs`` function couldn't find an attribute that the user asked for.
-
- .. versionadded:: 16.2.0
- """
-
-
-class NotAnAttrsClassError(ValueError):
- """
- A non-``attrs`` class has been passed into an ``attrs`` function.
-
- .. versionadded:: 16.2.0
- """
-
-
-class DefaultAlreadySetError(RuntimeError):
- """
- A default has been set using ``attr.ib()`` and is attempted to be reset
- using the decorator.
-
- .. versionadded:: 17.1.0
- """
-
-
-class UnannotatedAttributeError(RuntimeError):
- """
- A class with ``auto_attribs=True`` has an ``attr.ib()`` without a type
- annotation.
-
- .. versionadded:: 17.3.0
- """
-
-
-class PythonTooOldError(RuntimeError):
- """
- An ``attrs`` feature requiring a more recent python version has been used.
-
- .. versionadded:: 18.2.0
- """
diff --git a/lib/attr/exceptions.pyi b/lib/attr/exceptions.pyi
deleted file mode 100644
index 48fffcc1e2..0000000000
--- a/lib/attr/exceptions.pyi
+++ /dev/null
@@ -1,7 +0,0 @@
-class FrozenInstanceError(AttributeError):
- msg: str = ...
-
-class AttrsAttributeNotFoundError(ValueError): ...
-class NotAnAttrsClassError(ValueError): ...
-class DefaultAlreadySetError(RuntimeError): ...
-class UnannotatedAttributeError(RuntimeError): ...
diff --git a/lib/attr/filters.py b/lib/attr/filters.py
deleted file mode 100644
index f1c69b8bac..0000000000
--- a/lib/attr/filters.py
+++ /dev/null
@@ -1,52 +0,0 @@
-"""
-Commonly useful filters for :func:`attr.asdict`.
-"""
-
-from __future__ import absolute_import, division, print_function
-
-from ._compat import isclass
-from ._make import Attribute
-
-
-def _split_what(what):
- """
- Returns a tuple of `frozenset`s of classes and attributes.
- """
- return (
- frozenset(cls for cls in what if isclass(cls)),
- frozenset(cls for cls in what if isinstance(cls, Attribute)),
- )
-
-
-def include(*what):
- """
- Whitelist *what*.
-
- :param what: What to whitelist.
- :type what: :class:`list` of :class:`type` or :class:`attr.Attribute`\\ s
-
- :rtype: :class:`callable`
- """
- cls, attrs = _split_what(what)
-
- def include_(attribute, value):
- return value.__class__ in cls or attribute in attrs
-
- return include_
-
-
-def exclude(*what):
- """
- Blacklist *what*.
-
- :param what: What to blacklist.
- :type what: :class:`list` of classes or :class:`attr.Attribute`\\ s.
-
- :rtype: :class:`callable`
- """
- cls, attrs = _split_what(what)
-
- def exclude_(attribute, value):
- return value.__class__ not in cls and attribute not in attrs
-
- return exclude_
diff --git a/lib/attr/filters.pyi b/lib/attr/filters.pyi
deleted file mode 100644
index a618140c2d..0000000000
--- a/lib/attr/filters.pyi
+++ /dev/null
@@ -1,5 +0,0 @@
-from typing import Union
-from . import Attribute, _FilterType
-
-def include(*what: Union[type, Attribute]) -> _FilterType: ...
-def exclude(*what: Union[type, Attribute]) -> _FilterType: ...
diff --git a/lib/attr/py.typed b/lib/attr/py.typed
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/lib/attr/validators.py b/lib/attr/validators.py
deleted file mode 100644
index f12d0aa593..0000000000
--- a/lib/attr/validators.py
+++ /dev/null
@@ -1,170 +0,0 @@
-"""
-Commonly useful validators.
-"""
-
-from __future__ import absolute_import, division, print_function
-
-from ._make import _AndValidator, and_, attrib, attrs
-
-
-__all__ = ["and_", "in_", "instance_of", "optional", "provides"]
-
-
-@attrs(repr=False, slots=True, hash=True)
-class _InstanceOfValidator(object):
- type = attrib()
-
- def __call__(self, inst, attr, value):
- """
- We use a callable class to be able to change the ``__repr__``.
- """
- if not isinstance(value, self.type):
- raise TypeError(
- "'{name}' must be {type!r} (got {value!r} that is a "
- "{actual!r}).".format(
- name=attr.name,
- type=self.type,
- actual=value.__class__,
- value=value,
- ),
- attr,
- self.type,
- value,
- )
-
- def __repr__(self):
- return "".format(
- type=self.type
- )
-
-
-def instance_of(type):
- """
- A validator that raises a :exc:`TypeError` if the initializer is called
- with a wrong type for this particular attribute (checks are performed using
- :func:`isinstance` therefore it's also valid to pass a tuple of types).
-
- :param type: The type to check for.
- :type type: type or tuple of types
-
- :raises TypeError: With a human readable error message, the attribute
- (of type :class:`attr.Attribute`), the expected type, and the value it
- got.
- """
- return _InstanceOfValidator(type)
-
-
-@attrs(repr=False, slots=True, hash=True)
-class _ProvidesValidator(object):
- interface = attrib()
-
- def __call__(self, inst, attr, value):
- """
- We use a callable class to be able to change the ``__repr__``.
- """
- if not self.interface.providedBy(value):
- raise TypeError(
- "'{name}' must provide {interface!r} which {value!r} "
- "doesn't.".format(
- name=attr.name, interface=self.interface, value=value
- ),
- attr,
- self.interface,
- value,
- )
-
- def __repr__(self):
- return "".format(
- interface=self.interface
- )
-
-
-def provides(interface):
- """
- A validator that raises a :exc:`TypeError` if the initializer is called
- with an object that does not provide the requested *interface* (checks are
- performed using ``interface.providedBy(value)`` (see `zope.interface
- `_).
-
- :param zope.interface.Interface interface: The interface to check for.
-
- :raises TypeError: With a human readable error message, the attribute
- (of type :class:`attr.Attribute`), the expected interface, and the
- value it got.
- """
- return _ProvidesValidator(interface)
-
-
-@attrs(repr=False, slots=True, hash=True)
-class _OptionalValidator(object):
- validator = attrib()
-
- def __call__(self, inst, attr, value):
- if value is None:
- return
-
- self.validator(inst, attr, value)
-
- def __repr__(self):
- return "".format(
- what=repr(self.validator)
- )
-
-
-def optional(validator):
- """
- A validator that makes an attribute optional. An optional attribute is one
- which can be set to ``None`` in addition to satisfying the requirements of
- the sub-validator.
-
- :param validator: A validator (or a list of validators) that is used for
- non-``None`` values.
- :type validator: callable or :class:`list` of callables.
-
- .. versionadded:: 15.1.0
- .. versionchanged:: 17.1.0 *validator* can be a list of validators.
- """
- if isinstance(validator, list):
- return _OptionalValidator(_AndValidator(validator))
- return _OptionalValidator(validator)
-
-
-@attrs(repr=False, slots=True, hash=True)
-class _InValidator(object):
- options = attrib()
-
- def __call__(self, inst, attr, value):
- try:
- in_options = value in self.options
- except TypeError as e: # e.g. `1 in "abc"`
- in_options = False
-
- if not in_options:
- raise ValueError(
- "'{name}' must be in {options!r} (got {value!r})".format(
- name=attr.name, options=self.options, value=value
- )
- )
-
- def __repr__(self):
- return "".format(
- options=self.options
- )
-
-
-def in_(options):
- """
- A validator that raises a :exc:`ValueError` if the initializer is called
- with a value that does not belong in the options provided. The check is
- performed using ``value in options``.
-
- :param options: Allowed options.
- :type options: list, tuple, :class:`enum.Enum`, ...
-
- :raises ValueError: With a human readable error message, the attribute (of
- type :class:`attr.Attribute`), the expected options, and the value it
- got.
-
- .. versionadded:: 17.1.0
- """
- return _InValidator(options)
diff --git a/lib/attr/validators.pyi b/lib/attr/validators.pyi
deleted file mode 100644
index abbaedf10a..0000000000
--- a/lib/attr/validators.pyi
+++ /dev/null
@@ -1,14 +0,0 @@
-from typing import Container, List, Union, TypeVar, Type, Any, Optional, Tuple
-from . import _ValidatorType
-
-_T = TypeVar("_T")
-
-def instance_of(
- type: Union[Tuple[Type[_T], ...], Type[_T]]
-) -> _ValidatorType[_T]: ...
-def provides(interface: Any) -> _ValidatorType[Any]: ...
-def optional(
- validator: Union[_ValidatorType[_T], List[_ValidatorType[_T]]]
-) -> _ValidatorType[Optional[_T]]: ...
-def in_(options: Container[_T]) -> _ValidatorType[_T]: ...
-def and_(*validators: _ValidatorType[_T]) -> _ValidatorType[_T]: ...
diff --git a/lib/attrs-18.2.0.dist-info/INSTALLER b/lib/attrs-18.2.0.dist-info/INSTALLER
deleted file mode 100644
index a1b589e38a..0000000000
--- a/lib/attrs-18.2.0.dist-info/INSTALLER
+++ /dev/null
@@ -1 +0,0 @@
-pip
diff --git a/lib/attrs-18.2.0.dist-info/LICENSE.txt b/lib/attrs-18.2.0.dist-info/LICENSE.txt
deleted file mode 100644
index 7ae3df9309..0000000000
--- a/lib/attrs-18.2.0.dist-info/LICENSE.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2015 Hynek Schlawack
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/lib/attrs-18.2.0.dist-info/METADATA b/lib/attrs-18.2.0.dist-info/METADATA
deleted file mode 100644
index 8300b5cd67..0000000000
--- a/lib/attrs-18.2.0.dist-info/METADATA
+++ /dev/null
@@ -1,260 +0,0 @@
-Metadata-Version: 2.1
-Name: attrs
-Version: 18.2.0
-Summary: Classes Without Boilerplate
-Home-page: https://www.attrs.org/
-Author: Hynek Schlawack
-Author-email: hs@ox.cx
-Maintainer: Hynek Schlawack
-Maintainer-email: hs@ox.cx
-License: MIT
-Project-URL: Documentation, https://www.attrs.org/
-Project-URL: Bug Tracker, https://github.com/python-attrs/attrs/issues
-Project-URL: Source Code, https://github.com/python-attrs/attrs
-Keywords: class,attribute,boilerplate
-Platform: UNKNOWN
-Classifier: Development Status :: 5 - Production/Stable
-Classifier: Intended Audience :: Developers
-Classifier: Natural Language :: English
-Classifier: License :: OSI Approved :: MIT License
-Classifier: Operating System :: OS Independent
-Classifier: Programming Language :: Python
-Classifier: Programming Language :: Python :: 2
-Classifier: Programming Language :: Python :: 2.7
-Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.4
-Classifier: Programming Language :: Python :: 3.5
-Classifier: Programming Language :: Python :: 3.6
-Classifier: Programming Language :: Python :: 3.7
-Classifier: Programming Language :: Python :: Implementation :: CPython
-Classifier: Programming Language :: Python :: Implementation :: PyPy
-Classifier: Topic :: Software Development :: Libraries :: Python Modules
-Provides-Extra: docs
-Provides-Extra: dev
-Provides-Extra: tests
-Provides-Extra: dev
-Requires-Dist: coverage; extra == 'dev'
-Requires-Dist: hypothesis; extra == 'dev'
-Requires-Dist: pympler; extra == 'dev'
-Requires-Dist: pytest; extra == 'dev'
-Requires-Dist: six; extra == 'dev'
-Requires-Dist: zope.interface; extra == 'dev'
-Requires-Dist: sphinx; extra == 'dev'
-Requires-Dist: zope.interface; extra == 'dev'
-Requires-Dist: pre-commit; extra == 'dev'
-Provides-Extra: docs
-Requires-Dist: sphinx; extra == 'docs'
-Requires-Dist: zope.interface; extra == 'docs'
-Provides-Extra: tests
-Requires-Dist: coverage; extra == 'tests'
-Requires-Dist: hypothesis; extra == 'tests'
-Requires-Dist: pympler; extra == 'tests'
-Requires-Dist: pytest; extra == 'tests'
-Requires-Dist: six; extra == 'tests'
-Requires-Dist: zope.interface; extra == 'tests'
-
-.. image:: https://www.attrs.org/en/latest/_static/attrs_logo.png
- :alt: attrs Logo
-
-======================================
-``attrs``: Classes Without Boilerplate
-======================================
-
-.. image:: https://readthedocs.org/projects/attrs/badge/?version=stable
- :target: https://www.attrs.org/en/stable/?badge=stable
- :alt: Documentation Status
-
-.. image:: https://travis-ci.org/python-attrs/attrs.svg?branch=master
- :target: https://travis-ci.org/python-attrs/attrs
- :alt: CI Status
-
-.. image:: https://codecov.io/github/python-attrs/attrs/branch/master/graph/badge.svg
- :target: https://codecov.io/github/python-attrs/attrs
- :alt: Test Coverage
-
-.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
- :target: https://github.com/ambv/black
- :alt: Code style: black
-
-.. teaser-begin
-
-``attrs`` is the Python package that will bring back the **joy** of **writing classes** by relieving you from the drudgery of implementing object protocols (aka `dunder `_ methods).
-
-Its main goal is to help you to write **concise** and **correct** software without slowing down your code.
-
-.. -spiel-end-
-
-For that, it gives you a class decorator and a way to declaratively define the attributes on that class:
-
-.. -code-begin-
-
-.. code-block:: pycon
-
- >>> import attr
-
- >>> @attr.s
- ... class SomeClass(object):
- ... a_number = attr.ib(default=42)
- ... list_of_numbers = attr.ib(factory=list)
- ...
- ... def hard_math(self, another_number):
- ... return self.a_number + sum(self.list_of_numbers) * another_number
-
-
- >>> sc = SomeClass(1, [1, 2, 3])
- >>> sc
- SomeClass(a_number=1, list_of_numbers=[1, 2, 3])
-
- >>> sc.hard_math(3)
- 19
- >>> sc == SomeClass(1, [1, 2, 3])
- True
- >>> sc != SomeClass(2, [3, 2, 1])
- True
-
- >>> attr.asdict(sc)
- {'a_number': 1, 'list_of_numbers': [1, 2, 3]}
-
- >>> SomeClass()
- SomeClass(a_number=42, list_of_numbers=[])
-
- >>> C = attr.make_class("C", ["a", "b"])
- >>> C("foo", "bar")
- C(a='foo', b='bar')
-
-
-After *declaring* your attributes ``attrs`` gives you:
-
-- a concise and explicit overview of the class's attributes,
-- a nice human-readable ``__repr__``,
-- a complete set of comparison methods,
-- an initializer,
-- and much more,
-
-*without* writing dull boilerplate code again and again and *without* runtime performance penalties.
-
-On Python 3.6 and later, you can often even drop the calls to ``attr.ib()`` by using `type annotations `_.
-
-This gives you the power to use actual classes with actual types in your code instead of confusing ``tuple``\ s or `confusingly behaving `_ ``namedtuple``\ s.
-Which in turn encourages you to write *small classes* that do `one thing well `_.
-Never again violate the `single responsibility principle `_ just because implementing ``__init__`` et al is a painful drag.
-
-
-.. -testimonials-
-
-Testimonials
-============
-
-**Amber Hawkie Brown**, Twisted Release Manager and Computer Owl:
-
- Writing a fully-functional class using attrs takes me less time than writing this testimonial.
-
-
-**Glyph Lefkowitz**, creator of `Twisted `_, `Automat `_, and other open source software, in `The One Python Library Everyone Needs `_:
-
- I’m looking forward to is being able to program in Python-with-attrs everywhere.
- It exerts a subtle, but positive, design influence in all the codebases I’ve see it used in.
-
-
-**Kenneth Reitz**, author of `Requests `_ and Developer Advocate at DigitalOcean, (`on paper no less `_!):
-
- attrs—classes for humans. I like it.
-
-
-**Łukasz Langa**, prolific CPython core developer and Production Engineer at Facebook:
-
- I'm increasingly digging your attr.ocity. Good job!
-
-
-.. -end-
-
-.. -project-information-
-
-Getting Help
-============
-
-Please use the ``python-attrs`` tag on `StackOverflow `_ to get help.
-
-Answering questions of your fellow developers is also great way to help the project!
-
-
-Project Information
-===================
-
-``attrs`` is released under the `MIT `_ license,
-its documentation lives at `Read the Docs `_,
-the code on `GitHub `_,
-and the latest release on `PyPI `_.
-It’s rigorously tested on Python 2.7, 3.4+, and PyPy.
-
-We collect information on **third-party extensions** in our `wiki `_.
-Feel free to browse and add your own!
-
-If you'd like to contribute to ``attrs`` you're most welcome and we've written `a little guide `_ to get you started!
-
-
-Release Information
-===================
-
-18.2.0 (2018-09-01)
--------------------
-
-Deprecations
-^^^^^^^^^^^^
-
-- Comparing subclasses using ``<``, ``>``, ``<=``, and ``>=`` is now deprecated.
- The docs always claimed that instances are only compared if the types are identical, so this is a first step to conform to the docs.
-
- Equality operators (``==`` and ``!=``) were always strict in this regard.
- `#394 `_
-
-
-Changes
-^^^^^^^
-
-- ``attrs`` now ships its own `PEP 484 `_ type hints.
- Together with `mypy `_'s ``attrs`` plugin, you've got all you need for writing statically typed code in both Python 2 and 3!
-
- At that occasion, we've also added `narrative docs `_ about type annotations in ``attrs``.
- `#238 `_
-- Added *kw_only* arguments to ``attr.ib`` and ``attr.s``, and a corresponding *kw_only* attribute to ``attr.Attribute``.
- This change makes it possible to have a generated ``__init__`` with keyword-only arguments on Python 3, relaxing the required ordering of default and non-default valued attributes.
- `#281 `_,
- `#411 `_
-- The test suite now runs with ``hypothesis.HealthCheck.too_slow`` disabled to prevent CI breakage on slower computers.
- `#364 `_,
- `#396 `_
-- ``attr.validators.in_()`` now raises a ``ValueError`` with a useful message even if the options are a string and the value is not a string.
- `#383 `_
-- ``attr.asdict()`` now properly handles deeply nested lists and dictionaries.
- `#395 `_
-- Added ``attr.converters.default_if_none()`` that allows to replace ``None`` values in attributes.
- For example ``attr.ib(converter=default_if_none(""))`` replaces ``None`` by empty strings.
- `#400 `_,
- `#414 `_
-- Fixed a reference leak where the original class would remain live after being replaced when ``slots=True`` is set.
- `#407 `_
-- Slotted classes can now be made weakly referenceable by passing ``@attr.s(weakref_slot=True)``.
- `#420 `_
-- Added *cache_hash* option to ``@attr.s`` which causes the hash code to be computed once and stored on the object.
- `#425 `_
-- Attributes can be named ``property`` and ``itemgetter`` now.
- `#430 `_
-- It is now possible to override a base class' class variable using only class annotations.
- `#431 `_
-
-`Full changelog `_.
-
-Credits
-=======
-
-``attrs`` is written and maintained by `Hynek Schlawack `_.
-
-The development is kindly supported by `Variomedia AG `_.
-
-A full list of contributors can be found in `GitHub's overview `_.
-
-It’s the spiritual successor of `characteristic `_ and aspires to fix some of it clunkiness and unfortunate decisions.
-Both were inspired by Twisted’s `FancyEqMixin `_ but both are implemented using class decorators because `subclassing is bad for you `_, m’kay?
-
-
diff --git a/lib/attrs-18.2.0.dist-info/RECORD b/lib/attrs-18.2.0.dist-info/RECORD
deleted file mode 100644
index aaab9c6839..0000000000
--- a/lib/attrs-18.2.0.dist-info/RECORD
+++ /dev/null
@@ -1,30 +0,0 @@
-attr/__init__.py,sha256=5pRFI7J27MRSvdzcRiUMW6k2PEbU3-Jp3de4Iohg01I,1244
-attr/__init__.pyc,,
-attr/__init__.pyi,sha256=3OiFuXAVhhw599eaCQXidqay5ZgNhIGVOL9MEiGYU6k,7638
-attr/_compat.py,sha256=bIlOWj_fPcz9Z_kkXdKS_aQgx-olkY-3r3flW_PLqtI,4468
-attr/_compat.pyc,,
-attr/_config.py,sha256=_KvW0mQdH2PYjHc0YfIUaV_o2pVfM7ziMEYTxwmEhOA,514
-attr/_config.pyc,,
-attr/_funcs.py,sha256=7v3MNMHdOUP2NkiLPwEiWAorBs3uNQq5Rn70Odr5uqo,9725
-attr/_funcs.pyc,,
-attr/_make.py,sha256=WeQz2rBClF0EsgTGaxaiVf_mU9ijHh-lIOfaiBVfmx8,65714
-attr/_make.pyc,,
-attr/converters.py,sha256=SFPiz6-hAs2pw3kn7SzkBcdpE9AjW8iT9wjpe2eLDrQ,2155
-attr/converters.pyc,,
-attr/converters.pyi,sha256=wAhCoOT1MFV8t323rpD87O7bxQ8CYLTPiBQd-29BieI,351
-attr/exceptions.py,sha256=N0WQfKvBVd4GWgDxTbFScg4ajy7-HlyvXiwlSQBA0jA,1272
-attr/exceptions.pyc,,
-attr/exceptions.pyi,sha256=sq7TbBEGGSf81uFXScW9_aO62vd0v6LAvqz0a8Hrsxw,257
-attr/filters.py,sha256=s6NrcRWJKlCQauPEH0S4lmgFwlCdUQcHKcNkDHpptN4,1153
-attr/filters.pyc,,
-attr/filters.pyi,sha256=MwXtozGEyi1PwyxyOw1dzywWRM1u4LbSOcRkaDO0ayM,189
-attr/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
-attr/validators.py,sha256=ZEPSsWcH8XfM0JMmH0pE0yyg8hImm4LKM_FE8qncXVc,5174
-attr/validators.pyc,,
-attr/validators.pyi,sha256=U_odr0Bg4-2lKD7Bn6nd9mPTybRBa0fJH-ecyljcdsQ,528
-attrs-18.2.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
-attrs-18.2.0.dist-info/LICENSE.txt,sha256=v2WaKLSSQGAvVrvfSQy-LsUJsVuY-Z17GaUsdA4yeGM,1082
-attrs-18.2.0.dist-info/METADATA,sha256=FVn0_IbUZ--Lx-ovJJR0itwxYx9g2NDW37V-KjuKUhk,11173
-attrs-18.2.0.dist-info/RECORD,,
-attrs-18.2.0.dist-info/WHEEL,sha256=gduuPyBvFJQSQ0zdyxF7k0zynDXbIbvg5ZBHoXum5uk,110
-attrs-18.2.0.dist-info/top_level.txt,sha256=tlRYMddkRlKPqJ96wP2_j9uEsmcNHgD2SbuWd4CzGVU,5
diff --git a/lib/attrs-18.2.0.dist-info/WHEEL b/lib/attrs-18.2.0.dist-info/WHEEL
deleted file mode 100644
index 1316c41d07..0000000000
--- a/lib/attrs-18.2.0.dist-info/WHEEL
+++ /dev/null
@@ -1,6 +0,0 @@
-Wheel-Version: 1.0
-Generator: bdist_wheel (0.31.1)
-Root-Is-Purelib: true
-Tag: py2-none-any
-Tag: py3-none-any
-
diff --git a/lib/attrs-18.2.0.dist-info/top_level.txt b/lib/attrs-18.2.0.dist-info/top_level.txt
deleted file mode 100644
index 66a062d889..0000000000
--- a/lib/attrs-18.2.0.dist-info/top_level.txt
+++ /dev/null
@@ -1 +0,0 @@
-attr
diff --git a/lib/bin/flask b/lib/bin/flask
deleted file mode 100755
index 88b05de1d0..0000000000
--- a/lib/bin/flask
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
-
-# -*- coding: utf-8 -*-
-import re
-import sys
-
-from flask.cli import main
-
-if __name__ == '__main__':
- sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
- sys.exit(main())
diff --git a/lib/certifi-2017.7.27.1.dist-info/DESCRIPTION.rst b/lib/certifi-2017.7.27.1.dist-info/DESCRIPTION.rst
deleted file mode 100644
index 30e23620bf..0000000000
--- a/lib/certifi-2017.7.27.1.dist-info/DESCRIPTION.rst
+++ /dev/null
@@ -1,49 +0,0 @@
-Certifi: Python SSL Certificates
-================================
-
-`Certifi`_ is a carefully curated collection of Root Certificates for
-validating the trustworthiness of SSL certificates while verifying the identity
-of TLS hosts. It has been extracted from the `Requests`_ project.
-
-Installation
-------------
-
-``certifi`` is available on PyPI. Simply install it with ``pip``::
-
- $ pip install certifi
-
-Usage
------
-
-To reference the installed certificate authority (CA) bundle, you can use the
-built-in function::
-
- >>> import certifi
-
- >>> certifi.where()
- '/usr/local/lib/python2.7/site-packages/certifi/cacert.pem'
-
-Enjoy!
-
-1024-bit Root Certificates
-~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Browsers and certificate authorities have concluded that 1024-bit keys are
-unacceptably weak for certificates, particularly root certificates. For this
-reason, Mozilla has removed any weak (i.e. 1024-bit key) certificate from its
-bundle, replacing it with an equivalent strong (i.e. 2048-bit or greater key)
-certificate from the same CA. Because Mozilla removed these certificates from
-its bundle, ``certifi`` removed them as well.
-
-Unfortunately, old versions of OpenSSL (less than 1.0.2) sometimes fail to
-validate certificate chains that use the strong roots. For this reason, if you
-fail to validate a certificate using the ``certifi.where()`` mechanism, you can
-intentionally re-add the 1024-bit roots back into your bundle by calling
-``certifi.old_where()`` instead. This is not recommended in production: if at
-all possible you should upgrade to a newer OpenSSL. However, if you have no
-other option, this may work for you.
-
-.. _`Certifi`: http://certifi.io/en/latest/
-.. _`Requests`: http://docs.python-requests.org/en/latest/
-
-
diff --git a/lib/certifi-2017.7.27.1.dist-info/INSTALLER b/lib/certifi-2017.7.27.1.dist-info/INSTALLER
deleted file mode 100644
index a1b589e38a..0000000000
--- a/lib/certifi-2017.7.27.1.dist-info/INSTALLER
+++ /dev/null
@@ -1 +0,0 @@
-pip
diff --git a/lib/certifi-2017.7.27.1.dist-info/METADATA b/lib/certifi-2017.7.27.1.dist-info/METADATA
deleted file mode 100644
index 609114457b..0000000000
--- a/lib/certifi-2017.7.27.1.dist-info/METADATA
+++ /dev/null
@@ -1,71 +0,0 @@
-Metadata-Version: 2.0
-Name: certifi
-Version: 2017.7.27.1
-Summary: Python package for providing Mozilla's CA Bundle.
-Home-page: http://certifi.io/
-Author: Kenneth Reitz
-Author-email: me@kennethreitz.com
-License: MPL-2.0
-Platform: UNKNOWN
-Classifier: Development Status :: 5 - Production/Stable
-Classifier: Intended Audience :: Developers
-Classifier: Natural Language :: English
-Classifier: Programming Language :: Python
-Classifier: Programming Language :: Python :: 2
-Classifier: Programming Language :: Python :: 2.6
-Classifier: Programming Language :: Python :: 2.7
-Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.3
-Classifier: Programming Language :: Python :: 3.4
-Classifier: Programming Language :: Python :: 3.5
-Classifier: Programming Language :: Python :: 3.6
-
-Certifi: Python SSL Certificates
-================================
-
-`Certifi`_ is a carefully curated collection of Root Certificates for
-validating the trustworthiness of SSL certificates while verifying the identity
-of TLS hosts. It has been extracted from the `Requests`_ project.
-
-Installation
-------------
-
-``certifi`` is available on PyPI. Simply install it with ``pip``::
-
- $ pip install certifi
-
-Usage
------
-
-To reference the installed certificate authority (CA) bundle, you can use the
-built-in function::
-
- >>> import certifi
-
- >>> certifi.where()
- '/usr/local/lib/python2.7/site-packages/certifi/cacert.pem'
-
-Enjoy!
-
-1024-bit Root Certificates
-~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Browsers and certificate authorities have concluded that 1024-bit keys are
-unacceptably weak for certificates, particularly root certificates. For this
-reason, Mozilla has removed any weak (i.e. 1024-bit key) certificate from its
-bundle, replacing it with an equivalent strong (i.e. 2048-bit or greater key)
-certificate from the same CA. Because Mozilla removed these certificates from
-its bundle, ``certifi`` removed them as well.
-
-Unfortunately, old versions of OpenSSL (less than 1.0.2) sometimes fail to
-validate certificate chains that use the strong roots. For this reason, if you
-fail to validate a certificate using the ``certifi.where()`` mechanism, you can
-intentionally re-add the 1024-bit roots back into your bundle by calling
-``certifi.old_where()`` instead. This is not recommended in production: if at
-all possible you should upgrade to a newer OpenSSL. However, if you have no
-other option, this may work for you.
-
-.. _`Certifi`: http://certifi.io/en/latest/
-.. _`Requests`: http://docs.python-requests.org/en/latest/
-
-
diff --git a/lib/certifi-2017.7.27.1.dist-info/RECORD b/lib/certifi-2017.7.27.1.dist-info/RECORD
deleted file mode 100644
index 1f7999c7e7..0000000000
--- a/lib/certifi-2017.7.27.1.dist-info/RECORD
+++ /dev/null
@@ -1,16 +0,0 @@
-certifi/__init__.py,sha256=My7zz7T7ihes4NXz6H8W7R5_mbQKxH4QOC-bpe2NzWk,65
-certifi/__main__.py,sha256=FiOYt1Fltst7wk9DRa6GCoBr8qBUxlNQu_MKJf04E6s,41
-certifi/cacert.pem,sha256=H1zXFqV-gILXM16kCI9onoUlQtpPQFRUx22fQXVygv8,296399
-certifi/core.py,sha256=QUebyXnT-N_b9vdOg1zw28xqdT0Y7mLkiBrLEQY8fXM,714
-certifi/old_root.pem,sha256=HT0KIfaM83q0XHFqGEesiGyfmlSWuD2RI0-AVIS2srY,25626
-certifi/weak.pem,sha256=Oo30AxpvkrmeN29S3UgbVzTIfaxqAbdXUZ1y2V6nEe0,322025
-certifi-2017.7.27.1.dist-info/DESCRIPTION.rst,sha256=wVWYoH3eovdWFPZnYU2NT4itGRx3eN5C_s1IuNm4qF4,1731
-certifi-2017.7.27.1.dist-info/METADATA,sha256=oq-Gce39ekQpzgfJJOSDXa3_LUhguodCWLYAGFeBkHI,2548
-certifi-2017.7.27.1.dist-info/RECORD,,
-certifi-2017.7.27.1.dist-info/WHEEL,sha256=5wvfB7GvgZAbKBSE9uX9Zbi6LCL-_KgezgHblXhCRnM,113
-certifi-2017.7.27.1.dist-info/metadata.json,sha256=u7l0Z0L2OAt8iknI-JBmglISdRD1WSh_En-v_uE6oTU,915
-certifi-2017.7.27.1.dist-info/top_level.txt,sha256=KMu4vUCfsjLrkPbSNdgdekS-pVJzBAJFO__nI8NF6-U,8
-certifi-2017.7.27.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
-certifi/core.pyc,,
-certifi/__main__.pyc,,
-certifi/__init__.pyc,,
diff --git a/lib/certifi-2017.7.27.1.dist-info/WHEEL b/lib/certifi-2017.7.27.1.dist-info/WHEEL
deleted file mode 100644
index 7bf9daa1ad..0000000000
--- a/lib/certifi-2017.7.27.1.dist-info/WHEEL
+++ /dev/null
@@ -1,6 +0,0 @@
-Wheel-Version: 1.0
-Generator: bdist_wheel (0.30.0.a0)
-Root-Is-Purelib: true
-Tag: py2-none-any
-Tag: py3-none-any
-
diff --git a/lib/certifi-2017.7.27.1.dist-info/metadata.json b/lib/certifi-2017.7.27.1.dist-info/metadata.json
deleted file mode 100644
index 497b57f64a..0000000000
--- a/lib/certifi-2017.7.27.1.dist-info/metadata.json
+++ /dev/null
@@ -1 +0,0 @@
-{"classifiers": ["Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6"], "extensions": {"python.details": {"contacts": [{"email": "me@kennethreitz.com", "name": "Kenneth Reitz", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst"}, "project_urls": {"Home": "http://certifi.io/"}}}, "generator": "bdist_wheel (0.30.0.a0)", "license": "MPL-2.0", "metadata_version": "2.0", "name": "certifi", "summary": "Python package for providing Mozilla's CA Bundle.", "version": "2017.7.27.1"}
\ No newline at end of file
diff --git a/lib/certifi-2017.7.27.1.dist-info/top_level.txt b/lib/certifi-2017.7.27.1.dist-info/top_level.txt
deleted file mode 100644
index 963eac530b..0000000000
--- a/lib/certifi-2017.7.27.1.dist-info/top_level.txt
+++ /dev/null
@@ -1 +0,0 @@
-certifi
diff --git a/lib/certifi/__init__.py b/lib/certifi/__init__.py
deleted file mode 100644
index a76cd477e7..0000000000
--- a/lib/certifi/__init__.py
+++ /dev/null
@@ -1,3 +0,0 @@
-from .core import where, old_where
-
-__version__ = "2017.07.27.1"
diff --git a/lib/certifi/__main__.py b/lib/certifi/__main__.py
deleted file mode 100644
index 5f1da0dd0c..0000000000
--- a/lib/certifi/__main__.py
+++ /dev/null
@@ -1,2 +0,0 @@
-from certifi import where
-print(where())
diff --git a/lib/certifi/cacert.pem b/lib/certifi/cacert.pem
deleted file mode 100644
index 44313cb054..0000000000
--- a/lib/certifi/cacert.pem
+++ /dev/null
@@ -1,4834 +0,0 @@
-
-# Issuer: CN=GlobalSign Root CA O=GlobalSign nv-sa OU=Root CA
-# Subject: CN=GlobalSign Root CA O=GlobalSign nv-sa OU=Root CA
-# Label: "GlobalSign Root CA"
-# Serial: 4835703278459707669005204
-# MD5 Fingerprint: 3e:45:52:15:09:51:92:e1:b7:5d:37:9f:b1:87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CAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOz
-yj1hTdNGCbM+w6DjY1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE
-38NflNUVyRRBnMRddWQVDf9VMOyGj/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymP
-AbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhHhm4qxFYxldBniYUr+WymXUad
-DKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveCX4XSQRjbgbME
-HMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A==
------END CERTIFICATE-----
-
-# Issuer: CN=GlobalSign O=GlobalSign OU=GlobalSign Root CA - R2
-# Subject: CN=GlobalSign O=GlobalSign OU=GlobalSign Root CA - R2
-# Label: "GlobalSign Root CA - R2"
-# Serial: 4835703278459682885658125
-# MD5 Fingerprint: 94:14:77:7e:3e:5e:fd:8f:30:bd:41:b0:cf:e7:d0:30
-# SHA1 Fingerprint: 75:e0:ab:b6:13:85:12:27:1c:04:f8:5f:dd:de:38:e4:b7:24:2e:fe
-# SHA256 Fingerprint: ca:42:dd:41:74:5f:d0:b8:1e:b9:02:36:2c:f9:d8:bf:71:9d:a1:bd:1b:1e:fc:94:6f:5b:4c:99:f4:2c:1b:9e
------BEGIN CERTIFICATE-----
-MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4G
-A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNp
-Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjExMjE1
-MDgwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMjETMBEG
-A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI
-hvcNAQEBBQADggEPADCCAQoCggEBAKbPJA6+Lm8omUVCxKs+IVSbC9N/hHD6ErPL
-v4dfxn+G07IwXNb9rfF73OX4YJYJkhD10FPe+3t+c4isUoh7SqbKSaZeqKeMWhG8
-eoLrvozps6yWJQeXSpkqBy+0Hne/ig+1AnwblrjFuTosvNYSuetZfeLQBoZfXklq
-tTleiDTsvHgMCJiEbKjNS7SgfQx5TfC4LcshytVsW33hoCmEofnTlEnLJGKRILzd
-C9XZzPnqJworc5HGnRusyMvo4KD0L5CLTfuwNhv2GXqF4G3yYROIXJ/gkwpRl4pa
-zq+r1feqCapgvdzZX99yqWATXgAByUr6P6TqBwMhAo6CygPCm48CAwEAAaOBnDCB
-mTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUm+IH
-V2ccHsBqBt5ZtJot39wZhi4wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2NybC5n
-bG9iYWxzaWduLm5ldC9yb290LXIyLmNybDAfBgNVHSMEGDAWgBSb4gdXZxwewGoG
-3lm0mi3f3BmGLjANBgkqhkiG9w0BAQUFAAOCAQEAmYFThxxol4aR7OBKuEQLq4Gs
-J0/WwbgcQ3izDJr86iw8bmEbTUsp9Z8FHSbBuOmDAGJFtqkIk7mpM0sYmsL4h4hO
-291xNBrBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu01yiPqFbQfXf5WRDLenVOavS
-ot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG79G+dwfCMNYxd
-AfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7
-TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg==
------END CERTIFICATE-----
-
-# Issuer: CN=VeriSign Class 3 Public Primary Certification Authority - G3 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 1999 VeriSign, Inc. - For authorized use only
-# Subject: CN=VeriSign Class 3 Public Primary Certification Authority - G3 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 1999 VeriSign, Inc. - For authorized use only
-# Label: "Verisign Class 3 Public Primary Certification Authority - G3"
-# Serial: 206684696279472310254277870180966723415
-# MD5 Fingerprint: cd:68:b6:a7:c7:c4:ce:75:e0:1d:4f:57:44:61:92:09
-# SHA1 Fingerprint: 13:2d:0d:45:53:4b:69:97:cd:b2:d5:c3:39:e2:55:76:60:9b:5c:c6
-# SHA256 Fingerprint: eb:04:cf:5e:b1:f3:9a:fa:76:2f:2b:b1:20:f2:96:cb:a5:20:c1:b9:7d:b1:58:95:65:b8:1c:b9:a1:7b:72:44
------BEGIN CERTIFICATE-----
-MIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQUAMIHKMQsw
-CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZl
-cmlTaWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWdu
-LCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlT
-aWduIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3Jp
-dHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQswCQYD
-VQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlT
-aWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJ
-bmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWdu
-IENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg
-LSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMu6nFL8eB8aHm8b
-N3O9+MlrlBIwT/A2R/XQkQr1F8ilYcEWQE37imGQ5XYgwREGfassbqb1EUGO+i2t
-KmFZpGcmTNDovFJbcCAEWNF6yaRpvIMXZK0Fi7zQWM6NjPXr8EJJC52XJ2cybuGu
-kxUccLwgTS8Y3pKI6GyFVxEa6X7jJhFUokWWVYPKMIno3Nij7SqAP395ZVc+FSBm
-CC+Vk7+qRy+oRpfwEuL+wgorUeZ25rdGt+INpsyow0xZVYnm6FNcHOqd8GIWC6fJ
-Xwzw3sJ2zq/3avL6QaaiMxTJ5Xpj055iN9WFZZ4O5lMkdBteHRJTW8cs54NJOxWu
-imi5V5cCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAERSWwauSCPc/L8my/uRan2Te
-2yFPhpk0djZX3dAVL8WtfxUfN2JzPtTnX84XA9s1+ivbrmAJXx5fj267Cz3qWhMe
-DGBvtcC1IyIuBwvLqXTLR7sdwdela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC
-/Y4wjylGsB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565p
-F4ErWjfJXir0xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGt
-TxzhT5yvDwyd93gN2PQ1VoDat20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ==
------END CERTIFICATE-----
-
-# Issuer: CN=Entrust.net Certification Authority (2048) O=Entrust.net OU=www.entrust.net/CPS_2048 incorp. by ref. (limits liab.)/(c) 1999 Entrust.net Limited
-# Subject: CN=Entrust.net Certification Authority (2048) O=Entrust.net OU=www.entrust.net/CPS_2048 incorp. by ref. (limits liab.)/(c) 1999 Entrust.net Limited
-# Label: "Entrust.net Premium 2048 Secure Server CA"
-# Serial: 946069240
-# MD5 Fingerprint: ee:29:31:bc:32:7e:9a:e6:e8:b5:f7:51:b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KQP5L6RQstRIzgUyVYr9smRMDuSYB3Xbf9+5CFVghTAp+XtIpGmG4zU/
-HoZdenoVve8AjhUiVBcAkCaTvA5JaJG/+EfTnZVCwQ5N328mz8MYIWJmQ3DW1cAH
-4QIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNV
-HQ4EFgQUVeSB0RGAvtiJuQijMfmhJAkWuXAwDQYJKoZIhvcNAQEFBQADggEBADub
-j1abMOdTmXx6eadNl9cZlZD7Bh/KM3xGY4+WZiT6QBshJ8rmcnPyT/4xmf3IDExo
-U8aAghOY+rat2l098c5u9hURlIIM7j+VrxGrD9cv3h8Dj1csHsm7mhpElesYT6Yf
-zX1XEC+bBAlahLVu2B064dae0Wx5XnkcFMXj0EyTO2U87d89vqbllRrDtRnDvV5b
-u/8j72gZyxKTJ1wDLW8w0B62GqzeWvfRqqgnpv55gcR5mTNXuhKwqeBCbJPKVt7+
-bYQLCIt+jerXmCHG8+c8eS9enNFMFY3h7CI3zJpDC5fcgJCNs2ebb0gIFVbPv/Er
-fF6adulZkMV8gzURZVE=
------END CERTIFICATE-----
-
-# Issuer: CN=Baltimore CyberTrust Root O=Baltimore OU=CyberTrust
-# Subject: CN=Baltimore CyberTrust Root O=Baltimore OU=CyberTrust
-# Label: "Baltimore CyberTrust Root"
-# Serial: 33554617
-# MD5 Fingerprint: ac:b6:94:a5:9c:17:e0:d7:91:52:9b:b1:97:06:a6:e4
-# SHA1 Fingerprint: d4:de:20:d0:5e:66:fc:53:fe:1a:50:88:2c:78:db:28:52:ca:e4:74
-# SHA256 Fingerprint: 16:af:57:a9:f6:76:b0:ab:12:60:95:aa:5e:ba:de:f2:2a:b3:11:19:d6:44:ac:95:cd:4b:93:db:f3:f2:6a:eb
------BEGIN CERTIFICATE-----
-MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJ
-RTESMBAGA1UEChMJQmFsdGltb3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eYs9HRCwBXbsdtTLS
-R9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp
------END CERTIFICATE-----
-
-# Issuer: CN=AddTrust External CA Root O=AddTrust AB OU=AddTrust External TTP Network
-# Subject: CN=AddTrust External CA Root O=AddTrust AB OU=AddTrust External TTP Network
-# Label: "AddTrust External Root"
-# Serial: 1
-# MD5 Fingerprint: 1d:35:54:04:85:78:b0:3f:42:42:4d:bf:20:73:0a:3f
-# SHA1 Fingerprint: 02:fa:f3:e2:91:43:54:68:60:78:57:69:4d:f5:e4:5b:68:85:18:68
-# SHA256 Fingerprint: 68:7f:a4:51:38:22:78:ff:f0:c8:b1:1f:8d:43:d5:76:67:1c:6e:b2:bc:ea:b4:13:fb:83:d9:65:d0:6d:2f:f2
------BEGIN CERTIFICATE-----
-MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU
-MBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFs
-IFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290
-MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFowbzELMAkGA1UEBhMCU0Ux
-FDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRUcnVzdCBFeHRlcm5h
-bCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0EgUm9v
-dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvt
-H7xsD821+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9
-uMq/NzgtHj6RQa1wVsfwTz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzX
-mk6vBbOmcZSccbNQYArHE504B4YCqOmoaSYYkKtMsE8jqzpPhNjfzp/haW+710LX
-a0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy2xSoRcRdKn23tNbE7qzN
-E0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv77+ldU9U0
-WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYD
-VR0PBAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0
-Jvf6xCZU7wO94CTLVBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRU
-cnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsx
-IjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENBIFJvb3SCAQEwDQYJKoZIhvcN
-AQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZlj7DYd7usQWxH
-YINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5
-6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvC
-Nr4TDea9Y355e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEX
-c4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5a
-mnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ=
------END CERTIFICATE-----
-
-# Issuer: CN=Entrust Root Certification Authority O=Entrust, Inc. OU=www.entrust.net/CPS is incorporated by reference/(c) 2006 Entrust, Inc.
-# Subject: CN=Entrust Root Certification Authority O=Entrust, Inc. OU=www.entrust.net/CPS is incorporated by reference/(c) 2006 Entrust, Inc.
-# Label: "Entrust Root Certification Authority"
-# Serial: 1164660820
-# MD5 Fingerprint: d6:a5:c3:ed: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F0YaDW6KKjbHjKYD+JXGI
-rb68j6xSlkuqUY3kEzEZ6E5Nn9uss2rVvDlUccp6en+Q3X0dgNmBu1kmwhH+5pPi
-94DkZfs0Nw4pgHBNrziGLp5/V6+eF67rHMsoIV+2HNjnogQi+dPa2MsCAwEAAaOB
-sDCBrTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zArBgNVHRAEJDAi
-gA8yMDA2MTEyNzIwMjM0MlqBDzIwMjYxMTI3MjA1MzQyWjAfBgNVHSMEGDAWgBRo
-kORnpKZTgMeGZqTx90tD+4S9bTAdBgNVHQ4EFgQUaJDkZ6SmU4DHhmak8fdLQ/uE
-vW0wHQYJKoZIhvZ9B0EABBAwDhsIVjcuMTo0LjADAgSQMA0GCSqGSIb3DQEBBQUA
-A4IBAQCT1DCw1wMgKtD5Y+iRDAUgqV8ZyntyTtSx29CW+1RaGSwMCPeyvIWonX9t
-O1KzKtvn1ISMY/YPyyYBkVBs9F8U4pN0wBOeMDpQ47RgxRzwIkSNcUesyBrJ6Zua
-AGAT/3B+XxFNSRuzFVJ7yVTav52Vr2ua2J7p8eRDjeIRRDq/r72DQnNSi6q7pynP
-9WQcCk3RvKqsnyrQ/39/2n3qse0wJcGE2jTSW3iDVuycNsMm4hH2Z0kdkquM++v/
-eu6FSqdQgPCnXEqULl8FmTxSQeDNtGPPAUO6nIPcj2A781q0tHuu2guQOHXvgR1m
-0vdXcDazv/wor3ElhVsT/h5/WrQ8
------END CERTIFICATE-----
-
-# Issuer: CN=GeoTrust Global CA O=GeoTrust Inc.
-# Subject: CN=GeoTrust Global CA O=GeoTrust Inc.
-# Label: "GeoTrust Global CA"
-# Serial: 144470
-# MD5 Fingerprint: f7:75:ab:29:fb:51:4e:b7:77:5e:ff:05:3c:99:8e:f5
-# SHA1 Fingerprint: de:28:f4:a4:ff:e5:b9:2f:a3:c5:03:d1:a3:49:a7:f9:96:2a:82:12
-# SHA256 Fingerprint: ff:85:6a:2d:25:1d:cd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l5PdPcF
-PseKUgzbFbS9bZvlxrFUaKnjaZC2mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Un
-hw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6pXE0zX5IJL4hmXXeXxx12E6nV
-5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvmMw==
------END CERTIFICATE-----
-
-# Issuer: CN=GeoTrust Universal CA O=GeoTrust Inc.
-# Subject: CN=GeoTrust Universal CA O=GeoTrust Inc.
-# Label: "GeoTrust Universal CA"
-# Serial: 1
-# MD5 Fingerprint: 92:65:58:8b:a2:1a:31:72:73:68:5c:b4:a5:7a:07:48
-# SHA1 Fingerprint: e6:21:f3:35:43:79:05:9a:4b:68:30:9d:8a:2f:74:22:15:87:ec:79
-# SHA256 Fingerprint: a0:45:9b:9f:63:b2:25:59:f5:fa:5d:4c:6d:b3:f9:f7:2f:f1:93:42:03:35:78:f0:73:bf:1d:1b:46:cb:b9:12
------BEGIN CERTIFICATE-----
-MIIFaDCCA1CgAwIBAgIBATANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJVUzEW
-MBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEeMBwGA1UEAxMVR2VvVHJ1c3QgVW5pdmVy
-c2FsIENBMB4XDTA0MDMwNDA1MDAwMFoXDTI5MDMwNDA1MDAwMFowRTELMAkGA1UE
-BhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xHjAcBgNVBAMTFUdlb1RydXN0
-IFVuaXZlcnNhbCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAKYV
-VaCjxuAfjJ0hUNfBvitbtaSeodlyWL0AG0y/YckUHUWCq8YdgNY96xCcOq9tJPi8
-cQGeBvV8Xx7BDlXKg5pZMK4ZyzBIle0iN430SppyZj6tlcDgFgDgEB8rMQ7XlFTT
-QjOgNB0eRXbdT8oYN+yFFXoZCPzVx5zw8qkuEKmS5j1YPakWaDwvdSE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FTYXNd673nxE0pN2HrrDktZy4W1vUAg4WhzH92xH3kt0tm7wNFYGm2DFKW
-koRepqO1pD4r2czYG0eq8kTaT/kD6PAUyz/zg97QwVTjt+gKN02LIFkDMBmhLMi9
-ER/frslKxfMnZmaGrGiR/9nmUxwPi1xpZQomyB40w11Re9epnAahNt3ViZS82eQt
-DF4JbAiXfKM9fJP/P6EUp8+1Xevb2xzEdt+Iub1FBZUbrvxGakyvSOPOrg/Sfuvm
-bJxPgWp6ZKy7PtXny3YuxadIwVyQD8vIP/rmMuGNG2+k5o7Y+SlIis5z/iw=
------END CERTIFICATE-----
-
-# Issuer: CN=GeoTrust Universal CA 2 O=GeoTrust Inc.
-# Subject: CN=GeoTrust Universal CA 2 O=GeoTrust Inc.
-# Label: "GeoTrust Universal CA 2"
-# Serial: 1
-# MD5 Fingerprint: 34:fc:b8:d0:36:db:9e:14:b3:c2:f2:db:8f:e4:94:c7
-# SHA1 Fingerprint: 37:9a:19:7b:41:85:45:35:0c:a6:03:69:f3:3c:2e:af:47:4f:20:79
-# SHA256 Fingerprint: a0:23:4f:3b:c8:52:7c:a5:62:8e:ec:81:ad:5d:69:89:5d:a5:68:0d:c9:1d:1c:b8:47:7f:33:f8:78:b9:5b:0b
------BEGIN CERTIFICATE-----
-MIIFbDCCA1SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBHMQswCQYDVQQGEwJVUzEW
-MBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVy
-c2FsIENBIDIwHhcNMDQwMzA0MDUwMDAwWhcNMjkwMzA0MDUwMDAwWjBHMQswCQYD
-VQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMXR2VvVHJ1
-c3QgVW5pdmVyc2FsIENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC
-AQCzVFLByT7y2dyxUxpZKeexw0Uo5dfR7cXFS6GqdHtXr0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X6uuyo9DRXcNJW2GHSo
-ag/HtPQTxORb7QrSpJdMKu0vbBKJPfEncKpqA1Ihn0CoZ1Dy81of398j9tx4TuaY
-T1U6U+Pv8vSfx3zYWK8pIpe44L2RLrB27FcRz+8pRPPphXpgY+RdM4kX2TGq2tbz
-GDVyz4crL2MjhF2EjD9XoIj8mZEoJmmZ1I+XRL6O1UixpCgp8RW04eWe3fiPpm8m
-1wk8OhwRDqZsN/etRIcsKMfYdIKz0G9KV7s1KSegi+ghp4dkNl3M2Basx7InQJJV
-OCiNUW7dFGdTbHFcJoRNdVq2fmBWqU2t+5sel/MN2dKXVHfaPRK34B7vCAas+YWH
-6aLcr34YEoP9VhdBLtUpgn2Z9DH2canPLAEnpQW5qrJITirvn5NSUZU8UnOOVkwX
-QMAJKOSLakhT2+zNVVXxxvjpoixMptEmX36vWkzaH6byHCx+rgIW0lbQL1dTR+iS
------END CERTIFICATE-----
-
-# Issuer: CN=Visa eCommerce Root O=VISA OU=Visa International Service Association
-# Subject: CN=Visa eCommerce Root O=VISA OU=Visa International Service Association
-# Label: "Visa eCommerce Root"
-# Serial: 25952180776285836048024890241505565794
-# MD5 Fingerprint: fc:11:b8:d8:08:93:30:00:6d:23:f9:7e:eb:52:1e:02
-# SHA1 Fingerprint: 70:17:9b:86:8c:00:a4:fa:60:91:52:22:3f:9f:3e:32:bd:e0:05:62
-# SHA256 Fingerprint: 69:fa:c9:bd:55:fb:0a:c7:8d:53:bb:ee:5c:f1:d5:97:98:9f:d0:aa:ab:20:a2:51:51:bd:f1:73:3e:e7:d1:22
------BEGIN CERTIFICATE-----
-MIIDojCCAoqgAwIBAgIQE4Y1TR0/BvLB+WUF1ZAcYjANBgkqhkiG9w0BAQUFADBr
-MQswCQYDVQQGEwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMmVmlzYSBJbnRl
-cm5hdGlvbmFsIFNlcnZpY2UgQXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNv
-bW1lcmNlIF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pLgXPYHDw==
------END CERTIFICATE-----
-
-# Issuer: CN=Certum CA O=Unizeto Sp. z o.o.
-# Subject: CN=Certum CA O=Unizeto Sp. z o.o.
-# Label: "Certum Root CA"
-# Serial: 65568
-# MD5 Fingerprint: 2c:8f:9f:66:1d:18:90:b1:47:26:9d:8e:86:82:8c:a9
-# SHA1 Fingerprint: 62:52:dc:40:f7:11:43:a2:2f:de:9e:f7:34:8e:06:42:51:b1:81:18
-# SHA256 Fingerprint: d8:e0:fe:bc:1d:b2:e3:8d:00:94:0f:37:d2:7d:41:34:4d:99:3e:73:4b:99:d5:65:6d:97:78:d4:d8:14:36:24
------BEGIN CERTIFICATE-----
-MIIDDDCCAfSgAwIBAgIDAQAgMA0GCSqGSIb3DQEBBQUAMD4xCzAJBgNVBAYTAlBM
-MRswGQYDVQQKExJVbml6ZXRvIFNwLiB6IG8uby4xEjAQBgNVBAMTCUNlcnR1bSBD
-QTAeFw0wMjA2MTExMDQ2MzlaFw0yNzA2MTExMDQ2MzlaMD4xCzAJBgNVBAYTAlBM
-MRswGQYDVQQKExJVbml6ZXRvIFNwLiB6IG8uby4xEjAQBgNVBAMTCUNlcnR1bSBD
-QTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM6xwS7TT3zNJc4YPk/E
-jG+AanPIW1H4m9LcuwBcsaD8dQPugfCI7iNS6eYVM42sLQnFdvkrOYCJ5JdLkKWo
-ePhzQ3ukYbDYWMzhbGZ+nPMJXlVjhNWo7/OxLjBos8Q82KxujZlakE403Daaj4GI
-ULdtlkIJ89eVgw1BS7Bqa/j8D35in2fE7SZfECYPCE/wpFcozo+47UX2bu4lXapu
-Ob7kky/ZR6By6/qmW6/KUz/iDsaWVhFu9+lmqSbYf5VT7QqFiLpPKaVCjF62/IUg
-AKpoC6EahQGcxEZjgoi2IrHu/qpGWX7PNSzVttpd90gzFFS269lvzs2I1qsb2pY7
-HVkCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEA
-uI3O7+cUus/usESSbLQ5PqKEbq24IXfS1HeCh+YgQYHu4vgRt2PRFze+GXYkHAQa
-TOs9qmdvLdTN/mUxcMUbpgIKumB7bVjCmkn+YzILa+M6wKyrO7Do0wlRjBCDxjTg
-xSvgGrZgFCdsMneMvLJymM/NzD+5yCRCFNZX/OYmQ6kd5YCQzgNUKD73P9P4Te1q
-CjqTE5s7FCMTY5w/0YcneeVMUeMBrYVdGjux1XMQpNPyvG5k9VpWkKjHDkx0Dy5x
-O/fIR/RpbxXyEV6DHpx8Uq79AtoSqFlnGNu8cN2bsWntgM6JQEhqDjXKKWYVIZQs
-6GAqm4VKQPNriiTsBhYscw==
------END CERTIFICATE-----
-
-# Issuer: CN=AAA Certificate Services O=Comodo CA Limited
-# Subject: CN=AAA Certificate Services O=Comodo CA Limited
-# Label: "Comodo AAA Services root"
-# Serial: 1
-# MD5 Fingerprint: 49:79:04:b0:eb:87:19:ac:47:b0:bc:11:51:9b:74:d0
-# SHA1 Fingerprint: d1:eb:23:a4:6d:17:d6:8f:d9:25:64:c2:f1:f1:60:17:64:d8:e3:49
-# SHA256 Fingerprint: d7:a7:a0:fb:5d:7e:27:31:d7:71:e9:48:4e:bc:de:f7:1d:5f:0c:3e:0a:29:48:78:2b:c8:3e:e0:ea:69:9e:f4
------BEGIN CERTIFICATE-----
-MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEb
-MBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow
-GAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmlj
-YXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAwMFoXDTI4MTIzMTIzNTk1OVowezEL
-MAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE
-B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
-l2D4kF501KKaU73yqWjgom7C12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3
-smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg==
------END CERTIFICATE-----
-
-# Issuer: CN=QuoVadis Root Certification Authority O=QuoVadis Limited OU=Root Certification Authority
-# Subject: CN=QuoVadis Root Certification Authority O=QuoVadis Limited OU=Root Certification Authority
-# Label: "QuoVadis Root CA"
-# Serial: 985026699
-# MD5 Fingerprint: 27:de:36:fe:72:b7:00:03:00:9d:f4:f0:1e:6c:04:24
-# SHA1 Fingerprint: de:3f:40:bd:50:93:d3:9b:6c:60:f6:da:bc:07:62:01:00:89:76:c9
-# SHA256 Fingerprint: a4:5e:de:3b:bb:f0:9c:8a:e1:5c:72:ef:c0:72:68:d6:93:a2:1c:99:6f:d5:1e:67:ca:07:94:60:fd:6d:88:73
------BEGIN CERTIFICATE-----
-MIIF0DCCBLigAwIBAgIEOrZQizANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJC
-TTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDElMCMGA1UECxMcUm9vdCBDZXJ0
-aWZpY2F0aW9uIEF1dGhvcml0eTEuMCwGA1UEAxMlUXVvVmFkaXMgUm9vdCBDZXJ0
-aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wMTAzMTkxODMzMzNaFw0yMTAzMTcxODMz
-MzNaMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMSUw
-IwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYDVQQDEyVR
-dW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG
-9w0BAQEFAAOCAQ8AMIIBCgKCAQEAv2G1lVO6V/z68mcLOhrfEYBklbTRvM16z/Yp
-li4kVEAkOPcahdxYTMukJ0KX0J+DisPkBgNbAKVRHnAEdOLB1Dqr1607BxgFjv2D
-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wIBBjANBgkqhkiG9w0BAQUFAAOCAQEAitQUtf70mpKnGdSk
-fnIYj9lofFIk3WdvOXrEql494liwTXCYhGHoG+NpGA7O+0dQoE7/8CQfvbLO9Sf8
-7C9TqnN7Az10buYWnuulLsS/VidQK2K6vkscPFVcQR0kvoIgR13VRH56FmjffU1R
-cHhXHTMe/QKZnAzNCgVPx7uOpHX6Sm2xgI4JVrmcGmD+XcHXetwReNDWXcG31a0y
-mQM6isxUJTkxgXsTIlG6Rmyhu576BGxJJnSP0nPrzDCi5upZIof4l/UO/erMkqQW
-xFIY6iHOsfHmhIHluqmGKPJDWl0Snawe2ajlCmqnf6CHKc/yiU3U7MXi5nrQNiOK
-SnQ2+Q==
------END CERTIFICATE-----
-
-# Issuer: CN=QuoVadis Root CA 2 O=QuoVadis Limited
-# Subject: CN=QuoVadis Root CA 2 O=QuoVadis Limited
-# Label: "QuoVadis Root CA 2"
-# Serial: 1289
-# MD5 Fingerprint: 5e:39:7b:dd:f8:ba:ec:82:e9:ac:62:ba:0c:54:00:2b
-# SHA1 Fingerprint: ca:3a:fb:cf:12:40:36:4b:44:b2:16:20:88:80:48:39:19:93:7c:f7
-# SHA256 Fingerprint: 85:a0:dd:7d:d7:20:ad:b7:ff:05:f8:3d:54:2b:20:9d:c7:ff:45:28:f7:d6:77:b1:83:89:fe:a5:e5:c4:9e:86
------BEGIN CERTIFICATE-----
-MIIFtzCCA5+gAwIBAgICBQkwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0x
-GTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJv
-b3QgQ0EgMjAeFw0wNjExMjQxODI3MDBaFw0zMTExMjQxODIzMzNaMEUxCzAJBgNV
-BAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMRswGQYDVQQDExJRdW9W
-YWRpcyBSb290IENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIK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9NLmeyhP3ZRPx3UIHmfLTJDQtyU/h2BwdBR5YM++CCJpNVjP4iH2Bl
-fF/nJrP3MpCYUNQ3cVX2kiF495V5+vgtJodmVjB3pjd4M1IQWK4/YY7yarHvGH5K
-WWPKjaJW1acvvFYfzznB4vsKqBUsfU16Y8Zsl0Q80m/DShcK+JDSV6IZUaUtl0Ha
-B0+pUNqQjZRG4T7wlP0QADj1O+hA4bRuVhogzG9Yje0uRY/W6ZM/57Es3zrWIozc
-hLsib9D45MY56QSIPMO661V6bYCZJPVsAfv4l7CUW+v90m/xd2gNNWQjrLhVoQPR
-TUIZ3Ph1WVaj+ahJefivDrkRoHy3au000LYmYjgahwz46P0u05B/B5EqHdZ+XIWD
-mbA4CD/pXvk1B+TJYm5Xf6dQlfe6yJvmjqIBxdZmv3lh8zwc4bmCXF2gw+nYSL0Z
-ohEUGW6yhhtoPkg3Goi3XZZenMfvJ2II4pEZXNLxId26F0KCl3GBUzGpn/Z9Yr9y
-4aOTHcyKJloJONDO1w2AFrR4pTqHTI2KpdVGl/IsELm8VCLAAVBpQ570su9t+Oza
-8eOx79+Rj1QqCyXBJhnEUhAFZdWCEOrCMc0u
------END CERTIFICATE-----
-
-# Issuer: CN=QuoVadis Root CA 3 O=QuoVadis Limited
-# Subject: CN=QuoVadis Root CA 3 O=QuoVadis Limited
-# Label: "QuoVadis Root CA 3"
-# Serial: 1478
-# MD5 Fingerprint: 31:85:3c:62:94:97:63:b9:aa:fd:89:4e:af:6f:e0:cf
-# SHA1 Fingerprint: 1f:49:14:f7:d8:74:95:1d:dd:ae:02:c0:be:fd:3a:2d:82:75:51:85
-# SHA256 Fingerprint: 18:f1:fc:7f:20:5d:f8:ad:dd:eb:7f:e0:07:dd:57:e3:af:37:5a:9c:4d:8d:73:54:6b:f4:f1:fe:d1:e1:8d:35
------BEGIN CERTIFICATE-----
-MIIGnTCCBIWgAwIBAgICBcYwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0x
-GTAXBgN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WhIstfTsEokt4YutUqKLsRixeT
-mJlglFwjz1onl14LBQaTNx47aTbrqZ5hHY8y2o4M1nQ+ewkk2gF3R8Q7zTSMmfXK
-4SVhM7JZG+Ju1zdXtg2pEto=
------END CERTIFICATE-----
-
-# Issuer: O=SECOM Trust.net OU=Security Communication RootCA1
-# Subject: O=SECOM Trust.net OU=Security Communication RootCA1
-# Label: "Security Communication Root CA"
-# Serial: 0
-# MD5 Fingerprint: f1:bc:63:6a:54:e0:b5:27:f5:cd:e7:1a:e3:4d:6e:4a
-# SHA1 Fingerprint: 36:b1:2b:49:f9:81:9e:d7:4c:9e:bc:38:0f:c6:56:8f:5d:ac:b2:f7
-# SHA256 Fingerprint: e7:5e:72:ed:9f:56:0e:ec:6e:b4:80:00:73:a4:3f:c3:ad:19:19:5a:39:22:82:01:78:95:97:4a:99:02:6b:6c
------BEGIN CERTIFICATE-----
-MIIDWjCCAkKgAwIBAgIBADANBgkqhkiG9w0BAQUFADBQMQswCQYDVQQGEwJKUDEY
-MBYGA1UEChMPU0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21t
-dW5pY2F0aW9uIFJvb3RDQTEwHhcNMDMwOTMwMDQyMDQ5WhcNMjMwOTMwMDQyMDQ5
-WjBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMPU0VDT00gVHJ1c3QubmV0MScwJQYD
-VQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEwggEiMA0GCSqGSIb3
-DQEBAQUAA4IBDwAwggEKAoIBAQCzs/5/022x7xZ8V6UMbXaKL0u/ZPtM7orw8yl8
-9f/uKuDp6bpbZCKamm8sOiZpUQWZJtzVHGpxxpp9Hp3dfGzGjGdnSj74cbAZJ6kJ
-DKaVv0uMDPpVmDvY6CKhS3E4eayXkmmziX7qIWgGmBSWh9JhNrxtJ1aeV+7AwFb9
-Ms+k2Y7CI9eNqPPYJayX5HA49LY6tJ07lyZDo6G8SVlyTCMwhwFY9k6+HGhWZq/N
-QV3Is00qVUarH9oe4kA92819uZKAnDfdDJZkndwi92SL32HeFZRSFaB9UslLqCHJ
-xrHty8OVYNEP8Ktw+N/LTX7s1vqr2b1/VPKl6Xn62dZ2JChzAgMBAAGjPzA9MB0G
-A1UdDgQWBBSgc0mZaNyFW2XjmygvV5+9M7wHSDALBgNVHQ8EBAMCAQYwDwYDVR0T
-AQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAaECpqLvkT115swW1F7NgE+vG
-kl3g0dNq/vu+m22/xwVtWSDEHPC32oRYAmP6SBbvT6UL90qY8j+eG61Ha2POCEfr
-Uj94nK9NrvjVT8+amCoQQTlSxN3Zmw7vkwGusi7KaEIkQmywszo+zenaSMQVy+n5
-Bw+SUEmK3TGXX8npN6o7WWWXlDLJs58+OmJYxUmtYg5xpTKqL8aJdkNAExNnPaJU
-JRDL8Try2frbSVa7pv6nQTXD4IhhyYjH3zYQIphZ6rBK+1YWc26sTfcioU+tHXot
-RSflMMFe8toTyyVCUZVHA4xsIcx0Qu1T/zOLjw9XARYvz6buyXAiFL39vmwLAw==
------END CERTIFICATE-----
-
-# Issuer: CN=Sonera Class2 CA O=Sonera
-# Subject: CN=Sonera Class2 CA O=Sonera
-# Label: "Sonera Class 2 Root CA"
-# Serial: 29
-# MD5 Fingerprint: a3:ec:75:0f:2e:88:df:fa:48:01:4e:0b:5c:48:6f:fb
-# SHA1 Fingerprint: 37:f7:6d:e6:07:7c:90:c5:b1:3e:93:1a:b7:41:10:b4:f2:e4:9a:27
-# SHA256 Fingerprint: 79:08:b4:03:14:c1:38:10:0b:51:8d:07:35:80:7f:fb:fc:f8:51:8a:00:95:33:71:05:ba:38:6b:15:3d:d9:27
------BEGIN CERTIFICATE-----
-MIIDIDCCAgigAwIBAgIBHTANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEP
-MA0GA1UEChMGU29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MyIENBMB4XDTAx
-MDQwNjA3Mjk0MFoXDTIxMDQwNjA3Mjk0MFowOTELMAkGA1UEBhMCRkkxDzANBgNV
-BAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJhIENsYXNzMiBDQTCCASIwDQYJKoZI
-hvcNAQEBBQADggEPADCCAQoCggEBAJAXSjWdyvANlsdE+hY3/Ei9vX+ALTU74W+o
-Z6m/AxxNjG8yR9VBaKQTBME1DJqEQ/xcHf+Js+gXGM2RX/uJ4+q/Tl18GybTdXnt
-5oTjV+WtKcT0OijnpXuENmmz/V52vaMtmdOQTiMofRhj8VQ7Jp12W5dCsv+u8E7s
-3TmVToMGf+dJQMjFAbJUWmYdPfz56TwKnoG4cPABi+QjVHzIrviQHgCWctRUz2Ej
-vOr7nQKV0ba5cTppCD8PtOFCx4j1P5iop7oc4HFx71hXgVB6XGt0Rg6DA5jDjqhu
-8nYybieDwnPz3BjotJPqdURrBGAgcVeHnfO+oJAjPYok4doh28MCAwEAAaMzMDEw
-DwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQISqCqWITTXjwwCwYDVR0PBAQDAgEG
-MA0GCSqGSIb3DQEBBQUAA4IBAQBazof5FnIVV0sd2ZvnoiYw7JNn39Yt0jSv9zil
-zqsWuasvfDXLrNAPtEwr/IDva4yRXzZ299uzGxnq9LIR/WFxRL8oszodv7ND6J+/
-3DEIcbCdjdY0RzKQxmUk96BKfARzjzlvF4xytb1LyHr4e4PDKE6cCepnP7JnBBvD
-FNr450kkkdAdavphOe9r5yF1BgfYErQhIHBCcYHaPJo2vqZbDWpsmh+Re/n570K6
-Tk6ezAyNlNzZRZxe7EJQY670XcSxEtzKO6gunRRaBXW37Ndj4ro1tgQIkejanZz2
-ZrUYrAqmVCY0M9IbwdR/GjqOC6oybtv8TyWf2TLHllpwrN9M
------END CERTIFICATE-----
-
-# Issuer: CN=Chambers of Commerce Root O=AC Camerfirma SA CIF A82743287 OU=http://www.chambersign.org
-# Subject: CN=Chambers of Commerce Root O=AC Camerfirma SA CIF A82743287 OU=http://www.chambersign.org
-# Label: "Camerfirma Chambers of Commerce Root"
-# Serial: 0
-# MD5 Fingerprint: b0:01:ee:14:d9:af:29:18:94:76:8e:f1:69:33:2a:84
-# SHA1 Fingerprint: 6e:3a:55:a4:19:0c:19:5c:93:84:3c:c0:db:72:2e:31:30:61:f0:b1
-# SHA256 Fingerprint: 0c:25:8a:12:a5:67:4a:ef:25:f2:8b:a7:dc:fa:ec:ee:a3:48:e5:41:e6:f5:cc:4e:e6:3b:71:b3:61:60:6a:c3
------BEGIN CERTIFICATE-----
-MIIEvTCCA6WgAwIBAgIBADANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJFVTEn
-MCUGA1UEChMeQUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQL
-ExpodHRwOi8vd3d3LmNoYW1iZXJzaWduLm9yZzEiMCAGA1UEAxMZQ2hhbWJlcnMg
-b2YgQ29tbWVyY2UgUm9vdDAeFw0wMzA5MzAxNjEzNDNaFw0zNzA5MzAxNjEzNDRa
-MH8xCzAJBgNVBAYTAkVVMScwJQYDVQQKEx5BQyBDYW1lcmZpcm1hIFNBIENJRiBB
-ODI3NDMyODcxIzAhBgNVBAsTGmh0dHA6Ly93d3cuY2hhbWJlcnNpZ24ub3JnMSIw
-IAYDVQQDExlDaGFtYmVycyBvZiBDb21tZXJjZSBSb290MIIBIDANBgkqhkiG9w0B
-AQEFAAOCAQ0AMIIBCAKCAQEAtzZV5aVdGDDg2olUkfzIx1L4L1DZ77F1c2VHfRtb
-unXF/KGIJPov7coISjlUxFF6tdpg6jg8gbLL8bvZkSM/SAFwdakFKq0fcfPJVD0d
-BmpAPrMMhe5cG3nCYsS4No41XQEMIwRHNaqbYE6gZj3LJgqcQKH0XZi/caulAGgq
-7YN6D6IUtdQis4CwPAxaUWktWBiP7Zme8a7ileb2R6jWDA+wWFjbw2Y3npuRVDM3
-0pQcakjJyfKl2qUMI/cjDpwyVV5xnIQFUZot/eZOKjRa3spAN2cMVCFVd9oKDMyX
-roDclDZK9D7ONhMeU+SsTjoF7Nuucpw4i9A5O4kKPnf+dQIBA6OCAUQwggFAMBIG
-A1UdEwEB/wQIMAYBAf8CAQwwPAYDVR0fBDUwMzAxoC+gLYYraHR0cDovL2NybC5j
-aGFtYmVyc2lnbi5vcmcvY2hhbWJlcnNyb290LmNybDAdBgNVHQ4EFgQU45T1sU3p
-26EpW1eLTXYGduHRooowDgYDVR0PAQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIA
-BzAnBgNVHREEIDAegRxjaGFtYmVyc3Jvb3RAY2hhbWJlcnNpZ24ub3JnMCcGA1Ud
-EgQgMB6BHGNoYW1iZXJzcm9vdEBjaGFtYmVyc2lnbi5vcmcwWAYDVR0gBFEwTzBN
-BgsrBgEEAYGHLgoDATA+MDwGCCsGAQUFBwIBFjBodHRwOi8vY3BzLmNoYW1iZXJz
-aWduLm9yZy9jcHMvY2hhbWJlcnNyb290Lmh0bWwwDQYJKoZIhvcNAQEFBQADggEB
-AAxBl8IahsAifJ/7kPMa0QOx7xP5IV8EnNrJpY0nbJaHkb5BkAFyk+cefV/2icZd
-p0AJPaxJRUXcLo0waLIJuvvDL8y6C98/d3tGfToSJI6WjzwFCm/SlCgdbQzALogi
-1djPHRPH8EjX1wWnz8dHnjs8NMiAT9QUu/wNUPf6s+xCX6ndbcj0dc97wXImsQEc
-XCz9ek60AcUFV7nnPKoF2YjpB0ZBzu9Bga5Y34OirsrXdx/nADydb47kMgkdTXg0
-eDQ8lJsm7U9xxhl6vSAiSFr+S30Dt+dYvsYyTnQeaN2oaFuzPu5ifdmA6Ap1erfu
-tGWaIZDgqtCYvDi1czyL+Nw=
------END CERTIFICATE-----
-
-# Issuer: CN=Global Chambersign Root O=AC Camerfirma SA CIF A82743287 OU=http://www.chambersign.org
-# Subject: CN=Global Chambersign Root O=AC Camerfirma SA CIF A82743287 OU=http://www.chambersign.org
-# Label: "Camerfirma Global Chambersign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Qpe/SyBoT+rB/sYIcd2oPX9wLlY/vQ37mRQklAgEDo4IBUDCCAUwwEgYDVR0T
-AQH/BAgwBgEB/wIBDDA/BgNVHR8EODA2MDSgMqAwhi5odHRwOi8vY3JsLmNoYW1i
-ZXJzaWduLm9yZy9jaGFtYmVyc2lnbnJvb3QuY3JsMB0GA1UdDgQWBBRDnDafsJ4w
-TcbOX60Qq+UDpfqpFDAOBgNVHQ8BAf8EBAMCAQYwEQYJYIZIAYb4QgEBBAQDAgAH
-MCoGA1UdEQQjMCGBH2NoYW1iZXJzaWducm9vdEBjaGFtYmVyc2lnbi5vcmcwKgYD
-VR0SBCMwIYEfY2hhbWJlcnNpZ25yb290QGNoYW1iZXJzaWduLm9yZzBbBgNVHSAE
-VDBSMFAGCysGAQQBgYcuCgEBMEEwPwYIKwYBBQUHAgEWM2h0dHA6Ly9jcHMuY2hh
-bWJlcnNpZ24ub3JnL2Nwcy9jaGFtYmVyc2lnbnJvb3QuaHRtbDANBgkqhkiG9w0B
-AQUFAAOCAQEAPDtwkfkEVCeR4e3t/mh/YV3lQWVPMvEYBZRqHN4fcNs+ezICNLUM
-bKGKfKX0j//U2K0X1S0E0T9YgOKBWYi+wONGkyT+kL0mojAt6JcmVzWJdJYY9hXi
-ryQZVgICsroPFOrGimbBhkVVi76SvpykBMdJPJ7oKXqJ1/6v/2j1pReQvayZzKWG
-VwlnRtvWFsJG8eSpUPWP0ZIV018+xgBJOm5YstHRJw0lyDL4IBHNfTIzSJRUTN3c
-ecQwn+uOuFW114hcxWokPbLTBQNRxgfvzBRydD1ucs4YKIxKoHflCStFREest2d/
-AYoFWpO+ocH/+OcOZ6RHSXZddZAa9SaP8A==
------END CERTIFICATE-----
-
-# Issuer: CN=XRamp Global Certification Authority O=XRamp Security Services Inc OU=www.xrampsecurity.com
-# Subject: CN=XRamp Global Certification Authority O=XRamp Security Services Inc OU=www.xrampsecurity.com
-# Label: "XRamp Global CA Root"
-# Serial: 107108908803651509692980124233745014957
-# MD5 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uIjhdV6Db1q4Ons7Be7QhtnqiXtRYMh/MHJfNVi
-PvryxS3T/dRlAgMBAAGjgZ8wgZwwEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0P
-BAQDAgGGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFMZPoj0GY4QJnM5i5ASs
-jVy16bYbMDYGA1UdHwQvMC0wK6ApoCeGJWh0dHA6Ly9jcmwueHJhbXBzZWN1cml0
-eS5jb20vWEdDQS5jcmwwEAYJKwYBBAGCNxUBBAMCAQEwDQYJKoZIhvcNAQEFBQAD
-ggEBAJEVOQMBG2f7Shz5CmBbodpNl2L5JFMn14JkTpAuw0kbK5rc/Kh4ZzXxHfAR
-vbdI4xD2Dd8/0sm2qlWkSLoC295ZLhVbO50WfUfXN+pfTXYSNrsf16GBBEYgoyxt
-qZ4Bfj8pzgCT3/3JknOJiWSe5yvkHJEs0rnOfc5vMZnT5r7SHpDwCRR5XCOrTdLa
-IR9NmXmd4c8nnxCbHIgNsIpkQTG4DmyQJKSbXHGPurt+HBvbaoAPIbzp26a3QPSy
-i6mx5O+aGtA9aZnuqCij4Tyz8LIRnM98QObd50N9otg6tamN8jSZxNQQ4Qb9CYQQ
-O+7ETPTsJ3xCwnR8gooJybQDJbw=
------END CERTIFICATE-----
-
-# Issuer: O=The Go Daddy Group, Inc. OU=Go Daddy Class 2 Certification Authority
-# Subject: O=The Go Daddy Group, Inc. OU=Go Daddy Class 2 Certification Authority
-# Label: "Go Daddy Class 2 CA"
-# Serial: 0
-# MD5 Fingerprint: 91:de:06:25:ab:da:fd:32:17:0c:bb:25:17:2a:84:67
-# SHA1 Fingerprint: 27:96:ba:e6:3f:18:01:e2:77:26:1b:a0:d7:77:70:02:8f:20:ee:e4
-# SHA256 Fingerprint: c3:84:6b:f2:4b:9e:93:ca:64:27:4c:0e:c6:7c:1e:cc:5e:02:4f:fc:ac:d2:d7:40:19:35:0e:81:fe:54:6a:e4
------BEGIN CERTIFICATE-----
-MIIE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EsahB4yOd6AzBhRckB4Y9wimPQoZ+YeAEW5p5JYXMP80kWNy
-OO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKtI3lpjbi2Tc7P
-TMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ
-HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mER
-dEr/VxqHD3VILs9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5Cuf
-ReYNnyicsbkqWletNw+vHX/bvZ8=
------END CERTIFICATE-----
-
-# Issuer: O=Starfield Technologies, Inc. OU=Starfield Class 2 Certification Authority
-# Subject: O=Starfield Technologies, Inc. OU=Starfield Class 2 Certification Authority
-# Label: "Starfield Class 2 CA"
-# Serial: 0
-# MD5 Fingerprint: 32:4a:4b:bb:c8:63:69:9b:be:74:9a:c6:dd:1d:46:24
-# SHA1 Fingerprint: ad:7e:1c:28:b0:64:ef:8f:60:03:40:20:14:c3:d0:e3:37:0e:b5:8a
-# SHA256 Fingerprint: 14:65:fa:20:53:97:b8:76:fa:a6:f0:a9:95:8e:55:90:e4:0f:cc:7f:aa:4f:b7:c2:c8:67:75:21:fb:5f:b6:58
------BEGIN CERTIFICATE-----
-MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzEl
-MCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMp
-U3RhcmZpZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQw
-NjI5MTczOTE2WhcNMzQwNjI5MTczOTE2WjBoMQswCQYDVQQGEwJVUzElMCMGA1UE
-ChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZp
-ZWxkIENsYXNzIDIgQ2VydGlmaWNhdG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er: CN=StartCom Certification Authority O=StartCom Ltd. OU=Secure Digital Certificate Signing
-# Subject: CN=StartCom Certification Authority O=StartCom Ltd. OU=Secure Digital Certificate Signing
-# Label: "StartCom Certification Authority"
-# Serial: 1
-# MD5 Fingerprint: 22:4d:8f:8a:fc:f7:35:c2:bb:57:34:90:7b:8b:22:16
-# SHA1 Fingerprint: 3e:2b:f7:f2:03:1b:96:f3:8c:e6:c4:d8:a8:5d:3e:2d:58:47:6a:0f
-# SHA256 Fingerprint: c7:66:a9:be:f2:d4:07:1c:86:3a:31:aa:49:20:e8:13:b2:d1:98:60:8c:b7:b7:cf:e2:11:43:b8:36:df:09:ea
------BEGIN CERTIFICATE-----
-MIIHyTCCBbGgAwIBAgIBATANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJJTDEW
-MBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwg
-Q2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNh
-dGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0NjM2WhcNMzYwOTE3MTk0NjM2WjB9
-MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMi
-U2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3Rh
-cnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUA
-A4ICDwAwggIKAoICAQDBiNsJvGxGfHiflXu1M5DycmLWwTYgIiRezul38kMKogZk
-pMyONvg45iPwbm2xPN1yo4UcodM9tDMr0y+v/uqwQVlntsQGfQqedIXWeUyAN3rf
-OQVSWff0G0ZDpNKFhdLDcfN1YjS6LIp/Ho/u7TTQEceWzVI9ujPW3U3eCztKS5/C
-Ji/6tRYccjV3yjxd5srhJosaNnZcAdt0FCX+7bWgiA/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WdhbCBMaW1pdGF0aW9ucyogb2Yg
-dGhlIFN0YXJ0Q29tIENlcnRpZmljYXRpb24gQXV0aG9yaXR5IFBvbGljeSBhdmFp
-bGFibGUgYXQgaHR0cDovL2NlcnQuc3RhcnRjb20ub3JnL3BvbGljeS5wZGYwEQYJ
-YIZIAYb4QgEBBAQDAgAHMDgGCWCGSAGG+EIBDQQrFilTdGFydENvbSBGcmVlIFNT
-TCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTANBgkqhkiG9w0BAQUFAAOCAgEAFmyZ
-9GYMNPXQhV59CuzaEE44HF7fpiUFS5Eyweg78T3dRAlbB0mKKctmArexmvclmAk8
-jhvh3TaHK0u7aNM5Zj2gJsfyOZEdUauCe37Vzlrk4gNXcGmXCPleWKYK34wGmkUW
-FjgKXlf2Ysd6AgXmvB618p70qSmD+LIU424oh0TDkBreOKk8rENNZEXO3SipXPJz
-ewT4F+irsfMuXGRuczE6Eri8sxHkfY+BUZo7jYn0TZNmezwD7dOaHZrzZVD1oNB1
-ny+v8OqCQ5j4aZyJecRDjkZy42Q2Eq/3JR44iZB3fsNrarnDy0RLrHiQi+fHLB5L
-EUTINFInzQpdn4XBidUaePKVEFMy3YCEZnXZtWgo+2EuvoSoOMCZEoalHmdkrQYu
-L6lwhceWD3yJZfWOQ1QOq92lgDmUYMA0yZZwLKMS9R9Ie70cfmu3nZD0Ijuu+Pwq
-yvqCUqDvr0tVk+vBtfAii6w0TiYiBKGHLHVKt+V9E9e4DGTANtLJL4YSjCMJwRuC
-O3NJo2pXh5Tl1njFmUNj403gdy3hZZlyaQQaRwnmDwFWJPsfvw55qVguucQJAX6V
-um0ABj6y6koQOdjQK/W/7HW/lwLFCRsI3FU34oH7N4RDYiDK51ZLZer+bMEkkySh
-NOsF/5oirpt9P/FlUQqmMGqz9IgcgA38corog14=
------END CERTIFICATE-----
-
-# Issuer: O=Government Root Certification Authority
-# Subject: O=Government Root Certification Authority
-# Label: "Taiwan GRCA"
-# Serial: 42023070807708724159991140556527066870
-# MD5 Fingerprint: 37:85:44:53:32:45:1f:20:f0:f3:95:e1:25:c4:43:4e
-# SHA1 Fingerprint: f4:8b:11:bf:de:ab:be:94:54:20:71:e6:41:de:6b:be:88:2b:40:b9
-# SHA256 Fingerprint: 76:00:29:5e:ef:e8:5b:9e:1f:d6:24:db:76:06:2a:aa:ae:59:81:8a:54:d2:77:4c:d4:c0:b2:c0:11:31:e1:b3
------BEGIN CERTIFICATE-----
-MIIFcjCCA1qgAwIBAgIQH51ZWtcvwgZEpYAIaeNe9jANBgkqhkiG9w0BAQUFADA/
-MQswCQYDVQQGEwJUVzEwMC4GA1UECgwnR292ZXJubWVudCBSb290IENlcnRpZmlj
-YXRpb24gQXV0aG9yaXR5MB4XDTAyMTIwNTEzMjMzM1oXDTMyMTIwNTEzMjMzM1ow
-PzELMAkGA1UEBhMCVFcxMDAuBgNVBAoMJ0dvdmVybm1lbnQgUm9vdCBDZXJ0aWZp
-Y2F0aW9uIEF1dGhvcml0eTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIB
-AJoluOzMonWoe/fOW1mKydGGEghU7Jzy50b2iPN86aXfTEc2pBsBHH8eV4qNw8XR
-IePaJD9IK/ufLqGU5ywck9G/GwGHU5nOp/UKIXZ3/6m3xnOUT0b3EEk3+qhZSV1q
-gQdW8or5BtD3cCJNtLdBuTK4sfCxw5w/cP1T3YGq2GN49thTbqGsaoQkclSGxtKy
-yhwOeYHWtXBiCAEuTk8O1RGvqa/lmr/czIdtJuTJV6L7lvnM4T9TjGxMfptTCAts
-F/tnyMKtsc2AtJfcdgEWFelq16TheEfOhtX7MfP6Mb40qij7cEwdScevLJ1tZqa2
-jWR+tSBqnTuBto9AAGdLiYa4zGX+FVPpBMHWXx1E1wovJ5pGfaENda1UhhXcSTvx
-ls4Pm6Dso3pdvtUqdULle96ltqqvKKyskKw4t9VoNSZ63Pc78/1Fm9G7Q3hub/FC
-VGqY8A2tl+lSXunVanLeavcbYBT0peS2c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QAu4njIT/rEUNE1yDMuAl
-pYYsfPQS
------END CERTIFICATE-----
-
-# Issuer: CN=DigiCert Assured ID Root CA O=DigiCert Inc OU=www.digicert.com
-# Subject: CN=DigiCert Assured ID Root CA O=DigiCert Inc OU=www.digicert.com
-# Label: "DigiCert Assured ID Root CA"
-# Serial: 17154717934120587862167794914071425081
-# MD5 Fingerprint: 87:ce:0b:7b:2a:0e:49:00:e1:58:71:9b:37:a8:93:72
-# SHA1 Fingerprint: 05:63:b8:63:0d:62:d7:5a:bb:c8:ab:1e:4b:df:b5:a8:99:b2:4d:43
-# SHA256 Fingerprint: 3e:90:99:b5:01:5e:8f:48:6c:00:bc:ea:9d:11:1e:e7:21:fa:ba:35:5a:89:bc:f1:df:69:56:1e:3d:c6:32:5c
------BEGIN CERTIFICATE-----
-MIIDtzCCAp+gAwIBAgIQDOfg5RfYRv6P5WD8G/AwOTANBgkqhkiG9w0BAQUFADBl
-MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
-d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJv
-b3QgQ0EwHhcNMDYxMTEwMDAwMDAwWhcNMzExMTEwMDAwMDAwWjBlMQswCQYDVQQG
-EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNl
-cnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0EwggEi
-MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtDhXO5EOAXLGH87dg+XESpa7c
-JpSIqvTO9SA5KFhgDPiA2qkVlTJhPLWxKISKityfCgyDF3qPkKyK53lTXDGEKvYP
-mDI2dsze3Tyoou9q+yHyUmHfnyDXH+Kx2f4YZNISW1/5WBg1vEfNoTb5a3/UsDg+
-wRvDjDPZ2C8Y/igPs6eD1sNuRMBhNZYW/lmci3Zt1/GiSw0r/wty2p5g0I6QNcZ4
-VYcgoc/lbQrISXwxmDNsIumH0DJaoroTghHtORedmTpyoeb6pNnVFzF1roV9Iq4/
-AUaG9ih5yLHa5FcXxH4cDrC0kqZWs72yl+2qp/C3xag/lRbQ/6GW6whfGHdPAgMB
-AAGjYzBhMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQW
-BBRF66Kv9JLLgjEtUYunpyGd823IDzAfBgNVHSMEGDAWgBRF66Kv9JLLgjEtUYun
-pyGd823IDzANBgkqhkiG9w0BAQUFAAOCAQEAog683+Lt8ONyc3pklL/3cmbYMuRC
-dWKuh+vy1dneVrOfzM4UKLkNl2BcEkxY5NM9g0lFWJc1aRqoR+pWxnmrEthngYTf
-fwk8lOa4JiwgvT2zKIn3X/8i4peEH+ll74fg38FnSbNd67IJKusm7Xi+fT8r87cm
-NW1fiQG2SVufAQWbqz0lwcy2f8Lxb4bG+mRo64EtlOtCt/qMHt1i8b5QZ7dsvfPx
-H2sMNgcWfzd8qVttevESRmCD1ycEvkvOl77DZypoEd+A5wwzZr8TDRRu838fYxAe
-+o0bJW1sj6W3YQGx0qMmoRBxna3iw/nDmVG3KwcIzi7mULKn+gpFL6Lw8g==
------END CERTIFICATE-----
-
-# Issuer: CN=DigiCert Global Root CA O=DigiCert Inc OU=www.digicert.com
-# Subject: CN=DigiCert Global Root CA O=DigiCert Inc OU=www.digicert.com
-# Label: "DigiCert Global Root CA"
-# Serial: 10944719598952040374951832963794454346
-# MD5 Fingerprint: 79:e4:a9:84:0d:7d:3a:96:d7:c0:4f:e2:43:4c:89:2e
-# SHA1 Fingerprint: a8:98:5d:3a:65:e5:e5:c4:b2:d7:d6:6d:40:c6:dd:2f:b1:9c:54:36
-# SHA256 Fingerprint: 43:48:a0:e9:44:4c:78:cb:26:5e:05:8d:5e:89:44:b4:d8:4f:96:62:bd:26:db:25:7f:89:34:a4:43:c7:01:61
------BEGIN CERTIFICATE-----
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41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJF
-PnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls
-YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk
-CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=
------END CERTIFICATE-----
-
-# Issuer: CN=DigiCert High Assurance EV Root CA O=DigiCert Inc OU=www.digicert.com
-# Subject: CN=DigiCert High Assurance EV Root CA O=DigiCert Inc OU=www.digicert.com
-# Label: "DigiCert High Assurance EV Root CA"
-# Serial: 3553400076410547919724730734378100087
-# MD5 Fingerprint: d4:74:de:57:5c:39:b2:d3:9c:85:83:c5:c0:65:49:8a
-# SHA1 Fingerprint: 5f:b7:ee:06:33:e2:59:db:ad:0c:4c:9a:e6:d3:8f:1a:61:c7:dc:25
-# SHA256 Fingerprint: 74:31:e5:f4:c3:c1:ce:46:90:77:4f:0b:61:e0:54:40:88:3b:a9:a0:1e:d0:0b:a6:ab:d7:80:6e:d3:b1:18:cf
------BEGIN CERTIFICATE-----
-MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBs
-MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
-d3cuZGlnaWNlcnQuY29tMSswKQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5j
-ZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAwMFoXDTMxMTExMDAwMDAwMFowbDEL
-MAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZMBcGA1UECxMQd3d3
-LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFuY2Ug
-RVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm
-+9S75S0tMqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTW
-PNt0OKRKzE0lgvdKpVMSOO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEM
-xChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFB
-Ik5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQNAQTXKFx01p8VdteZOE3
-hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUeh10aUAsg
-EsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQF
-MAMBAf8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaA
-FLE+w2kD+L9HAdSYJhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3Nec
-nzyIZgYIVyHbIUf4KmeqvxgydkAQV8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6z
-eM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFpmyPInngiK3BD41VHMWEZ71jF
-hS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkKmNEVX58Svnw2
-Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe
-vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep
-+OkuE6N36B9K
------END CERTIFICATE-----
-
-# Issuer: CN=Class 2 Primary CA O=Certplus
-# Subject: CN=Class 2 Primary CA O=Certplus
-# Label: "Certplus Class 2 Primary CA"
-# Serial: 177770208045934040241468760488327595043
-# MD5 Fingerprint: 88:2c:8c:52:b8:a2:3c:f3:f7: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u
-Y29tL0NSTC9jbGFzczIuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQCnVM+IRBnL39R/
-AN9WM2K191EBkOvDP9GIROkkXe/nFL0gt5o8AP5tn9uQ3Nf0YtaLcF3n5QRIqWh8
-yfFC82x/xXp8HVGIutIKPidd3i1RTtMTZGnkLuPT55sJmabglZvOGtd/vjzOUrMR
-FcEPF80Du5wlFbqidon8BvEY0JNLDnyCt6X09l/+7UCmnYR0ObncHoUW2ikbhiMA
-ybuJfm6AiB4vFLQDJKgybwOaRywwvlbGp0ICcBvqQNi6BQNwB6SW//1IMwrh3KWB
-kJtN3X3n57LNXMhqlfil9o3EXXgIvnsG1knPGTZQIy4I5p4FTUcY1Rbpsda2ENW7
-l7+ijrRU
------END CERTIFICATE-----
-
-# Issuer: CN=DST Root CA X3 O=Digital Signature Trust Co.
-# Subject: CN=DST Root CA X3 O=Digital Signature Trust Co.
-# Label: "DST Root CA X3"
-# Serial: 91299735575339953335919266965803778155
-# MD5 Fingerprint: 41:03:52:dc:0f:f7:50:1b:16:f0:02:8e:ba:6f:45:c5
-# SHA1 Fingerprint: da:c9:02:4f:54:d8:f6:df:94:93:5f:b1:73:26:38:ca:6a:d7:7c:13
-# SHA256 Fingerprint: 06:87:26:03:31:a7:24:03:d9:09:f1:05:e6:9b:cf:0d:32:e1:bd:24:93:ff:c6:d9:20:6d:11:bc:d6:77:07:39
------BEGIN CERTIFICATE-----
-MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/
-MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT
-DkRTVCBSb290IENBIFgzMB4XDTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVow
-PzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRcwFQYDVQQD
-Ew5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB
-AN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmTrE4O
-rz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEq
-OLl5CjH9UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9b
-xiqKqy69cK3FCxolkHRyxXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw
-7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40dutolucbY38EVAjqr2m7xPi71XAicPNaD
-aeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNV
-HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQMA0GCSqG
-SIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69
-ikugdB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXr
-AvHRAosZy5Q6XkjEGB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZz
-R8srzJmwN0jP41ZL9c8PDHIyh8bwRLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5
-JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubSfZGL+T0yjWW06XyxV3bqxbYo
-Ob8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ
------END CERTIFICATE-----
-
-# Issuer: CN=DST ACES CA X6 O=Digital Signature Trust OU=DST ACES
-# Subject: CN=DST ACES CA X6 O=Digital Signature Trust OU=DST ACES
-# Label: "DST ACES CA X6"
-# Serial: 17771143917277623872238992636097467865
-# MD5 Fingerprint: 21:d8:4c:82:2b:99:09:33:a2:eb:14:24:8d:8e:5f:e8
-# SHA1 Fingerprint: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EBATBJMEcGCCsGAQUFBwIBFjto
-dHRwOi8vd3d3LnRydXN0ZHN0LmNvbS9jZXJ0aWZpY2F0ZXMvcG9saWN5L0FDRVMt
-aW5kZXguaHRtbDAdBgNVHQ4EFgQUCXIGThhDD+XWzMNqizF7eI+og7gwDQYJKoZI
-hvcNAQEFBQADggEBAKPYjtay284F5zLNAdMEA+V25FYrnJmQ6AgwbN99Pe7lv7Uk
-QIRJ4dEorsTCOlMwiPH1d25Ryvr/ma8kXxug/fKshMrfqfBfBC6tFr8hlxCBPeP/
-h40y3JTlR4peahPJlJU90u7INJXQgNStMgiAVDzgvVJT11J8smk/f3rPanTK+gQq
-nExaBqXpIK1FZg9p8d2/6eMyi/rgwYZNcjwu2JN4Cir42NInPRmJX1p7ijvMDNpR
-rscL9yuwNwXsvFcj4jjSm2jzVhKIT0J8uDHEtdvkyCE06UgRNe76x5JXxZ805Mf2
-9w4LTJxoeHtxMcfrHuBnQfO3oKfN5XozNmr6mis=
------END CERTIFICATE-----
-
-# Issuer: CN=SwissSign Gold CA - G2 O=SwissSign AG
-# Subject: CN=SwissSign Gold CA - G2 O=SwissSign AG
-# Label: "SwissSign Gold CA - G2"
-# Serial: 13492815561806991280
-# MD5 Fingerprint: 24:77:d9:a8:91:d1:3b:fa:88:2d:c2:ff:f8:cd:33:93
-# SHA1 Fingerprint: d8:c5:38:8a:b7:30:1b:1b:6e:d4:7a:e6:45:25:3a:6f:9f:1a:27:61
-# SHA256 Fingerprint: 62:dd:0b:e9:b9:f5:0a:16:3e:a0:f8:e7:5c:05:3b:1e:ca:57:ea:55:c8:68:8f:64:7c:68:81:f2:c8:35:7b:95
------BEGIN CERTIFICATE-----
-MIIFujCCA6KgAwIBAgIJALtAHEP1Xk+wMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV
-BAYTAkNIMRUwEwYDVQQKEwxTd2lzc1NpZ24gQUcxHzAdBgNVBAMTFlN3aXNzU2ln
-biBHb2xkIENBIC0gRzIwHhcNMDYxMDI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gEFBQcCARYgaHR0cDov
-L3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBACe6
-45R88a7A3hfm5djV9VSwg/S7zV4Fe0+fdWavPOhWfvxyeDgD2StiGwC5+OlgzczO
-UYrHUDFu4Up+GC9pWbY9ZIEr44OE5iKHjn3g7gKZYbge9LgriBIWhMIxkziWMaa5
-O1M/wySTVltpkuzFwbs4AOPsF6m43Md8AYOfMke6UiI0HTJ6CVanfCU2qT1L2sCC
-bwq7EsiHSycR+R4tx5M/nttfJmtS2S6K8RTGRI0Vqbe/vd6mGu6uLftIdxf+u+yv
-GPUqUfA5hJeVbG4bwyvEdGB5JbAKJ9/fXtI5z0V9QkvfsywexcZdylU6oJxpmo/a
-77KwPJ+HbBIrZXAVUjEaJM9vMSNQH4xPjyPDdEFjHFWoFN0+4FFQz/EbMFYOkrCC
-hdiDyyJkvC24JdVUorgG6q2SpCSgwYa1ShNqR88uC1aVVMvOmttqtKay20EIhid3
-92qgQmwLOM7XdVAyksLfKzAiSNDVQTglXaTpXZ/GlHXQRf0wl0OPkKsKx4ZzYEpp
-Ld6leNcG2mqeSz53OiATIgHQv2ieY2BrNU0LbbqhPcCT4H8js1WtciVORvnSFu+w
-ZMEBnunKoGqYDs/YYPIvSbjkQuE4NRb0yG5P94FW6LqjviOvrv1vA+ACOzB2+htt
-Qc8Bsem4yWb02ybzOqR08kkkW8mw0FfB+j564ZfJ
------END CERTIFICATE-----
-
-# Issuer: CN=SwissSign Silver CA - G2 O=SwissSign AG
-# Subject: CN=SwissSign Silver CA - G2 O=SwissSign AG
-# Label: "SwissSign Silver CA - G2"
-# Serial: 5700383053117599563
-# MD5 Fingerprint: e0:06:a1:c9:7d:cf:c9:fc:0d:c0:56:75:96:d8:62:13
-# SHA1 Fingerprint: 9b:aa:e5:9f:56:ee:21:cb:43:5a:be:25:93:df:a7:f0:40:d1:1d:cb
-# SHA256 Fingerprint: be:6c:4d:a2:bb:b9:ba:59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GeoTrust Primary Certification Authority O=GeoTrust Inc.
-# Subject: CN=GeoTrust Primary Certification Authority O=GeoTrust Inc.
-# Label: "GeoTrust Primary Certification Authority"
-# Serial: 32798226551256963324313806436981982369
-# MD5 Fingerprint: 02:26:c3:01:5e:08:30:37:43:a9:d0:7d:cf:37:e6:bf
-# SHA1 Fingerprint: 32:3c:11:8e:1b:f7:b8:b6:52:54:e2:e2:10:0d:d6:02:90:37:f0:96
-# SHA256 Fingerprint: 37:d5:10:06:c5:12:ea:ab:62:64:21:f1:ec:8c:92:01:3f:c5:f8:2a:e9:8e:e5:33:eb:46:19:b8:de:b4:d0:6c
------BEGIN CERTIFICATE-----
-MIIDfDCCAmSgAwIBAgIQGKy1av1pthU6Y2yv2vrEoTANBgkqhkiG9w0BAQUFADBY
-MQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjExMC8GA1UEAxMo
-R2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjEx
-MjcwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMFgxCzAJBgNVBAYTAlVTMRYwFAYDVQQK
-Ew1HZW9UcnVzdCBJbmMuMTEwLwYDVQQDEyhHZW9UcnVzdCBQcmltYXJ5IENlcnRp
-ZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC
-AQEAvrgVe//UfH1nrYNke8hCUy3f9oQIIGHWAVlqnEQRr+92/ZV+zmEwu3qDXwK9
-AWbK7hWNb6EwnL2hhZ6UOvNWiAAxz9juapYC2e0DjPt1befquFUWBRaa9OBesYjA
-ZIVcFU2Ix7e64HXprQU9nceJSOC7KMgD4TCTZF5SwFlwIjVXiIrxlQqD17wxcwE0
-7e9GceBrAqg1cmuXm2bgyxx5X9gaBGgeRwLmnWDiNpcB3841kt++Z8dtd1k7j53W
-kBWUvEI0EME5+bEnPn7WinXFsq+W06Lem+SYvn3h6YGttm/81w7a4DSwDRp35+MI
-mO9Y+pyEtzavwt+s0vQQBnBxNQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4G
-A1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQULNVQQZcVi/CPNmFbSvtr2ZnJM5IwDQYJ
-KoZIhvcNAQEFBQADggEBAFpwfyzdtzRP9YZRqSa+S7iq8XEN3GHHoOo0Hnp3DwQ1
-6CePbJC/kRYkRj5KTs4rFtULUh38H2eiAkUxT87z+gOneZ1TatnaYzr4gNfTmeGl
-4b7UVXGYNTq+k+qurUKykG/g/CFNNWMziUnWm07Kx+dOCQD32sfvmWKZd7aVIl6K
-oKv0uHiYyjgZmclynnjNS6yvGaBzEi38wkG6gZHaFloxt/m0cYASSJlyc1pZU8Fj
-UjPtp8nSOQJw+uCxQmYpqptR7TBUIhRf2asdweSU8Pj1K/fqynhG1riR/aYNKxoU
-AT6A8EKglQdebc3MS6RFjasS6LPeWuWgfOgPIh1a6Vk=
------END CERTIFICATE-----
-
-# Issuer: CN=thawte Primary Root CA O=thawte, Inc. OU=Certification Services Division/(c) 2006 thawte, Inc. - For authorized use only
-# Subject: CN=thawte Primary Root CA O=thawte, Inc. OU=Certification Services Division/(c) 2006 thawte, Inc. - For authorized use only
-# Label: "thawte Primary Root CA"
-# Serial: 69529181992039203566298953787712940909
-# MD5 Fingerprint: 8c:ca:dc:0b:22:ce:f5:be:72:ac:41:1a:11:a8:d8:12
-# SHA1 Fingerprint: 91:c6:d6:ee:3e:8a:c8:63:84:e5:48:c2:99:29:5c:75:6c:81:7b:81
-# SHA256 Fingerprint: 8d:72:2f:81:a9:c1:13:c0:79:1d:f1:36:a2:96:6d:b2:6c:95:0a:97:1d:b4:6b:41:99:f4:ea:54:b7:8b:fb:9f
------BEGIN CERTIFICATE-----
-MIIEIDCCAwigAwIBAgIQNE7VVyDV7exJ9C/ON9srbTANBgkqhkiG9w0BAQUFADCB
-qTELMAkGA1UEBhMCVVMxFTATBgNVBAoT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jp2oEzsUHboZHIMpKnxuIvW1oeEuzLlQRHAd9mz
-YJ3rG9XRbkREqaYB7FViHXe4XI5ISXycO1cRrK1zN44veFyQaEfZYGDm/Ac9IiAX
-xPcW6cTYcvnIc3zfFi8VqT79aie2oetaupgf1eNNZAqdE8hhuvU5HIe6uL17In/2
-/qxAeeWsEG89jxt5dovEN7MhGITlNgDrYyCZuen+MwS7QcjBAvlEYyCegc5C09Y/
-LHbTY5xZ3Y+m4Q6gLkH3LpVHz7z9M/P2C2F+fpErgUfCJzDupxBdN49cOSvkBPB7
-jVaMaA==
------END CERTIFICATE-----
-
-# Issuer: CN=VeriSign Class 3 Public Primary Certification Authority - G5 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 2006 VeriSign, Inc. - For authorized use only
-# Subject: CN=VeriSign Class 3 Public Primary Certification Authority - G5 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 2006 VeriSign, Inc. - For authorized use only
-# Label: "VeriSign Class 3 Public Primary Certification Authority - G5"
-# Serial: 33037644167568058970164719475676101450
-# MD5 Fingerprint: cb:17:e4:31:67:3e:e2:09:fe:45:57:93:f3:0a:fa:1c
-# SHA1 Fingerprint: 4e:b6:d5:78:49:9b:1c:cf:5f:58:1e:ad:56:be:3d:9b:67:44:a5:e5
-# SHA256 Fingerprint: 9a:cf:ab:7e:43:c8:d8:80:d0:6b:26:2a:94:de:ee:e4:b4:65:99:89:c3:d0:ca:f1:9b:af:64:05:e4:1a:b7:df
------BEGIN CERTIFICATE-----
-MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCB
-yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL
-ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJp
-U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQD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+gKv
-MzEzMA0GCSqGSIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzE
-p6B4Eq1iDkVwZMXnl2YtmAl+X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y
-5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKEKQsTb47bDN0lAtukixlE0kF6BWlK
-WE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiCKm0oHw0LxOXnGiYZ
-4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vEZV8N
-hnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq
------END CERTIFICATE-----
-
-# Issuer: CN=SecureTrust CA O=SecureTrust Corporation
-# Subject: CN=SecureTrust CA O=SecureTrust Corporation
-# Label: "SecureTrust CA"
-# Serial: 17199774589125277788362757014266862032
-# MD5 Fingerprint: dc:32:c3:a7:6d:25:57:c7:68:09:9d:ea:2d:a9:a2:d1
-# SHA1 Fingerprint: 87:82:c6:c3:04:35:3b:cf:d2:96:92:d2:59:3e:7d:44:d9:34:ff:11
-# SHA256 Fingerprint: f1:c1:b5:0a:e5:a2:0d:d8:03:0e:c9:f6:bc:24:82:3d:d3:67:b5:25:57:59:b4:e7:1b:61:fc:e9:f7:37:5d:73
------BEGIN CERTIFICATE-----
-MIIDuDCCAqCgAwIBAgIQDPCOXAgWpa1Cf/DrJxhZ0DANBgkqhkiG9w0BAQUFADBI
-MQswCQYDVQQGEwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24x
-FzAVBgNVBAMTDlNlY3VyZVRydXN0IENBMB4XDTA2MTEwNzE5MzExOFoXDTI5MTIz
-MTE5NDA1NVowSDELMAkGA1UEBhMCVVMxIDAeBgNVBAoTF1NlY3VyZVRydXN0IENv
-cnBvcmF0aW9uMRcwFQYDVQQDEw5TZWN1cmVUcnVzdCBDQT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Global CA O=SecureTrust Corporation
-# Label: "Secure Global CA"
-# Serial: 9751836167731051554232119481456978597
-# MD5 Fingerprint: cf:f4:27:0d:d4:ed:dc:65:16:49:6d:3d:da:bf:6e:de
-# SHA1 Fingerprint: 3a:44:73:5a:e5:81:90:1f:24:86:61:46:1e:3b:9c:c4:5f:f5:3a:1b
-# SHA256 Fingerprint: 42:00:f5:04:3a:c8:59:0e:bb:52:7d:20:9e:d1:50:30:29:fb:cb:d4:1c:a1:b5:06:ec:27:f1:5a:de:7d:ac:69
------BEGIN CERTIFICATE-----
-MIIDvDCCAqSgAwIBAgIQB1YipOjUiolN9BPI8PjqpTANBgkqhkiG9w0BAQUFADBK
-MQswCQYDVQQGEwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24x
-GTAXBgNVBAMTEFNlY3VyZSBHbG9iYWwgQ0EwHhcNMDYxMTA3MTk0MjI4WhcNMjkx
-MjMxMTk1MjA2WjBKMQswCQYDVQQGEwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3Qg
-Q29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBHbG9iYWwgQ0EwggEiMA0GCSqG
-SIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvNS7YrGxVaQZx5RNoJLNP2MwhR/jxYDiJ
-iQPpvepeRlMJ3Fz1Wuj3RSoC6zFh1ykzTM7HfAo3fg+6MpjhHZevj8fcyTiW89sa
-/FHtaMbQbqR8JNGuQsiWUGMu4P51/pinX0kuleM5M2SOHqRfkNJnPLLZ/kG5VacJ
-jnIFHovdRIWCQtBJwB1g8NEXLJXr9qXBkqPFwqcIYA1gBBCWeZ4WNOaptvolRTnI
-HmX5k/Wq8VLcmZg9pYYaDDUz+kulBAYVHDGA76oYa8J719rO+TMg1fW9ajMtgQT7
-sFzUnKPiXB3jqUJ1XnvUd+85VLrJChgbEplJL4hL/VBi0XPnj3pDAgMBAAGjgZ0w
-gZowEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1UdEwEB/wQF
-MAMBAf8wHQYDVR0OBBYEFK9EBMJBfkiD2045AuzshHrmzsmkMDQGA1UdHwQtMCsw
-KaAnoCWGI2h0dHA6Ly9jcmwuc2VjdXJldHJ1c3QuY29tL1NHQ0EuY3JsMBAGCSsG
-AQQBgjcVAQQDAgEAMA0GCSqGSIb3DQEBBQUAA4IBAQBjGghAfaReUw132HquHw0L
-URYD7xh8yOOvaliTFGCRsoTciE6+OYo68+aCiV0BN7OrJKQVDpI1WkpEXk5X+nXO
-H0jOZvQ8QCaSmGwb7iRGDBezUqXbpZGRzzfTb+cnCDpOGR86p1hcF895P4vkp9Mm
-I50mD1hp/Ed+stCNi5O/KU9DaXR2Z0vPB4zmAve14bRDtUstFJ/53CYNv6ZHdAbY
-iNE6KTCEztI5gGIbqMdXSbxqVVFnFUq+NQfk1XWYN3kwFNspnWzFacxHVaIw98xc
-f8LDmBxrThaA63p4ZUWiABqvDA1VZDRIuJK58bRQKfJPIx/abKwfROHdI3hRW8cW
------END CERTIFICATE-----
-
-# Issuer: CN=COMODO Certification Authority O=COMODO CA Limited
-# Subject: CN=COMODO Certification Authority O=COMODO CA Limited
-# Label: "COMODO Certification Authority"
-# Serial: 104350513648249232941998508985834464573
-# MD5 Fingerprint: 5c:48:dc:f7:42:72:ec:56:94:6d:1c:cc:71:35:80:75
-# SHA1 Fingerprint: 66:31:bf:9e:f7:4f:9e:b6:c9:d5:a6:0c:ba:6a:be:d1:f7:bd:ef:7b
-# SHA256 Fingerprint: 0c:2c:d6:3d:f7:80:6f:a3:99:ed:e8:09:11:6b:57:5b:f8:79:89:f0:65:18:f9:80:8c:86:05:03:17:8b:af:66
------BEGIN CERTIFICATE-----
-MIIEHTCCAwWgAwIBAgIQToEtioJl4AsC7j41AkblPTANBgkqhkiG9w0BAQUFADCB
-gTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4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v
-IC9Bi5HcSEW88cbeunZrM8gALTFGTO3nnc+IlP8zwFboJIYmuNg4ON8qa90SzMc/
-RxdMosIGlgnW2/4/PEZB31jiVg88O8EckzXZOFKs7sjsLjBOlDW0JB9LeGna8gI4
-zJVSk/BwJVmcIGfE7vmLV2H0knZ9P4SNVbfo5azV8fUZVqZa+5Acr5Pr5RzUZ5dd
-BA6+C4OmF4O5MBKgxTMVBbkN+8cFduPYSo38NBejxiEovjBFMR7HeL5YYTisO+IB
-ZQ==
------END CERTIFICATE-----
-
-# Issuer: CN=Network Solutions Certificate Authority O=Network Solutions L.L.C.
-# Subject: CN=Network Solutions Certificate Authority O=Network Solutions L.L.C.
-# Label: "Network Solutions Certificate Authority"
-# Serial: 116697915152937497490437556386812487904
-# MD5 Fingerprint: d3:f3:a6:16:c0:fa:6b:1d:59:b1:2d:96:4d:0e:11:2e
-# SHA1 Fingerprint: 74:f8:a3:c3:ef:e7:b3:90:06:4b:83:90:3c:21:64:60:20:e5:df:ce
-# SHA256 Fingerprint: 15:f0:ba:00:a3:ac:7a:f3:ac:88:4c:07:2b:10:11:a0:77:bd:77:c0:97:f4:01:64:b2:f8:59:8a:bd:83:86:0c
------BEGIN CERTIFICATE-----
-MIID5jCCAs6gAwIBAgIQV8szb8JcFuZHFhfjkDFo4DANBgkqhkiG9w0BAQUFADBi
-MQswCQYDVQQGEwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMu
-MTAwLgYDVQQDEydOZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3Jp
-dHkwHhcNMDYxMjAxMDAwMDAwWhcNMjkxMjMxMjM1OTU5WjBiMQswCQYDVQQGEwJV
-UzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMuMTAwLgYDVQQDEydO
-ZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0GCSqG
-SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDkvH6SMG3G2I4rC7xGzuAnlt7e+foS0zwz
-c7MEL7xxjOWftiJgPl9dzgn/ggwbmlFQGiaJ3dVhXRncEg8tCqJDXRfQNJIg6nPP
-OCwGJgl6cvf6UDL4wpPTaaIjzkGxzOTVHzbRijr4jGPiFFlp7Q3Tf2vouAPlT2rl
-mGNpSAW+Lv8ztumXWWn4Zxmuk2GWRBXTcrA/vGp97Eh/jcOrqnErU2lBUzS1sLnF
-BgrEsEX1QV1uiUV7PTsmjHTC5dLRfbIR1PtYMiKagMnc/Qzpf14Dl847ABSHJ3A4
-qY5usyd2mFHgBeMhqxrVhSI8KbWaFsWAqPS7azCPL0YCorEMIuDTAgMBAAGjgZcw
-gZQwHQYDVR0OBBYEFCEwyfsA106Y2oeqKtCnLrFAMadMMA4GA1UdDwEB/wQEAwIB
-BjAPBgNVHRMBAf8EBTADAQH/MFIGA1UdHwRLMEkwR6BFoEOGQWh0dHA6Ly9jcmwu
-bmV0c29sc3NsLmNvbS9OZXR3b3JrU29sdXRpb25zQ2VydGlmaWNhdGVBdXRob3Jp
-dHkuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQC7rkvnt1frf6ott3NHhWrB5KUd5Oc8
-6fRZZXe1eltajSU24HqXLjjAV2CDmAaDn7l2em5Q4LqILPxFzBiwmZVRDuwduIj/
-h1AcgsLj4DKAv6ALR8jDMe+ZZzKATxcheQxpXN5eNK4CtSbqUN9/GGUsyfJj4akH
-/nxxH2szJGoeBfcFaMBqEssuXmHLrijTfsK0ZpEmXzwuJF/LWA/rKOyvEZbz3Htv
-wKeI8lN3s2Berq4o2jUsbzRF0ybh3uxbTydrFny9RAQYgrOJeRcQcT16ohZO9QHN
-pGxlaKFJdlxDydi8NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey
------END CERTIFICATE-----
-
-# Issuer: CN=COMODO ECC Certification Authority O=COMODO CA Limited
-# Subject: CN=COMODO ECC Certification Authority O=COMODO CA Limited
-# Label: "COMODO ECC Certification Authority"
-# Serial: 41578283867086692638256921589707938090
-# MD5 Fingerprint: 7c:62:ff:74:9d:31:53:5e:68:4a:d5:78:aa:1e:bf:23
-# SHA1 Fingerprint: 9f:74:4e:9f:2b:4d:ba:ec:0f:31:2c:50:b6:56:3b:8e:2d:93:c3:11
-# SHA256 Fingerprint: 17:93:92:7a:06:14:54:97:89:ad:ce:2f:8f:34:f7:f0:b6:6d:0f:3a:e3:a3:b8:4d:21:ec:15:db:ba:4f:ad:c7
------BEGIN CERTIFICATE-----
-MIICiTCCAg+gAwIBAgIQH0evqmIAcFBUTAGem2OZKjAKBggqhkjOPQQDAzCBhTEL
-MAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE
-BxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMT
-IkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDgwMzA2MDAw
-MDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdy
-ZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09N
-T0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlv
-biBBdXRob3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQDR3svdcmCFYX7deSR
-FtSrYpn1PlILBs5BAH+X4QokPB0BBO490o0JlwzgdeT6+3eKKvUDYEs2ixYjFq0J
-cfRK9ChQtP6IHG4/bC8vCVlbpVsLM5niwz2J+Wos77LTBumjQjBAMB0GA1UdDgQW
-BBR1cacZSBm8nZ3qQUfflMRId5nTeTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/
-BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjEA7wNbeqy3eApyt4jf/7VGFAkK+qDm
-fQjGGoe9GKhzvSbKYAydzpmfz1wPMOG+FDHqAjAU9JM8SaczepBGR7NjfRObTrdv
-GDeAU/7dIOA1mjbRxwG55tzd8/8dLDoWV9mSOdY=
------END CERTIFICATE-----
-
-# Issuer: O=SECOM Trust Systems CO.,LTD. OU=Security Communication EV RootCA1
-# Subject: O=SECOM Trust Systems CO.,LTD. OU=Security Communication EV RootCA1
-# Label: "Security Communication EV RootCA1"
-# Serial: 0
-# MD5 Fingerprint: 22:2d:a6:01:ea:7c:0a:f7:f0:6c:56:43:3f:77:76:d3
-# SHA1 Fingerprint: fe:b8:c4:32:dc:f9:76:9a:ce:ae:3d:d8:90:8f:fd:28:86:65:64:7d
-# SHA256 Fingerprint: a2:2d:ba:68:1e:97:37:6e:2d:39:7d:72:8a:ae:3a:9b:62:96:b9:fd:ba:60:bc:2e:11:f6:47:f2:c6:75:fb:37
------BEGIN CERTIFICATE-----
-MIIDfTCCAmWgAwIBAgIBADANBgkqhkiG9w0BAQUFADBgMQswCQYDVQQGEwJKUDEl
-MCMGA1UEChMcU0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEqMCgGA1UECxMh
-U2VjdXJpdHkgQ29tbXVuaWNhdGlvbiBFViBSb290Q0ExMB4XDTA3MDYwNjAyMTIz
-MloXDTM3MDYwNjAyMTIzMlowYDELMAkGA1UEBhMCSlAxJTAjBgNVBAoTHFNFQ09N
-IFRydXN0IFN5c3RlbXMgQ08uLExURC4xKjAoBgNVBAsTIVNlY3VyaXR5IENvbW11
-bmljYXRpb24gRVYgUm9vdENBMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
-ggEBALx/7FebJOD+nLpCeamIivqA4PUHKUPqjgo0No0c+qe1OXj/l3X3L+SqawSE
-RMqm4miO/VVQYg+kcQ7OBzgtQoVQrTyWb4vVog7P3kmJPdZkLjjlHmy1V4qe70gO
-zXppFodEtZDkBp2uoQSXWHnvIEqCa4wiv+wfD+mEce3xDuS4GBPMVjZd0ZoeUWs5
-bmB2iDQL87PRsJ3KYeJkHcFGB7hj3R4zZbOOCVVSPbW9/wfrrWFVGCypaZhKqkDF
-MxRldAD5kd6vA0jFQFTcD4SQaCDFkpbcLuUCRarAX1T4bepJz11sS6/vmsJWXMY1
-VkJqMF/Cq/biPT+zyRGPMUzXn0kCAwEAAaNCMEAwHQYDVR0OBBYEFDVK9U2vP9eC
-OKyrcWUXdYydVZPmMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0G
-CSqGSIb3DQEBBQUAA4IBAQCoh+ns+EBnXcPBZsdAS5f8hxOQWsTvoMpfi7ent/HW
-tWS3irO4G8za+6xmiEHO6Pzk2x6Ipu0nUBsCMCRGef4Eh3CXQHPRwMFXGZpppSeZ
-q51ihPZRwSzJIxXYKLerJRO1RuGGAv8mjMSIkh1W/hln8lXkgKNrnKt34VFxDSDb
-EJrbvXZ5B3eZKK2aXtqxT0QsNY6llsf9g/BYxnnWmHyojf6GPgcWkuF75x3sM3Z+
-Qi5KhfmRiWiEA4Glm5q+4zfFVKtWOxgtQaQM+ELbmaDgcm+7XeEWT1MKZPlO9L9O
-VL14bIjqv5wTJMJwaaJ/D8g8rQjJsJhAoyrniIPtd490
------END CERTIFICATE-----
-
-# Issuer: CN=OISTE WISeKey Global Root GA CA O=WISeKey OU=Copyright (c) 2005/OISTE Foundation Endorsed
-# Subject: CN=OISTE WISeKey Global Root GA CA O=WISeKey OU=Copyright (c) 2005/OISTE Foundation Endorsed
-# Label: "OISTE WISeKey Global Root GA CA"
-# Serial: 86718877871133159090080555911823548314
-# MD5 Fingerprint: bc:6c:51:33:a7:e9:d3:66:63:54:15:72:1b:21:92:93
-# SHA1 Fingerprint: 59:22:a1:e1:5a:ea:16:35:21:f8:98:39:6a:46:46:b0:44:1b:0f:a9
-# SHA256 Fingerprint: 41:c9:23:86:6a:b4:ca:d6:b7:ad:57:80:81:58:2e:02:07:97:a6:cb:df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IhvcNAQEFBQADggEBAEuh/wuHbrP5wUOx
-SPMowB0uyQlB+pQAHKSkq0lPjz0e701vvbyk9vImMMkQyh2I+3QZH4VFvbBsUfk2
-ftv1TDI6QU9bR8/oCy22xBmddMVHxjtqD6wU2zz0c5ypBd8A3HR4+vg1YFkCExh8
-vPtNsCBtQ7tgMHpnM1zFmdH4LTlSc/uMqpclXHLZCB6rTjzjgTGfA6b7wP4piFXa
-hNVQA7bihKOmNqoROgHhGEvWRGizPflTdISzRpFGlgC3gCy24eMQ4tui5yiPAZZi
-Fj4A4xylNoEYokxSdsARo27mHbrjWr42U8U+dY+GaSlYU7Wcu2+fXMUY7N0v4ZjJ
-/L7fCg0=
------END CERTIFICATE-----
-
-# Issuer: CN=Certigna O=Dhimyotis
-# Subject: CN=Certigna O=Dhimyotis
-# Label: "Certigna"
-# Serial: 18364802974209362175
-# MD5 Fingerprint: ab:57:a6:5b:7d:42:82:19:b5:d8:58:26:28:5e:fd:ff
-# SHA1 Fingerprint: b1:2e:13:63:45:86:a4:6f:1a:b2:60:68:37:58:2d:c4:ac:fd:94:97
-# SHA256 Fingerprint: e3:b6:a2:db:2e:d7:ce:48:84:2f:7a:c5:32:41:c7:b7:1d:54:14:4b:fb:40:c1:1f:3f:1d:0b:42:f5:ee:a1:2d
------BEGIN CERTIFICATE-----
-MIIDqDCCApCgAwIBAgIJAP7c4wEPyUj/MA0GCSqGSIb3DQEBBQUAMDQxCzAJBgNV
-BAYTAkZSMRIwEAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hMB4X
-DTA3MDYyOTE1MTMwNVoXDTI3MDYyOTE1MTMwNVowNDELMAkGA1UEBhMCRlIxEjAQ
-BgNVBAoMCURoaW15b3RpczERMA8GA1UEAwwIQ2VydGlnbmEwggEiMA0GCSqGSIb3
-DQEBAQUAA4IBDwAwggEKAoIBAQDIaPHJ1tazNHUmgh7stL7qXOEm7RFHYeGifBZ4
-QCHkYJ5ayGPhxLGWkv8YbWk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=T-TeleSec Trust Center
-# Label: "Deutsche Telekom Root CA 2"
-# Serial: 38
-# MD5 Fingerprint: 74:01:4a:91:b1:08:c4:58:ce:47:cd:f0:dd:11:53:08
-# SHA1 Fingerprint: 85:a4:08:c0:9c:19:3e:5d:51:58:7d:cd:d6:13:30:fd:8c:de:37:bf
-# SHA256 Fingerprint: b6:19:1a:50:d0:c3:97:7f:7d:a9:9b:cd:aa:c8:6a:22:7d:ae:b9:67:9e:c7:0b:a3:b0:c9:d9:22:71:c1:70:d3
------BEGIN CERTIFICATE-----
-MIIDnzCCAoegAwIBAgIBJjANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJERTEc
-MBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxlU2Vj
-IFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290IENB
-IDIwHhcNOTkwNzA5MTIxMTAwWhcNMTkwNzA5MjM1OTAwWjBxMQswCQYDVQQGEwJE
-RTEcMBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxl
-U2VjIFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290
-IENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCrC6M14IspFLEU
-ha88EOQ5bzVdSq7d6mGNlUn0b2SjGmBmpKlAIoTZ1KXleJMOaAGtuU1cOs7TuKhC
-QN/Po7qCWWqSG6wcmtoIKyUn+WkjR/Hg6yx6m/UTAtB+NHzCnjwAWav12gz1Mjwr
-rFDa1sPeg5TKqAyZMg4ISFZbavva4VhYAUlfckE8FQYBjl2tqriTtM2e66foai1S
-NNs671x1Udrb8zH57nGYMsRUFUQM+ZtV7a3fGAigo4aKSe5TBY8ZTNXeWHmb0moc
-QqvF1afPaA+W5OFhmHZhyJF81j4A4pFQh+GdCuatl9Idxjp9y7zaAzTVjlsB9WoH
-txa2bkp/AgMBAAGjQjBAMB0GA1UdDgQWBBQxw3kbuvVT1xfgiXotF2wKsyudMzAP
-BgNVHRMECDAGAQH/AgEFMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOC
-AQEAlGRZrTlk5ynrE/5aw4sTV8gEJPB0d8Bg42f76Ymmg7+Wgnxu1MM9756Abrsp
-tJh6sTtU6zkXR34ajgv8HzFZMQSyzhfzLMdiNlXiItiJVbSYSKpk+tYcNthEeFpa
-IzpXl/V6ME+un2pMSyuOoAPjPuCp1NJ70rOo4nI8rZ7/gFnkm0W09juwzTkZmDLl
-6iFhkOQxIY40sfcvNUqFENrnijchvllj4PKFiDFT1FQUhXB59C4Gdyd1Lx+4ivn+
-xbrYNuSD7Odlt79jWvNGr4GUN9RBjNYj1h7P9WgbRGOiWrqnNVmh5XAFmw4jV5mU
-Cm26OWMohpLzGITY+9HPBVZkVw==
------END CERTIFICATE-----
-
-# Issuer: CN=Cybertrust Global Root O=Cybertrust, Inc
-# Subject: CN=Cybertrust Global Root O=Cybertrust, Inc
-# Label: "Cybertrust Global Root"
-# Serial: 4835703278459682877484360
-# MD5 Fingerprint: 72:e4:4a:87:e3:69:40:80:77:ea:bc:e3:f4:ff:f0:e1
-# SHA1 Fingerprint: 5f:43:e5:b1:bf:f8:78:8c:ac:1c:c7:ca:4a:9a:c6:22:2b:cc:34:c6
-# SHA256 Fingerprint: 96:0a:df:00:63:e9:63:56:75:0c:29:65:dd:0a:08:67:da:0b:9c:bd:6e:77:71:4a:ea:fb:23:49:ab:39:3d:a3
------BEGIN CERTIFICATE-----
-MIIDoTCCAomgAwIBAgILBAAAAAABD4WqLUgwDQYJKoZIhvcNAQEFBQAwOzEYMBYG
-A1UEChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2Jh
-bCBSb290MB4XDTA2MTIxNTA4MDAwMFoXDTIxMTIxNTA4MDAwMFowOzEY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jW
-WL1WMRJOEcgh4LMRkWXbtKaIOM5V
------END CERTIFICATE-----
-
-# Issuer: O=Chunghwa Telecom Co., Ltd. OU=ePKI Root Certification Authority
-# Subject: O=Chunghwa Telecom Co., Ltd. OU=ePKI Root Certification Authority
-# Label: "ePKI Root Certification Authority"
-# Serial: 28956088682735189655030529057352760477
-# MD5 Fingerprint: 1b:2e:00:ca:26:06:90:3d:ad:fe:6f:15:68:d3:6b:b3
-# SHA1 Fingerprint: 67:65:0d:f1:7e:8e:7e:5b:82:40:a4:f4:56:4b:cf:e2:3d:69:c6:f0
-# SHA256 Fingerprint: c0:a6:f4:dc:63:a2:4b:fd:cf:54:ef:2a:6a:08:2a:0a:72:de:35:80:3e:2f:f5:ff:52:7a:e5:d8:72:06:df:d5
------BEGIN CERTIFICATE-----
-MIIFsDCCA5igAwIBAgIQFci9ZUdcr7iXAF7kBtK8nTANBgkqhkiG9w0BAQUFADBe
-MQswCQYDVQQGEwJUVzEjMCEGA1UECgwaQ2h1bmdod2EgVGVsZWNvbSBDby4sIEx0
-ZC4xKjAoBgNVBAsMIWVQS0kgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAe
-Fw0wNDEyMjAwMjMxMjdaFw0zNDEyMjAwMjMxMjdaMF4xCzAJBgNVBAYTAlRXMSMw
-IQYDVQQKDBpDaHVuZ2h3YSBUZWxlY29tIENvLiwgTHRkLjEqMCgGA1UECwwhZVBL
-SSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0BAQEF
-AAOCAg8AMIICCgKCAgEA4SUP7o3biDN1Z82tH306Tm2d0y8U82N0ywEhajfqhFAH
-SyZbCUNsIZ5qyNUD9WBpj8zwIuQf5/dqIjG3LBXy4P4AakP/h2XGtRrBp0xtInAh
-ijHyl3SJCRImHJ7K2RKilTza6We/CKBk49ZCt0Xvl/T29de1ShUCWH2YWEtgvM3X
-DZoTM1PRYfl61dd4s5oz9wCGzh1NlDivqOx4UXC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dheLSClIKF5r8GrBQAuUB
-o2M3IUxExJtRmREOc5wGj1QupyheRDmHVi03vYVElOEMSyycw5KFNGHLD7ibSkNS
-/jQ6fbjpKdx2qcgw+BRxgMYeNkh0IkFch4LoGHGLQYlE535YW6i4jRPpp2zDR+2z
-Gp1iro2C6pSe3VkQw63d4k3jMdXH7OjysP6SHhYKGvzZ8/gntsm+HbRsZJB/9OTE
-W9c3rkIO3aQab3yIVMUWbuF6aC74Or8NpDyJO3inTmODBCEIZ43ygknQW/2xzQ+D
-hNQ+IIX3Sj0rnP0qCglN6oH4EZw=
------END CERTIFICATE-----
-
-# Issuer: CN=T\xdcB\u0130TAK UEKAE K\xf6k Sertifika Hizmet Sa\u011flay\u0131c\u0131s\u0131 - S\xfcr\xfcm 3 O=T\xfcrkiye Bilimsel ve Teknolojik Ara\u015ft\u0131rma Kurumu - T\xdcB\u0130TAK OU=Ulusal Elektronik ve Kriptoloji Ara\u015ft\u0131rma Enstit\xfcs\xfc - UEKAE/Kamu Sertifikasyon Merkezi
-# Subject: CN=T\xdcB\u0130TAK UEKAE K\xf6k Sertifika Hizmet Sa\u011flay\u0131c\u0131s\u0131 - S\xfcr\xfcm 3 O=T\xfcrkiye Bilimsel ve Teknolojik Ara\u015ft\u0131rma Kurumu - T\xdcB\u0130TAK OU=Ulusal Elektronik ve Kriptoloji Ara\u015ft\u0131rma Enstit\xfcs\xfc - UEKAE/Kamu Sertifikasyon Merkezi
-# Label: "T\xc3\x9c\x42\xC4\xB0TAK UEKAE K\xC3\xB6k Sertifika Hizmet Sa\xC4\x9Flay\xc4\xb1\x63\xc4\xb1s\xc4\xb1 - S\xC3\xBCr\xC3\xBCm 3"
-# Serial: 17
-# MD5 Fingerprint: ed:41:f5:8c:50:c5:2b:9c:73:e6:ee:6c:eb:c2:a8:26
-# SHA1 Fingerprint: 1b:4b:39:61:26:27:6b:64:91:a2:68:6d:d7:02:43:21:2d:1f:1d:96
-# SHA256 Fingerprint: e4:c7:34:30:d7:a5:b5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im1L/xCIOsP2fpTo6iBkcK4h
-gb46ezzb8R1Sf1n68yJMlaCQvEhOEav7t7WNeoMojCZG2E6VQIdhn8WebYGHV2yK
-O7Rm6sxA/OOqbLLLAdsyv9Lrhc+hDVXDWzhXcLh1xnnRFDDtG1hba+818qEhTsXO
-fJlfbLm4IpNQp81McGq+agV/E5wrHur+R84EpW+sky58K5+eeROR6Oqeyjh1jmKw
-lZMq5d/pXpduIF9fhHpEORlAHLpVK/swsoHvhOPc7Jg4OQOFCKlUAwUp8MmPi+oL
-hmUZEdPpCSPeaJMDyTYcIW7OjGbxmTDY17PDHfiBLqi9ggtm/oLL4eAagsNAgQID
-AQABo0IwQDAdBgNVHQ4EFgQUvYiHyY/2pAoLquvF/pEjnatKijIwDgYDVR0PAQH/
-BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAB18+kmP
-NOm3JpIWmgV050vQbTlswyb2zrgxvMTfvCr4N5EY3ATIZJkrGG2AA1nJrvhY0D7t
-wyOfaTyGOBye79oneNGEN3GKPEs5z35FBtYt2IpNeBLWrcLTy9LQQfMmNkqblWwM
-7uXRQydmwYj3erMgbOqwaSvHIOgMA8RBBZniP+Rr+KCGgceExh/VS4ESshYhLBOh
-gLJeDEoTniDYYkCrkOpkSi+sDQESeUWoL4cZaMjihccwsnX5OD+ywJO0a+IDRM5n
-oN+J1q2MdqMTw5RhK2vZbMEHCiIHhWyFJEapvj+LeISCfiQMnf2BN+MlqO02TpUs
-yZyQ2uypQjyttgI=
------END CERTIFICATE-----
-
-# Issuer: O=certSIGN OU=certSIGN ROOT CA
-# Subject: O=certSIGN OU=certSIGN ROOT CA
-# Label: "certSIGN ROOT CA"
-# Serial: 35210227249154
-# MD5 Fingerprint: 18:98:c0:d6:e9:3a:fc:f9:b0:f5:0c:f7:4b:01:44:17
-# SHA1 Fingerprint: fa:b7:ee:36:97:26:62:fb:2d:b0:2a:f6:bf:03:fd:e8:7c:4b:2f:9b
-# SH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W8xXjrJ1/RsCCdtZb3KTafcxQdaIOL+Hsr0Wefmq5L6I
-Jd1hJyMctTEHBDa0GpC9oHRxUIltvBTjD4au8as+x6AJzKNI0eDbZOeStc+vckNw
-i/nDhDwTqn6Sm1dTk/pwwpEOMfmbZ13pljheX7NzTogVZ96edhBiIL5VaZVDADlN
-9u6wWk5JRFRYX0KD
------END CERTIFICATE-----
-
-# Issuer: CN=GeoTrust Primary Certification Authority - G3 O=GeoTrust Inc. OU=(c) 2008 GeoTrust Inc. - For authorized use only
-# Subject: CN=GeoTrust Primary Certification Authority - G3 O=GeoTrust Inc. OU=(c) 2008 GeoTrust Inc. - For authorized use only
-# Label: "GeoTrust Primary Certification Authority - G3"
-# Serial: 28809105769928564313984085209975885599
-# MD5 Fingerprint: b5:e8:34:36:c9:10:44:58:48:70:6d:2e:83:d4:b8:05
-# SHA1 Fingerprint: 03:9e:ed:b8:0b:e7:a0:3c:69:53:89:3b:20:d2:d9:32:3a:4c:2a:fd
-# SHA256 Fingerprint: b4:78:b8:12:25:0d:f8:78:63:5c:2a:a7:ec:7d:15:5e:aa:62:5e:e8:29:16:e2:cd:29:43:61:88:6c:d1:fb:d4
------BEGIN CERTIFICATE-----
-MIID/jCCAuagAwIBAgIQFaxulBmyeUtB9iepwxgPHzANBgkqhkiG9w0BAQsFADCB
-mDELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsT
-MChjKSAyMDA4IEdlb1RydXN0IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25s
-eTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhv
-cml0eSAtIEczMB4XDTA4MDQwMjAwMDAwMFoXDTM3MTIwMTIzNTk1OVowgZgxCzAJ
-BgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykg
-MjAwOCBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0
-BgNVBAMTLUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg
-LSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANziXmJYHTNXOTIz
-+uvLh4yn1ErdBojqZI4xmKU4kB6Yzy5jK/BGvESyiaHAKAxJcCGVn2TAppMSAmUm
-hsalifD614SgcK9PGpc/BkTVyetyEH3kMSj7HGHmKAdEc5IiaacDiGydY8hS2pgn
-5whMcD60yRLBxWeDXTPzAxHsatBT4tG6NmCUgLthY2xbF37fQJQeqw3CIShwiP/W
-JmxsYAQlTlV+fe+/lEjetx3dcI0FX4ilm/LC7urRQEFtYjgdVgbFA0dRIBn8exAL
-DmKudlW/X3e+PkkBUz2YJQN2JFodtNuJ6nnltrM7P7pMKEF/BqxqjsHQ9gUdfeZC
-huOl1UcCAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYw
-HQYDVR0OBBYEFMR5yo6hTgMdHNxr2zFblD4/MH8tMA0GCSqGSIb3DQEBCwUAA4IB
-AQAtxRPPVoB7eni9n64smefv2t+UXglpp+duaIy9cr5HqQ6XErhK8WTTOd8lNNTB
-zU6B8A8ExCSzNJbGpqow32hhc9f5joWJ7w5elShKKiePEI4ufIbEAp7aDHdlDkQN
-kv39sxY2+hENHYwOB4lqKVb3cvTdFZx3NWZXqxNT2I7BQMXXExZacse3aQHEerGD
-AWh9jUGhlBjBJVz88P6DAod8DQ3PLghcSkANPuyBYeYk28rgDi0Hsj5W3I31QYUH
-SJsMC8tJP33st/3LjWeJGqvtux6jAAgIFyqCXDFdRootD4abdNlF+9RAsXqqaC2G
-spki4cErx5z481+oghLrGREt
------END CERTIFICATE-----
-
-# Issuer: CN=thawte Primary Root CA - G2 O=thawte, Inc. OU=(c) 2007 thawte, Inc. - For authorized use only
-# Subject: CN=thawte Primary Root CA - G2 O=thawte, Inc. OU=(c) 2007 thawte, Inc. - For authorized use only
-# Label: "thawte Primary Root CA - G2"
-# Serial: 71758320672825410020661621085256472406
-# MD5 Fingerprint: 74:9d:ea:60:24:c4:fd:22:53:3e:cc:3a:72:d9:29:4f
-# SHA1 Fingerprint: aa:db:bc:22:23:8f:c4:01:a1:27:bb:38:dd:f4:1d:db:08:9e:f0:12
-# SHA256 Fingerprint: a4:31:0d:50:af:18:a6:44:71:90:37:2a:86:af:af:8b:95:1f:fb:43:1d:83:7f:1e:56:88:b4:59:71:ed:15:57
------BEGIN CERTIFICATE-----
-MIICiDCCAg2gAwIBAgIQNfwmXNmET8k9Jj1Xm67XVjAKBggqhkjOPQQDAzCBhDEL
-MAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjE4MDYGA1UECxMvKGMp
-IDIwMDcgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAi
-BgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMjAeFw0wNzExMDUwMDAw
-MDBaFw0zODAxMTgyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhh
-d3RlLCBJbmMuMTgwNgYDVQQLEy8oYykgMjAwNyB0aGF3dGUsIEluYy4gLSBGb3Ig
-YXV0aG9yaXplZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9v
-dCBDQSAtIEcyMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEotWcgnuVnfFSeIf+iha/
-BebfowJPDQfGAFG6DAJSLSKkQjnE/o/qycG+1E3/n3qe4rF8mq2nhglzh9HnmuN6
-papu+7qzcMBniKI11KOasf2twu8x+qi58/sIxpHR+ymVo0IwQDAPBgNVHRMBAf8E
-BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUmtgAMADna3+FGO6Lts6K
-DPgR4bswCgYIKoZIzj0EAwMDaQAwZgIxAN344FdHW6fmCsO99YCKlzUNG4k8VIZ3
-KMqh9HneteY4sPBlcIx/AlTCv//YoT7ZzwIxAMSNlPzcU9LcnXgWHxUzI1NS41ox
-XZ3Krr0TKUQNJ1uo52icEvdYPy5yAlejj6EULg==
------END CERTIFICATE-----
-
-# Issuer: CN=thawte Primary Root CA - G3 O=thawte, Inc. OU=Certification Services Division/(c) 2008 thawte, Inc. - For authorized use only
-# Subject: CN=thawte Primary Root CA - G3 O=thawte, Inc. OU=Certification Services Division/(c) 2008 thawte, Inc. - For authorized use only
-# Label: "thawte Primary Root CA - G3"
-# Serial: 127614157056681299805556476275995414779
-# MD5 Fingerprint: fb:1b:5d:43:8a:94:cd:44:c6:76:f2:43:4b:47:e7:31
-# SHA1 Fingerprint: f1:8b:53:8d:1b:e9:03:b6:a6:f0:56:43:5b:17:15:89:ca:f3:6b:f2
-# SHA256 Fingerprint: 4b:03:f4:58:07:ad:70:f2:1b:fc:2c:ae:71:c9:fd:e4:60:4c:06:4c:f5:ff:b6:86:ba:e5:db:aa:d7:fd:d3:4c
------BEGIN CERTIFICATE-----
-MIIEKjCCAxKgAwIBAgIQYAGXt0an6rS0mtZLL/eQ+zANBgkqhkiG9w0BAQsFADCB
-rjELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMf
-Q2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIw
-MDggdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAiBgNV
-BAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMzAeFw0wODA0MDIwMDAwMDBa
-Fw0zNzEyMDEyMzU5NTlaMIGuMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhhd3Rl
-LCBJbmMuMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9uIFNlcn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Primary Certification Authority - G2 O=GeoTrust Inc. OU=(c) 2007 GeoTrust Inc. - For authorized use only
-# Subject: CN=GeoTrust Primary Certification Authority - G2 O=GeoTrust Inc. OU=(c) 2007 GeoTrust Inc. - For authorized use only
-# Label: "GeoTrust Primary Certification Authority - G2"
-# Serial: 80682863203381065782177908751794619243
-# MD5 Fingerprint: 01:5e:d8:6b:bd:6f:3d:8e:a1:31:f8:12:e0:98:73:6a
-# SHA1 Fingerprint: 8d:17:84:d5:37:f3:03:7d:ec:70:fe:57:8b:51:9a:99:e6:10:d7:b0
-# SHA256 Fingerprint: 5e:db:7a:c4:3b:82:a0:6a:87:61:e8:d7:be:49:79:eb:f2:61:1f:7d:d7:9b:f9:1c:1c:6b:56:6a:21:9e:d7:66
------BEGIN CERTIFICATE-----
-MIICrjCCAjWgAwIBAgIQPLL0SAoA4v7rJDteYD7DazAKBggqhkjOPQQDAzCBmDEL
-MAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChj
-KSAyMDA3IEdlb1RydXN0IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2
-MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0
-eSAtIEcyMB4XDTA3MTEwNTAwMDAwMFoXDTM4MDExODIzNTk1OVowgZgxCzAJBgNV
-BAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykgMjAw
-NyBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNV
-BAMTLUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBH
-MjB2MBAGByqGSM49AgEGBSuBBAAiA2IABBWx6P0DFUPlrOuHNxFi79KDNlJ9RVcL
-So17VDs6bl8VAsBQps8lL33KSLjHUGMcKiEIfJo22Av+0SbFWDEwKCXzXV2juLal
-tJLtbCyf691DiaI8S0iRHVDsJt/WYC69IaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAO
-BgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBVfNVdRVfslsq0DafwBo/q+EVXVMAoG
-CCqGSM49BAMDA2cAMGQCMGSWWaboCd6LuvpaiIjwH5HTRqjySkwCY/tsXzjbLkGT
-qQ7mndwxHLKgpxgceeHHNgIwOlavmnRs9vuD4DPTCF+hnMJbn0bWtsuRBmOiBucz
-rD6ogRLQy7rQkgu2npaqBA+K
------END CERTIFICATE-----
-
-# Issuer: CN=VeriSign Universal Root Certification Authority O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 2008 VeriSign, Inc. - For authorized use only
-# Subject: CN=VeriSign Universal Root Certification Authority O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 2008 VeriSign, Inc. - For authorized use only
-# Label: "VeriSign Universal Root Certification Authority"
-# Serial: 85209574734084581917763752644031726877
-# MD5 Fingerprint: 8e:ad:b5:01:aa:4d:81:e4:8c:1d:d1:e1:14:00:95:19
-# SHA1 Fingerprint: 36:79:ca:35:66:87:72:30:4d:30:a5:fb:87:3b:0f:a7:7b:b7:0d:54
-# SHA256 Fingerprint: 23:99:56:11:27:a5:71:25:de:8c:ef:ea:61:0d:df:2f:a0:78:b5:c8:06:7f:4e:82:82:90:bf:b8:60:e8:4b:3c
------BEGIN CERTIFICATE-----
-MIIEuTCCA6GgAwIBAgIQQBrEZCGzEyEDDrvkEhrFHTANBgkqhkiG9w0BAQsFADCB
-vTELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL
-ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJp
-U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MTgwNgYDVQQDEy9W
-ZXJpU2lnbiBVbml2ZXJzYWwgU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yLk1uXBPY/ok+myDjEedO2Pzmvl2MpWRsXe8rJq+
-seQxIcaBlVZaDrHC1LGmWazxY8u4TB1ZkErvkBYoH1quEPuBUDgMbMzxPcP1Y+Oz
-4yHJJDnp/RVmRvQbEdBNc6N9Rvk97ahfYtTxP/jgdFcrGJ2BtMQo2pSXpXDrrB2+
-BxHw1dvd5Yzw1TKwg+ZX4o+/vqGqvz0dtdQ46tewXDpPaj+PwGZsY6rp2aQW9IHR
-lRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WIg0vvBZIGcfK4mJO3
-7M2CYfE45k+XmCpajQ==
------END CERTIFICATE-----
-
-# Issuer: CN=VeriSign Class 3 Public Primary Certification Authority - G4 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 2007 VeriSign, Inc. - For authorized use only
-# Subject: CN=VeriSign Class 3 Public Primary Certification Authority - G4 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 2007 VeriSign, Inc. - For authorized use only
-# Label: "VeriSign Class 3 Public Primary Certification Authority - G4"
-# Serial: 63143484348153506665311985501458640051
-# MD5 Fingerprint: 3a:52:e1:e7:fd:6f:3a:e3:6f:f3:6f:99:1b:f9:22:41
-# SHA1 Fingerprint: 22:d5:d8:df:8f:02:31:d1:8d:f7:9d:b7:cf:8a:2d:64:c9:3f:6c:3a
-# SHA256 Fingerprint: 69:dd:d7:ea:90:bb:57:c9:3e:13:5d:c8:5e:a6:fc:d5:48:0b:60:32:39:bd:c4:54:fc:75:8b:2a:26:cf:7f:79
------BEGIN CERTIFICATE-----
-MIIDhDCCAwqgAwIBAgIQL4D+I4wOIg9IZxIokYesszAKBggqhkjOPQQDAzCByjEL
-MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZW
-ZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2ln
-biwgSW5jLiAtIEZvciBhdXRob3Jpem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gold) F\u0151tan\xfas\xedtv\xe1ny O=NetLock Kft. OU=Tan\xfas\xedtv\xe1nykiad\xf3k (Certification Services)
-# Subject: CN=NetLock Arany (Class Gold) F\u0151tan\xfas\xedtv\xe1ny O=NetLock Kft. OU=Tan\xfas\xedtv\xe1nykiad\xf3k (Certification Services)
-# Label: "NetLock Arany (Class Gold) F\u0151tan\xfas\xedtv\xe1ny"
-# Serial: 80544274841616
-# MD5 Fingerprint: c5:a1:b7:ff:73:dd:d6:d7:34:32:18:df:fc:3c:ad:88
-# SHA1 Fingerprint: 06:08:3f:59:3f:15:a1:04:a0:69:a4:6b:a9:03:d0:06:b7:97:09:91
-# SHA256 Fingerprint: 6c:61:da:c3:a2:de:f0:31:50:6b:e0:36:d2:a6:fe:40:19:94:fb:d1:3d:f9:c8:d4:66:59:92:74:c4:46:ec:98
------BEGIN CERTIFICATE-----
-MIIEFTCCAv2gAwIBAgIGSUEs5AAQMA0GCSqGSIb3DQEBCwUAMIGnMQswCQYDVQQG
-EwJIVTERMA8GA1UEBwwIQnVkYXBlc3QxFTATBgNVBAoMDE5ldExvY2sgS2Z0LjE3
-MDUGA1UECwwuVGFuw7pzw610dsOhbnlraWFkw7NrIChDZXJ0aWZpY2F0aW9uIFNl
-cnZpY2VzKTE1MDMGA1UEAwwsTmV0TG9jayBBcmFueSAoQ2xhc3MgR29sZCkgRsWR
-dGFuw7pzw610dsOhbnkwHhcNMDgxMjExMTUwODIxWhcNMjgxMjA2MTUwODIxWjCB
-pzELMAkGA1UEBhMCSFUxETAPBgNVBAcMCEJ1ZGFwZXN0MRUwEwYDVQQKDAxOZXRM
-b2NrIEtmdC4xNzA1BgNVBAsMLlRhbsO6c8OtdHbDoW55a2lhZMOzayAoQ2VydGlm
-aWNhdGlvbiBTZXJ2aWNlcykxNTAzBgNVBAMMLE5ldExvY2sgQXJhbnkgKENsYXNz
-IEdvbGQpIEbFkXRhbsO6c8OtdHbDoW55MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A
-MIIBCgKCAQEAxCRec75LbRTDofTjl5Bu0jBFHjzuZ9lk4BqKf8owyoPjIMHj9DrT
-lF8afFttvzBPhCf2nx9JvMaZCpDyD/V/Q4Q3Y1GLeqVw/HpYzY6b7cNGbIRwXdrz
-AZAj/E4wqX7hJ2Pn7WQ8oLjJM2P+FpD/sLj916jAwJRDC7bVWaaeVtAkH3B5r9s5
-VA1lddkVQZQBr17s9o3x/61k/iCa11zr/qYfCGSji3ZVrR47KGAuhyXoqq8fxmRG
-ILdwfzzeSNuWU7c5d+Qa4scWhHaXWy+7GRWF+GmF9ZmnqfI0p6m2pgP8b4Y9VHx2
-BJtr+UBdADTHLpl1neWIA6pN+APSQnbAGwIDAKiLo0UwQzASBgNVHRMBAf8ECDAG
-AQH/AgEEMA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUzPpnk/C2uNClwB7zU/2M
-U9+D15YwDQYJKoZIhvcNAQELBQADggEBAKt/7hwWqZw8UQCgwBEIBaeZ5m8BiFRh
-bvG5GK1Krf6BQCOUL/t1fC8oS2IkgYIL9WHxHG64YTjrgfpioTtaYtOUZcTh5m2C
-+C8lcLIhJsFyUR+MLMOEkMNaj7rP9KdlpeuY0fsFskZ1FSNqb4VjMIDw1Z4fKRzC
-bLBQWV2QWzuoDTDPv31/zvGdg73JRm4gpvlhUbohL3u+pRVjodSVh/GeufOJ8z2F
-uLjbvrW5KfnaNwUASZQDhETnv0Mxz3WLJdH0pmT1kvarBes96aULNmLazAZfNou2
-XjG4Kvte9nHfRCaexOYNkbQudZWAUWpLMKawYqGT8ZvYzsRjdT9ZR7E=
------END CERTIFICATE-----
-
-# Issuer: CN=Staat der Nederlanden Root CA - G2 O=Staat der Nederlanden
-# Subject: CN=Staat der Nederlanden Root CA - G2 O=Staat der Nederlanden
-# Label: "Staat der Nederlanden Root CA - G2"
-# Serial: 10000012
-# MD5 Fingerprint: 7c:a5:0f:f8:5b:9a:7d:6d:30:ae:54:5a:e3:42:a2:8a
-# SH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JoVIPVVYpbtbZNQvOSqeK3Z
-ywplh6ZmwcSBo3c6WB4L7oOLnR7SUqTMHW+wmG2UMbX4cQrcufx9MmDm66+KAQ==
------END CERTIFICATE-----
-
-# Issuer: CN=Hongkong Post Root CA 1 O=Hongkong Post
-# Subject: CN=Hongkong Post Root CA 1 O=Hongkong Post
-# Label: "Hongkong Post Root CA 1"
-# Serial: 1000
-# MD5 Fingerprint: a8:0d:6f:39:78:b9:43:6d:77:42:6d:98:5a:cc:23:ca
-# SHA1 Fingerprint: d6:da:a8:20:8d:09:d2:15:4d:24:b5:2f:cb:34:6e:b2:58:b2:8a:58
-# SHA256 Fingerprint: f9:e6:7d:33:6c:51:00:2a:c0:54:c6:32:02:2d:66:dd:a2:e7:e3:ff:f1:0a:d0:61:ed:31:d8:bb:b4:10:cf:b2
------BEGIN CERTIFICATE-----
-MIIDMDCCAhigAwIBAgICA+gwDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCSEsx
-FjAUBgNVBAoTDUhvbmdrb25nIFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3Qg
-Um9vdCBDQSAxMB4XDTAzMDUxNTA1MTMxNFoXDTIzMDUxNTA0NTIyOVowRzELMAkG
-A1UEBhMCSEsxFjAUBgNVBAoTDUhvbmdrb25nIFBvc3QxIDAeBgNVBAMTF0hvbmdr
-b25nIFBvc3QgUm9vdCBDQSAxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC
-AQEArP84tulmAknjorThkPlAj3n54r15/gK97iSSHSL22oVyaf7XPwnU3ZG1ApzQ
-jVrhVcNQhrkpJsLj2aDxaQMoIIBFIi1WpztUlVYiWR8o3x8gPW2iNr4joLFutbEn
-PzlTCeqrauh0ssJlXI6/fMN4hM2eFvz1Lk8gKgifd/PFHsSaUmYeSF7jEAaPIpjh
-ZY4bXSNmO7ilMlHIhqqhqZ5/dpTCpmy3QfDVyAY45tQM4vM7TG1QjMSDJ8EThFk9
-nnV0ttgCXjqQesBCNnLsak3c78QA3xMYV18meMjWCnl3v/evt3a5pQuEF10Q6m/h
-q5URX208o1xNg1vysxmKgIsLhwIDAQABoyYwJDASBgNVHRMBAf8ECDAGAQH/AgED
-MA4GA1UdDwEB/wQEAwIBxjANBgkqhkiG9w0BAQUFAAOCAQEADkbVPK7ih9legYsC
-mEEIjEy82tvuJxuC52pF7BaLT4Wg87JwvVqWuspube5Gi27nKi6Wsxkz67SfqLI3
-7piol7Yutmcn1KZJ/RyTZXaeQi/cImyaT/JaFTmxcdcrUehtHJjA2Sr0oYJ71clB
-oiMBdDhViw+5LmeiIAQ32pwL0xch4I+XeTRvhEgCIDMb5jREn5Fw9IBehEPCKdJs
-EhTkYY2sEJCehFC78JZvRZ+K88psT/oROhUVRsPNH4NbLUES7VBnQRM9IauUiqpO
-fMGx+6fWtScvl6tu4B3i0RwsH0Ti/L6RoZz71ilTc4afU9hDDl3WY4JxHYB0yvbi
-AmvZWg==
------END CERTIFICATE-----
-
-# Issuer: CN=SecureSign RootCA11 O=Japan Certification Services, Inc.
-# Subject: CN=SecureSign RootCA11 O=Japan Certification Services, Inc.
-# Label: "SecureSign RootCA11"
-# Serial: 1
-# MD5 Fingerprint: b7:52:74:e2:92:b4:80:93:f2:75:e4:cc:d7:f2:ea:26
-# SHA1 Fingerprint: 3b:c4:9f:48:f8:f3:73:a0:9c:1e:bd:f8:5b:b1:c3:65:c7:d8:11:b3
-# SHA256 Fingerprint: bf:0f:ee:fb:9e:3a:58:1a:d5:f9:e9:db:75:89:98:57:43:d2:61:08:5c:4d:31:4f:6f:5d:72:59:aa:42:16:12
------BEGIN CERTIFICATE-----
-MIIDbTCCAlWgAwIBAgIBATANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQGEwJKUDEr
-MCkGA1UEChMiSmFwYW4gQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcywgSW5jLjEcMBoG
-A1UEAxMTU2VjdXJlU2lnbiBSb290Q0ExMTAeFw0wOTA0MDgwNDU2ND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OM OU=PKI
-# Subject: CN=ACEDICOM Root O=EDICOM OU=PKI
-# Label: "ACEDICOM Root"
-# Serial: 7029493972724711941
-# MD5 Fingerprint: 42:81:a0:e2:1c:e3:55:10:de:55:89:42:65:96:22:e6
-# SHA1 Fingerprint: e0:b4:32:2e:b2:f6:a5:68:b6:54:53:84:48:18:4a:50:36:87:43:84
-# SHA256 Fingerprint: 03:95:0f:b4:9a:53:1f:3e:19:91:94:23:98:df:a9:e0:ea:32:d7:ba:1c:dd:9b:c8:5d:b5:7e:d9:40:0b:43:4a
------BEGIN CERTIFICATE-----
-MIIFtTCCA52gAwIBAgIIYY3HhjsBggUwDQYJKoZIhvcNAQEFBQAwRDEWMBQGA1UE
-AwwNQUNFRElDT00gUm9vdDEMMAoGA1UECwwDUEtJMQ8wDQYDVQQKDAZFRElDT00x
-CzAJBgNVBAYTAkVTMB4XDTA4MDQxODE2MjQyMloXDTI4MDQxMzE2MjQyMlowRDEW
-MBQGA1UEAwwNQUNFRElDT00gUm9vdDEMMAoGA1UECwwDUEtJMQ8wDQYDVQQKDAZF
-RElDT00xCzAJBgNVBAYTAkVTMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKC
-AgEA/5KV4WgGdrQsyFhIyv2AVClVYyT/kGWbEHV7w2rbYgIB8hiGtXxaOLHkWLn7
-09gtn70yN78sFW2+tfQh0hOR2QetAQXW8713zl9CgQr5auODAKgrLlUTY4HKRxx7
-XBZXehuDYAQ6PmXDzQHe3qTWDLqO3tkE7hdWIpuPY/1NFgu3e3eM+SW10W2ZEi5P
-Grjm6gSSrj0RuVFCPYewMYWveVqc/udOXpJPQ/yrOq2lEiZmueIM15jO1FillUAK
-t0SdE3QrwqXrIhWYENiLxQSfHY9g5QYbm8+5eaA9oiM/Qj9r+hwDezCNzmzAv+Yb
-X79nuIQZ1RXve8uQNjFiybwCq0Zfm/4aaJQ0PZCOrfbkHQl/Sog4P75n/TSW9R28
-MHTLOO7VbKvU/PQAtwBbhTIWdjPp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V5vx+qQQEQIHriy1tvuWacN
-GHk0vFQYXlPKNFHtRQrmjseCNj6nOGOpMCwXEGCSn1WHElkQwg9naRHMTh5+Spqt
-r0CodaxWkHS4oJyleW/c6RrIaQXpuvoDs3zk4E7Czp3otkYNbn5XOmeUwssfnHdK
-Z05phkOTOPu220+DkdRgfks+KzgHVZhepA==
------END CERTIFICATE-----
-
-# Issuer: CN=Microsec e-Szigno Root CA 2009 O=Microsec Ltd.
-# Subject: CN=Microsec e-Szigno Root CA 2009 O=Microsec Ltd.
-# Label: "Microsec e-Szigno Root CA 2009"
-# Serial: 14014712776195784473
-# MD5 Fingerprint: f8:49:f4:03:bc:44:2d:83:be:48:69:7d:29:64:fc:b1
-# SHA1 Fingerprint: 89:df:74:fe:5c:f4:0f:4a:80:f9:e3:37:7d:54:da:91:e1:01:31:8e
-# SHA256 Fingerprint: 3c:5f:81:fe:a5:fa:b8:2c:64:bf:a2:ea:ec:af:cd:e8:e0:77:fc:86:20:a7:ca:e5:37:16:3d:f3:6e:db:f3:78
------BEGIN CERTIFICATE-----
-MIIECjCCAvKgAwIBAgIJAMJ+QwRORz8ZMA0GCSqGSIb3DQEBCwUAMIGCMQswCQYD
-VQQGEwJIVTERMA8GA1UEBwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0
-ZC4xJzAlBgNVBAMMHk1pY3Jvc2VjIGUtU3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0G
-CSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5odTAeFw0wOTA2MTYxMTMwMThaFw0y
-OTEyMzAxMTMwMThaMIGCMQswCQYDVQQGEwJIVTERMA8GA1UEBwwIQnVkYXBlc3Qx
-FjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4xJzAlBgNVBAMMHk1pY3Jvc2VjIGUtU3pp
-Z25vIFJvb3QgQ0EgMjAwOTEfMB0GCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5o
-dTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOn4j/NjrdqG2KfgQvvP
-kd6mJviZpWNwrZuuyjNAfW2WbqEORO7hE52UQlKavXWFdCyoDh2Tthi3jCyoz/tc
-cbna7P7ofo/kLx2yqHWH2Leh5TvPmUpG0IMZfcChEhyVbUr02MelTTMuhTlAdX4U
-fIASmFDHQWe4oIBhVKZsTh/gnQ4H6cm6M+f+wFUoLAKApxn1ntxVUwOXewdI/5n7
-N4okxFnMUBBjjqqpGrCEGob5X7uxUG6k0QrM1XF+H6cbfPVTbiJfyyvm1HxdrtbC
-xkzlBQHZ7Vf8wSN5/PrIJIOV87VqUQHQd9bpEqH5GoP7ghu5sJf0dgYzQ0mg/wu1
-+rUCAwEAAaOBgDB+MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0G
-A1UdDgQWBBTLD8bfQkPMPcu1SCOhGnqmKrs0aDAfBgNVHSMEGDAWgBTLD8bfQkPM
-Pcu1SCOhGnqmKrs0aDAbBgNVHREEFDASgRBpbmZvQGUtc3ppZ25vLmh1MA0GCSqG
-SIb3DQEBCwUAA4IBAQDJ0Q5eLtXMs3w+y/w9/w0olZMEyL/azXm4Q5DwpL7v8u8h
-mLzU1F0G9u5C7DBsoKqpyvGvivo/C3NqPuouQH4frlRheesuCDfXI/OMn74dseGk
-ddug4lQUsbocKaQY9hK6ohQU4zE1yED/t+AFdlfBHFny+L/k7SViXITwfn4fs775
-tyERzAMBVnCnEJIeGzSBHq2cGsMEPO0CYdYeBvNfOofyK/FFh+U9rNHHV4S9a67c
-2Pm2G2JwCz02yULyMtd6YebS2z3PyKnJm9zbWETXbzivf3jTo60adbocwTZ8jx5t
-HMN1Rq41Bab2XD0h7lbwyYIiLXpUq3DDfSJlgnCW
------END CERTIFICATE-----
-
-# Issuer: CN=GlobalSign O=GlobalSign OU=GlobalSign Root CA - R3
-# Subject: CN=GlobalSign O=GlobalSign OU=GlobalSign Root CA - R3
-# Label: "GlobalSign Root CA - R3"
-# Serial: 4835703278459759426209954
-# MD5 Fingerprint: c5:df:b8:49:ca:05:13:55:ee:2d:ba:1a:c3:3e:b0:28
-# SHA1 Fingerprint: d6:9b:56:11:48:f0:1c:77:c5:45:78:c1:09:26:df:5b:85:69:76:ad
-# SHA256 Fingerprint: cb:b5:22:d7:b7:f1:27:ad:6a:01:13:86:5b:df:1c:d4:10:2e:7d:07:59:af:63:5a:7c:f4:72:0d:c9:63:c5:3b
------BEGIN CERTIFICATE-----
-MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4G
-A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNp
-Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4
-MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEG
-A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI
-hvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWtiHL8
-RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsT
-gHeMCOFJ0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmm
-KPZpO/bLyCiR5Z2KYVc3rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zd
-QQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjlOCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZ
-XriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2xmmFghcCAwEAAaNCMEAw
-DgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFI/wS3+o
-LkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZU
-RUm7lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMp
-jjM5RcOO5LlXbKr8EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK
-6fBdRoyV3XpYKBovHd7NADdBj+1EbddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQX
-mcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJrlAGomecs
-Mx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH
-WD9f
------END CERTIFICATE-----
-
-# Issuer: CN=Autoridad de Certificacion Firmaprofesional CIF A62634068
-# Subject: CN=Autoridad de Certificacion Firmaprofesional CIF A62634068
-# Label: "Autoridad de Certificacion Firmaprofesional CIF A62634068"
-# Serial: 6047274297262753887
-# MD5 Fingerprint: 73:3a:74:7a:ec:bb:a3:96:a6:c2:e4:e2:c8:9b:c0:c3
-# SHA1 Fingerprint: ae:c5:fb:3f:c8:e1:bf:c4:e5:4f:03:07:5a:9a:e8:00:b7:f7:b6:fa
-# SHA256 Fingerprint: 04:04:80:28:bf:1f:28:64:d4:8f:9a:d4:d8:32:94:36:6a:82:88:56:55:3f:3b:14:30:3f:90:14:7f:5d:40:ef
------BEGIN CERTIFICATE-----
-MIIGFDCCA/ygAwIBAgIIU+w77vuySF8wDQYJKoZIhvcNAQEFBQAwUTELMAkGA1UE
-BhMCRVMxQjBABgNVBAMMOUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1h
-cHJvZmVzaW9uYWwgQ0lGIEE2MjYzNDA2ODAeFw0wOTA1MjAwODM4MTVaFw0zMDEy
-MzEwODM4MTVaMFExCzAJBgNVBAYTAkVTMUIwQAYDVQQDDDlBdXRvcmlkYWQgZGUg
-Q2VydGlmaWNhY2lvbiBGaXJtY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ACAAQgBhAHIAYwBl
-AGwAbwBuAGEAIAAwADgAMAAxADcwDQYJKoZIhvcNAQEFBQADggIBABd9oPm03cXF
-661LJLWhAqvdpYhKsg9VSytXjDvlMd3+xDLx51tkljYyGOylMnfX40S2wBEqgLk9
-am58m9Ot/MPWo+ZkKXzR4Tgegiv/J2Wv+xYVxC5xhOW1//qkR71kMrv2JYSiJ0L1
-ILDCExARzRAVukKQKtJE4ZYm6zFIEv0q2skGz3QeqUvVhyj5eTSSPi5E6PaPT481
-PyWzOdxjKpBrIF/EUhJOlywqrJ2X3kjyo2bbwtKDlaZmp54lD+kLM5FlClrD2VQS
-3a/DTg4fJl4N3LON7NWBcN7STyQF82xO9UxJZo3R/9ILJUFI/lGExkKvgATP0H5k
-SeTy36LssUzAKh3ntLFlosS88Zj0qnAHY7S42jtM+kAiMFsRpvAFDsYCA0irhpuF
-3dvd6qJ2gHN99ZwExEWN57kci57q13XRcrHedUTnQn3iV2t93Jm8PYMo6oCTjcVM
-ZcFwgbg4/EMxsvYDNEeyrPsiBsse3RdHHF9mudMaotoRsaS8I8nkvof/uZS2+F0g
-StRf571oe2XyFR7SOqkt6dhrJKyXWERHrVkY8SFlcN7ONGCoQPHzPKTDKCOM/icz
-Q0CgFzzr6juwcqajuUpLXhZI9LK8yIySxZ2frHI2vDSANGupi5LAuBft7HZT9SQB
-jLMi6Et8Vcad+qMUu2WFbm5PEn4KPJ2V
------END CERTIFICATE-----
-
-# Issuer: CN=Izenpe.com O=IZENPE S.A.
-# Subject: CN=Izenpe.com O=IZENPE S.A.
-# Label: "Izenpe.com"
-# Serial: 917563065490389241595536686991402621
-# MD5 Fingerprint: a6:b0:cd:85:80:da:5c:50:34:a3:39:90:2f:55:67:73
-# SHA1 Fingerprint: 2f:78:3d:25:52:18:a7:4a:65:39:71:b5:2c:a2:9c:45:15:6f:e9:19
-# SHA256 Fingerprint: 25:30:cc:8e:98:32:15:02:ba:d9:6f:9b:1f:ba:1b:09:9e:2d:29:9e:0f:45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
------END CERTIFICATE-----
-
-# Issuer: CN=Chambers of Commerce Root - 2008 O=AC Camerfirma S.A.
-# Subject: CN=Chambers of Commerce Root - 2008 O=AC Camerfirma S.A.
-# Label: "Chambers of Commerce Root - 2008"
-# Serial: 11806822484801597146
-# MD5 Fingerprint: 5e:80:9e:84:5a:0e:65:0b:17:02:f3:55:18:2a:3e:d7
-# SHA1 Fingerprint: 78:6a:74:ac:76:ab:14:7f:9c:6a:30:50:ba:9e:a8:7e:fe:9a:ce:3c
-# SHA256 Fingerprint: 06:3e:4a:fa:c4:91:df:d3:32:f3:08:9b:85:42:e9:46:17:d8:93:d7:fe:94:4e:10:a7:93:7e:e2:9d:96:93:c0
------BEGIN CERTIFICATE-----
-MIIHTzCCBTegAwIBAgIJAKPaQn6ksa7aMA0GCSqGSIb3DQEBBQUAMIGuMQswCQYD
-VQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0
-IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3
-MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xKTAnBgNVBAMTIENoYW1iZXJz
-IG9mIENvbW1lcmNlIFJvb3QgLSAyMDA4MB4XDTA4MDgwMTEyMjk1MFoXDTM4MDcz
-MTEyMjk1MFowga4xCzAJBgNVBAYTAkVVMUMwQQYDVQQHEzpNYWRyaWQgKHNlZSBj
-dXJyZW50IGFkZHJlc3MgYXQgd3d3LmNhbWVyZmlybWEuY29tL2FkZHJlc3MpMRIw
-EAYDVQQFEwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENhbWVyZmlybWEgUy5BLjEp
-MCcGA1UEAxMgQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdCAtIDIwMDgwggIiMA0G
-CSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCvAMtwNyuAWko6bHiUfaN/Gh/2NdW9
-28sNRHI+JrKQU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+pLGu2jAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRV
-HSAAMCowKAYIKwYBBQUHAgEWHGh0dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20w
-DQYJKoZIhvcNAQEFBQADggIBAJASryI1wqM58C7e6bXpeHxIvj99RZJe6dqxGfwW
-PJ+0W2aeaufDuV2I6A+tzyMP3iU6XsxPpcG1Lawk0lgH3qLPaYRgM+gQDROpI9CF
-5Y57pp49chNyM/WqfcZjHwj0/gF/JM8rLFQJ3uIrbZLGOU8W6jx+ekbURWpGqOt1
-glanq6B8aBMz9p0w8G8nOSQjKpD9kCk18pPfNKXG9/jvjA9iSnyu0/VU+I22mlaH
-FoI6M6taIgj3grrqLuBHmrS1RaMFO9ncLkVAO+rcf+g769HsJtg1pDDFOqxXnrN2
-pSB7+R5KBWIBpih1YJeSDW4+TTdDDZIVnBgizVGZoCkaPF+KMjNbMMeJL0eYD6MD
-xvbxrN8y8NmBGuScvfaAFPDRLLmF9dijscilIeUcE5fuDr3fKanvNFNb0+RqE4QG
-tjICxFKuItLcsiFCGtpA8CnJ7AoMXOLQusxI0zcKzBIKinmwPQN/aUv0NCB9szTq
-jktk9T79syNnFQ0EuPAtwQlRPLJsFfClI9eDdOTlLsn+mCdCxqvGnrDQWzilm1De
-fhiYtUU79nm06PcaewaD+9CL2rvHvRirCG88gGtAPxkZumWK5r7VXNM21+9AUiRg
-OGcEMeyP84LG3rlV8zsxkVrctQgVrXYlCg17LofiDKYGvCYQbTed7N14jHyAxfDZ
-d0jQ
------END CERTIFICATE-----
-
-# Issuer: CN=Global Chambersign Root - 2008 O=AC Camerfirma S.A.
-# Subject: CN=Global Chambersign Root - 2008 O=AC Camerfirma S.A.
-# Label: "Global Chambersign Root - 2008"
-# Serial: 14541511773111788494
-# MD5 Fingerprint: 9e:80:ff:78:01:0c:2e:c1:36:bd:fe:96:90:6e:08:f3
-# SHA1 Fingerprint: 4a:bd:ee:ec:95:0d:35:9c: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1+WLGiLwUePmJs9wOzL9dWCkoQ10b42OFZyMVtHLaoXpGNR6woBrX/sdZ7LoR/x
-fxKxueRkf2fWIyr0uDldmOghp+G9PUIadJpwr2hsUF1Jz//7Dl3mLEfXgTpZALVz
-a2Mg9jFFCDkO9HB+QHBaP9BrQql0PSgvAm11cpUJjUhjxsYjV5KTXjXBjfkK9yyd
-Yhz2rXzdpjEetrHHfoUm+qRqtdpjMNHvkzeyZi99Bffnt0uYlDXA2TopwZ2yUDMd
-SqlapskD7+3056huirRXhOukP9DuqqqHW2Pok+JrqNS4cnhrG+055F3Lm6qH1U9O
-AP7Zap88MQ8oAgF9mOinsKJknnn4SPIVqczmyETrP3iZ8ntxPjzxmKfFGBI/5rso
-M0LpRQp8bfKGeS/Fghl9CYl8slR2iK7ewfPM4W7bMdaTrpmg7yVqc5iJWzouE4ge
-v8CSlDQb4ye3ix5vQv/n6TebUB0tovkC7stYWDpxvGjjqsGvHCgfotwjZT+B6q6Z
-09gwzxMNTxXJhLynSC34MCN32EZLeW32jO06f2ARePTpm67VVMB0gNELQp/B
------END CERTIFICATE-----
-
-# Issuer: CN=Go Daddy Root Certificate Authority - G2 O=GoDaddy.com, Inc.
-# Subject: CN=Go Daddy Root Certificate Authority - G2 O=GoDaddy.com, Inc.
-# Label: "Go Daddy Root Certificate Authority - G2"
-# Serial: 0
-# MD5 Fingerprint: 80:3a:bc:22:c1:e6:fb:8d:9b:3b:27:4a:32:1b:9a:01
-# SHA1 Fingerprint: 47:be:ab:c9:22:ea:e8:0e:78:78:34:62:a7:9f:45:c2:54:fd:e6:8b
-# SHA256 Fingerprint: 45:14:0b:32:47:eb:9c:c8:c5:b4:f0:d7:b5:30:91:f7:32:92:08:9e:6e:5a:63:e2:74:9d:d3:ac:a9:19:8e:da
------BEGIN CERTIFICATE-----
-MIIDxTCCAq2gAwIBAgIBADANBgkqhkiG9w0BAQsFADCBgzELMAkGA1UEBhMCVVMx
-EDAOBgNVBAgTB0FyaXpvbmExEzARBgNV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N8Gb5DKj7Tjo
-2GTzLH4U/ALqn83/B2gX2yKQOC16jdFU8WnjXzPKej17CuPKf1855eJ1usV2GDPO
-LPAvTK33sefOT6jEm0pUBsV/fdUID+Ic/n4XuKxe9tQWskMJDE32p2u0mYRlynqI
-4uJEvlz36hz1
------END CERTIFICATE-----
-
-# Issuer: CN=Starfield Root Certificate Authority - G2 O=Starfield Technologies, Inc.
-# Subject: CN=Starfield Root Certificate Authority - G2 O=Starfield Technologies, Inc.
-# Label: "Starfield Root Certificate Authority - G2"
-# Serial: 0
-# MD5 Fingerprint: d6:39:81:c6:52:7e:96:69:fc:fc:ca:66:ed:05:f2:96
-# SHA1 Fingerprint: b5:1c:06:7c:ee:2b:0c:3d:f8:55:ab:2d:92:f4:fe:39:d4:e7:0f:0e
-# SHA256 Fingerprint: 2c:e1:cb:0b:f9:d2:f9:e1:02:99:3f:be:21:51:52:c3:b2:dd:0c:ab:de:1c:68:e5:31:9b:83:91:54:db:b7:f5
------BEGIN CERTIFICATE-----
-MIID3TCCAsWgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBjzELMAkGA1UEBhMCVVMx
-EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoT
-HFN0YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xMjAwBgNVBAMTKVN0YXJmaWVs
-ZCBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAw
-MFoXDTM3MTIzMTIzNTk1OVowgY8xCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6
-b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxTdGFyZmllbGQgVGVj
-aG5vbG9naWVzLCBJbmMuMTIwMAYDVQQDEylTdGFyZmllbGQgUm9vdCBDZXJ0aWZp
-Y2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
-ggEBAL3twQP89o/8ArFvW59I2Z154qK3A2FWGMNHttfKPTUuiUP3oWmb3ooa/RMg
-nLRJdzIpVv257IzdIvpy3Cdhl+72WoTsbhm5iSzchFvVdPtrX8WJpRBSiUZV9Lh1
-HOZ/5FSuS/hVclcCGfgXcVnrHigHdMWdSL5stPSksPNkN3mSwOxGXn/hbVNMYq/N
-Hwtjuzqd+/x5AJhhdM8mgkBj87JyahkNmcrUDnXMN/uLicFZ8WJ/X7NfZTD4p7dN
-dloedl40wOiWVpmKs/B/pM293DIxfJHP4F8R+GuqSVzRmZTRouNjWwl2tVZi4Ut0
-HZbUJtQIBFnQmA4O5t78w+wfkPECAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAO
-BgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFHwMMh+n2TB/xH1oo2Kooc6rB1snMA0G
-CSqGSIb3DQEBCwUAA4IBAQARWfolTwNvlJk7mh+ChTnUdgWUXuEok21iXQnCoKjU
-sHU48TRqneSfioYmUeYs0cYtbpUgSpIB7LiKZ3sx4mcujJUDJi5DnUox9g61DLu3
-4jd/IroAow57UvtruzvE03lRTs2Q9GcHGcg8RnoNAX3FWOdt5oUwF5okxBDgBPfg
-8n/Uqgr/Qh037ZTlZFkSIHc40zI+OIF1lnP6aI+xy84fxez6nH7PfrHxBy22/L/K
-pL/QlwVKvOoYKAKQvVR4CSFx09F9HdkWsKlhPdAKACL8x3vLCWRFCztAgfd9fDL1
-mMpYjn0q7pBZc2T5NnReJaH1ZgUufzkVqSr7UIuOhWn0
------END CERTIFICATE-----
-
-# Issuer: CN=Starfield Services Root Certificate Authority - G2 O=Starfield Technologies, Inc.
-# Subject: CN=Starfield Services Root Certificate Authority - G2 O=Starfield Technologies, Inc.
-# Label: "Starfield Services Root Certificate Authority - G2"
-# Serial: 0
-# MD5 Fingerprint: 17:35:74:af:7b:61:1c:eb:f4:f9:3c:e2:ee:40:f9:a2
-# SHA1 Fingerprint: 92:5a:8f:8d:2c:6d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NCMEAw
-DwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJxfAN+q
-AdcwKziIorhtSpzyEZGDMA0GCSqGSIb3DQEBCwUAA4IBAQBLNqaEd2ndOxmfZyMI
-bw5hyf2E3F/YNoHN2BtBLZ9g3ccaaNnRbobhiCPPE95Dz+I0swSdHynVv/heyNXB
-ve6SbzJ08pGCL72CQnqtKrcgfU28elUSwhXqvfdqlS5sdJ/PHLTyxQGjhdByPq1z
-qwubdQxtRbeOlKyWN7Wg0I8VRw7j6IPdj/3vQQF3zCepYoUz8jcI73HPdwbeyBkd
-iEDPfUYd/x7H4c7/I9vG+o1VTqkC50cRRj70/b17KSa7qWFiNyi2LSr2EIZkyXCn
-0q23KXB56jzaYyWf/Wi3MOxw+3WKt21gZ7IeyLnp2KhvAotnDU0mV3HaIPzBSlCN
-sSi6
------END CERTIFICATE-----
-
-# Issuer: CN=AffirmTrust Commercial O=AffirmTrust
-# Subject: CN=AffirmTrust Commercial O=AffirmTrust
-# Label: "AffirmTrust Commercial"
-# Serial: 8608355977964138876
-# MD5 Fingerprint: 82:92:ba:5b:ef:cd:8a:6f:a6:3d:55:f9:84:f6:d6:b7
-# SHA1 Fingerprint: f9:b5:b6:32:45:5f:9c:be:ec:57:5f:80:dc:e9:6e:2c:c7:b2:78:b7
-# SHA256 Fingerprint: 03:76:ab:1d:54:c5:f9:80:3c:e4:b2:e2:01:a0:ee:7e:ef:7b:57:b6:36:e8:a9:3c:9b:8d:48:60:c9:6f:5f:a7
------BEGIN CERTIFICATE-----
-MIIDTDCCAjSgAwIBAgIId3cGJyapsXwwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UE
-BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVz
-dCBDb21tZXJjaWFsMB4XDTEwMDEyOTE0MDYwNloXDTMwMTIzMTE0MDYwNlowRDEL
-MAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZp
-cm1UcnVzdCBDb21tZXJjaWFsMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC
-AQEA9htPZwcroRX1BiLLHwGy43NFBkRJLLtJJRTWzsO3qyxPxkEylFf6EqdbDuKP
-Hx6GGaeqtS25Xw2Kwq+FNXkyLbscYjfysVtKPcrNcV/pQr6U6Mje+SJIZMblq8Yr
-ba0F8PrVC8+a5fBQpIs7R6UjW3p6+DM/uO+Zl+MgwdYoic+U+7lF7eNAFxHUdPAL
-MeIrJmqbTFeurCA+ukV6BfO9m2kVrn1OIGPENXY6BwLJN/3HR+7o8XYdcxXyl6S1
-yHp52UKqK39c/s4mT6NmgTWvRLpUHhwwMmWd5jyTXlBOeuM61G7MGvv50jeuJCqr
-VwMiKA1JdX+3KNp1v47j3A55MQIDAQABo0IwQDAdBgNVHQ4EFgQUnZPGU4teyq8/
-nx4P5ZmVvCT2lI8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwDQYJ
-KoZIhvcNAQELBQADggEBAFis9AQOzcAN/wr91LoWXym9e2iZWEnStB03TX8nfUYG
-XUPGhi4+c7ImfU+TqbbEKpqrIZcUsd6M06uJFdhrJNTxFq7YpFzUf1GO7RgBsZNj
-vbz4YYCanrHOQnDiqX0GJX0nof5v7LMeJNrjS1UaADs1tDvZ110w/YETifLCBivt
-Z8SOyUOyXGsViQK8YvxO8rUzqrJv0wqiUOP2O+guRMLbZjipM1ZI8W0bM40NjD9g
-N53Tym1+NH4Nn3J2ixufcv1SNUFFApYvHLKac0khsUlHRUe072o0EclNmsxZt9YC
-nlpOZbWUrhvfKbAW8b8Angc6F2S1BLUjIZkKlTuXfO8=
------END CERTIFICATE-----
-
-# Issuer: CN=AffirmTrust Networking O=AffirmTrust
-# Subject: CN=AffirmTrust Networking O=AffirmTrust
-# Label: "AffirmTrust Networking"
-# Serial: 8957382827206547757
-# MD5 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tmbmzTCnLQyFE2npN/svqe++EPbkTfO
-tDIuUFUaNU52Q3Eg75N3ThVwLofDwR1t3Mu1J9QsVtFSUzpE0nPIxBsFZVpikpzu
-QY0x2+c06lkh1QF612S4ZDnNye2v7UsDSKegmQGA3GWjNq5lWUhPgkvIZfFXHeVZ
-Lgo/bNjR9eUJtGxUAArgFU2HdW23WJZa3W3SAKD0m0i+wzekujbgfIeFlxoVot4u
-olu9rxj5kFDNcFn4J2dHy8egBzp90SxdbBk6ZrV9/ZFvgrG+CJPbFEfxojfHRZ48
-x3evZKiT3/Zpg4Jg8klCNO1aAFSFHBY2kgxc+qatv9s=
------END CERTIFICATE-----
-
-# Issuer: CN=AffirmTrust Premium O=AffirmTrust
-# Subject: CN=AffirmTrust Premium O=AffirmTrust
-# Label: "AffirmTrust Premium"
-# Serial: 7893706540734352110
-# MD5 Fingerprint: c4:5d:0e:48:b6:ac:28:30:4e:0a:bc:f9:38:16:87:57
-# SHA1 Fingerprint: d8:a6:33:2c:e0:03:6f:b1:85:f6:63:4f:7d:6a:06:65:26:32:28:27
-# SHA256 Fingerprint: 70:a7:3f:7f:37:6b:60:07:42:48:90:45:34:b1:14:82:d5:bf:0e:69:8e:cc:49:8d:f5:25:77:eb:f2:e9:3b:9a
------BEGIN CERTIFICATE-----
-MIIFRjCCAy6gAwIBAgIIbYwURrGmCu4wDQYJKoZIhvcNAQEMBQAwQTELMAkGA1UE
-BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1UcnVz
-dCBQcmVtaXVtMB4XDTEwMDEyOTE0MTAzNloXDTQwMTIzMTE0MTAzNlowQTELMAkG
-A1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1U
-cnVzdCBQcmVtaXVtMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxBLf
-qV/+Qd3d9Z+K4/as4Tx4mrzY8H96oDMq3I0gW64tb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5n61EIJenmJWtSKZGc
-0jlzCFfemQa0W50QBuHCAKi4HEoCChTQwUHK+4w1IX2COPKpVJEZNZOUbWo6xbLQ
-u4mGk+ibyQ86p3q4ofB4Rvr8Ny/lioTz3/4E2aFooC8k4gmVBtWVyuEklut89pMF
-u+1z6S3RdTnX5yTb2E5fQ4+e0BQ5v1VwSJlXMbSc7kqYA5YwH2AG7hsj/oFgIxpH
-YoWlzBk0gG+zrBrjn/B7SK3VAdlntqlyk+otZrWyuOQ9PLLvTIzq6we/qzWaVYa8
-GKa1qF60g2xraUDTn9zxw2lrueFtCfTxqlB2Cnp9ehehVZZCmTEJ3WARjQUwfuaO
-RtGdFNrHF+QFlozEJLUbzxQHskD4o55BhrwE0GuWyCqANP2/7waj3VjFhT0+j/6e
-KeC2uAloGRwYQw==
------END CERTIFICATE-----
-
-# Issuer: CN=AffirmTrust Premium ECC O=AffirmTrust
-# Subject: CN=AffirmTrust Premium ECC O=AffirmTrust
-# Label: "AffirmTrust Premium ECC"
-# Serial: 8401224907861490260
-# MD5 Fingerprint: 64:b0:09:55:cf:b1:d5:99:e2:be:13:ab:a6:5d:ea:4d
-# SHA1 Fingerprint: b8:23:6b:00:2f:1d:16:86:53:01:55:6c:11:a4:37:ca:eb:ff:c3:bb
-# SHA256 Fingerprint: bd:71:fd:f6:da:97:e4:cf:62:d1:64:7a:dd:25:81:b0:7d:79:ad:f8:39:7e:b4:ec:ba:9c:5e:84:88:82:14:23
------BEGIN CERTIFICATE-----
-MIIB/jCCAYWgAwIBAgIIdJclisc/elQwCgYIKoZIzj0EAwMwRTELMAkGA1UEBhMC
-VVMxFDASBgNVBAoMC0FmZmlybVRydXN0MSAwHgYDVQQDDBdBZmZpcm1UcnVzdCBQ
-cmVtaXVtIEVDQzAeFw0xMDAxMjkxNDIwMjRaFw00MDEyMzExNDIwMjRaMEUxCzAJ
-BgNVBAYTAlVTMRQwEgYDVQQKDAtBZmZpcm1UcnVzdDEgMB4GA1UEAwwXQWZmaXJt
-VHJ1c3QgUHJlbWl1bSBFQ0MwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQNMF4bFZ0D
-0KF5Nbc6PJJ6yhUczWLznCZcBz3lVPqj1swS6vQUX+iOGasvLkjmrBhDeKzQN8O9
-ss0s5kfiGuZjuD0uL3jET9v0D6RoTFVya5UdThhClXjMNzyR4ptlKymjQjBAMB0G
-A1UdDgQWBBSaryl6wBE1NSZRMADDav5A1a7WPDAPBgNVHRMBAf8EBTADAQH/MA4G
-A1UdDwEB/wQEAwIBBjAKBggqhkjOPQQDAwNnADBkAjAXCfOHiFBar8jAQr9HX/Vs
-aobgxCd05DhT1wV/GzTjxi+zygk8N53X57hG8f2h4nECMEJZh0PUUd+60wkyWs6I
-flc9nF9Ca/UHLbXwgpP5WW+uZPpY5Yse42O+tYHNbwKMeQ==
------END CERTIFICATE-----
-
-# Issuer: CN=Certum Trusted Network CA O=Unizeto Technologies S.A. OU=Certum Certification Authority
-# Subject: CN=Certum Trusted Network CA O=Unizeto Technologies S.A. OU=Certum Certification Authority
-# Label: "Certum Trusted Network CA"
-# Serial: 279744
-# MD5 Fingerprint: d5:e9:81:40:c5:18:69:fc:46:2c:89:75:62:0f:aa:78
-# SHA1 Fingerprint: 07:e0:32:e0:20:b7:2c:3f:19:2f:06:28:a2:59:3a:19:a7:0f:06:9e
-# SHA256 Fingerprint: 5c:58:46:8d:55:f5:8e:49:7e:74:39:82:d2:b5:00:10:b6:d1:65:37:4a:cf:83:a7:d4:a3:2d:b7:68:c4:40:8e
------BEGIN CERTIFICATE-----
-MIIDuzCCAqOgAwIBAgIDBETAMA0GCSqGSIb3DQEBBQUAMH4xCzAJBgNVBAYTAlBM
-MSIwIAYDVQQKExlVbml6ZXRvIFRlY2hub2xvZ2llcyBTLkEuMScwJQYDVQQLEx5D
-ZXJ0dW0gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxIjAgBgNVBAMTGUNlcnR1bSBU
-cnVzdGVkIE5ldHdvcmsgQ0EwHhcN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FWIGUbWtzT1fs45mtk48VH3Tyw=
------END CERTIFICATE-----
-
-# Issuer: CN=Certinomis - Autorit\xe9 Racine O=Certinomis OU=0002 433998903
-# Subject: CN=Certinomis - Autorit\xe9 Racine O=Certinomis OU=0002 433998903
-# Label: "Certinomis - Autorit\xe9 Racine"
-# Serial: 1
-# MD5 Fingerprint: 7f:30:78:8c:03:e3:ca:c9:0a:e2:c9:ea:1e:aa:55:1a
-# SHA1 Fingerprint: 2e:14:da:ec:28:f0:fa:1e:8e:38:9a:4e:ab:eb:26:c0:0a:d3:83:c3
-# SHA256 Fingerprint: fc:bf:e2:88:62:06:f7:2b:27:59:3c:8b:07:02:97:e1:2d:76:9e:d1:0e:d7:93:07:05:a8:09:8e:ff:c1:4d:17
------BEGIN CERTIFICATE-----
-MIIFnDCCA4SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJGUjET
-MBEGA1UEChMKQ2VydGlub21pczEXMBUGA1UECxMOMDAwMiA0MzM5OTg5MDMxJjAk
-BgNVBAMMHUNlcnRpbm9taXMgLSBBdXRvcml0w6kgUmFjaW5lMB4XDTA4MDkxNzA4
-Mjg1OVoXDTI4MDkxNzA4Mjg1OVowYzELMAkGA1UEBhMCRlIxEzARBgNVBAoTCkNl
-cnRpbm9taXMxFzAVBgNVBAsTDjAwMDIgNDMzOTk4OTAzMSYwJAYDVQQDDB1DZXJ0
-aW5vbWlzIC0gQXV0b3JpdMOpIFJhY2luZTCCAiIwDQYJKoZIhvcNAQEBBQADggIP
-ADCCAgoCggIBAJ2Fn4bT46/HsmtuM+Cet0I0VZ35gb5j2CN2DpdUzZlMGvE5x4jY
-F1AMnmHawE5V3udauHpOd4cN5bjr+p5eex7Ezyh0x5P1FMYiKAT5kcOrJ3NqDi5N
-8y4oH3DfVS9O7cdxbwlyLu3VMpfQ8Vh30WC8Tl7bmoT2R2FFK/ZQpn9qcSdIhDWe
-rP5pqZ56XjUl+rSnSTV3lqc2W+HN3yNw2F1MpQ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XVIRFb7zdNIu0eJOqxp9YDG
-5ERQL1TEqkPFMTFYvZbF6nVsmnWxTfj3l/+WFvKXTej28xH5On2KOG4Ey+HTRRWq
-pdEdnV1j6CTmNhTih60bWfVEm/vXd3wfAXBioSAaosUaKPQhA+4u2cGA6rnZgtZb
-dsLLO7XSAPCjDuGtbkD326C00EauFddEwk01+dIL8hf2rGbVJLJP0RyZwG71fet0
-BLj5TXcJ17TPBzAJ8bgAVtkXFhYKK4bfjwEZGuW7gmP/vgt2Fl43N+bYdJeimUV5
------END CERTIFICATE-----
-
-# Issuer: CN=TWCA Root Certification Authority O=TAIWAN-CA OU=Root CA
-# Subject: CN=TWCA Root Certification Authority O=TAIWAN-CA OU=Root CA
-# Label: "TWCA Root Certification Authority"
-# Serial: 1
-# MD5 Fingerprint: aa:08:8f:f6:f9:7b:b7:f2:b1:a7:1e:9b:ea:ea:bd:79
-# SHA1 Fingerprint: cf:9e:87:6d:d3:eb:fc:42:26:97:a3:b5:a3:7a:a0:76:a9:06:23:48
-# SHA256 Fingerprint: bf:d8:8f:e1:10:1c:41:ae:3e:80:1b:f8:be:56:35:0e:e9:ba:d1:a6:b9:bd:51:5e:dc:5c:6d:5b:87:11:ac:44
------BEGIN CERTIFICATE-----
-MIIDezCCAmOgAwIBAgIBATANBgkqhkiG9w0BAQUFADBfMQswCQYDVQQGEwJUVzES
-MBAGA1UECgwJVEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFU
-V0NBIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDgwODI4MDcyNDMz
-WhcNMzAxMjMxMTU1OTU5WjBfMQswCQYDVQQGEwJUVzESMBAGA1UECgwJVEFJV0FO
-LUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NBIFJvb3QgQ2VydGlm
-aWNhdGlvbiBBdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB
-AQCwfnK4pAOU5qfeCTiRShFAh6d8WWQUe7UREN3+v9XAu1bihSX0NXIP+FPQQeFE
-AcK0HMMxQhZHhTMidrIKbw/lJVBPhYa+v5guEGcevhEFhgWQxFnQfHgQsIBct+HH
-K3XLfJ+utdGdIzdjp9xCoi2SBBtQwXu4PhvJVgSLL1KbralW6cH/ralYhzC2gfeX
-RfwZVzsrb+RH9JlF/h3x+JejiB03HFyP4HYlmlD4oFT/RJB2I9IyxsOrBr/8+7/z
-rX2SYgJbKdM1o5OaQ2RgXbL6Mv87BK9NQGr5x+PvI/1ry+UPizgN7gr8/g+YnzAx
-3WxSZfmLgb4i4RxYA7qRG4kHAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV
-HRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqOFsmjd6LWvJPelSDGRjjCDWmujANBgkq
-hkiG9w0BAQUFAAOCAQEAPNV3PdrfibqHDAhUaiBQkr6wQT25JmSDCi/oQMCXKCeC
-MErJk/9q56YAf4lCmtYR5VPOL8zy2gXE/uJQxDqGfczafhAJO5I1KlOy/usrBdls
-XebQ79NqZp4VKIV66IIArB6nCWlWQtNoURi+VJq/REG6Sb4gumlc7rh3zc5sH62D
-lhh9DrUUOYTxKOkto557HnpyWoOzeW/vtPzQCqVYT0bf+215WfKEIlKuD8z7fDvn
-aspHYcN6+NOSBB+4IIThNlQWx0DeO4pz3N/GCUzf7Nr/1FNCocnyYh0igzyXxfkZ
-YiesZSLX0zzG5Y6yU8xJzrww/nsOM5D77dIUkR8Hrw==
------END CERTIFICATE-----
-
-# Issuer: O=SECOM Trust Systems CO.,LTD. OU=Security Communication RootCA2
-# Subject: O=SECOM Trust Systems CO.,LTD. OU=Security Communication RootCA2
-# Label: "Security Communication RootCA2"
-# Serial: 0
-# MD5 Fingerprint: 6c:39:7d:a4:0e:55:59:b2:3f:d6:41:b1:12:50:de:43
-# SHA1 Fingerprint: 5f:3b:8c:f2:f8:10:b3:7d:78:b4:ce:ec:19:19:c3:73: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8sX/oymzsLS28yN/HH8AynBbF0zX2S2ZTuJbxh2ePXc
-okgfGT+Ok+vx+hfuzU7jBBJV1uXk3fs+BXziHV7Gp7yXT2g69ekuCkO2r1dcYmh8
-t/2jioSgrGK+KwmHNPBqAbubKVY8/gA3zyNs8U6qtnRGEmyR7jTV7JqR50S+kDFy
-1UkC9gLl9B/rfNmWVan/7Ir5mUf/NVoCqgTLiluHcSmRvaS0eg29mvVXIwAHIRc/
-SjnRBUkLp7Y3gaVdjKozXoEofKd9J+sAro03
------END CERTIFICATE-----
-
-# Issuer: CN=Hellenic Academic and Research Institutions RootCA 2011 O=Hellenic Academic and Research Institutions Cert. Authority
-# Subject: CN=Hellenic Academic and Research Institutions RootCA 2011 O=Hellenic Academic and Research Institutions Cert. Authority
-# Label: "Hellenic Academic and Research Institutions RootCA 2011"
-# Serial: 0
-# MD5 Fingerprint: 73:9f:4c:4b:73:5b:79:e9:fa:ba:1c:ef:6e:cb:d5:c9
-# SHA1 Fingerprint: fe:45:65:9b:79:03:5b:98:a1:61:b5:51:2e:ac:da:58:09:48:22:4d
-# SHA256 Fingerprint: bc:10:4f:15:a4:8b:e7:09:dc:a5:42:a7:e1:d4:b9:df:6f:05:45:27:e8:02:ea:a9:2d:59:54:44:25:8a:fe:71
------BEGIN CERTIFICATE-----
-MIIEMTCCAxmgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBlTELMAkGA1UEBhMCR1Ix
-RDBCBgNVBAoTO0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1
-dGlvbnMgQ2VydC4gQXV0aG9yaXR5MUAwPgYDVQQDEzdIZWxsZW5pYyBBY2FkZW1p
-YyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25zIFJvb3RDQSAyMDExMB4XDTExMTIw
-NjEzNDk1MloXDTMxMTIwMTEzNDk1MlowgZUxCzAJBgNVBAYTAkdSMUQwQgYDVQQK
-EztIZWxsZW5pYyBBY2FkZW1pYyBhbmQg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iOOASSXI
-l7WdmplNsDz4SgCbZN2fOUvRJ9e4
------END CERTIFICATE-----
-
-# Issuer: CN=Actalis Authentication Root CA O=Actalis S.p.A./03358520967
-# Subject: CN=Actalis Authentication Root CA O=Actalis S.p.A./03358520967
-# Label: "Actalis Authentication Root CA"
-# Serial: 6271844772424770508
-# MD5 Fingerprint: 69:c1:0d:4f:07:a3:1b:c3:fe:56:3d:04:bc:11:f6:a6
-# SHA1 Fingerprint: f3:73:b3:87:06:5a:28:84:8a:f2:f3:4a:ce:19:2b:dd:c7:8e:9c:ac
-# SHA256 Fingerprint: 55:92:60:84:ec:96:3a:64:b9:6e:2a:be:01:ce:0b:a8:6a:64:fb:fe:bc:c7:aa:b5:af:c1:55:b3:7f:d7:60:66
------BEGIN CERTIFICATE-----
-MIIFuzCCA6OgAwIBAgIIVwoRl0LE48wwDQYJKoZIhvcNAQELBQAwazELMAkGA1UE
-BhMCSVQxDjAMBgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlzIFMucC5BLi8w
-MzM1ODUyMDk2NzEnMCUGA1UEAwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290
-IENBMB4XDTExMDkyMjExMjIwMloXDTMwMDkyMjExMjIwMlowazELMAkGA1UEBhMC
-SVQxDjAMBgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlzIFMucC5BLi8wMzM1
-ODUyMDk2NzEnMCUGA1UEAwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290IENB
-MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAp8bEpSmkLO/lGMWwUKNv
-UTufClrJwkg4CsIcoBh/kbWHuUA/3R1oHwiD1S0eiKD4j1aPbZkCkpAW1V8IbInX
-4ay8IMKx4INRimlNAJZaby/ARH6jDuSRzVju3PvHHkVH3Se5CAGfpiEd9UEtL0z9
-KK3giq0itFZljoZUj5NDKd45RnijMCO6zfB9E1fAXdKDa0hMxKufgFpbOr3JpyI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XHo2qN8xcL4dJIEG4aspCJTQLas/kx2z/uUMsA1n3Y/buWQbqCmJqK4LL7R
-K4X9p2jIugErsWx0Hbhzlefut8cl8ABMALJ+tguLHPPAUJ4lueAI3jZm/zel0btU
-ZCzJJ7VLkn5l/9Mt4blOvH+kQSGQQXemOR/qnuOf0GZvBeyqdn6/axag67XH/JJU
-LysRJyU3eExRarDzzFhdFPFqSBX/wge2sY0PjlxQRrM9vwGYT7JZVEc+NHt4bVaT
-LnPqZih4zR0Uv6CPLy64Lo7yFIrM6bV8+2ydDKXhlg==
------END CERTIFICATE-----
-
-# Issuer: O=Trustis Limited OU=Trustis FPS Root CA
-# Subject: O=Trustis Limited OU=Trustis FPS Root CA
-# Label: "Trustis FPS Root CA"
-# Serial: 36053640375399034304724988975563710553
-# MD5 Fingerprint: 30:c9:e7:1e:6b:e6:14:eb:65:b2:16:69:20:31:67:4d
-# SHA1 Fingerprint: 3b:c0:38:0b:33:c3:f6:a6:0c:86:15:22:93:d9:df:f5:4b:81:c0:04
-# SHA256 Fingerprint: c1:b4:82:99:ab:a5:20:8f:e9:63:0a:ce:55:ca:68:a0:3e:da:5a:51:9c:88:02:a0:d3:a6:73:be:8f:8e:55:7d
------BEGIN CERTIFICATE-----
-MIIDZzCCAk+gAwIBAgIQGx+ttiD5JNM2a/fH8YygWTANBgkqhkiG9w0BAQUFADBF
-MQswCQYDVQQGEwJHQjEYMBYGA1UEChMPVHJ1c3RpcyBMaW1pdGVkMRwwGgYDVQQL
-ExNUcnVzdGlzIEZQUyBSb290IENBMB4XDTAzMTIyMzEyMTQwNloXDTI0MDEyMTEx
-MzY1NFowRTELMAkGA1UEBhMCR0IxGDAWBgNVBAoTD1RydXN0aXMgTGltaXRlZDEc
-MBoGA1UECxMTVHJ1c3RpcyBGUFMgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQAD
-ggEPADCCAQoCggEBAMVQe547NdDfxIzNjpvto8A2mfRC6qc+gIMPpqdZh8mQRUN+
-AOqGeSoDvT03mYlmt+WKVoaTnGhLaASMk5MCPjDSNzoiYYkchU59j9WvezX2fihH
-iTHcDnlkH5nSW7r+f2C/revnPDgpai/lkQtV/+xvWNUtyd5MZnGPDNcE2gfmHhjj
-vSkCqPoc4Vu5g6hBSLwacY3nYuUtsuvffM/bq1rKMfFMIvMFE/eC+XN5DL7XSxzA
-0RU8k0Fk0ea+IxciAIleH2ulrG6nS4zto3Lmr2NNL4XSFDWaLk6M6jKYKIahkQlB
-OrTh4/L68MkKokHdqeMDx4gVOxzUGpTXn2RZEm0CAwEAAaNTMFEwDwYDVR0TAQH/
-BAUwAwEB/zAfBgNVHSMEGDAWgBS6+nEleYtXQSUhhgtx67JkDoshZzAdBgNVHQ4E
-FgQUuvpxJXmLV0ElIYYLceuyZA6LIWcwDQYJKoZIhvcNAQEFBQADggEBAH5Y//01
-GX2cGE+esCu8jowU/yyg2kdbw++BLa8F6nRIW/M+TgfHbcWzk88iNVy2P3UnXwmW
-zaD+vkAMXBJV+JOCyinpXj9WV4s4NvdFGkwozZ5BuO1WTISkQMi4sKUraXAEasP4
-1BIy+Q7DsdwyhEQsb8tGD+pmQQ9P8Vilpg0ND2HepZ5dfWWhPBfnqFVO76DH7cZE
-f1T1o+CP8HxVIo8ptoGj4W1OLBuAZ+ytIJ8MYmHVl/9D7S3B2l0pKoU/rGXuhg8F
-jZBf3+6f9L/uHfuY5H+QK4R4EA5sSVPvFVtlRkpdr7r7OnIdzfYliB6XzCGcKQEN
-ZetX2fNXlrtIzYE=
------END CERTIFICATE-----
-
-# Issuer: CN=StartCom Certification Authority O=StartCom Ltd. OU=Secure Digital Certificate Signing
-# Subject: CN=StartCom Certification Authority O=StartCom Ltd. OU=Secure Digital Certificate Signing
-# Label: "StartCom Certification Authority"
-# Serial: 45
-# MD5 Fingerprint: c9:3b:0d:84:41:fc:a4:76:79:23:08:57:de:10:19:16
-# SHA1 Fingerprint: a3:f1:33:3f:e2:42:bf:cf:c5:d1:4e:8f:39:42:98:40:68:10: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nUCBVJX92ehQN6wQOQOY+2IirByeDqXWmN3PH/UvS
-Ta0XQMhGvjt/UfzDtgUx3M2FIk5xt/JxXrAaxrqTi3iSSoX4eA+D/i+tLPfkpLst
-0OcNOrg+zvZ49q5HJMqjNTbOx8aHmNrs++myziebiMMEofYLWWivydsQD032ZGNc
-pRJvkrKTlMeIFw6Ttn5ii5B/q06f/ON1FE8qMt9bDeD1e5MNq6HPh+GlBEXoPBKl
-CcWw0bdT82AUuoVpaiF8H3VhFyAXe2w7QSlc4axa0c2Mm+tgHRns9+Ww2vl5GKVF
-P0lDV9LdJNUso/2RjSe15esUBppMeyG7Oq0wBhjA2MFrLH9ZXF2RsXAiV+uKa0hK
-1Q8p7MZAwC+ITGgBF3f0JBlPvfrhsiAhS90a2Cl9qrjeVOwhVYBsHvUwyKMQ5bLm
-KhQxw4UtjJixhlpPiVktucf3HMiKf8CdBUrmQk9io20ppB+Fq9vlgcitKj1MXVuE
-JnHEhV5xJMqlG2zYYdMa4FTbzrqpMrUi9nNBCV24F10OD5mQ1kfabwo6YigUZ4LZ
-8dCAWZvLMdibD4x3TrVoivJs9iQOLWxwxXPR3hTQcY+203sC9uO41Alua551hDnm
-fyWl8kgAwKQB2j8=
------END CERTIFICATE-----
-
-# Issuer: CN=StartCom Certification Authority G2 O=StartCom Ltd.
-# Subject: CN=StartCom Certification Authority G2 O=StartCom Ltd.
-# Label: "StartCom Certification Authority G2"
-# Serial: 59
-# MD5 Fingerprint: 78:4b:fb:9e:64:82:0a:d3:b8:4c:62:f3:64:f2:90:64
-# SHA1 Fingerprint: 31:f1:fd:68:22:63:20:ee:c6:3b:3f:9d:ea:4a:3e:53:7c:7c:39:17
-# SHA256 Fingerprint: c7:ba:65:67:de:93:a7:98:ae:1f:aa:79:1e:71:2d:37:8f:ae:1f:93:c4:39:7f:ea:44:1b:b7:cb:e6:fd:59:95
------BEGIN CERTIFICATE-----
-MIIFYzCCA0ugAwIBAgIBOzANBgkqhkiG9w0BAQsFADBTMQswC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gNVHQ4EFgQUS8W0QGutHLOlHGVuRjaJhwUMDrYwDQYJKoZIhvcNAQEL
-BQADggIBAHNXPyzVlTJ+N9uWkusZXn5T50HsEbZH77Xe7XRcxfGOSeD8bpkTzZ+K
-2s06Ctg6Wgk/XzTQLwPSZh0avZyQN8gMjgdalEVGKua+etqhqaRpEpKwfTbURIfX
-UfEpY9Z1zRbkJ4kd+MIySP3bmdCPX1R0zKxnNBFi2QwKN4fRoxdIjtIXHfbX/dtl
-6/2o1PXWT6RbdejF0mCy2wl+JYt7ulKSnj7oxXehPOBKc2thz4bcQ///If4jXSRK
-9dNtD2IEBVeC2m6kMyV5Sy5UGYvMLD0w6dEG/+gyRr61M3Z3qAFdlsHB1b6uJcDJ
-HgoJIIihDsnzb02CVAAgp9KP5DlUFy6NHrgbuxu9mk47EDTcnIhT76IxW1hPkWLI
-wpqazRVdOKnWvvgTtZ8SafJQYqz7Fzf07rh1Z2AQ+4NQ+US1dZxAF7L+/XldblhY
-XzD8AK6vM8EOTmy6p6ahfzLbOOCxchcKK5HsamMm7YnUeMx0HgX4a/6ManY5Ka5l
-IxKVCCIcl85bBu4M4ru8H0ST9tg4RQUh7eStqxK2A6RCLi3ECToDZ2mEmuFZkIoo
-hdVddLHRDiBYmxOlsGOm7XtH/UVVMKTumtTm4ofvmMkyghEpIrwACjFeLQ/Ajulr
-so8uBtjRkcfGEvRM/TAXw8HaOFvjqermobp573PYtlNXLfbQ4ddI
------END CERTIFICATE-----
-
-# Issuer: CN=Buypass Class 2 Root CA O=Buypass AS-983163327
-# Subject: CN=Buypass Class 2 Root CA O=Buypass AS-983163327
-# Label: "Buypass Class 2 Root CA"
-# Serial: 2
-# MD5 Fingerprint: 46:a7:d2:fe:45:fb:64:5a:a8:59:90:9b:78:44:9b:29
-# SHA1 Fingerprint: 49:0a:75:74:de:87:0a:47:fe:58:ee:f6:c7:6b:eb:c6:0b:12:40:99
-# SHA256 Fingerprint: 9a:11:40:25:19:7c:5b:b9:5d:94:e6:3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N
-9SG9dKpN6nIDSdvHXx1iY8f93ZHsM+71bbRuMGjeyNYmsHVee7QHIJihdjK4TWxP
-AgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFMmAd+BikoL1Rpzz
-uvdMw964o605MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEAU18h
-9bqwOlI5LJKwbADJ784g7wbylp7ppHR/ehb8t/W2+xUbP6umwHJdELFx7rxP462s
-A20ucS6vxOOto70MEae0/0qyexAQH6dXQbLArvQsWdZHEIjzIVEpMMpghq9Gqx3t
-OluwlN5E40EIosHsHdb9T7bWR9AUC8rmyrV7d35BH16Dx7aMOZawP5aBQW9gkOLo
-+fsicdl9sz1Gv7SEr5AcD48Saq/v7h56rgJKihcrdv6sVIkkLE8/trKnToyokZf7
-KcZ7XC25y2a2t6hbElGFtQl+Ynhw/qlqYLYdDnkM/crqJIByw5c/8nerQyIKx+u2
-DISCLIBrQYoIwOula9+ZEsuK1V6ADJHgJgg2SMX6OBE1/yWDLfJ6v9r9jv6ly0Us
-H8SIU653DtmadsWOLB2jutXsMq7Aqqz30XpN69QH4kj3Io6wpJ9qzo6ysmD0oyLQ
-I+uUWnpp3Q+/QFesa1lQ2aOZ4W7+jQF5JyMV3pKdewlNWudLSDBaGOYKbeaP4NK7
-5t98biGCwWg5TbSYWGZizEqQXsP6JwSxeRV0mcy+rSDeJmAc61ZRpqPq5KM/p/9h
-3PFaTWwyI0PurKju7koSCTxdccK+efrCh2gdC/1cacwG0Jp9VJkqyTkaGa9LKkPz
-Y11aWOIv4x3kqdbQCtCev9eBCfHJxyYNrJgWVqA=
------END CERTIFICATE-----
-
-# Issuer: CN=Buypass Class 3 Root CA O=Buypass AS-983163327
-# Subject: CN=Buypass Class 3 Root CA O=Buypass AS-983163327
-# Label: "Buypass Class 3 Root CA"
-# Serial: 2
-# MD5 Fingerprint: 3d:3b:18:9e:2c:64:5a:e8:d5:88:ce:0e:f9:37:c2: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Services GmbH OU=T-Systems Trust Center
-# Subject: CN=T-TeleSec GlobalRoot Class 3 O=T-Systems Enterprise Services GmbH OU=T-Systems Trust Center
-# Label: "T-TeleSec GlobalRoot Class 3"
-# Serial: 1
-# MD5 Fingerprint: ca:fb:40:a8:4e:39:92:8a:1d:fe:8e:2f:c4:27:ea:ef
-# SHA1 Fingerprint: 55:a6:72:3e:cb:f2:ec:cd:c3:23:74:70:19:9d:2a:be:11:e3:81:d1
-# SHA256 Fingerprint: fd:73:da:d3:1c:64:4f:f1:b4:3b:ef:0c:cd:da:96:71:0b:9c:d9:87:5e:ca:7e:31:70:7a:f3:e9:6d:52:2b:bd
------BEGIN CERTIFICATE-----
-MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUx
-KzApBgNVBAoMIlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAd
-BgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNl
-YyBHbG9iYWxSb290IENsYXNzIDMwHhcNMDgxMDAxMTAyOTU2WhcNMzMxMDAxMjM1
-OTU5WjCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoMIlQtU3lzdGVtcyBFbnRlcnBy
-aXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBDZW50
-ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDMwggEiMA0G
-CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC9dZPwYiJvJK7genasfb3ZJNW4t/zN
-8ELg63iIVl6bmlQdTQyK9tPPcPRStdiTBONGhnFBSivwKixVA9ZIw+A5OO3yXDw/
-RLyTPWGrTs0NvvAgJ1gORH8EGoel15YUNpDQSXuhdfsaa3Ox+M6pCSzyU9XDFES4
-hqX2iys52qMzVNn6chr3IhUciJFrf2blw2qAsCTz34ZFiP0Zf3WHHx+xGwpzJFu5
-ZeAsVMhg02YXP+HMVDNzkQI6pn97djmiH5a2OK61yJN0HZ65tOVgnS9W0eDrXltM
-EnAMbEQgqxHY9Bn20pxSN+f6tsIxO0rUFJmtxxr1XV/6B7h8DR/Wgx6zAgMBAAGj
-QjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS1
-A/d2O2GCahKqGFPrAyGUv/7OyjANBgkqhkiG9w0BAQsFAAOCAQEAVj3vlNW92nOy
-WL6ukK2YJ5f+AbGwUgC4TeQbIXQbfsDuXmkqJa9c1h3a0nnJ85cp4IaH3gRZD/FZ
-1GSFS5mvJQQeyUapl96Cshtwn5z2r3Ex3XsFpSzTucpH9sry9uetuUg/vBa3wW30
-6gmv7PO15wWeph6KU1HWk4HMdJP2udqmJQV0eVp+QD6CSyYRMG7hP0HHRwA11fXT
-91Q+gT3aSWqas+8QPebrb9HIIkfLzM8BMZLZGOMivgkeGj5asuRrDFR6fUNOuIml
-e9eiPZaGzPImNC1qkp2aGtAw4l1OBLBfiyB+d8E9lYLRRpo7PHi4b6HQDWSieB4p
-TpPDpFQUWw==
------END CERTIFICATE-----
-
-# Issuer: CN=EE Certification Centre Root CA O=AS Sertifitseerimiskeskus
-# Subject: CN=EE Certification Centre Root CA O=AS Sertifitseerimiskeskus
-# Label: "EE Certification Centre Root CA"
-# Serial: 112324828676200291871926431888494945866
-# MD5 Fingerprint: 43:5e:88:d4:7d:1a:4a:7e:fd:84:2e:52:eb:01:d4:6f
-# SHA1 Fingerprint: c9:a8:b9:e7:55:80:5e:58:e3:53:77:a7:25:eb:af:c3:7b:27:cc:d7
-# SHA256 Fingerprint: 3e:84:ba:43:42:90:85:16:e7:75:73:c0:99:2f:09:79:ca:08:4e:46:85:68:1f:f1:95:cc:ba:8a:22:9b:8a:76
------BEGIN CERTIFICATE-----
-MIIEAzCCAuugAwIBAgIQVID5oHPtPwBMyonY43HmSjANBgk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Tlrg4wCQiZrxTFGGV
-v9DHKpY5P30osxBAIWrEr7BSdxjhlthWXePdNl4dp1BUoMUq5KqMlIpPnTX/dqQG
-E5Gion0ARD9V04I8GtVbvFZMIi5GQ4okQC3zErg7cBqklrkar4dBGmoYDQZPxz5u
-uSlNDUmJEYcyW+ZLBMjkXOZ0c5RdFpgTlf7727FE5TpwrDdr5rMzcijJs1eg9gIW
-iAYLtqZLICjU3j2LrTcFU3T+bsy8QxdxXvnFzBqpYe73dgzzcvRyrc9yAjYHR8/v
-GVCJYMzpJJUPwssd8m92kMfMdcGWxZ0=
------END CERTIFICATE-----
-
-# Issuer: CN=T\xdcRKTRUST Elektronik Sertifika Hizmet Sa\u011flay\u0131c\u0131s\u0131 O=T\xdcRKTRUST Bilgi \u0130leti\u015fim ve Bili\u015fim G\xfcvenli\u011fi Hizmetleri A.\u015e. (c) Aral\u0131k 2007
-# Subject: CN=T\xdcRKTRUST Elektronik Sertifika Hizmet Sa\u011flay\u0131c\u0131s\u0131 O=T\xdcRKTRUST Bilgi \u0130leti\u015fim ve Bili\u015fim G\xfcvenli\u011fi Hizmetleri A.\u015e. (c) Aral\u0131k 2007
-# Label: "TURKTRUST Certificate Services Provider Root 2007"
-# Serial: 1
-# MD5 Fingerprint: 2b:70:20:56:86:82:a0:18:c8:07:53:12:28:70:21:72
-# SHA1 Fingerprint: f1:7f:6f:b6:31:dc:99:e3:a3:c8:7f:fe:1c:f1:81:10:88:d9:60:33
-# SHA256 Fingerprint: 97:8c:d9:66:f2:fa:a0:7b:a7:aa:95:00:d9:c0:2e:9d:77:f2:cd:ad:a6:ad:6b:a7:4a:f4:b9:1c:66:59:3c:50
------BEGIN CERTIFICATE-----
-MIIEPTCCAyWgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBvzE/MD0GA1UEAww2VMOc
-UktUUlVTVCBFbGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sx
-c8SxMQswCQYDVQQGEwJUUjEPMA0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CLCPyA8JWcqdmBzlVPi5RX9ql2+I
-aE1KBiY3iAIOtsbWcpnOa3faYjGkVh+uX4132l32iPwa2Z61gfAyuOOI0JzzaqC5
-mxRZNTZPz/OOXl0XrRWV2N2y1RVuAE6zS89mlOTgzbUF2mNXi+WzqtvALhyQRNsa
-XRik7r4EW5nVcV9VZWRi1aKbBFmGyGJ353yCRWo9F7/snXUMrqNvWtMvmDb08PUZ
-qxFdyKbjKlhqQgnDvZImZjINXQhVdP+MmNAKpoRq0Tl9
------END CERTIFICATE-----
-
-# Issuer: CN=D-TRUST Root Class 3 CA 2 2009 O=D-Trust GmbH
-# Subject: CN=D-TRUST Root Class 3 CA 2 2009 O=D-Trust GmbH
-# Label: "D-TRUST Root Class 3 CA 2 2009"
-# Serial: 623603
-# MD5 Fingerprint: cd:e0:25:69:8d:47:ac:9c:89:35:90:f7:fd:51:3d:2f
-# SHA1 Fingerprint: 58:e8:ab:b0:36:15:33:fb:80:f7:9b:1b:6d:29:d3:ff:8d:5f:00:f0
-# SHA256 Fingerprint: 49:e7:a4:42:ac:f0:ea:62:87:05:00:54:b5:25:64:b6:50:e4:f4:9e:42:e3:48:d6:aa:38:e0:39:e9:57:b1:c1
------BEGIN CERTIFICATE-----
-MIIEMzCCAxugAwIBAgIDCYPzMA0GCSqGSIb3DQEBCwUAME0xCzAJBgNVBAYTAkRF
-MRUwEwYDVQQKDAxELVRydXN0IEdtYkgxJzAlBgNVBAMMHkQtVFJVU1QgUm9vdCBD
-bGFzcyAzIENBIDIgMjAwOTAeFw0wOTExMDUwODM1NThaFw0yOTExMDUwODM1NTha
-ME0xCzAJBgNVBAYTAkRFMRUwEwYDVQQKDAxELVRydXN0IEdtYkgxJzAlBgNVBAMM
-HkQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgMjAwOTCCASIwDQYJKoZIhvcNAQEB
-BQADggEPADCCAQoCggEBANOySs96R+91myP6Oi/WUEWJNTrGa9v+2wBoqOADER03
-UAifTUpolDWzU9GUY6c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I=
------END CERTIFICATE-----
-
-# Issuer: CN=D-TRUST Root Class 3 CA 2 EV 2009 O=D-Trust GmbH
-# Subject: CN=D-TRUST Root Class 3 CA 2 EV 2009 O=D-Trust GmbH
-# Label: "D-TRUST Root Class 3 CA 2 EV 2009"
-# Serial: 623604
-# MD5 Fingerprint: aa:c6:43:2c:5e:2d:cd:c4:34:c0:50:4f:11:02:4f:b6
-# SHA1 Fingerprint: 96:c9:1b:0b:95:b4:10:98:42:fa:d0:d8:22:79:fe:60:fa:b9:16:83
-# SHA256 Fingerprint: ee:c5:49:6b:98:8c:e9:86:25:b9:34:09:2e:ec:29:08:be:d0:b0:f3:16:c2:d4:73:0c:84:ea:f1:f3:d3:48:81
------BEGIN CERTIFICATE-----
-MIIEQzCCAyugAwIBAgIDCYP0MA0GCSqGSIb3DQEBCwUAMFAxCzAJBgNVBAYTAkRF
-MRUwEwYDVQQKDAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBD
-bGFzcyAzIENBIDIgRVYgMjAwOTAeFw0wOTExMDUwODUwNDZaFw0yOTExMDUwODUw
-NDZaMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQKDAxELVRydXN0IEdtYkgxKjAoBgNV
-BAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAwOTCCASIwDQYJKoZI
-hvcNAQEBBQADggEPADCCAQoCggEBAJnxhDRwui+3MKCOvXwEz75ivJn9gpfSegpn
-ljgJ9hBOlSJzmY3aFS3nBfwZcyK3jpgAvDw9rKFs+9Z5JUut8Mxk2og+KbgPCdM0
-3TP1YtHhzRnp7hhPTFiu4h7WDFsVWtg6uMQYZB7jM7K1iXdODL/ZlGsTl28So/6Z
-qQTMFexgaDbtCHu39b+T7WYxg4zGcTSHThfqr4uRjRxWQa4iN1438h3Z0S0NL2lR
-p75mpoo6Kr3HGrHhFPC+Oh25z1uxav60sUYgovseO3Dvk5h9jHOW8sXvhXCtKSb8
-HgQ+HKDYD8tSg2J87otTlZCpV6LqYQXY+U3EJ/pure3511H3a6UCAwEAAaOCASQw
-ggEgMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNOUikxiEyoZLsyvcop9Ntea
-HNxnMA4GA1UdDwEB/wQEAwIBBjCB3QYDVR0fBIHVMIHSMIGHoIGEoIGBhn9sZGFw
-Oi8vZGlyZWN0b3J5LmQtdHJ1c3QubmV0L0NOPUQtVFJVU1QlMjBSb290JTIwQ2xh
-c3MlMjAzJTIwQ0ElMjAyJTIwRVYlMjAyMDA5LE89RC1UcnVzdCUyMEdtYkgsQz1E
-RT9jZXJ0aWZpY2F0ZXJldm9jYXRpb25saXN0MEagRKBChkBodHRwOi8vd3d3LmQt
-dHJ1c3QubmV0L2NybC9kLXRydXN0X3Jvb3RfY2xhc3NfM19jYV8yX2V2XzIwMDku
-Y3JsMA0GCSqGSIb3DQEBCwUAA4IBAQA07XtaPKSUiO8aEXUHL7P+PPoeUSbrh/Yp
-3uDx1MYkCenBz1UbtDDZzhr+BlGmFaQt77JLvyAoJUnRpjZ3NOhk31KxEcdzes05
-nsKtjHEh8lprr988TlWvsoRlFIm5d8sqMb7Po23Pb0iUMkZv53GMoKaEGTcH8gNF
-CSuGdXzfX2lXANtu2KZyIktQ1HWYVt+3GP9DQ1CuekR78HlR10M9p9OB0/DJT7na
-xpeG0ILD5EJt/rDiZE4OJudANCa1CInXCGNjOCd1HjPqbqjdn5lPdE2BiYBL3ZqX
-KVwvvoFBuYz/6n1gBp7N1z3TLqMVvKjmJuVvw9y4AyHqnxbxLFS1
------END CERTIFICATE-----
-
-# Issuer: CN=Autoridad de Certificacion Raiz del Estado Venezolano O=Sistema Nacional de Certificacion Electronica OU=Superintendencia de Servicios de Certificacion Electronica
-# Subject: CN=PSCProcert O=Sistema Nacional de Certificacion Electronica OU=Proveedor de Certificados PROCERT
-# Label: "PSCProcert"
-# Serial: 11
-# MD5 Fingerprint: e6:24:e9:12:01:ae:0c:de:8e:85:c4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QAVzAswbVhltw+HoSvOULP5dAssSS830DD7X9jSr3hTxJkhpXz
-sOfIt+FTvZLm8wyWuevo5pLtp4EJFAv8lXrPj9Y0TzYS3F7RNHXGRoAvlQSMx4bE
-qCaJqD8Zm4G7UaRKhqsLEQ+xrmNTbSjq3TNWOByyrYDT13K9mmyZY+gAu0F2Bbdb
-mRiKw7gSXFbPVgx96OLP7bx0R/vu0xdOIk9W/1DzLuY5poLWccret9W6aAjtmcz9
-opLLabid+Qqkpj5PkygqYWwHJgD/ll9ohri4zspV4KuxPX+Y1zMOWj3YeMLEYC/H
-YvBhkdI4sPaeVdtAgAUSM84dkpvRabP/v/GSCmE1P93+hvS84Bpxs2Km
------END CERTIFICATE-----
-
-# Issuer: CN=CA Disig Root R1 O=Disig a.s.
-# Subject: CN=CA Disig Root R1 O=Disig a.s.
-# Label: "CA Disig Root R1"
-# Serial: 14052245610670616104
-# MD5 Fingerprint: be:ec:11:93:9a:f5:69:21:bc:d7:c1:c0:67:89:cc:2a
-# SHA1 Fingerprint: 8e:1c:74:f8:a6:20:b9:e5:8a:f4:61:fa:ec:2b:47:56:51:1a:52:c6
-# SHA256 Fingerprint: f9:6f:23:f4:c3:e7:9c:07:7a:46:98:8d:5a:f5:90:06:76:a0:f0:39:cb:64:5d:d1:75:49:b2:16:c8:24:40:ce
------BEGIN CERTIFICATE-----
-MIIFaTCCA1GgAwIBAgIJAMMDmu5QkG4oMA0GCSqGSIb3DQEBBQUAMFIxCzAJBgNV
-BAYTAlNLMRMwEQYDVQQHEwpCcmF0aXNsYXZhMRMwEQYDVQQKEwpEaXNpZyBhLnMu
-MRkwFwYDVQQDExBDQSBEaXNpZyBSb290IFIxMB4XDTEyMDcxOTA5MDY1NloXDTQy
-MDcxOTA5MDY1NlowUjELMAkGA1UEBhMCU0sxEzARBgNVBAcTCkJyYXRpc2xhdmEx
-EzARBgNVBAoTCkRpc2lnIGEucy4xGTAXBgNVBAMTEENBIERpc2lnIFJvb3QgUjEw
-ggIiMA0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SVhlMCrDpfNIZTUJG7L399ldb3Zh+pE3McgODWF3vkzpB
-emOqfDqo9ayk0d2iLbYq/J8BjuIQscTK5GfbVSUZP/3oNn6z4eGBrxEWi1CXYBmC
-AMBrTXO40RMHPuq2MU/wQppt4hF05ZSsjYSVPCGvxdpHyN85YmLLW1AL14FABZyb
-7bq2ix4Eb5YgOe2kfSnbSM6C3NQCjR0EMVrHS/BsYVLXtFHCgWzN4funodKSds+x
-DzdYpPJScWc/DIh4gInByLUfkmO+p3qKViwaqKactV2zY9ATIKHrkWzQjX2v3wvk
-F7mGnjixlAxYjOBVqjtjbZqJYLhkKpLGN/R+Q0O3c+gB53+XD9fyexn9GtePyfqF
-a3qdnom2piiZk4hA9z7NUaPK6u95RyG1/jLix8NRb76AdPCkwzryT+lf3xkK8jsT
-Q6wxpLPn6/wY1gGp8yqPNg7rtLG8t0zJa7+h89n07eLw4+1knj0vllJPgFOL
------END CERTIFICATE-----
-
-# Issuer: CN=CA Disig Root R2 O=Disig a.s.
-# Subject: CN=CA Disig Root R2 O=Disig a.s.
-# Label: "CA Disig Root R2"
-# Serial: 10572350602393338211
-# MD5 Fingerprint: 26:01:fb:d8:27:a7:17:9a:45:54:38:1a:43:01:3b:03
-# SHA1 Fingerprint: b5:61:eb:ea:a4:de:e4:25:4b:69:1a:98:a5:57:47:c2:34:c7:d9:71
-# SHA256 Fingerprint: e2:3d:4a:03:6d:7b:70:e9:f5:95:b1:42:20:79:d2:b9:1e:df:bb:1f:b6:51:a0:63:3e:aa:8a:9d:c5:f8:07:03
------BEGIN CERTIFICATE-----
-MIIFaTCCA1GgAwIBAgIJAJK4iNuwisFjMA0GCSqGSIb3DQEBCwUAMFIxCzAJBgNV
-BAYTAlNLMRMwEQYDVQQHEwpCcmF0aXNsYXZhMRMwEQYDVQQKEwpEaXNpZyBhLnMu
-MRkwFwYDVQQDExBDQSBEaXNpZyBSb290IFIyMB4XDTEyMDcxOTA5MTUzMFoXDTQy
-MDcxOTA5MTUzMFowUj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qjGom32+nNjf7xueQgcnYqf
-GopTpti72TVVsRHFqQOzVju5hJMiXn7B9hJSi+osZ7z+Nkz1uM/Rs0mSO9MpDpkb
-lvdhuDvEK7Z4bLQjb/D907JedR+Zlais9trhxTF7+9FGs9K8Z7RiVLoJ92Owk6Ka
-+elSLotgEqv89WBW7xBci8QaQtyDW2QOy7W81k/BfDxujRNt+3vrMNDcTa/F1bal
-TFtxyegxvug4BkihGuLq0t4SOVga/4AOgnXmt8kHbA7v/zjxmHHEt38OFdAlab0i
-nSvtBfZGR6ztwPDUO+Ls7pZbkBNOHlY667DvlruWIxG68kOGdGSVyCh13x01utI3
-gzhTODY7z2zp+WsO0PsE6E9312UBeIYMej4hYvF/Y3EMyZ9E26gnonW+boE+18Dr
-G5gPcFw0sorMwIUY6256s/daoQe/qUKS82Ail+QUoQebTnbAjn39pCXHR+3/H3Os
-zMOl6W8KjptlwlCFtaOgUxLMVYdh84GuEEZhvUQhuMI9dM9+JDX6HAcOmz0iyu8x
-L4ysEr3vQCj8KWefshNPZiTEUxnpHikV7+ZtsH8tZ/3zbBt1RqPlShfppNcL
------END CERTIFICATE-----
-
-# Issuer: CN=ACCVRAIZ1 O=ACCV OU=PKIACCV
-# Subject: CN=ACCVRAIZ1 O=ACCV OU=PKIACCV
-# Label: "ACCVRAIZ1"
-# Serial: 6828503384748696800
-# MD5 Fingerprint: d0:a0:5a:ee:05:b6:09:94:21:a1:7d:f1:b2:29:82:02
-# SHA1 Fingerprint: 93:05:7a:88:15:c6:4f:ce:88:2f:fa:91:16:52:28:78:bc:53:64:17
-# SHA256 Fingerprint: 9a:6e:c0:12:e1:a7:da:9d:be:34:19:4d:47:8a:d7:c0:db:18:22:fb:07:1d:f1:29:81:49:6e:d1:04:38:41:13
------BEGIN CERTIFICATE-----
-MIIH0zCCBbugAwIBAgIIXsO3pkN/pOAwDQYJKoZIhvcNAQEFBQAwQjESMBAGA1UE
-AwwJQUNDVlJBSVoxMRAwDgYDVQQLDAdQS0lBQ0N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m
-AM/EKXMRNt6GGT6d7hmKG9Ww7Y49nCrADdg9ZuM8Db3VlFzi4qc1GwQA9j9ajepD
-vV+JHanBsMyZ4k0ACtrJJ1vnE5Bc5PUzolVt3OAJTS+xJlsndQAJxGJ3KQhfnlms
-tn6tn1QwIgPBHnFk/vk4CpYY3QIUrCPLBhwepH2NDd4nQeit2hW3sCPdK6jT2iWH
-7ehVRE2I9DZ+hJp4rPcOVkkO1jMl1oRQQmwgEh0q1b688nCBpHBgvgW1m54ERL5h
-I6zppSSMEYCUWqKiuUnSwdzRp+0xESyeGabu4VXhwOrPDYTkF7eifKXeVSUG7szA
-h1xA2syVP1XgNce4hL60Xc16gwFy7ofmXx2utYXGJt/mwZrpHgJHnyqobalbz+xF
-d3+YJ5oyXSrjhO7FmGYvliAd3djDJ9ew+f7Zfc3Qn48LFFhRny+Lwzgt3uiP1o2H
-pPVWQxaZLPSkVrQ0uGE3ycJYgBugl6H8WY3pEfbRD0tVNEYqi4Y7
------END CERTIFICATE-----
-
-# Issuer: CN=TWCA Global Root CA O=TAIWAN-CA OU=Root CA
-# Subject: CN=TWCA Global Root CA O=TAIWAN-CA OU=Root CA
-# Label: "TWCA Global Root CA"
-# Serial: 3262
-# MD5 Fingerprint: f9:03:7e:cf:e6:9e:3c:73:7a:2a:90:07:69:ff:2b:96
-# SHA1 Fingerprint: 9c:bb:48:53:f6:a4:f6:d3:52:a4:e8:32:52:55:60:13:f5:ad:af:65
-# SHA256 Fingerprint: 59:76:90:07:f7:68:5d:0f:cd:50:87:2f:9f:95:d5:75:5a:5b:2b:45:7d:81:f3:69:2b:61:0a:98:67:2f:0e:1b
------BEGIN CERTIFICATE-----
-MIIFQTCCAymgAwIBAgICDL4wDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVFcx
-EjAQBgNVBAoTCVRBSVdBTi1DQTEQMA4GA1UECxMHUm9vdCBDQTEcMBoGA1UEAxMT
-VFdDQSBHbG9iYWwgUm9vdCBDQTAeFw0xMjA2Mj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EfJdLjbDorMjupWkEmQqSpqsn
-LhpNgb+E1HAerUf+/UqdM+DyucRFCCEK2mlpc3INvjT+lIutwx4116KD7+U4x6WF
-H6vPNOw/KP4M8VeGTslV9xzU2KV9Bnpv1d8Q34FOIWWxtuEXeZVFBs5fzNxGiWNo
-RI2T9GRwoD2dKAXDOXC4Ynsg/eTb6QihuJ49CcdP+yz4k3ZB3lLg4VfSnQO8d57+
-nile98FRYB/e2guyLXW3Q0iT5/Z5xoRdgFlglPx4mI88k1HtQJAH32RjJMtOcQWh
-15QaiDLxInQirqWm2BJpTGCjAu4r7NRjkgtevi92a6O2JryPA9gK8kxkRr05YuWW
-6zRjESjMlfGt7+/cgFhI6Uu46mWs6fyAtbXIRfmswZ/ZuepiiI7E8UuDEq3mi4TW
-nsLrgxifarsbJGAzcMzs9zLzXNl5fe+epP7JI8Mk7hWSsT2RTyaGvWZzJBPqpK5j
-wa19hAM8EHiGG3njxPPyBJUgriOCxLM6AGK/5jYk4Ve6xx6QddVfP5VhK8E7zeWz
-aGHQRiapIVJpLesux+t3zqY6tQMzT3bR51xUAV3LePTJDL/PEo4XLSNolOer/qmy
-KwbQBM0=
------END CERTIFICATE-----
-
-# Issuer: CN=TeliaSonera Root CA v1 O=TeliaSonera
-# Subject: CN=TeliaSonera Root CA v1 O=TeliaSonera
-# Label: "TeliaSonera Root CA v1"
-# Serial: 199041966741090107964904287217786801558
-# MD5 Fingerprint: 37:41:49:1b:18:56:9a:26:f5:ad:c2:66:fb:40:a5:4c
-# SHA1 Fingerprint: 43:13:bb:96:f1:d5:86:9b:c1:4e:6a:92:f6:cf:f6:34:69:87:82:37
-# SHA256 Fingerprint: dd:69:36:fe:21:f8:f0:77:c1:23:a1:a5:21:c1:22:24:f7:22:55:b7:3e:03:a7:26:06:93:e8:a2:4b:0f:a3:89
------BEGIN CERTIFICATE-----
-MIIFODCCAyCgAwIBAgIRAJW+FqD3LkbxezmCcvqLzZYwDQYJKoZIhvcNAQEFBQAw
-NzEUMBI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FAAOCAgEAvuRcYk4k9AwI//DTDGjkk0kiP0Qnb7tt3oNmzqjMDfz1mgbl
-dxSR651Be5kqhOX//CHBXfDkH1e3damhXwIm/9fH907eT/j3HEbAek9ALCI18Bmx
-0GtnLLCo4MBANzX2hFxc469CeP6nyQ1Q6g2EdvZR74NTxnr/DlZJLo961gzmJ1Tj
-TQpgcmLNkQfWpb/ImWvtxBnmq0wROMVvMeJuScg/doAmAyYp4Db29iBT4xdwNBed
-Y2gea+zDTYa4EzAvXUYNR0PVG6pZDrlcjQZIrXSHX8f8MVRBE+LHIQ6e4B4N4cB7
-Q4WQxYpYxmUKeFfyxiMPAdkgS94P+5KFdSpcc41teyWRyu5FrgZLAMzTsVlQ2jqI
-OylDRl6XK1TOU2+NSueW+r9xDkKLfP0ooNBIytrEgUy7onOTJsjrDNYmiLbAJM+7
-vVvrdX3pCI6GMyx5dwlppYn8s3CQh3aP0yK7Qs69cwsgJirQmz1wHiRszYd2qReW
-t88NkvuOGKmYSdGe/mBEciG5Ge3C9THxOUiIkCR1VBatzvT4aRRkOfujuLpwQMcn
-HL/EVlP6Y2XQ8xwOFvVrhlhNGNTkDY6lnVuR3HYkUD/GKvvZt5y11ubQ2egZixVx
-SK236thZiNSQvxaz2emsWWFUyBy6ysHK4bkgTI86k4mloMy/0/Z1pHWWbVY=
------END CERTIFICATE-----
-
-# Issuer: CN=E-Tugra Certification Authority O=E-Tu\u011fra EBG Bili\u015fim Teknolojileri ve Hizmetleri A.\u015e. OU=E-Tugra Sertifikasyon Merkezi
-# Subject: CN=E-Tugra Certification Authority O=E-Tu\u011fra EBG Bili\u015fim Teknolojileri ve Hizmetleri A.\u015e. OU=E-Tugra Sertifikasyon Merkezi
-# Label: "E-Tugra Certification Authority"
-# Serial: 7667447206703254355
-# MD5 Fingerprint: b8:a1:03:63:b0:bd:21:71:70:8a:6f:13:3a:bb:79:49
-# SHA1 Fingerprint: 51:c6:e7:08:49:06:6e:f3:92:d4:5c:a0:0d:6d:a3:62:8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mPoSHyDYwKcMhcWQ9DstliaxLL5Mq+ux0orJ23gTDx4JnW2P
-AJ8C2sH6H3p6CcRK5ogql5+Ji/03X186zjhZhkuvcQu02PJwT58yE+Owp1fl2tpD
-y4Q08ijE6m30Ku/Ba3ba+367hTzSU8JNvnHhRdH9I2cNE3X7z2VnIp2usAnRCf8d
-NL/+I5c30jn6PQ0GC7TbO6Orb1wdtn7os4I07QZcJA==
------END CERTIFICATE-----
-
-# Issuer: CN=T-TeleSec GlobalRoot Class 2 O=T-Systems Enterprise Services GmbH OU=T-Systems Trust Center
-# Subject: CN=T-TeleSec GlobalRoot Class 2 O=T-Systems Enterprise Services GmbH OU=T-Systems Trust Center
-# Label: "T-TeleSec GlobalRoot Class 2"
-# Serial: 1
-# MD5 Fingerprint: 2b:9b:9e:e4:7b:6c:1f:00:72:1a:cc:c1:77:79:df:6a
-# SHA1 Fingerprint: 59:0d:2d:7d:88:4f:40:2e:61:7e:a5:62:32:17:65:cf:17:d8:94:e9
-# SHA256 Fingerprint: 91:e2:f5:78:8d:58:10:eb:a7:ba:58:73:7d:e1:54:8a:8e:ca:cd:01:45:98:bc:0b:14:3e:04:1b:17:05:25:52
------BEGIN CERTIFICATE-----
-MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUx
-KzApBgNVBAoMIlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAd
-BgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNl
-YyBHbG9iYWxSb290IENsYXNzIDIwHhcNMDgxMDAxMTA0MDE0WhcNMzMxMDAxMjM1
-OTU5WjCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoMIlQtU3lzdGVtcyBFbnRlcnBy
-aXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBDZW50
-ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDIwggEiMA0G
-CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCqX9obX+hzkeXaXPSi5kfl82hVYAUd
-AqSzm1nzHoqvNK38DcLZSBnuaY/JIPwhqgcZ7bBcrGXHX+0CfHt8LRvWurmAwhiC
-FoT6ZrAIxlQjgeTNuUk/9k9uN0goOA/FvudocP05l03Sx5iRUKrERLMjfTlH6VJi
-1hKTXrcxlkIF+3anHqP1wvzpesVsqXFP6st4vGCvx9702cu+fjOlbpSD8DT6Iavq
-jnKgP6TeMFvvhk1qlVtDRKgQFRzlAVfFmPHmBiiRqiDFt1MmUUOyCxGVWOHAD3bZ
-wI18gfNycJ5v/hqO2V81xrJvNHy+SE/iWjnX2J14np+GPgNeGYtEotXHAgMBAAGj
-QjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS/
-WSA2AHmgoCJrjNXyYdK4LMuCSjANBgkqhkiG9w0BAQsFAAOCAQEAMQOiYQsfdOhy
-NsZt+U2e+iKo4YFWz827n+qrkRk4r6p8FU3ztqONpfSO9kSpp+ghla0+AGIWiPAC
-uvxhI+YzmzB6azZie60EI4RYZeLbK4rnJVM3YlNfvNoBYimipidx5joifsFvHZVw
-IEoHNN/q/xWA5brXethbdXwFeilHfkCoMRN3zUA7tFFHei4R40cR3p1m0IvVVGb6
-g1XqfMIpiRvpb7PO4gWEyS8+eIVibslfwXhjdFjASBgMmTnrpMwatXlajRWc2BQN
-9noHV8cigwUtPJslJj0Ys6lDfMjIq2SPDqO/nBudMNva0Bkuqjzx+zOAduTNrRlP
-BSeOE6Fuwg==
------END CERTIFICATE-----
-
-# Issuer: CN=Atos TrustedRoot 2011 O=Atos
-# Subject: CN=Atos TrustedRoot 2011 O=Atos
-# Label: "Atos TrustedRoot 2011"
-# Serial: 6643877497813316402
-# MD5 Fingerprint: ae:b9:c4:32:4b:ac:7f:5d:66:cc:77:94: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CwUAA4IBAQAmdzTblEiGKkGdLD4GkGDEjKwLVLgfuXvTBznk+j57sj1O7Z8j
-vZfza1zv7v1Apt+hk6EKhqzvINB5Ab149xnYJDE0BAGmuhWawyfc2E8PzBhj/5kP
-DpFrdRbhIfzYJsdHt6bPWHJxfrrhTZVHO8mvbaG0weyJ9rQPOLXiZNwlz6bb65pc
-maHFCN795trV1lpFDMS3wrUU77QR/w4VtfX128a961qn8FYiqTxlVMYVqL2Gns2D
-lmh6cYGJ4Qvh6hEbaAjMaZ7snkGeRDImeuKHCnE96+RapNLbxc3G3mB/ufNPRJLv
-KrcYPqcZ2Qt9sTdBQrC6YB3y/gkRsPCHe6ed
------END CERTIFICATE-----
-
-# Issuer: CN=QuoVadis Root CA 1 G3 O=QuoVadis Limited
-# Subject: CN=QuoVadis Root CA 1 G3 O=QuoVadis Limited
-# Label: "QuoVadis Root CA 1 G3"
-# Serial: 687049649626669250736271037606554624078720034195
-# MD5 Fingerprint: a4:bc:5b:3f:fe:37:9a:fa:64:f0:e2:fa:05:3d:0b:ab
-# SHA1 Fingerprint: 1b:8e:ea:57:96:29:1a:c9:39:ea:b8:0a:81:1a:73:73:c0:93:79:67
-# SHA256 Fingerprint: 8a:86:6f:d1:b2:76:b5:7e:57:8e:92:1c:65:82:8a:2b:ed:58:e9:f2:f2:88:05:41:34:b7:f1:f4:bf:c9:cc:74
------BEGIN CERTIFICATE-----
-MIIFYDCCA0igAwIBAgIUeFhfLq0sGUvjNwc1NBMotZbUZZMwDQYJKoZIhvcNAQEL
-BQAwSDELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAc
-BgNVBAMTFVF1b1ZhZGlzIFJvb3QgQ0EgMSBHMzAeFw0xMjAxMTIxNzI3NDRaFw00
-MjAxMTIxNzI3NDRaMEgxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM
-aW1pdGVkMR4wHAYDVQQDExVRdW9WYWRpcyBSb290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/7sPtPKlL92CiUN
-qXsCHKnQO18LwIE6PWThv6ctTr1NxNgpxiIY0MWscgKCP6o6ojoilzHdCGPDdRS5
-YCgtW2jgFqlmgiNR9etT2DGbe+m3nUvriBbP+V04ikkwj+3x6xn0dxoxGE1nVGwv
-b2X52z3sIexe9PSLymBlVNFxZPT5pqOBMzYzcfCkeF9OrYMh3jRJjehZrJ3ydlo2
-8hP0r+AJx2EqbPfgna67hkooby7utHnNkDPDs3b69fBsnQGQ+p6Q9pxyz0fawx/k
-NSBT8lTR32GDpgLiJTjehTItXnOQUl1CxM49S+H5GYQd1aJQzEH7QRTDvdbJWqNj
-ZgKAvQU6O0ec7AAmTPWIUb+oI38YB7AL7YsmoWTTYUrrXJ/es69nA7Mf3W1daWhp
-q1467HxpvMc7hU6eFbm0FU/DlXpY18ls6Wy58yljXrQs8C097Vpl4KlbQMJImYFt
-nh8GKjwStIsPm6Ik8KaN1nrgS7ZklmOVhMJKzRwuJIczYOXD
------END CERTIFICATE-----
-
-# Issuer: CN=QuoVadis Root CA 2 G3 O=QuoVadis Limited
-# Subject: CN=QuoVadis Root CA 2 G3 O=QuoVadis Limited
-# Label: "QuoVadis Root CA 2 G3"
-# Serial: 390156079458959257446133169266079962026824725800
-# MD5 Fingerprint: af:0c:86:6e:bf:40:2d:7f:0b:3e:12:50:ba:12:3d:06
-# SHA1 Fingerprint: 09:3c:61:f3:8b:8b:dc:7d:55:df:75:38:02:05:00:e1:25:f5:c8:36
-# SHA256 Fingerprint: 8f:e4:fb:0a:f9:3a:4d:0d:67:db:0b:eb:b2:3e:37:c7:1b:f3:25:dc:bc:dd:24:0e:a0:4d:af:58:b4:7e:18:40
------BEGIN CERTIFICATE-----
-MIIFYDCCA0igAwIBAgIURFc0JFuBiZs18s64KztbpybwdSgwDQYJKoZIhvcNAQEL
-BQAwSDELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAc
-BgNVBAMTFVF1b1ZhZGlzIF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LyZm3tdquXK4Qr36LLTn91nMX66
-AarHakE7kNQIXLJgapDwyM4DYvmL7ftuKtwGTTwpD4kWilhMSA/ohGHqPHKmd+RC
-roijQ1h5fq7KpVMNqT1wvSAZYaRsOPxDMuHBR//47PERIjKWnML2W2mWeyAMQ0Ga
-W/ZZGYjeVYg3UQt4XAoeo0L9x52ID8DyeAIkVJOviYeIyUqAHerQbj5hLja7NQ4n
-lv1mNDthcnPxFlxHBlRJAHpYErAK74X9sbgzdWqTHBLmYF5vHX/JHyPLhGGfHoJE
-+V+tYlUkmlKY7VHnoX6XOuYvHxHaU4AshZ6rNRDbIl9qxV6XU/IyAgkwo1jwDQHV
-csaxfGl7w/U2Rcxhbl5MlMVerugOXou/983g7aEOGzPuVBj+D77vfoRrQ+NwmNtd
-dbINWQeFFSM51vHfqSYP1kjHs6Yi9TM3WpVHn3u6GBVv/9YUZINJ0gpnIdsPNWNg
-KCLjsZWDzYWm3S8P52dSbrsvhXz1SnPnxT7AvSESBT/8twNJAlvIJebiVDj1eYeM
-HVOyToV7BjjHLPj4sHKNJeV3UvQDHEimUF+IIDBu8oJDqz2XhOdT+yHBTw8imoa4
-WSr2Rz0ZiC3oheGe7IUIarFsNMkd7EgrO3jtZsSOeWmD3n+M
------END CERTIFICATE-----
-
-# Issuer: CN=QuoVadis Root CA 3 G3 O=QuoVadis Limited
-# Subject: CN=QuoVadis Root CA 3 G3 O=QuoVadis Limited
-# Label: "QuoVadis Root CA 3 G3"
-# Serial: 268090761170461462463995952157327242137089239581
-# MD5 Fingerprint: df:7d:b9:ad:54:6f:68:a1:df:89:57:03:97:43:b0:d7
-# SHA1 Fingerprint: 48:12:bd:92:3c:a8:c4:39:06:e7:30:6d:27:96:e6:a4:cf:22:2e:7d
-# SHA256 Fingerprint: 88:ef:81:de:20:2e:b0:18:45:2e:43:f8:64:72:5c:ea:5f:bd:1f:c2:d9:d2:05:73:07:09:c5:d8:b8:69:0f:46
------BEGIN CERTIFICATE-----
-MIIFYDCCA0ig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MBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIB
-BjAdBgNVHQ4EFgQUxhfQvKjqAkPyGwaZXSuQILnXnOQwDQYJKoZIhvcNAQELBQAD
-ggIBADRh2Va1EodVTd2jNTFGu6QHcrxfYWLopfsLN7E8trP6KZ1/AvWkyaiTt3px
-KGmPc+FSkNrVvjrlt3ZqVoAh313m6Tqe5T72omnHKgqwGEfcIHB9UqM+WXzBusnI
-FUBhynLWcKzSt/Ac5IYp8M7vaGPQtSCKFWGafoaYtMnCdvvMujAWzKNhxnQT5Wvv
-oxXqA/4Ti2Tk08HS6IT7SdEQTXlm66r99I0xHnAUrdzeZxNMgRVhvLfZkXdxGYFg
-u/BYpbWcC/ePIlUnwEsBbTuZDdQdm2NnL9DuDcpmvJRPpq3t/O5jrFc/ZSXPsoaP
-0Aj/uHYUbt7lJ+yreLVTubY/6CD50qi+YUbKh4yE8/nxoGibIh6BJpsQBJFxwAYf
-3KDTuVan45gtf4Od34wrnDKOMpTwATwiKp9Dwi7DmDkHOHv8XgBCH/MyJnmDhPbl
-8MFREsALHgQjDFSlTC9JxUrRtm5gDWv8a4uFJGS3iQ6rJUdbPM9+Sb3H6QrG2vd+
-DhcI00iX0HGS8A85PjRqHH3Y8iKuu2n0M7SmSFXRDw4m6Oy2Cy2nhTXN/VnIn9HN
-PlopNLk9hM6xZdRZkZFWdSHBd575euFgndOtBBj0fOtek49TSiIp+EgrPk2GrFt/
-ywaZWWDYWGWVjUTR939+J399roD1B0y2PpxxVJkES/1Y+Zj0
------END CERTIFICATE-----
-
-# Issuer: CN=DigiCert Assured ID Root G2 O=DigiCert Inc OU=www.digicert.com
-# Subject: CN=DigiCert Assured ID Root G2 O=DigiCert Inc OU=www.digicert.com
-# Label: "DigiCert Assured ID Root G2"
-# Serial: 15385348160840213938643033620894905419
-# MD5 Fingerprint: 92:38:b9:f8:63:24:82:65:2c:57:33:e6:fe:81:8f:9d
-# SHA1 Fingerprint: a1:4b:48:d9:43:ee:0a:0e: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qVVjOPI
-QW5pJ6d1Ee88hjZv0p3GeDgdaZaikmkuOGybfQTUiaWxMTeKySHMq2zNixya1r9I
-0jJmwYrA8y8678Dj1JGG0VDjA9tzd29KOVPt3ibHtX2vK0LRdWLjSisCx1BL4Gni
-lmwORGYQRI+tBev4eaymG+g3NJ1TyWGqolKvSnAWhsI6yLETcDbYz+70CjTVW0z9
-B5yiutkBclzzTcHdDrEcDcRjvq30FPuJ7KJBDkzMyFdA0G4Dqs0MjomZmWzwPDCv
-ON9vvKO+KSAnq3T/EyJ43pdSVR6DtVQgA+6uwE9W3jfMw3+qBCe703e4YtsXfJwo
-IhNzbM8m9Yop5w==
------END CERTIFICATE-----
-
-# Issuer: CN=DigiCert Assured ID Root G3 O=DigiCert Inc OU=www.digicert.com
-# Subject: CN=DigiCert Assured ID Root G3 O=DigiCert Inc OU=www.digicert.com
-# Label: "DigiCert Assured ID Root G3"
-# Serial: 15459312981008553731928384953135426796
-# MD5 Fingerprint: 7c:7f:65:31:0c:81:df:8d:ba:3e:99:e2:5c:ad:6e:fb
-# SHA1 Fingerprint: f5:17:a2:4f:9a:48:c6:c9:f8:a2:00:26:9f:dc:0f:48:2c:ab:30:89
-# SHA256 Fingerprint: 7e:37:cb:8b:4c:47:09:0c:ab:36:55:1b:a6:f4:5d:b8:40:68:0f:ba:16:6a:95:2d:b1:00:71:7f:43:05:3f:c2
------BEGIN CERTIFICATE-----
-MIICRjCCAc2gAwIBAgIQC6Fa+h3foLVJRK/NJKBs7DAKBggqhkjOPQQDAzBlMQsw
-CQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cu
-ZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3Qg
-RzMwHhcNMTMwODAxMTIwMDAwWhcNMzgwMTE1MTIwMDAwWjBlMQswCQYDVQQGEwJV
-UzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQu
-Y29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzMwdjAQBgcq
-hkjOPQIBBgUrgQQAIgNiAAQZ57ysRGXtzbg/WPuNsVepRC0FFfLvC/8QdJ+1YlJf
-Zn4f5dwbRXkLzMZTCp2NXQLZqVneAlr2lSoOjThKiknGvMYDOAdfVdp+CW7if17Q
-RSAPWXYQ1qAk8C3eNvJsKTmjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/
-BAQDAgGGMB0GA1UdDgQWBBTL0L2p4ZgFUaFNN6KDec6NHSrkhDAKBggqhkjOPQQD
-AwNnADBkAjAlpIFFAmsSS3V0T8gj43DydXLefInwz5FyYZ5eEJJZVrmDxxDnOOlY
-JjZ91eQ0hjkCMHw2U/Aw5WJjOpnitqM7mzT6HtoQknFekROn3aRukswy1vUhZscv
-6pZjamVFkpUBtA==
------END CERTIFICATE-----
-
-# Issuer: CN=DigiCert Global Root G2 O=DigiCert Inc OU=www.digicert.com
-# Subject: CN=DigiCert Global Root G2 O=DigiCert Inc OU=www.digicert.com
-# Label: "DigiCert Global Root G2"
-# Serial: 4293743540046975378534879503202253541
-# MD5 Fingerprint: e4:a6:8a:c8:54:ac:52:42:46:0a:fd:72:48:1b:2a:44
-# SHA1 Fingerprint: df:3c:24:f9:bf:d6:66:76:1b:26:80:73:fe:06:d1:cc:8d:4f:82:a4
-# SHA256 Fingerprint: cb:3c:cb:b7:60:31:e5:e0:13:8f:8d:d3:9a:23:f9:de:47:ff:c3:5e:43:c1:14:4c:ea:27:d4:6a:5a:b1:cb:5f
------BEGIN CERTIFICATE-----
-MIIDjjCCAnagAwIBAgIQAzrx5qcRqaC7KGSxHQn65TANBgkqhkiG9w0BAQsFADBh
-MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
-d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExd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hvld1927jyNxF1WW6LZZm6zNTfl
-MrY=
------END CERTIFICATE-----
-
-# Issuer: CN=DigiCert Global Root G3 O=DigiCert Inc OU=www.digicert.com
-# Subject: CN=DigiCert Global Root G3 O=DigiCert Inc OU=www.digicert.com
-# Label: "DigiCert Global Root G3"
-# Serial: 7089244469030293291760083333884364146
-# MD5 Fingerprint: f5:5d:a4:50:a5:fb:28:7e:1e:0f:0d:cc:96:57:56:ca
-# SHA1 Fingerprint: 7e:04:de:89:6a:3e:66:6d:00:e6:87:d3:3f:fa:d9:3b:e8:3d:34:9e
-# SHA256 Fingerprint: 31:ad:66:48:f8:10:41:38:c7:38:f3:9e:a4:32:01:33:39:3e:3a:18:cc:02:29:6e:f9:7c:2a:c9:ef:67:31:d0
------BEGIN CERTIFICATE-----
-MIICPzCCAcWgAwIBAgIQBVVWvPJepDU1w6QP1atFcjAKBggqhkjOPQQDAzBhMQsw
-CQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cu
-ZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBHMzAe
-Fw0xMzA4MDExMjAwMDBaFw0zODAxMTUxMjAwMDBaMGExCzAJBgNVBAYTAlVTMRUw
-EwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20x
-IDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEczMHYwEAYHKoZIzj0CAQYF
-K4EEACIDYgAE3afZu4q4C/sLfyHS8L6+c/MzXRq8NOrexpu80JX28MzQC7phW1FG
-fp4tn+6OYwwX7Adw9c+ELkCDnOg/QW07rdOkFFk2eJ0DQ+4QE2xy3q6Ip6FrtUPO
-Z9wj/wMco+I+o0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAd
-BgNVHQ4EFgQUs9tIpPmhxdiuNkHMEWNpYim8S8YwCgYIKoZIzj0EAwMDaAAwZQIx
-AK288mw/EkrRLTnDCgmXc/SINoyIJ7vmiI1Qhadj+Z4y3maTD/HMsQmP3Wyr+mt/
-oAIwOWZbwmSNuJ5Q3KjVSaLtx9zRSX8XAbjIho9OjIgrqJqpisXRAL34VOKa5Vt8
-sycX
------END CERTIFICATE-----
-
-# Issuer: CN=DigiCert Trusted Root G4 O=DigiCert Inc OU=www.digicert.com
-# Subject: CN=DigiCert Trusted Root G4 O=DigiCert Inc OU=www.digicert.com
-# Label: "DigiCert Trusted Root G4"
-# Serial: 7451500558977370777930084869016614236
-# MD5 Fingerprint: 78:f2:fc:aa:60:1f:2f:b4:eb:c9:37:ba:53:2e:75:49
-# SHA1 Fingerprint: dd:fb:16:cd:49:31:c9:73:a2:03:7d:3f:c8:3a:4d:7d:77:5d:05:e4
-# SHA256 Fingerprint: 55:2f:7b:dc:f1:a7:af:9e:6c:e6:72:01:7f:4f:12:ab:f7:72:40:c7:8e:76:1a:c2:03:d1:d9:d2:0a:c8:99:88
------BEGIN CERTIFICATE-----
-MIIFkDCCA3igAwIBAgIQBZsbV56OITLiOQe9p3d1XDANBgkqhkiG9w0BAQwFADBi
-MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
-d3cuZGlnaWNlcnQuY29tMSEwHwYDVQQDExhEaWdpQ2VydCBUcnVzdGVkIFJvb3Qg
-RzQwHhcNMTMwODAxMTIwMDAwWhcNMzgwMTE1MTIwMDAwWjBiMQswCQYDVQQGEwJV
-UzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQu
-Y29tMSEwHwYDVQQDExhEaWdpQ2VydCBUcnVzdGVkIFJvb3QgRzQwggIiMA0GCSqG
-SIb3DQEBAQUAA4ICDwAwggIKAoICAQC/5pBzaN675F1KPDAiMGkz7MKnJS7JIT3y
-ithZwuEppz1Yq3aaza57G4QNxDAf8xukOBbr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TZ6iahixTXTBmyUEFxPT9N
-cCOGDErcgdLMMpSEDQgJlxxPwO5rIHQw0uA5NBCFIRUBCOhVMt5xSdkoF1BN5r5N
-0XWs0Mr7QbhDparTwwVETyw2m+L64kW4I1NsBm9nVX9GtUw/bihaeSbSpKhil9Ie
-4u1Ki7wb/UdKDd9nZn6yW0HQO+T0O/QEY+nvwlQAUaCKKsnOeMzV6ocEGLPOr0mI
-r/OSmbaz5mEP0oUA51Aa5BuVnRmhuZyxm7EAHu/QD09CbMkKvO5D+jpxpchNJqU1
-/YldvIViHTLSoCtU7ZpXwdv6EM8Zt4tKG48BtieVU+i2iW1bvGjUI+iLUaJW+fCm
-gKDWHrO8Dw9TdSmq6hN35N6MgSGtBxBHEa2HPQfRdbzP82Z+
------END CERTIFICATE-----
-
-# Issuer: CN=Certification Authority of WoSign O=WoSign CA Limited
-# Subject: CN=Certification Authority of WoSign O=WoSign CA Limited
-# Label: "WoSign"
-# Serial: 125491772294754854453622855443212256657
-# MD5 Fingerprint: a1:f2:f9:b5:d2:c8:7a:74:b8:f3:05:f1:d7:e1:84:8d
-# SHA1 Fingerprint: b9:42:94:bf:91:ea:8f:b6:4b:e6:10:97:c7:fb:00:13:59:b6:76:cb
-# SHA256 Fingerprint: 4b:22:d5:a6:ae:c9:9f:3c:db:79:aa:5e:c0:68:38:47:9c:d5:ec:ba:71:64:f7:f2:2d:c1:d6:5f:63:d8:57:08
------BEGIN CERTIFICATE-----
-MIIFdjCCA16gAwIBAgIQXmjWEXGUY1BWAGjzPsnFkTANBgkqhkiG9w0BAQUFADBV
-MQswCQYDVQQGEwJDTjEaMBgGA1UEChMRV29TaWduIENBIExpbWl0ZWQxKjAoBgNV
-BAMTIUNlcnRpZmljYXRpb24gQXV0aG9yaXR5IG9mIFdvU2lnbjAeFw0wOTA4MDgw
-MTAwMDFaFw0zOTA4MDgwMTAwMDFaMFUxCzAJBgNVBAYTAkNOMRowGAYDVQQKExFX
-b1NpZ24gQ0EgTGltaXRlZDEq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nOeQHrAK2GpZ8nzJLmzbVUsWh2e
-JXLOC62qx1ViC777Y7NhRCOjy+EaDveaBk3e1CNOIZZbOVtXHS9dCF4Jef98l7VN
-g64N1uajeeAz0JmWAjCnPv/So0M/BVoG6kQC2nz4SNAzqfkHx5Xh9T71XXG68pWp
-dIhhWeO/yloTunK0jF02h+mmxTwTv97QRCbut+wucPrXnbes5cVAWubXbHssw1ab
-R80LzvobtCHXt2a49CUwi1wNuepnsvRtrtWhnk/Yn+knArAdBtaP4/tIEp9/EaEQ
-PkxROpaw0RPxx9gmrjrKkcRpnd8BKWRRb2jaFOwIQZeQjdCygPLPwj2/kWjFgGce
-xGATVdVhmVd8upUPYUk6ynW8yQqTP2cOEvIo4jEbwFcW3wh8GcF+Dx+FHgo2fFt+
-J7x6v+Db9NpSvd4MVHAxkUOVyLzwPt0JfjBkUO1/AaQzZ01oT74V77D2AhGiGxMl
-OtzCWfHjXEa7ZywCRuoeSKbmW9m1vFGikpbbqsY3Iqb+zCB0oy2pLmvLwIIRIbWT
-ee5Ehr7XHuQe+w==
------END CERTIFICATE-----
-
-# Issuer: CN=CA \u6c83\u901a\u6839\u8bc1\u4e66 O=WoSign CA Limited
-# Subject: CN=CA \u6c83\u901a\u6839\u8bc1\u4e66 O=WoSign CA Limited
-# Label: "WoSign China"
-# Serial: 106921963437422998931660691310149453965
-# MD5 Fingerprint: 78:83:5b:52:16:76:c4:24:3b:83:78:e8:ac:da:9a:93
-# SHA1 Fingerprint: 16:32:47:8d:89:f9:21:3a:92:00:85:63:f5:a4:a7:d3:12:40:8a:d6
-# SHA256 Fingerprint: d6:f0:34:bd:94:aa:23:3f:02:97:ec:a4:24:5b:28:39:73:e4:47:aa:59:0f:31:0c:77:f4:8f:df:83:11:22:54
------BEGIN CERTIFICATE-----
-MIIFWDCCA0CgAwIBAgIQUHBrzdgT/BtOOzNy0hFIjTANBgkqhkiG9w0BAQsFADBG
-MQswCQYDVQQGEwJDTjEaMBgGA1UEChMRV29TaWduIENBI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ICAQBqinA4
-WbbaixjIvirTthnVZil6Xc1bL3McJk6jfW+rtylNpumlEYOnOXOvEESS5iVdT2H6
-yAa+Tkvv/vMx/sZ8cApBWNromUuWyXi8mHwCKe0JgOYKOoICKuLJL8hWGSbueBwj
-/feTZU7n85iYr83d2Z5AiDEoOqsuC7CsDCT6eiaY8xJhEPRdF/d+4niXVOKM6Cm6
-jBAyvd0zaziGfjk9DgNyp115j0WKWa5bIW4xRtVZjc8VX90xJc/bYNaBRHIpAlf2
-ltTW/+op2znFuCyKGo3Oy+dCMYYFaA6eFN0AkLppRQjbbpCBhqcqBT/mhDn4t/lX
-X0ykeVoQDF7Va/81XwVRHmyjdanPUIPTfPRm94KNPQx96N97qA4bLJyuQHCH2u2n
-FoJavjVsIE4iYdm8UXrNemHcSxH5/mc0zy4EZmFcV5cjjPOGG0jfKq+nwf/Yjj4D
-u9gqsPoUJbJRa4ZDhS4HIxaAjUz7tGM7zMN07RujHv41D198HRaG9Q7DlfEvr10l
-O1Hm13ZBONFLAzkopR6RctR9q5czxNM+4Gm2KHmgCY0c0f9BckgG/Jou5yD5m6Le
-ie2uPAmvylezkolwQOQvT8Jwg0DXJCxr5wkf09XHwQj02w47HAcLQxGEIYbpgNR1
-2KvxAmLBsX5VYc8T1yaw15zLKYs4SgsOkI26oQ==
------END CERTIFICATE-----
-
-# Issuer: CN=COMODO RSA Certification Authority O=COMODO CA Limited
-# Subject: CN=COMODO RSA Certification Authority O=COMODO CA Limited
-# Label: "COMODO RSA Certification Authority"
-# Serial: 101909084537582093308941363524873193117
-# MD5 Fingerprint: 1b:31:b0:71:40:36:cc:14:36:91:ad:c4:3e:fd:ec:18
-# SHA1 Fingerprint: af:e5:d2:44:a8:d1:19:42:30:ff:47:9f:e2:f8:97:bb:cd:7a:8c:b4
-# SHA256 Fingerprint: 52:f0:e1:c4:e5:8e:c6:29:29:1b:60:31:7f:07:46:71:b8:5d:7e:a8:0d:5b:07:27:34:63:53:4b:32:b4:02:34
------BEGIN CER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xUpaVIC
-u9ffUGpVRr+goyhhf3DQw6KqLCGqR84onAZFdr+CGCe01a60y1Dma/RMhnEw6abf
-Fobg2P9A3fvQQoh/ozM6LlweQRGBY84YcWsr7KaKtzFcOmpH4MN5WdYgGq/yapiq
-crxXStJLnbsQ/LBMQeXtHT1eKJ2czL+zUdqnR+WEUwIDAQABo0IwQDAdBgNVHQ4E
-FgQUu69+Aj36pvE8hI6t7jiY7NkyMtQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB
-/wQFMAMBAf8wDQYJKoZIhvcNAQEMBQADggIBAArx1UaEt65Ru2yyTUEUAJNMnMvl
-wFTPoCWOAvn9sKIN9SCYPBMtrFaisNZ+EZLpLrqeLppysb0ZRGxhNaKatBYSaVqM
-4dc+pBroLwP0rmEdEBsqpIt6xf4FpuHA1sj+nq6PK7o9mfjYcwlYRm6mnPTXJ9OV
-2jeDchzTc+CiR5kDOF3VSXkAKRzH7JsgHAckaVd4sjn8OoSgtZx8jb8uk2Intzna
-FxiuvTwJaP+EmzzV1gsD41eeFPfR60/IvYcjt7ZJQ3mFXLrrkguhxuhoqEwWsRqZ
-CuhTLJK7oQkYdQxlqHvLI7cawiiFwxv/0Cti76R7CZGYZ4wUAc1oBmpjIXUDgIiK
-boHGhfKppC3n9KUkEEeDys30jXlYsQab5xoq2Z0B15R97QNKyvDb6KkBPvVWmcke
-jkk9u+UJueBPSZI9FoJAzMxZxuY67RIuaTxslbH9qh17f4a+Hg4yRvv7E491f0yL
-S0Zj/gA0QHDBw7mh3aZw4gSzQbzpgJHqZJx64SIDqZxubw5lT2yHh17zbqD5daWb
-QOhTsiedSrnAdyGN/4fy3ryM7xfft0kL0fJuMAsaDk527RH89elWsn2/x20Kk4yl
-0MC2Hb46TpSi125sC8KKfPog88Tk5c0NqMuRkrF8hey1FGlmDoLnzc7ILaZRfyHB
-NVOFBkpdn627G190
------END CERTIFICATE-----
-
-# Issuer: CN=USERTrust RSA Certification Authority O=The USERTRUST Network
-# Subject: CN=USERTrust RSA Certification Authority O=The USERTRUST Network
-# Label: "USERTrust RSA Certification Authority"
-# Serial: 2645093764781058787591871645665788717
-# MD5 Fingerprint: 1b:fe:69:d1:91:b7:19:33:a3:72:a8:0f:e1:55:e5:b5
-# SHA1 Fingerprint: 2b:8f:1b:57:33:0d:bb:a2:d0:7a:6c:51:f7:0e:e9:0d:da:b9:ad:8e
-# SHA256 Fingerprint: e7:93:c9:b0:2f:d8:aa:13:e2:1c:31:22:8a:cc:b0:81:19:64:3b:74:9c:89:89:64:b1:74:6d:46:c3:d4:cb:d2
------BEGIN CERTIFICATE-----
-MIIF3jCCA8agAwIBAgIQAf1tMPyjylGoG7xkDjUDLTANBgkqhkiG9w0BAQwFADCB
-iDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0pl
-cnNleSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNV
-BAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTAw
-MjAxMDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBiDELMAkGA1UEBhMCVVMxEzARBgNV
-BAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQKExVU
-aGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBSU0EgQ2Vy
-dGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIK
-AoICAQCAEmUXNg7D2wiz0KxXDXbtzSfTTK1Qg2HiqiBNCS1kCdzOiZ/MPans9s/B
-3PHTsdZ7NygRK0faOca8Ohm0X6a9fZ2jY0K2dvKpOyuR+OJv0OwWIJAJPuLodMkY
-tJHUYmTbf6MG8YgYapAiPLz+E/CHFHv25B+O1ORRxhFnRghRy4YUVD+8M/5+bJz/
-Fp0YvV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9zZbyuAlJQG03RoHnHcAP9Dc1ew91Pq7P8yF1m9/
-qS3fuQL39ZeatTXaw2ewh0qpKJ4jjv9cJ2vhsE/zB+4ALtRZh8tSQZXq9EfX7mRB
-VXyNWQKV3WKdwrnuWih0hKWbt5DHDAff9Yk2dDLWKMGwsAvgnEzDHNb842m1R0aB
-L6KCq9NjRHDEjf8tM7qtj3u1cIiuPhnPQCjY/MiQu12ZIvVS5ljFH4gxQ+6IHdfG
-jjxDah2nGN59PRbxYvnKkKj9
------END CERTIFICATE-----
-
-# Issuer: CN=USERTrust ECC Certification Authority O=The USERTRUST Network
-# Subject: CN=USERTrust ECC Certification Authority O=The USERTRUST Network
-# Label: "USERTrust ECC Certification Authority"
-# Serial: 123013823720199481456569720443997572134
-# MD5 Fingerprint: fa:68:bc:d9:b5:7f:ad:fd:c9:1d:06:83:28:cc:24:c1
-# SHA1 Fingerprint: d1:cb:ca:5d:b2:d5:2a:7f:69:3b:67:4d:e5:f0:5a:1d:0c:95:7d:f0
-# SHA256 Fingerprint: 4f:f4:60:d5:4b:9c:86:da:bf:bc:fc:57:12:e0:40:0d:2b:ed:3f:bc:4d:4f:bd:aa:86:e0:6a:dc:d2:a9:ad:7a
------BEGIN CERTIFICATE-----
-MIICjzCCAhWgAwIBAgIQXIuZxVqUxdJxVt7NiYDMJjAKBggqhkjOPQQDAzCBiDEL
-MAkGA1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNl
-eSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMT
-JVVTRVJUcnVzdCBFQ0MgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTAwMjAx
-MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBiDELMAkGA1UEBhMCVVMxEzARBgNVBAgT
-Ck5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQKExVUaGUg
-VVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBFQ0MgQ2VydGlm
-aWNhdGlvbiBBdXRob3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQarFRaqflo
-I+d61SRvU8Za2EurxtW20eZzca7dnNYMYf3boIkDuAUU7FfO7l0/4iGzzvfUinng
-o4N+LZfQYcTxmdwlkWOrfzCjtHDix6EznPO/LlxTsV+zfTJ/ijTjeXmjQjBAMB0G
-A1UdDgQWBBQ64QmG1M8ZwpZ2dEl23OA1xmNjmjAOBgNVHQ8BAf8EBAMCAQYwDwYD
-VR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjA2Z6EWCNzklwBBHU6+4WMB
-zzuqQhFkoJ2UOQIReVx7Hfpkue4WQrO/isIJxOzksU0CMQDpKmFHjFJKS04YcPbW
-RNZu9YO6bVi9JNlWSOrvxKJGgYhqOkbRqZtNyWHa0V1Xahg=
------END CERTIFICATE-----
-
-# Issuer: CN=GlobalSign O=GlobalSign OU=GlobalSign ECC Root CA - R4
-# Subject: CN=GlobalSign O=GlobalSign OU=GlobalSign ECC Root CA - R4
-# Label: "GlobalSign ECC Root CA - R4"
-# Serial: 14367148294922964480859022125800977897474
-# MD5 Fingerprint: 20:f0:27:68:d1:7e:a0:9d:0e:e6:2a:ca:df:5c:89:8e
-# SHA1 Fingerprint: 69:69:56:2e:40:80:f4:24:a1:e7:19:9f:14:ba:f3:ee:58:ab:6a:bb
-# SHA256 Fingerprint: be:c9:49:11:c2:95:56:76:db:6c:0a:55:09:86:d7:6e:3b:a0:05:66:7c:44:2c:97:62:b4:fb:b7:73:de:22:8c
------BEGIN CERTIFICATE-----
-MIIB4TCCAYegAwIBAgIRKjikHJYKBN5CsiilC+g0mAIwCgYIKoZIzj0EAwIwUDEk
-MCIGA1UECxMbR2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI0MRMwEQYDVQQKEwpH
-bG9iYWxTaWduMRMwEQYDVQQDEwpHbG9iYWxTaWduMB4XDTEyMTExMzAwMDAwMFoX
-DTM4MDExOTAzMTQwN1owUDEkMCIGA1UECxMbR2xvYmFsU2lnbiBFQ0MgUm9vdCBD
-QSAtIFI0MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQDEwpHbG9iYWxTaWdu
-MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEuMZ5049sJQ6fLjkZHAOkrprlOQcJ
-FspjsbmG+IpXwVfOQvpzofdlQv8ewQCybnMO/8ch5RikqtlxP6jUuc6MHaNCMEAw
-DgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFFSwe61F
-uOJAf/sKbvu+M8k8o4TVMAoGCCqGSM49BAMCA0gAMEUCIQDckqGgE6bPA7DmxCGX
-kPoUVy0D7O48027KqGx2vKLeuwIgJ6iFJzWbVsaj8kfSt24bAgAXqmemFZHe+pTs
-ewv4n4Q=
------END CERTIFICATE-----
-
-# Issuer: CN=GlobalSign O=GlobalSign OU=GlobalSign ECC Root CA - R5
-# Subject: CN=GlobalSign O=GlobalSign OU=GlobalSign ECC Root CA - R5
-# Label: "GlobalSign ECC Root CA - R5"
-# Serial: 32785792099990507226680698011560947931244
-# MD5 Fingerprint: 9f:ad:3b:1c:02:1e:8a:ba:17:74:38:81:0c:a2:bc:08
-# SHA1 Fingerprint: 1f:24:c6:30:cd:a4:18:ef:20:69:ff:ad:4f:dd:5f:46:3a:1b:69:aa
-# SHA256 Fingerprint: 17:9f:bc:14:8a:3d:d0:0f:d2:4e:a1:34:58:cc:43:bf:a7:f5:9c:81:82:d7:83:a5:13:f6:eb:ec:10:0c:89:24
------BEGIN CERTIFICATE-----
-MIICHjCCAaSgAwIBAgIRYFlJ4CYuu1X5CneKcflK2GwwCgYIKoZIzj0EAwMwUDEk
-MCIGA1UECxMbR2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI1MRMwEQYDVQQKEwpH
-bG9iYWxTaWduMRMwEQYDVQQDEwpHbG9iYWxTaWduMB4XDTEyMTExMzAwMDAwMFoX
-DTM4MDExOTAzMTQwN1owUDEkMCIGA1UECxMbR2xvYmFsU2lnbiBFQ0MgUm9vdCBD
-QSAtIFI1MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQDEwpHbG9iYWxTaWdu
-MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAER0UOlvt9Xb/pOdEh+J8LttV7HpI6SFkc
-8GIxLcB6KP4ap1yztsyX50XUWPrRd21DosCHZTQKH3rd6zwzocWdTaRvQZU4f8ke
-hOvRnkmSh5SHDDqFSmafnVmTTZdhBoZKo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYD
-VR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUPeYpSJvqB8ohREom3m7e0oPQn1kwCgYI
-KoZIzj0EAwMDaAAwZQIxAOVpEslu28YxuglB4Zf4+/2a4n0Sye18ZNPLBSWLVtmg
-515dTguDnFt2KaAJJiFqYgIwcdK1j1zqO+F4CYWodZI7yFz9SO8NdCKoCOJuxUnO
-xwy8p2Fp8fc74SrL+SvzZpA3
------END CERTIFICATE-----
-
-# Issuer: CN=Staat der Nederlanden Root CA - G3 O=Staat der Nederlanden
-# Subject: CN=Staat der Nederlanden Root CA - G3 O=Staat der Nederlanden
-# Label: "Staat der Nederlanden Root CA - G3"
-# Serial: 10003001
-# MD5 Fingerprint: 0b:46:67:07:db:10:2f:19:8c:35:50:60:d1:0b:f4:37
-# SHA1 Fingerprint: d8:eb:6b:41:51:92:59:e0:f3:e7:85:00:c0:3d:b6:88:97:c9:ee:fc
-# SHA256 Fingerprint: 3c:4f:b0:b9:5a:b8:b3:00:32:f4:32:b8:6f:53:5f:e1:72:c1:85:d0:fd:39:86:58:37:cf:36:18:7f:a6:f4:28
------BEGIN CERTIFICATE-----
-MIIFdDCCA1ygAwIBAgIEAJiiOTANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGE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gEGMB0GA1UdDgQWBBRUrfrHkleuyjWcLhL75Lpd
-INyUVzANBgkqhkiG9w0BAQsFAAOCAgEAMJmdBTLIXg47mAE6iqTnB/d6+Oea31BD
-U5cqPco8R5gu4RV78ZLzYdqQJRZlwJ9UXQ4DO1t3ApyEtg2YXzTdO2PCwyiBwpwp
-LiniyMMB8jPqKqrMCQj3ZWfGzd/TtiunvczRDnBfuCPRy5FOCvTIeuXZYzbB1N/8
-Ipf3YF3qKS9Ysr1YvY2WTxB1v0h7PVGHoTx0IsL8B3+A3MSs/mrBcDCw6Y5p4ixp
-gZQJut3+TcCDjJRYwEYgr5wfAvg1VUkvRtTA8KCWAg8zxXHzniN9lLf9OtMJgwYh
-/WA9rjLA0u6NpvDntIJ8CsxwyXmA+P5M9zWEGYox+wrZ13+b8KKaa8MFSu1BYBQw
-0aoRQm7TIwIEC8Zl3d1Sd9qBa7Ko+gE4uZbqKmxnl4mUnrzhVNXkanjvSr0rmj1A
-fsbAddJu+2gw7OyLnflJNZoaLNmzlTnVHpL3prllL+U9bTpITAjc5CgSKL59NVzq
-4BZ+Extq1z7XnvwtdbLBFNUjA9tbbws+eC8N3jONFrdI54OagQ97wUNNVQQXOEpR
-1VmiiXTTn74eS9fGbbeIJG9gkaSChVtWQbzQRKtqE77RLFi3EjNYsjdj3BP1lB0/
-QFH1T/U67cjF68IeHRaVesd+QnGTbksVtzDfqu1XhUisHWrdOWnk4Xl4vs4Fv6EM
-94B7IWcnMFk=
------END CERTIFICATE-----
-
-# Issuer: CN=Staat der Nederlanden EV Root CA O=Staat der Nederlanden
-# Subject: CN=Staat der Nederlanden EV Root CA O=Staat der Nederlanden
-# Label: "Staat der Nederlanden EV Root CA"
-# Serial: 10000013
-# MD5 Fingerprint: fc:06:af:7b:e8:1a:f1:9a:b4:e8:d2:70:1f:c0:f5:ba
-# SHA1 Fingerprint: 76:e2:7e:c1:4f:db:82:c1:c0:a6:75:b5:05:be:3d:29:b4:ed:db:bb
-# SHA256 Fingerprint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enTrust Commercial Root CA 1"
-# Serial: 13298821034946342390520003877796839426
-# MD5 Fingerprint: b3:3e:77:73:75:ee:a0:d3:e3:7e:49:63:49:59:bb:c7
-# SHA1 Fingerprint: df:71:7e:aa:4a:d9:4e:c9:55:84:99:60:2d:48:de:5f:bc:f0:3a:25
-# SHA256 Fingerprint: 5d:56:49:9b:e4:d2:e0:8b:cf:ca:d0:8a:3e:38:72:3d:50:50:3b:de:70:69:48:e4:2f:55:60:30:19:e5:28:ae
------BEGIN CERTIFICATE-----
-MIIFYDCCA0igAwIBAgIQCgFCgAAAAUUjyES1AAAAAjANBgkqhkiG9w0BAQsFADBK
-MQswCQYDVQQGEwJVUzESMBAGA1UEChMJSWRlblRydXN0MScwJQYDVQQDEx5JZGVu
-VHJ1c3QgQ29tbWVyY2lhbCBSb290IENBIDEwHhcNMTQwMTE2MTgxMjIzWhcNMzQw
-MTE2MTgxMjIzWjBKMQswCQYDVQQGEwJVUzESMBAGA1UEChMJSWRlblRydXN0MScw
-JQYDVQQDEx5JZGVuVHJ1c3QgQ29tbWVyY2lhbCBSb290IENBIDEwggIiMA0GCSqG
-SIb3DQEBAQUAA4ICDwAwggIKAoICAQCnUBneP5k91DNG8W9RYYKyqU+PZ4ldhNlT
-3Qwo2dfw/66VQ3KZ+bVdfIrBQuExUHTRgQ18zZshq0PirK1ehm7zCYofWjK9ouuU
-+ehcCuz/mNKvcbO0U59Oh++SvL3sTzIwiEsXXlfEU8L2ApeN2WIrvyQfYo3fw7gp
-S0l4PJNgiCL8mdo2yMKi1CxUAGc1bnO/AljwpN3lsKImesrgNqUZFvX9t++uP0D1
-bVoE/c40yiTcdCMbXTMTEl3EASX2MN0CXZ/g1Ue9tOsbobtJSdifWwLziuQkkORi
-T0/Br4sOdBeo0XKIanoBScy0RnnGF7HamB4HWfp1IYVl3ZBWzvurpWCdxJ35UrCL
-vYf5jysjCiN2O/cz4ckA82n5S6LgTrx+kzmEB/dEcH7+B1rlsazRGMzyNeVJSQjK
-Vs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tK4dw4LTzcqx+QGtVKnO7RcGzM7vRX+Bi6hG6H
------END CERTIFICATE-----
-
-# Issuer: CN=IdenTrust Public Sector Root CA 1 O=IdenTrust
-# Subject: CN=IdenTrust Public Sector Root CA 1 O=IdenTrust
-# Label: "IdenTrust Public Sector Root CA 1"
-# Serial: 13298821034946342390521976156843933698
-# MD5 Fingerprint: 37:06:a5:b0:fc:89:9d:ba:f4:6b:8c:1a:64:cd:d5:ba
-# SHA1 Fingerprint: ba:29:41:60:77:98:3f:f4:f3:ef:f2:31:05:3b:2e:ea:6d:4d:45:fd
-# SHA256 Fingerprint: 30:d0:89:5a:9a:44:8a:26:20:91:63:55:22:d1:f5:20:10:b5:86:7a:ca:e1:2c:78:ef:95:8f:d4:f4:38:9f:2f
------BEGIN CERTIFICATE-----
-MIIFZjCCA06gAwIBAgIQCgFCgAAAAUUjz0Z8AAAAAjANBgkqhkiG9w0BAQsFADBN
-MQswCQYDVQQGEwJVUzESMBAGA1UEChMJSWRlblRydXN0MSowKAYDVQQDEyFJZGVu
-VHJ1c3QgUHVibGljIFNlY3RvciBSb290IENBIDEwHhcNMTQwMTE2MTc1MzMyWhcN
-MzQwMTE2MTc1MzMyWjBNMQswCQYDVQQGEwJVUzESMBAGA1UEChMJSWRlblRydXN0
-MSowKAYDVQQDEyFJZGVuVHJ1c3QgUHVibGljIFNlY3RvciBSb290IENBIDEwggIi
-MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2IpT8pEiv6EdrCvsnduTyP4o7
-ekosMSqMjbCpwzFrqHd2hCa2rIFCDQjrVVi7evi8ZX3yoG2LqEfpYnYeEe4IFNGy
-RBb06tD6Hi9e28tzQa68ALBKK0CyrOE7S8ItneShm+waOh7wCLPQ5CQ1B5+ctMlS
-bdsHyo+1W/CD80/HLaXIrcuVIKQxKFdYWuSNG5qrng0M8gozOSI5Cpcu81N3uURF
-/YTLNiCBWS2ab21ISGHKTN9T0a9SvESfqy9rg3LvdYDaBjMbXcjaY8Z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NxbqBWJMWxJH7ae0s1hWx0nzfxJoCTFx8G34Tkf71oXuxVhA
-GaQdp/lLQzfcaFpPz+vCZHTetBXZ9FRUGi8c15dxVJCO2SCdUyt/q4/i6jC8UDfv
-8Ue1fXwsBOxonbRJRBD0ckscZOf85muQ3Wl9af0AVqW3rLatt8o+Ae+c
------END CERTIFICATE-----
-
-# Issuer: CN=Entrust Root Certification Authority - G2 O=Entrust, Inc. OU=See www.entrust.net/legal-terms/(c) 2009 Entrust, Inc. - for authorized use only
-# Subject: CN=Entrust Root Certification Authority - G2 O=Entrust, Inc. OU=See www.entrust.net/legal-terms/(c) 2009 Entrust, Inc. - for authorized use only
-# Label: "Entrust Root Certification Authority - G2"
-# Serial: 1246989352
-# MD5 Fingerprint: 4b:e2:c9:91:96:65:0c:f4:0e:5a:93:92:a0:0a:fe:b2
-# SHA1 Fingerprint: 8c:f4:27:fd:79:0c:3a:d1:66:06:8d:e8:1e:57:ef:bb:93:22:72:d4
-# SHA256 Fingerprint: 43:df:57:74:b0:3e:7f:ef:5f:e4:0d:93:1a:7b:ed:f1:bb:2e:6b:42:73:8c:4e:6d:38:41:10:3d:3a:a7:f3:39
------BEGIN CERTIFICATE-----
-MIIEPjCCAyagAwIBAgIESlOMKDANBgkqhkiG9w0BAQsFADCBvjELMAkGA1UEBhMC
-VVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50
-cnVzdC5uZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDA5IEVudHJ1c3Qs
-IEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25seTEyMDAGA1UEAxMpRW50cnVz
-dCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzIwHhcNMDkwNzA3MTcy
-NTU0WhcNMzAxMjA3MTc1NTU0WjCBvjELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUVu
-dHJ1c3QsIEluYy4xKDAmBgNVBAsT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CERTIFICATE-----
-
-# Issuer: CN=Entrust Root Certification Authority - EC1 O=Entrust, Inc. OU=See www.entrust.net/legal-terms/(c) 2012 Entrust, Inc. - for authorized use only
-# Subject: CN=Entrust Root Certification Authority - EC1 O=Entrust, Inc. OU=See www.entrust.net/legal-terms/(c) 2012 Entrust, Inc. - for authorized use only
-# Label: "Entrust Root Certification Authority - EC1"
-# Serial: 51543124481930649114116133369
-# MD5 Fingerprint: b6:7e:1d:f0:58:c5:49:6c:24:3b:3d:ed:98:18:ed:bc
-# SHA1 Fingerprint: 20:d8:06:40:df:9b:25:f5:12:25:3a:11:ea:f7:59:8a:eb:14:b5:47
-# SHA256 Fingerprint: 02:ed:0e:b2:8c:14:da:45:16:5c:56:67:91:70:0d:64:51:d7:fb:56:f0:b2:ab:1d:3b:8e:b0:70:e5:6e:df:f5
------BEGIN CERTIFICATE-----
-MIIC+TCCAoCgAwIBAgINAKaLeSkAAAAAUNCR+TAKBggqhkjOPQQDAzCBvzELMAkG
-A1UEBhMCVVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3
-d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDEyIEVu
-dHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25seTEzMDEGA1UEAxMq
-RW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRUMxMB4XDTEy
-MTIxODE1MjUzNloXDTM3MTIxODE1NTUzNlowgb8xCzAJBgNVBAYTAlVTMRYwFAYD
-VQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9TZWUgd3d3LmVudHJ1c3QubmV0
-L2xlZ2FsLXRlcm1zMTkwNwYDVQQLEzAoYykgMjAxMiBFbnRydXN0LCBJbmMuIC0g
-Zm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxMzAxBgNVBAMTKkVudHJ1c3QgUm9vdCBD
-ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEVDMTB2MBAGByqGSM49AgEGBSuBBAAi
-A2IABIQTydC6bUF74mzQ61VfZgIaJPRbiWlH47jCffHyAsWfoPZb1YsGGYZPUxBt
-ByQnoaD41UcZYUx9ypMn6nQM72+WCf5j7HBdNq1nd67JnXxVRDqiY1Ef9eNi1KlH
-Bz7MIKNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0O
-BBYEFLdj5xrdjekIplWDpOBqUEFlEUJJMAoGCCqGSM49BAMDA2cAMGQCMGF52OVC
-R98crlOZF7ZvHH3hvxGU0QOIdeSNiaSKd0bebWHvAvX7td/M/k7//qnmpwIwW5nX
-hTcGtXsI/esni0qU+eH6p44mCOh8kmhtc9hvJqwhAriZtyZBWyVgrtBIGu4G
------END CERTIFICATE-----
-
-# Issuer: CN=CFCA EV ROOT O=China Financial Certification Authority
-# Subject: CN=CFCA EV ROOT O=China Financial Certification Authority
-# Label: "CFCA EV ROOT"
-# Serial: 407555286
-# MD5 Fingerprint: 74:e1:b6:ed:26:7a:7a:44:30:33:94:ab:7b:27:81:30
-# SHA1 Fingerprint: e2:b8:29:4b:55:84:ab:6b:58:c2:90:46:6c:ac:3f:b8:39:8f:84:83
-# SHA256 Fingerprint: 5c:c3:d7:8e:4e:1d:5e:45:54:7a:04:e6:87:3e:64:f9:0c:f9:53:6d:1c:cc:2e:f8:00:f3:55:c4:c5:fd:70:fd
------BEGIN CERTIFICATE-----
-MIIFjTCCA3WgAwIBAgIEGErM1jANBgkqhkiG9w0BAQsFADBWMQswCQYDVQQGEwJD
-TjEwMC4GA1UECgwnQ2hpbmEgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9y
-aXR5MRUwEwYDVQQDDAxDRkNBIEVWIFJPT1QwHhcNMTIwODA4MDMwNzAxWhcNMjkx
-MjMxMDMwNzAxWjBWMQswCQYDVQQGEwJDTjEwMC4GA1UECgwnQ2hpb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ecsAIyjmHjdXNYmEwnZPNDatZ8POQQaIxffu2Bq41gt/UP+TqhdL
-jOztUmCypAbqTuv0axn96/Ua4CUqmtzHQTb3yHQFhDmVOdYLO6Qn+gjYXB74BGBS
-ESgoA//vU2YApUo0FmZ8/Qmkrp5nGm9BC2sGE5uPhnEFtC+NiWYzKXZUmhH4J/qy
-P5Hgzg0b8zAarb8iXRvTvyUFTeGSGn+ZnzxEk8rUQElsgIfXBDrDMlI1Dlb4pd19
-xIsNER9Tyx6yF7Zod1rg1MvIB671Oi6ON7fQAUtDKXeMOZePglr4UeWJoBjnaH9d
-Ci77o0cOPaYjesYBx4/IXr9tgFa+iiS6M+qf4TIRnvHST4D2G0CvOJ4RUHlzEhLN
-5mydLIhyPDCBBpEi6lmt2hkuIsKNuYyH4Ga8cyNfIWRjgEj1oDwYPZTISEEdQLpe
-/v5WOaHIz16eGWRGENoXkbcFgKyLmZJ956LYBws2J+dIeWCKw9cTXPhyQN9Ky8+Z
-AAoACxGV2lZFA4gKn2fQ1XmxqI1AbQ3CekD6819kR5LLU7m7Wc5P/dAVUwHY3+vZ
-5nbv0CO7O6l5s9UCKc2Jo5YPSjXnTkLAdc0Hz+Ys63su
------END CERTIFICATE-----
-
-# Issuer: CN=T\xdcRKTRUST Elektronik Sertifika Hizmet Sa\u011flay\u0131c\u0131s\u0131 H5 O=T\xdcRKTRUST Bilgi \u0130leti\u015fim ve Bili\u015fim G\xfcvenli\u011fi Hizmetleri A.\u015e.
-# Subject: CN=T\xdcRKTRUST Elektronik Sertifika Hizmet Sa\u011flay\u0131c\u0131s\u0131 H5 O=T\xdcRKTRUST Bilgi \u0130leti\u015fim ve Bili\u015fim G\xfcvenli\u011fi Hizmetleri A.\u015e.
-# Label: "T\xdcRKTRUST Elektronik Sertifika Hizmet Sa\u011flay\u0131c\u0131s\u0131 H5"
-# Serial: 156233699172481
-# MD5 Fingerprint: da:70:8e:f0:22:df:93:26:f6:5f:9f:d3:15:06:52:4e
-# SHA1 Fingerprint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VqhzPMggCTTV+wVunUlm+hkS7M0
-hO8EuPbJbKoCPrZV4jI3X/xml1/N1p7HIL9Nxqw/dV8c7TKcfGkAaZHjIxhT6QID
-AQABo0IwQDAdBgNVHQ4EFgQUVpkHHtOsDGlktAxQR95DLL4gwPswDgYDVR0PAQH/
-BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAJ5FdnsX
-SDLyOIspve6WSk6BGLFRRyDN0GSxDsnZAdkJzsiZ3GglE9Rc8qPoBP5yCccLqh0l
-VX6Wmle3usURehnmp349hQ71+S4pL+f5bFgWV1Al9j4uPqrtd3GqqpmWRgqujuwq
-URawXs3qZwQcWDD1YIq9pr1N5Za0/EKJAWv2cMhQOQwt1WbZyNKzMrcbGW3LM/nf
-peYVhDfwwvJllpKQd/Ct9JDpEXjXk4nAPQu6KfTomZ1yju2dL+6SfaHx/126M2CF
-Yv4HAqGEVka+lgqaE9chTLd8B59OTj+RdPsnnRHM3eaxynFNExc5JsUpISuTKWqW
-+qtB4Uu2NQvAmxU=
------END CERTIFICATE-----
-
-# Issuer: CN=Certinomis - Root CA O=Certinomis OU=0002 433998903
-# Subject: CN=Certinomis - Root CA O=Certinomis OU=0002 433998903
-# Label: "Certinomis - Root CA"
-# Serial: 1
-# MD5 Fingerprint: 14:0a:fd:8d:a8:28:b5:38:69:db:56:7e:61:22:03:3f
-# SHA1 Fingerprint: 9d:70:bb:01:a5:a4:a0:18:11:2e:f7:1c:01:b9:32:c5:34:e7:88:a8
-# SHA256 Fingerprint: 2a:99:f5:bc:11:74:b7:3c:bb:1d:62:08:84:e0:1c:34:e5:1c:cb:39:78:da:12:5f:0e:33:26:88:83:bf:41:58
------BEGIN CERTIFICATE-----
-MIIFkjCCA3qgAwIBAgIBATANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJGUjET
-MBEGA1UEChMKQ2VydGlub21pczEXMBUGA1UECxMOMDAwMiA0MzM5OTg5MDMxHTAb
-BgNVBAM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cMw6C8I6tNxIqSSaHh02TANBgkqhkiG9w0BAQsF
-AAOCAgEAfj1U2iJdGlg+O1QnurrMyOMaauo++RLrVl89UM7g6kgmJs95Vn6RHJk/
-0KGRHCwPT5iVWVO90CLYiF2cN/z7ZMF4jIuaYAnq1fohX9B0ZedQxb8uuQsLrbWw
-F6YSjNRieOpWauwK0kDDPAUwPk2Ut59KA9N9J0u2/kTO+hkzGm2kQtHdzMjI1xZS
-g081lLMSVX3l4kLr5JyTCcBMWwerx20RoFAXlCOotQqSD7J6wWAsOMwaplv/8gzj
-qh8c3LigkyfeY+N/IZ865Z764BNqdeuWXGKRlI5nU7aJ+BIJy29SWwNyhlCVCNSN
-h4YVH5Uk2KRvms6knZtt0rJ2BobGVgjF6wnaNsIbW0G+YSrjcOa4pvi2WsS9Iff/
-ql+hbHY5ZtbqTFXhADObE5hjyW/QASAJN1LnDE8+zbz1X5YnpyACleAu6AdBBR8V
-btaw5BngDwKTACdyxYvRVB9dSsNAl35VpnzBMwQUAR1JIGkLGZOdblgi90AMRgwj
-Y/M50n92Uaf0yKHxDHYiI0ZSKS3io0EHVmmY0gUJvGnHWmHNj4FgFU2A3ZDifcRQ
-8ow7bkrHxuaAKzyBvBGAFhAn1/DNP3nMcyrDflOR1m749fPH0FFNjkulW+YZFzvW
-gQncItzujrnEj1PhZ7szuIgVRs/taTX/dQ1G885x4cVrhkIGuUE=
------END CERTIFICATE-----
-
-# Issuer: CN=OISTE WISeKey Global Root GB CA O=WISeKey OU=OISTE Foundation Endorsed
-# Subject: CN=OISTE WISeKey Global Root GB CA O=WISeKey OU=OISTE Foundation Endorsed
-# Label: "OISTE WISeKey Global Root GB CA"
-# Serial: 157768595616588414422159278966750757568
-# MD5 Fingerprint: a4:eb:b9:61:28:2e:b7:2f:98:b0:35:26:90:99:51:1d
-# SHA1 Fingerprint: 0f:f9:40:76:18:d3:d7:6a:4b:98:f0:a8:35:9e:0c:fd:27:ac:cc:ed
-# SHA256 Fingerprint: 6b:9c:08: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sLAmzYh7KzKNbrgh
-cViXfa43FK8+5/ea4n32cZiZBKpDdHij40lhPnOMTZTg+XHEthYOU3gf1qKHLwI5
-gSk8rxWYITD+KJAAjNHhy/peyP34EEY7onhCkRd0VQreUGdNZtGn//3ZwLWoo4rO
-ZvUPQ82nK1d7Y0Zqqi5S2PTt4W2tKZB4SLrhI6qjiey1q5bAtEuiHZeeevJuQHHf
-aPFlTc58Bd9TZaml8LGXBHAVRgOY1NK/VLSgWH1Sb9pWJmLU2NuJMW8c8CLC02Ic
-Nc1MaRVUGpCY3useX8p3x8uOPUNpnJpY0CQ73xtAln41rYHHTnG6iBM=
------END CERTIFICATE-----
-
-# Issuer: CN=Certification Authority of WoSign G2 O=WoSign CA Limited
-# Subject: CN=Certification Authority of WoSign G2 O=WoSign CA Limited
-# Label: "Certification Authority of WoSign G2"
-# Serial: 142423943073812161787490648904721057092
-# MD5 Fingerprint: c8:1c:7d:19:aa:cb:71:93:f2:50:f8:52:a8:1e:ba:60
-# SHA1 Fingerprint: fb:ed:dc:90:65:b7:27:20:37:bc:55:0c:9c:56:de:bb:f2:78:94:e1
-# SHA256 Fingerprint: d4:87:a5:6f:83:b0:74:82:e8:5e:96:33:94:c1:ec:c2:c9:e5:1d:09:03:ee:94:6b:02:c3:01:58:1e:d9:9e:16
------BEGIN CERTIFICATE-----
-MIIDfDCCAmSgAwIBAgIQayXaioidfLwPBbOxemFFRDANBgkqhkiG9w0BAQsFADBY
-MQswCQYDVQQGEwJDTjEaMBgGA1UEChMRV29TaWduIENBIExpbWl0ZWQxLTArBgNV
-BAMTJENlcnRpZmljYXRpb24gQXV0aG9yaXR5IG9mIFdvU2lnbiBHMjAeFw0xNDEx
-MDgwMDU4NThaFw00NDExMDgwMDU4NThaMFgxCzAJBgNVBAYTAkNOMRowGAYDVQQK
-ExFXb1NpZ24gQ0EgTGltaXRlZDEtMCsGA1UEAxMkQ2VydGlmaWNhdGlvbiBBdXRo
-b3JpdHkgb2YgV29TaWduIEcyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC
-AQEAvsXEoCKASU+/2YcRxlPhuw+9YH+v9oIOH9ywjj2X4FA8jzrvZjtFB5sg+OPX
-JYY1kBaiXW8wGQiHC38Gsp1ij96vkqVg1CuAmlI/9ZqD6TRay9nVYlzmDuDfBpgO
-gHzKtB0TiGsOqCR3A9DuW/PKaZE1OVbFbeP3PU9ekzgkyhjpJMuSA93MHD0JcOQg
-5PGurLtzaaNjOg9FD6FKmsLRY6zLEPg95k4ot+vElbGs/V6r+kHLXZ1L3PR8du9n
-fwB6jdKgGlxNIuG12t12s9R23164i5jIFFTMaxeSt+BKv0mUYQs4kI9dJGwlezt5
-2eJ+na2fmKEG/HgUYFf47oB3sQIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYD
-VR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU+mCp62XF3RYUCE4MD42b4Pdkr2cwDQYJ
-KoZIhvcNAQELBQADggEBAFfDejaCnI2Y4qtAqkePx6db7XznPWZaOzG73/MWM5H8
-fHulwqZm46qwtyeYP0nXYGdnPzZPSsvxFPpahygc7Y9BMsaV+X3avXtbwrAh449G
-3CE4Q3RM+zD4F3LBMvzIkRfEzFg3TgvMWvchNSiDbGAtROtSjFA9tWwS1/oJu2yy
-SrHFieT801LYYRf+epSEj3m2M1m6D8QL4nCgS3gu+sif/a+RZQp4OBXllxcU3fng
-LDT4ONCEIgDAFFEYKwLcMFrw6AF8NTojrwjkr6qOKEJJLvD1mTS+7Q9LGOHSJDy7
-XUe3IfKN0QqZjuNuPq1w4I+5ysxugTH2e5x6eeRncRg=
------END CERTIFICATE-----
-
-# Issuer: CN=CA WoSign ECC Root O=WoSign CA Limited
-# Subject: CN=CA WoSign ECC Root O=WoSign CA Limited
-# Label: "CA WoSign ECC Root"
-# Serial: 138625735294506723296996289575837012112
-# MD5 Fingerprint: 80:c6:53:ee:61:82:28:72:f0:ff:21:b9:17:ca:b2:20
-# SHA1 Fingerprint: d2:7a:d2:be:ed:94:c0:a1:3c:c7:25:21:ea:5d:71:be:81:19:f3:2b
-# SHA256 Fingerprint: 8b:45:da:1c:06:f7:91:eb:0c:ab:f2:6b:e5:88:f5:fb:23:16:5c:2e:61:4b:f8:85:56:2d:0d:ce:50:b2:9b:02
------BEGIN CERTIFICATE-----
-MIICCTCCAY+gAwIBAgIQaEpYcIBr8I8C+vbe6LCQkDAKBggqhkjOPQQDAzBGMQsw
-CQYDVQQGEwJDTjEaMBgGA1UEChMRV29TaWduIENBIExpbWl0ZWQxGzAZBgNVBAMT
-EkNBIFdvU2lnbiBFQ0MgUm9vdDAeFw0xNDExMDgwMDU4NThaFw00NDExMDgwMDU4
-NThaMEYxCzAJBgNVBAYTAkNOMRowGAYDVQQKExFXb1NpZ24gQ0EgTGltaXRlZDEb
-MBkGA1UEAxMSQ0EgV29TaWduIEVDQyBSb290MHYwEAYHKoZIzj0CAQYFK4EEACID
-YgAE4f2OuEMkq5Z7hcK6C62N4DrjJLnSsb6IOsq/Srj57ywvr1FQPEd1bPiUt5v8
-KB7FVMxjnRZLU8HnIKvNrCXSf4/CwVqCXjCLelTOA7WRf6qU0NGKSMyCBSah1VES
-1ns2o0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4E
-FgQUqv3VWqP2h4syhf3RMluARZPzA7gwCgYIKoZIzj0EAwMDaAAwZQIxAOSkhLCB
-1T2wdKyUpOgOPQB0TKGXa/kNUTyh2Tv0Daupn75OcsqF1NnstTJFGG+rrQIwfcf3
-aWMvoeGY7xMQ0Xk/0f7qO3/eVvSQsRUR2LIiFdAvwyYua/GRspBl9JrmkO5K
------END CERTIFICATE-----
-
-# Issuer: CN=SZAFIR ROOT CA2 O=Krajowa Izba Rozliczeniowa S.A.
-# Subject: CN=SZAFIR ROOT CA2 O=Krajowa Izba Rozliczeniowa S.A.
-# Label: "SZAFIR ROOT CA2"
-# Serial: 357043034767186914217277344587386743377558296292
-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BBQuFqlKGLXLzPVvUPMjX/hd56zwyDANBgkqhkiG9w0BAQsF
-AAOCAQEAtXP4A9xZWx126aMqe5Aosk3AM0+qmrHUuOQn/6mWmc5G4G18TKI4pAZw
-8PRBEew/R40/cof5O/2kbytTAOD/OblqBw7rHRz2onKQy4I9EYKL0rufKq8h5mOG
-nXkZ7/e7DDWQw4rtTw/1zBLZpD67oPwglV9PJi8RI4NOdQcPv5vRtB3pEAT+ymCP
-oky4rc/hkA/NrgrHXXu3UNLUYfrVFdvXn4dRVOul4+vJhaAlIDf7js4MNIThPIGy
-d05DpYhfhmehPea0XGG2Ptv+tyjFogeutcrKjSoS75ftwjCkySp6+/NNIxuZMzSg
-LvWpCz/UXeHPhJ/iGcJfitYgHuNztw==
------END CERTIFICATE-----
-
-# Issuer: CN=Certum Trusted Network CA 2 O=Unizeto Technologies S.A. OU=Certum Certification Authority
-# Subject: CN=Certum Trusted Network CA 2 O=Unizeto Technologies S.A. OU=Certum Certification Authority
-# Label: "Certum Trusted Network CA 2"
-# Serial: 44979900017204383099463764357512596969
-# MD5 Fingerprint: 6d:46:9e:d9:25:6d:08:23:5b:5e:74:7d:1e:27:db:f2
-# SHA1 Fingerprint: d3:dd:48:3e:2b:bf:4c:05:e8:af:10:f5:fa:76:26:cf:d3:dc:30:92
-# SHA256 Fingerprint: b6:76:f2:ed:da:e8:77:5c:d3:6c:b0:f6:3c:d1:d4:60:39:61:f4:9e:62:65:ba:01:3a:2f:03:07:b6:d0:b8:04
------BEGIN CERTIFICATE-----
-MIIF0jCCA7qgAwIBAgIQIdbQSk8lD8kyN/yqXhKN6TANBgkqhkiG9w0BAQ0FADCB
-gDELMAkGA1UEBhMCUEwxIjAgBgNVBAoTGVVuaXpldG8gVGVjaG5vbG9naWVzIFMu
-QS4xJzAlBgNVBAsTHkNlcnR1bSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEkMCIG
-A1UEAxMbQ2VydHVtIFRydXN0ZWQgTmV0d29yayBDQSAyMCI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MC
-AQYwDQYJKoZIhvcNAQENBQADggIBAHGlDs7k6b8/ONWJWsQCYftMxRQXLYtPU2sQ
-F/xlhMcQSZDe28cmk4gmb3DWAl45oPePq5a1pRNcgRRtDoGCERuKTsZPpd1iHkTf
-CVn0W3cLN+mLIMb4Ck4uWBzrM9DPhmDJ2vuAL55MYIR4PSFk1vtBHxgP58l1cb29
-XN40hz5BsA72udY/CROWFC/emh1auVbONTqwX3BNXuMp8SMoclm2q8KMZiYcdywm
-djWLKKdpoPk79SPdhRB0yZADVpHnr7pH1BKXESLjokmUbOe3lEu6LaTaM4tMpkT/
-WjzGHWTYtTHkpjx6qFcL2+1hGsvxznN3Y6SHb0xRONbkX8eftoEq5IVIeVheO/jb
-AoJnwTnbw3RLPTYe+SmTiGhbqEQZIfCn6IENLOiTNrQ3ssqwGyZ6miUfmpqAnksq
-P/ujmv5zMnHCnsZy4YpoJ/HkD7TETKVhk/iXEAcqMCWpuchxuO9ozC1+9eB+D4Ko
-b7a6bINDd82Kkhehnlt4Fj1F4jNy3eFmypnTycUm/Q1oBEauttmbjL4ZvrHG8hnj
-XALKLNhvSgfZyTXaQHXyxKcZb55CEJh15pWLYLztxRLXis7VmFxWlgPF7ncGNf/P
-5O4/E2Hu29othfDNrp2yGAlFw5Khchf8R7agCyzxxN5DaAhqXzvwdmP7zAYspsbi
-DrW5viSP
------END CERTIFICATE-----
-
-# Issuer: CN=Hellenic Academic and Research Institutions RootCA 2015 O=Hellenic Academic and Research Institutions Cert. Authority
-# Subject: CN=Hellenic Academic and Research Institutions RootCA 2015 O=Hellenic Academic and Research Institutions Cert. Authority
-# Label: "Hellenic Academic and Research Institutions RootCA 2015"
-# Serial: 0
-# MD5 Fingerprint: ca:ff:e2:db:03:d9:cb:4b:e9:0f:ad:84:fd:7b:18:ce
-# SHA1 Fingerprint: 01:0c:06:95:a6:98:19:14:ff:bf:5f:c6:b0:b6:95:ea:29:e9:12:a6
-# SHA256 Fingerprint: a0:40:92:9a:02:ce:53:b4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JI7ZjnHK
-e7iG2rKPmT4dEw0SEe7Uq/DpFXYC5ODfqiAeW2GFZECpkJcNrVPSWh2HagCXZWK0
-vm9qp/UsQu0yrbYhnr68
------END CERTIFICATE-----
-
-# Issuer: CN=Hellenic Academic and Research Institutions ECC RootCA 2015 O=Hellenic Academic and Research Institutions Cert. Authority
-# Subject: CN=Hellenic Academic and Research Institutions ECC RootCA 2015 O=Hellenic Academic and Research Institutions Cert. Authority
-# Label: "Hellenic Academic and Research Institutions ECC RootCA 2015"
-# Serial: 0
-# MD5 Fingerprint: 81:e5:b4:17:eb:c2:f5:e1:4b:0d:41:7b:49:92:fe:ef
-# SHA1 Fingerprint: 9f:f1:71:8d:92:d5:9a:f3:7d:74:97:b4:bc:6f:84:68:0b:ba:b6:66
-# SHA256 Fingerprint: 44:b5:45:aa:8a:25:e6:5a:73:ca:15:dc:27:fc:36:d2:4c:1c:b9:95:3a:06:65:39:b1:15:82:dc:48:7b:48:33
------BEGIN CERTIFICATE-----
-MIICwzCCAkqgAwIBAgIBADAKBggqhkjOPQQDAjCBqjELMAkGA1UEBhMCR1IxDzAN
-BgNVBAcTBkF0aGVuczFEMEIGA1UEChM7SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJl
-c2VhcmNoIEluc3RpdHV0aW9ucyBDZXJ0LiBBdXRob3JpdHkxRDBCBgNVBAMTO0hl
-bGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgRUNDIFJv
-b3RDQSAyMDE1MB4XDTE1MDcwNzEwMzcxMloXDTQwMDYzMDEwMzcxMlowgaoxCzAJ
-BgNVBAYTAkdSMQ8wDQYDVQQHEwZBdGhlbnMxRDBCBgNVBAoTO0hlbGxlbmljIEFj
-YWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgQ2VydC4gQXV0aG9yaXR5
-MUQwQgYDVQQDEztIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0
-dXRpb25zIEVDQyBSb290Q0EgMjAxNTB2MBAGByqGSM49AgEGBSuBBAAiA2IABJKg
-QehLgoRc4vgxEZmGZE4JJS+dQS8KrjVPdJWyUWRrjWvmP3CV8AVER6ZyOFB2lQJa
-jq4onvktTpnvLEhvTCUp6NFxW98dwXU3tNf6e3pCnGoKVlp8aQuqgAkkbH7BRqNC
-MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFLQi
-C4KZJAEOnLvkDv2/+5cgk5kqMAoGCCqGSM49BAMCA2cAMGQCMGfOFmI4oqxiRaep
-lSTAGiecMjvAwNW6qef4BENThe5SId6d9SWDPp5YSy/XZxMOIQIwBeF1Ad5o7Sof
-TUwJCA3sS61kFyjndc5FZXIhF8siQQ6ME5g4mlRtm8rifOoCWCKR
------END CERTIFICATE-----
-
-# Issuer: CN=Certplus Root CA G1 O=Certplus
-# Subject: CN=Certplus Root CA G1 O=Certplus
-# Label: "Certplus Root CA G1"
-# Serial: 1491911565779898356709731176965615564637713
-# MD5 Fingerprint: 7f:09:9c:f7:d9:b9:5c:69:69:56:d5:37:3e:14:0d:42
-# SHA1 Fingerprint: 22:fd:d0:b7:fd:a2:4e:0d:ac:49:2c:a0:ac:a6:7b:6a:1f:e3:f7:66
-# SHA256 Fingerprint: 15:2a:40:2b:fc:df:2c:d5:48:05:4d:22:75:b3:9c:7f:ca:3e:c0:97:80:78:b0:f0:ea:76:e5:61:a6:c7:43:3e
------BEGIN CERTIFICATE-----
-MIIFazCCA1OgAwIBAgISESBVg+QtPlRWhS2DN7cs3EYRMA0GCSqGSIb3DQEBDQUA
-MD4xCzAJBgNVBAYTAkZSMREwDwYDVQQKDAhDZXJ0cGx1czEcMBoGA1UEAwwTQ2Vy
-dHBsdXMgUm9vdCBDQSBHMTAeFw0xNDA1MjYwMDAwMDBaFw0zODAxMTUwMDAwMDBa
-MD4xCzAJBgNVBAYTAkZSMREwDwYDVQQKDAhDZXJ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/MeXrKls3N/U/7
-/SMNkPX0XtPGYX2eEeAC7gkE2Qfdpoq3DIMku4NQkv5gdRE+2J2winq14J2by5BS
-S7CTKtQ+FjPlnsZlFT5kOwQ/2wyPX1wdaR+v8+khjPPvl/aatxm2hHSco1S1cE5j
-2FddUyGbQJJD+tZ3VTNPZNX70Cxqjm0lpu+F6ALEUz65noe8zDUa3qHpimOHZR4R
-Kttjd5cUvpoUmRGywO6wT/gUITJDT5+rosuoD6o7BlXGEilXCNQ314cnrUlZp5Gr
-RHpejXDbl85IULFzk/bwg2D5zfHhMf1bfHEhYxQUqq/F3pN+aLHsIqKqkHWetUNy
-6mSjhEv9DKgma3GX7lZjZuhCVPnHHd/Qj1vfyDBviP4NxDMcU6ij/UgQ8uQKTuEV
-V/xuZDDCVRHc6qnNSlSsKWNEz0pAoNZoWRsz+e86i9sgktxChL8Bq4fA1SCC28a5
-g4VCXA9DO2pJNdWY9BW/+mGBDAkgGNLQFwzLSABQ6XaCjGTXOqAHVcweMcDvOrRl
-++O/QmueD6i9a5jc2NvLi6Td11n0bt3+qsOR0C5CB8AMTVPNJLFMWx5R9N/pkvo=
------END CERTIFICATE-----
-
-# Issuer: CN=Certplus Root CA G2 O=Certplus
-# Subject: CN=Certplus Root CA G2 O=Certplus
-# Label: "Certplus Root CA G2"
-# Serial: 1492087096131536844209563509228951875861589
-# MD5 Fingerprint: a7:ee:c4:78:2d:1b:ee:2d:b9:29:ce:d6:a7:96:32:31
-# SHA1 Fingerprint: 4f:65:8e:1f:e9:06:d8:28:02:e9:54:47:41:c9:54:25:5d:69:cc:1a
-# SHA256 Fingerprint: 6c:c0:50:41:e6:44:5e:74:69:6c:4c:fb:c9:f8:0f:54:3b:7e:ab:bb:44:b4:ce:6f:78:7c:6a:99:71:c4:2f:17
------BEGIN CERTIFICATE-----
-MIICHDCCAaKgAwIBAgISESDZkc6uo+jF5//pAq/Pc7xVMAoGCCqGSM49BAMDMD4x
-CzAJBgNVBAYTAkZSMREwDwYDVQQKDAhDZXJ0cGx1czEcMBoGA1UEAwwTQ2VydHBs
-dXMgUm9vdCBDQSBHMjAeFw0xNDA1MjYwMDAwMDBaFw0zODAxMTUwMDAwMDBaMD4x
-CzAJBgNVBAYTAkZSMREwDwYDVQQKDAhDZXJ0cGx1czEcMBoGA1UEAwwTQ2VydHBs
-dXMgUm9vdCBDQSBHMjB2MBAGByqGSM49AgEGBSuBBAAiA2IABM0PW1aC3/BFGtat
-93nwHcmsltaeTpwftEIRyoa/bfuFo8XlGVzX7qY/aWfYeOKmycTbLXku54uNAm8x
-Ik0G42ByRZ0OQneezs/lf4WbGOT8zC5y0xaTTsqZY1yhBSpsBqNjMGEwDgYDVR0P
-AQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNqDYwJ5jtpMxjwj
-FNiPwyCrKGBZMB8GA1UdIwQYMBaAFNqDYwJ5jtpMxjwjFNiPwyCrKGBZMAoGCCqG
-SM49BAMDA2gAMGUCMHD+sAvZ94OX7PNVHdTcswYO/jOYnYs5kGuUIe22113WTNch
-p+e/IQ8rzfcq3IUHnQIxAIYUFuXcsGXCwI4Un78kFmjlvPl5adytRSv3tjFzzAal
-U5ORGpOucGpnutee5WEaXw==
------END CERTIFICATE-----
-
-# Issuer: CN=OpenTrust Root CA G1 O=OpenTrust
-# Subject: CN=OpenTrust Root CA G1 O=OpenTrust
-# Label: "OpenTrust Root CA G1"
-# Serial: 1492036577811947013770400127034825178844775
-# MD5 Fingerprint: 76:00:cc:81:29:cd:55:5e:88:6a:7a:2e:f7:4d:39:da
-# SHA1 Fingerprint: 79:91:e8:34:f7:e2:ee:dd:08:95:01:52:e9:55:2d:14:e9:58:d5:7e
-# SHA256 Fingerprint: 56:c7:71:28:d9:8c:18:d9:1b:4c:fd:ff:bc:25:ee:91:03:d4:75:8e:a2:ab:ad:82:6a:90:f3:45:7d:46:0e:b4
------BEGIN CERTIFICATE-----
-MIIFbzCCA1egAwIBAgISESCzkFU5fX82bWTCp59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l0YhVyE1
-2jZVx/PxN3DlCPaTKbYwHwYDVR0jBBgwFoAUl0YhVyE12jZVx/PxN3DlCPaTKbYw
-DQYJKoZIhvcNAQELBQADggIBAB3dAmB84DWn5ph76kTOZ0BP8pNuZtQ5iSas000E
-PLuHIT839HEl2ku6q5aCgZG27dmxpGWX4m9kWaSW7mDKHyP7Rbr/jyTwyqkxf3kf
-gLMtMrpkZ2CvuVnN35pJ06iCsfmYlIrM4LvgBBuZYLFGZdwIorJGnkSI6pN+VxbS
-FXJfLkur1J1juONI5f6ELlgKn0Md/rcYkoZDSw6cMoYsYPXpSOqV7XAp8dUv/TW0
-V8/bhUiZucJvbI/NeJWsZCj9VrDDb8O+WVLhX4SPgPL0DTatdrOjteFkdjpY3H1P
-XlZs5VVZV6Xf8YpmMIzUUmI4d7S+KNfKNsSbBfD4Fdvb8e80nR14SohWZ25g/4/I
-i+GOvUKpMwpZQhISKvqxnUOOBZuZ2mKtVzazHbYNeS2WuOvyDEsMpZTGMKcmGS3t
-TAZQMPH9WD25SxdfGbRqhFS0OE85og2WaMMolP3tLR9Ka0OWLpABEPs4poEL0L91
-09S5zvE/bw4cHjdx5RiHdRk/ULlepEU0rbDK5uUTdg8xFKmOLZTW1YVNcxVPS/Ky
-Pu1svf0OnWZzsD2097+o4BGkxK51CUpjAEggpsadCwmKtODmzj7HPiY46SvepghJ
-AwSQiumPv+i2tCqjI40cHLI5kqiPAlxAOXXUc0ECd97N4EOH1uS6SsNsEn/+KuYj
-1oxx
------END CERTIFICATE-----
-
-# Issuer: CN=OpenTrust Root CA G2 O=OpenTrust
-# Subject: CN=OpenTrust Root CA G2 O=OpenTrust
-# Label: "OpenTrust Root CA G2"
-# Serial: 1492012448042702096986875987676935573415441
-# MD5 Fingerprint: 57:24:b6:59:24:6b:ae:c8:fe:1c:0c:20:f2:c0:4e:eb
-# SHA1 Fingerprint: 79:5f:88:60:c5:ab:7c:3d:92:e6:cb:f4:8d:e1:45:cd:11:ef:60:0b
-# SHA256 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6jj9RjzIR9u701oBnstXW5DiabA+aC/
-gh7PU3+06yzbXfZqfUAkBXKJOAGTy3HCOV0GEfZvePg3DTmEJwIDAQABo2MwYTAO
-BgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUajn6QiL3
-5okATV59M4PLuG53hq8wHwYDVR0jBBgwFoAUajn6QiL35okATV59M4PLuG53hq8w
-DQYJKoZIhvcNAQENBQADggIBAJjLq0A85TMCl38th6aP1F5Kr7ge57tx+4BkJamz
-Gj5oXScmp7oq4fBXgwpkTx4idBvpkF/wrM//T2h6OKQQbA2xx6R3gBi2oihEdqc0
-nXGEL8pZ0keImUEiyTCYYW49qKgFbdEfwFFEVn8nNQLdXpgKQuswv42hm1GqO+qT
-RmTFAHneIWv2V6CG1wZy7HBGS4tz3aAhdT7cHcCP009zHIXZ/n9iyJVvttN7jLpT
-wm+bREx50B1ws9efAvSyB7DH5fitIw6mVskpEndI2S9G/Tvw/HRwkqWOOAgfZDC2
-t0v7NqwQjqBSM2OdAzVWxWm9xiNaJ5T2pBL4LTM8oValX9YZ6e18CL13zSdkzJTa
-TkZQh+D5wVOAHrut+0dSixv9ovneDiK3PTNZbNTe9ZUGMg1RGUFcPk8G97krgCf2
-o6p6fAbhQ8MTOWIaNr3gKC6UAuQpLmBVrkA9sHSSXvAgZJY/X0VdiLWK2gKgW0VU
-3jg9CcCoSmVGFvyqv1ROTVu+OEO3KMqLM6oaJbolXCkvW0pujOotnCr2BXbgd5eA
-iN1nE28daCSLT7d0geX0YJ96Vdc+N9oWaz53rK4YcJUIeSkDiv7BO7M/Gg+kO14f
-WKGVyasvc0rQLW6aWQ9VGHgtPFGml4vmu7JwqkwR3v98KzfUetF3NI/n+UL3PIEM
-S1IK
------END CERTIFICATE-----
-
-# Issuer: CN=OpenTrust Root CA G3 O=OpenTrust
-# Subject: CN=OpenTrust Root CA G3 O=OpenTrust
-# Label: "OpenTrust Root CA G3"
-# Serial: 1492104908271485653071219941864171170455615
-# MD5 Fingerprint: 21:37:b4:17:16:92:7b:67:46:70:a9:96:d7:a8:13:24
-# SHA1 Fingerprint: 6e:26:64:f3:56:bf:34:55:bf:d1:93:3f:7c:01:de:d8:13:da:8a:a6
-# SHA256 Fingerprint: b7:c3:62:31:70:6e:81:07:8c:36:7c:b8:96:19:8f:1e:32:08:dd:92:69:49:dd:8f:57:09:a4:10:f7:5b:62:92
------BEGIN CERTIFICATE-----
-MIICITCCAaagAwIBAgISESDm+Ez8JLC+BUCs2oMbNGA/MAoGCCqGSM49BAMDMEAx
-CzAJBgNVBAYTAkZSMRIwEAYDVQQKDAlPcGVuVHJ1c3QxHTAbBgNVBAMMFE9wZW5U
-cnVzdCBSb290IENBIEczMB4XDTE0MDUyNjAwMDAwMFoXDTM4MDExNTAwMDAwMFow
-QDELMAkGA1UEBhMCRlIxEjAQBgNVBAoMCU9wZW5UcnVzdDEdMBsGA1UEAwwUT3Bl
-blRydXN0IFJvb3QgQ0EgRzMwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAARK7liuTcpm
-3gY6oxH84Bjwbhy6LTAMidnW7ptzg6kjFYwvWYpa3RTqnVkrQ7cG7DK2uu5Bta1d
-oYXM6h0UZqNnfkbilPPntlahFVmhTzeXuSIevRHr9LIfXsMUmuXZl5mjYzBhMA4G
-A1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRHd8MUi2I5
-DMlv4VBN0BBY3JWIbTAfBgNVHSMEGDAWgBRHd8MUi2I5DMlv4VBN0BBY3JWIbTAK
-BggqhkjOPQQDAwNpADBmAjEAj6jcnboMBBf6Fek9LykBl7+BFjNAk2z8+e2AcG+q
-j9uEwov1NcoG3GRvaBbhj5G5AjEA2Euly8LQCGzpGPta3U1fJAuwACEl74+nBCZx
-4nxp5V2a+EEfOzmTk51V6s2N8fvB
------END CERTIFICATE-----
-
-# Issuer: CN=ISRG Root X1 O=Internet Security Research Group
-# Subject: CN=ISRG Root X1 O=Internet Security Research Group
-# Label: "ISRG Root X1"
-# Serial: 172886928669790476064670243504169061120
-# MD5 Fingerprint: 0c:d2:f9:e0:da:17:73:e9:ed:86:4d:a5:e3:70:e7:4e
-# SHA1 Fingerprint: ca:bd:2a:79:a1:07:6a:31:f2:1d:25:36:35:cb:03:9d:43:29:a5:e8
-# SHA256 Fingerprint: 96:bc:ec:06:26:49:76:f3:74:60:77:9a:cf:28:c5:a7:cf:e8:a3:c0:aa:e1:1a:8f:fc:ee:05:c0:bd:df:08:c6
------BEGIN CERTIFICATE-----
-MIIFazCCA1OgAwIBAgIRAIIQz7DSQONZRGPgu2OCiwAwDQYJKoZIhvcNAQELBQAw
-TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh
-cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMTUwNjA0MTEwNDM4
-WhcNMzUwNjA0MTEwNDM4WjBPMQswCQYDVQQGEwJVUzEpMCcGA1UEChMgSW50ZXJu
-ZXQgU2VjdXJpdHkgUmVzZWFyY2ggR3JvdXAxFTATBgNVBAMTDElTUkcgUm9vdCBY
-MTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAK3oJHP0FDfzm54rVygc
-h77ct984kIxuPOZXoHj3dcKi/vVqbvYATyjb3miGbESTtrFj/RQSa78f0uoxmyF+
-0TM8ukj13Xnfs7j/EvEhmkvBioZxaUpmZmyPfjxwv60pIgbz5MDmgK7iS4+3mX6U
-A5/TR5d8mUgjU+g4rk8Kb4Mu0UlXjIB0ttov0DiNewNwIRt18jA8+o+u3dpjq+sW
-T8KOEUt+zwvo/7V3LvSye0rgTBIlDHCNAymg4VMk7BPZ7hm/ELNKjD+Jo2FR3qyH
-B5T0Y3HsLuJvW5iB4YlcNHlsdu87kGJ55tukmi8mxdAQ4Q7e2RCOFvu396j3x+UC
-B5iPNgiV5+I3lg02dZ77DnKxHZu8A/lJBdiB3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Z0j4r7g1SgEEzwxA57d
-emyPxgcYxn/eR44/KJ4EBs+lVDR3veyJm+kXQ99b21/+jh5Xos1AnX5iItreGCc=
------END CERTIFICATE-----
-
-# Issuer: O=FNMT-RCM OU=AC RAIZ FNMT-RCM
-# Subject: O=FNMT-RCM OU=AC RAIZ FNMT-RCM
-# Label: "AC RAIZ FNMT-RCM"
-# Serial: 485876308206448804701554682760554759
-# MD5 Fingerprint: e2:09:04:b4:d3:bd:d1:a0:14:fd:1a:d2:47:c4:57:1d
-# SHA1 Fingerprint: ec:50:35:07:b2:15:c4:95:62:19:e2:a8:9a:5b:42:99:2c:4c:2c:20
-# SHA256 Fingerprint: eb:c5:57:0c:29:01:8c:4d:67:b1:aa:12:7b:af:12:f7:03:b4:61:1e:bc:17:b7:da:b5:57:38:94:17:9b:93:fa
------BEGIN CERTIFICATE-----
-MIIFgzCCA2ugAwIBAgIPXZONMGc2yAYdGsdUhGkHMA0GCSqGSIb3DQEBCwUAMDsx
-CzAJBgNVBAYTAkVTMREwDwYDVQQKDAhGTk1ULVJDTTEZMBcGA1UECwwQQUMgUkFJ
-WiBGTk1ULVJDTTAeFw0wODEwMjkxNTU5NTZaFw0zMDAxMDEwMDAwMDBaMDsxCzAJ
-BgNVBAYTAkVTMREwDwYDVQQKDAhGTk1ULVJDTTEZMBcGA1UECwwQQUMgUkFJWiBG
-Tk1ULVJDTTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBALpxgHpMhm5/
-yBNtwMZ9HACXjywMI7sQmkCpGreHiPibVmr75nuOi5KOpyVdWRHbNi63URcfqQgf
-BBckWKo3Shjf5TnUV/3XwSyRAZHiItQDwFj8d0fsjz50Q7qsNI1NOHZnjrDIbzAz
-WHFctPVrbtQBULgTfmxKo0nRIBnuvMApGGWn3v7v3QqQIecaZ5JCEJhfTzC8PhxF
-tBDXaEAUwED653cXeuYLj2VbPNmaUtu1vZ5Gzz3rkQUCwJaydkxNEJY7kvqcfw+Z
-374jNUUeAl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yO3m/qZASlaWFot4/nUbQ4mrcFuNLwy+AwF+mWj2zs3gyLp
-1txyM/1d8iC9djwj2ij3+RvrWWTV3F9yfiD8zYm1kGdNYno/Tq0dwzn+evQoFt9B
-9kiABdcPUXmsEKvU7ANm5mqwujGSQkBqvjrTcuFqN1W8rB2Vt2lh8kORdOag0wok
-RqEIr9baRRmW1FMdW4R58MD3R++Lj8UGrp1MYp3/RgT408m2ECVAdf4WqslKYIYv
-uu8wd+RU4riEmViAqhOLUTpPSPaLtrM=
------END CERTIFICATE-----
-
-# Issuer: CN=Amazon Root CA 1 O=Amazon
-# Subject: CN=Amazon Root CA 1 O=Amazon
-# Label: "Amazon Root CA 1"
-# Serial: 143266978916655856878034712317230054538369994
-# MD5 Fingerprint: 43:c6:bf:ae:ec:fe:ad:2f:18:c6:88:68:30:fc:c8:e6
-# SHA1 Fingerprint: 8d:a7:f9:65:ec:5e:fc:37:91:0f:1c:6e:59:fd:c1:cc:6a:6e:de:16
-# SHA256 Fingerprint: 8e:cd:e6:88:4f:3d:87:b1:12:5b:a3:1a:c3:fc:b1:3d:70:16:de:7f:57:cc:90:4f:e1:cb:97:c6:ae:98:19:6e
------BEGIN CERTIFICATE-----
-MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF
-ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6
-b24gUm9vdCBDQSAxMB4XDTE1MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTEL
-MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv
-b3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJ4gHHKeNXj
-ca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgHFzZM
-9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qw
-IFAGbHrQgLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAwhmahRWa6
-VOujw5H5SNz/0egwLX0tdHA114gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L
-93FcXmn/6pUCyziKrlA4b9v7LWIbxcceVOF34GfID5yHI9Y/QCB/IIDEgEw+OyQm
-jgSubJrIqg0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC
-AYYwHQYDVR0OBBYEFIQYzIU07LwMlJQuCFmcx7IQTgoIMA0GCSqGSIb3DQEBCwUA
-A4IBAQCY8jdaQZChGsV2USggNiMOruYou6r4lK5IpDB/G/wkjUu0yKGX9rbxenDI
-U5PMCCjjmCXPI6T53iHTfIUJrU6adTrCC2qJeHZERxhlbI1Bjjt/msv0tadQ1wUs
-N+gDS63pYaACbvXy8MWy7Vu33PqUXHeeE6V/Uq2V8viTO96LXFvKWlJbYK8U90vv
-o/ufQJVtMVT8QtPHRh8jrdkPSHCa2XV4cdFyQzR1bldZwgJcJmApzyMZFo6IQ6XU
-5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2xJNDd2ZhwLnoQdeXeGADbkpy
-rqXRfboQnoZsG4q5WTP468SQvvG5
------END CERTIFICATE-----
-
-# Issuer: CN=Amazon Root CA 2 O=Amazon
-# Subject: CN=Amazon Root CA 2 O=Amazon
-# Label: "Amazon Root CA 2"
-# Serial: 143266982885963551818349160658925006970653239
-# MD5 Fingerprint: c8:e5:8d:ce:a8:42:e2:7a:c0:2a:5c:7c:9e:26:bf:66
-# SHA1 Fingerprint: 5a:8c:ef:45:d7:a6:98:59:76:7a:8c:8b:44:96:b5:78:cf:47:4b:1a
-# SHA256 Fingerprint: 1b:a5:b2:aa:8c:65:40:1a:82:96:01:18:f8:0b:ec:4f:62:30:4d:83:ce:c4:71:3a:19:c3:9c:01:1e:a4:6d:b4
------B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MB
-Af8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBSwDPBMMPQFWAJI/TPlUq9LhONm
-UjANBgkqhkiG9w0BAQwFAAOCAgEAqqiAjw54o+Ci1M3m9Zh6O+oAA7CXDpO8Wqj2
-LIxyh6mx/H9z/WNxeKWHWc8w4Q0QshNabYL1auaAn6AFC2jkR2vHat+2/XcycuUY
-+gn0oJMsXdKMdYV2ZZAMA3m3MSNjrXiDCYZohMr/+c8mmpJ5581LxedhpxfL86kS
-k5Nrp+gvU5LEYFiwzAJRGFuFjWJZY7attN6a+yb3ACfAXVU3dJnJUH/jWS5E4ywl
-7uxMMne0nxrpS10gxdr9HIcWxkPo1LsmmkVwXqkLN1PiRnsn/eBG8om3zEK2yygm
-btmlyTrIQRNg91CMFa6ybRoVGld45pIq2WWQgj9sAq+uEjonljYE1x2igGOpm/Hl
-urR8FLBOybEfdF849lHqm/osohHUqS0nGkWxr7JOcQ3AWEbWaQbLU8uz/mtBzUF+
-fUwPfHJ5elnNXkoOrJupmHN5fLT0zLm4BwyydFy4x2+IoZCn9Kr5v2c69BoVYh63
-n749sSmvZ6ES8lgQGVMDMBu4Gon2nL2XA46jCfMdiyHxtN/kHNGfZQIG6lzWE7OE
-76KlXIx3KadowGuuQNKotOrN8I1LOJwZmhsoVLiJkO/KdYE+HvJkJMcYr07/R54H
-9jVlpNMKVv/1F2Rs76giJUmTtt8AF9pYfl3uxRuw0dFfIRDH+fO6AgonB8Xx1sfT
-4PsJYGw=
------END CERTIFICATE-----
-
-# Issuer: CN=Amazon Root CA 3 O=Amazon
-# Subject: CN=Amazon Root CA 3 O=Amazon
-# Label: "Amazon Root CA 3"
-# Serial: 143266986699090766294700635381230934788665930
-# MD5 Fingerprint: a0:d4:ef:0b:f7:b5:d8:49:95:2a:ec:f5:c4:fc:81:87
-# SHA1 Fingerprint: 0d:44:dd:8c:3c:8c:1a:1a:58:75:64:81:e9:0f:2e:2a:ff:b3:d2:6e
-# SHA256 Fingerprint: 18:ce:6c:fe:7b:f1:4e:60:b2:e3:47:b8:df:e8:68:cb:31:d0:2e:bb:3a:da:27:15:69:f5:03:43:b4:6d:b3:a4
------BEGIN CERTIFICATE-----
-MIIBtjCCAVugAwIBAgITBmyf1XSXNmY/Owua2eiedgPySjAKBggqhkjOPQQDAjA5
-MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24g
-Um9vdCBDQSAzMB4XDTE1MDUyNjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTELMAkG
-A1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJvb3Qg
-Q0EgMzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABCmXp8ZBf8ANm+gBG1bG8lKl
-ui2yEujSLtf6ycXYqm0fc4E7O5hrOXwzpcVOho6AF2hiRVd9RFgdszflZwjrZt6j
-QjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBSr
-ttvXBp43rDCGB5Fwx5zEGbF4wDAKBggqhkjOPQQDAgNJADBGAiEA4IWSoxe3jfkr
-BqWTrBqYaGFy+uGh0PsceGCmQ5nFuMQCIQCcAu/xlJyzlvnrxir4tiz+OpAUFteM
-YyRIHN8wfdVoOw==
------END CERTIFICATE-----
-
-# Issuer: CN=Amazon Root CA 4 O=Amazon
-# Subject: CN=Amazon Root CA 4 O=Amazon
-# Label: "Amazon Root CA 4"
-# Serial: 143266989758080763974105200630763877849284878
-# MD5 Fingerprint: 89:bc:27:d5:eb:17:8d:06:6a:69:d5:fd:89:47:b4:cd
-# SHA1 Fingerprint: f6:10:84:07:d6:f8:bb:67:98:0c:c2:e2:44:c2:eb:ae:1c:ef:63:be
-# SHA256 Fingerprint: e3:5d:28:41:9e:d0:20:25:cf:a6:90:38:cd:62:39:62:45:8d:a5:c6:95:fb:de:a3:c2:2b:0b:fb:25:89:70:92
------BEGIN CERTIFICATE-----
-MIIB8jCCAXigAwIBAgITBmyf18G7EEwpQ+Vxe3ssyBrBDjAKBggqhkjOPQQDAzA5
-MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24g
-Um9vdCBDQSA0MB4XDTE1MDUyNjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTELMAkG
-A1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJvb3Qg
-Q0EgNDB2MBAGByqGSM49AgEGBSuBBAAiA2IABNKrijdPo1MN/sGKe0uoe0ZLY7Bi
-9i0b2whxIdIA6GO9mif78DluXeo9pcmBqqNbIJhFXRbb/egQbeOc4OO9X4Ri83Bk
-M6DLJC9wuoihKqB1+IGuYgbEgds5bimwHvouXKNCMEAwDwYDVR0TAQH/BAUwAwEB
-/zAOBgNVHQ8BAf8EBAMCAYYwHQYDVR0OBBYEFNPsxzplbszh2naaVvuc84ZtV+WB
-MAoGCCqGSM49BAMDA2gAMGUCMDqLIfG9fhGt0O9Yli/W651+kI0rz2ZVwyzjKKlw
-CkcO8DdZEv8tmZQoTipPNU0zWgIxAOp1AE47xDqUEpHJWEadIRNyp4iciuRMStuW
-1KyLa2tJElMzrdfkviT8tQp21KW8EA==
------END CERTIFICATE-----
-
-# Issuer: CN=LuxTrust Global Root 2 O=LuxTrust S.A.
-# Subject: CN=LuxTrust Global Root 2 O=LuxTrust S.A.
-# Label: "LuxTrust Global Root 2"
-# Serial: 59914338225734147123941058376788110305822489521
-# MD5 Fingerprint: b2:e1:09:00:61:af:f7:f1:91:6f:c4:ad:8d:5e:3b:7c
-# SHA1 Fingerprint: 1e:0e:56:19:0a:d1:8b:25:98:b2:04:44:ff:66:8a:04:17:99:5f:3f
-# SHA256 Fingerprint: 54:45:5f:71:29:c2:0b:14:47:c4:18:f9:97:16:8f:24:c5:8f:c5:02:3b:f5:da:5b:e2:eb:6e:1d:d8:90:2e:d5
------BEGIN C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arastirma Kurumu - TUBITAK OU=Kamu Sertifikasyon Merkezi - Kamu SM
-# Subject: CN=TUBITAK Kamu SM SSL Kok Sertifikasi - Surum 1 O=Turkiye Bilimsel ve Teknolojik Arastirma Kurumu - TUBITAK OU=Kamu Sertifikasyon Merkezi - Kamu SM
-# Label: "TUBITAK Kamu SM SSL Kok Sertifikasi - Surum 1"
-# Serial: 1
-# MD5 Fingerprint: dc:00:81:dc:69:2f:3e:2f:b0:3b:f6:3d:5a:91:8e:49
-# SHA1 Fingerprint: 31:43:64:9b:ec:ce:27:ec:ed:3a:3f:0b:8f:0d:e4:e8:91:dd:ee:ca
-# SHA256 Fingerprint: 46:ed:c3:68:90:46:d5:3a:45:3f:b3:10:4a:b8:0d:ca:ec:65:8b:26:60:ea:16:29:dd:7e:86:79:90:64:87:16
------BEGIN CERTIFICATE-----
-MIIEYzCCA0ugAwIBAgIBATANBgkqhkiG9w0BAQsFADCB0jELMAkGA1UEBhMCVFIx
-GDAWBgNVBAcTD0dlYnplIC0gS29jYWVsaTFCMEAGA1UEChM5VHVya2l5ZSBCaWxp
-bXNlbCB2ZSBUZWtub2xvamlrIEFyYXN0aXJtYSBLdXJ1bXUgLSBUVUJJVEFLMS0w
-KwYDVQQLEyRLYW11IFNlcnRpZmlrYXN5b24gTWVya2V6aSAtIEthbXUgU00xNjA0
-BgNVBAMTLVRVQklUQUsgS2FtdSBTTSBTU0wgS29rIFNlcnRpZmlrYXNpIC0gU3Vy
-dW0gMTAeFw0xMzExMjUwODI1NTVaFw00MzEwMjUwODI1NTVaMIHSMQswCQYDVQQG
-EwJUUjEYMBYGA1UEBxMPR2ViemUgLSBLb2NhZWxpMUIwQAYDVQQKEzlUdXJraXll
-IEJpbGltc2VsIHZlIFRla25vbG9qaWsgQXJhc3Rpcm1hIEt1cnVtdSAtIFRVQklU
-QUsxLTArBgNVBAsTJEthbXUgU2VydGlmaWthc3lvbiBNZXJrZXppIC0gS2FtdSBT
-TTE2MDQGA1UEAxMtVFVCSVRBSyBLYW11IFNNIFNTTCBLb2sgU2VydGlmaWthc2kg
-LSBTdXJ1bSAxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAr3UwM6q7
-a9OZLBI3hNmNe5eA027n/5tQlT6QlVZC1xl8JoSNkvoBHToP4mQ4t4y86Ij5iySr
-LqP1N+RAjhgleYN1Hzv/bKjFxlb4tO2KRKOrbEz8HdDc72i9z+SqzvBV96I01INr
-N3wcwv61A+xXzry0tcXtAA9TNypN9E8Mg/uGz8v+jE69h/mniyFXnHrfA2eJLJ2X
-YacQuFWQfw4tJzh03+f92k4S400VIgLI4OD8D62K18lUUMw7D8oWgITQUVbDjlZ/
-iSIzL+aFCr2lqBs23tPcLG07xxO9WSMs5uWk99gL7eqQQESolbuT1dCANLZGeA4f
-AJNG4e7p+exPFwIDAQABo0IwQDAdBgNVHQ4EFgQUZT/HiobGPN08VFw1+DrtUgxH
-V8gwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEL
-BQADggEBACo/4fEyjq7hmFxLXs9rHmoJ0iKpEsdeV31zVmSAhHqT5Am5EM2fKifh
-AHe+SMg1qIGf5LgsyX8OsNJLN13qudULXjS99HMpw+0mFZx+CFOKWI3QSyjfwbPf
-IPP54+M638yclNhOT8NrF7f3cuitZjO1JVOr4PhMqZ398g26rrnZqsZr+ZO7rqu4
-lzwDGrpDxpa5RXI4s6ehlj2Re37AIVNMh+3yC1SVUZPVIqUNivGTDj5UDrDYyU7c
-8jEyVupk+eq1nRZmQnLzf9OxMUP8pI4X8W0jq5Rm+K37DwhuJi1/FwcJsoz7UMCf
-lo3Ptv0AnVoUmr8CRPXBwp8iXqIPoeM=
------END CERTIFICATE-----
diff --git a/lib/certifi/core.py b/lib/certifi/core.py
deleted file mode 100644
index f41d3fd1b7..0000000000
--- a/lib/certifi/core.py
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-"""
-certifi.py
-~~~~~~~~~~
-
-This module returns the installation location of cacert.pem.
-"""
-import os
-import warnings
-
-
-class DeprecatedBundleWarning(DeprecationWarning):
- """
- The weak security bundle is being deprecated. Please bother your service
- provider to get them to stop using cross-signed roots.
- """
-
-
-def where():
- f = os.path.dirname(__file__)
-
- return os.path.join(f, 'cacert.pem')
-
-
-def old_where():
- warnings.warn(
- "The weak security bundle is being deprecated.",
- DeprecatedBundleWarning
- )
- f = os.path.dirname(__file__)
- return os.path.join(f, 'weak.pem')
-
-if __name__ == '__main__':
- print(where())
diff --git a/lib/certifi/old_root.pem b/lib/certifi/old_root.pem
deleted file mode 100644
index af30ea7118..0000000000
--- a/lib/certifi/old_root.pem
+++ /dev/null
@@ -1,414 +0,0 @@
-# Issuer: CN=Entrust.net Secure Server Certification Authority O=Entrust.net OU=www.entrust.net/CPS incorp. by ref. (limits liab.)/(c) 1999 Entrust.net Limited
-# Subject: CN=Entrust.net Secure Server Certification Authority O=Entrust.net OU=www.entrust.net/CPS incorp. by ref. (limits liab.)/(c) 1999 Entrust.net Limited
-# Label: "Entrust.net Secure Server CA"
-# Serial: 927650371
-# MD5 Fingerprint: df:f2:80:73:cc:f1:e6:61:73:fc:f5:42:e9:c5:7c:ee
-# SHA1 Fingerprint: 99:a6:9b:e6:1a:fe:88:6b:4d:2b:82:00:7c:b8:54:fc:31:7e:15:39
-# SHA256 Fingerprint: 62:f2:40:27:8c:56:4c:4d:d8:bf:7d:9d:4f:6f:36:6e:a8:94:d2:2f:5f:34:d9:89:a9:83:ac:ec:2f:ff:ed:50
------BEGIN CERTIFICATE-----
-MIIE2DCCBEGgAwIBAgIEN0rSQzANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMC
-VVMxFDASBgNVBAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5u
-ZXQvQ1BTIGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMc
-K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ubmV0L0NSTC9uZXQxLmNybDArBgNVHRAEJDAigA8xOTk5MDUyNTE2MDk0
-MFqBDzIwMTkwNTI1MTYwOTQwWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAU8Bdi
-E1U9s/8KAGv7UISX8+1i0BowHQYDVR0OBBYEFPAXYhNVPbP/CgBr+1CEl/PtYtAa
-MAwGA1UdEwQFMAMBAf8wGQYJKoZIhvZ9B0EABAwwChsEVjQuMAMCBJAwDQYJKoZI
-hvcNAQEFBQADgYEAkNwwAvpkdMKnCqV8IY00F6j7Rw7/JXyNEwr75Ji174z4xRAN
-95K+8cPV1ZVqBLssziY2ZcgxxufuP+NXdYR6Ee9GTxj005i7qIcyunL2POI9n9cd
-2cNgQ4xYDiKWL2KjLB+6rQXvqzJ4h6BUcxm1XAX5Uj5tLUUL9wqT6u0G+bI=
------END CERTIFICATE-----
-
-# Issuer: CN=http://www.valicert.com/ O=ValiCert, Inc. OU=ValiCert Class 2 Policy Validation Authority
-# Subject: CN=http://www.valicert.com/ O=ValiCert, Inc. OU=ValiCert Class 2 Policy Validation Authority
-# Label: "ValiCert Class 2 VA"
-# Serial: 1
-# MD5 Fingerprint: a9:23:75:9b:ba:49:36:6e:31:c2:db:f2:e7:66:ba:87
-# SHA1 Fingerprint: 31:7a:2a:d0:7f:2b:33:5e:f5:a1:c3:4e:4b:57:e8:b7:d8:f1:fc:a6
-# SHA256 Fingerprint: 58:d0:17:27:9c:d4:dc:63:ab:dd:b1:96:a6:c9:90:6c:30:c4:e0:87:83:ea:e8:c1:60:99:54:d6:93:55:59:6b
------BEGIN CERTIFICATE-----
-MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0
-IFZhbGlkYXRpb24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAz
-BgNVBAsTLFZhbGlDZXJ0IENsYXNzIDIgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9y
-aXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG
-9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAwMTk1NFoXDTE5MDYy
-NjAwMTk1NFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0d29y
-azEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs
-YXNzIDIgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRw
-Oi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNl
-cnQuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDOOnHK5avIWZJV16vY
-dA757tn2VUdZZUcOBVXc65g2PFxTXdMwzzjsvUGJ7SVCCSRrCl6zfN1SLUzm1NZ9
-WlmpZdRJEy0kTRxQb7XBhVQ7/nHk01xC+YDgkRoKWzk2Z/M/VXwbP7RfZHM047QS
-v4dk+NoS/zcnwbNDu+97bi5p9wIDAQABMA0GCSqGSIb3DQEBBQUAA4GBADt/UG9v
-UJSZSWI4OB9L+KXIPqeCgfYrx+jFzug6EILLGACOTb2oWH+heQC1u+mNr0HZDzTu
-IYEZoDJJKPTEjlbVUjP9UNV+mWwD5MlM/Mtsq2azSiGM5bUMMj4QssxsodyamEwC
-W/POuZ6lcg5Ktz885hZo+L7tdEy8W9ViH0Pd
------END CERTIFICATE-----
-
-# Issuer: CN=NetLock Expressz (Class C) Tanusitvanykiado O=NetLock Halozatbiztonsagi Kft. OU=Tanusitvanykiadok
-# Subject: CN=NetLock Expressz (Class C) Tanusitvanykiado O=NetLock Halozatbiztonsagi Kft. OU=Tanusitvanykiadok
-# Label: "NetLock Express (Class C) Root"
-# Serial: 104
-# MD5 Fingerprint: 4f:eb:f1:f0:70:c2:80:63:5d:58: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B) Tanusitvanykiado O=NetLock Halozatbiztonsagi Kft. OU=Tanusitvanykiadok
-# Subject: CN=NetLock Uzleti (Class B) Tanusitvanykiado O=NetLock Halozatbiztonsagi Kft. OU=Tanusitvanykiadok
-# Label: "NetLock Business (Class B) Root"
-# Serial: 105
-# MD5 Fingerprint: 39:16:aa:b9:6a:41:e1:14:69:df:9e:6c:3b:72:dc:b6
-# SHA1 Fingerprint: 87:9f:4b:ee:05:df:98:58:3b:e3:60:d6:33:e7:0d:3f:fe:98:71:af
-# SHA256 Fingerprint: 39:df:7b:68:2b:7b:93:8f:84:71:54:81:cc:de:8d:60:d8:f2:2e:c5:98:87:7d:0a:aa:c1:2b:59:18:2b:03:12
------BEGIN CERTIFICATE-----
-MIIFSzCCBLSgAwIBAgIBaTANBgkqhkiG9w0BAQQFADCBmTELMAkGA1UEBhMCSFUx
-ETAPBgNVBAcTCEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0
-b25zYWdpIEtmdC4xGjAYBgNVBAsTEVRhbnVzaXR2YW55a2lhZG9rMTIwMAYDVQQD
-EylOZXRMb2NrIFV6bGV0aSAoQ2xhc3MgQikgVGFudXNpdHZhbnlraWFkbzAeFw05
-OTAyMjUxNDEwMjJaFw0xOTAyMjAxNDEwMjJaMIGZMQswCQYDVQQGEwJIVTERMA8G
-A1UEBxMIQnVkYXBlc3QxJzAlBgNVBAoTHk5ldExvY2sgSGFsb3phdGJpenRvbnNh
-Z2kgS2Z0LjEaMBgGA1UECxMRVGFudXNpdHZhbnlraWFkb2sxMjAwBgNVBAMTKU5l
-dExvY2sgVXpsZXRpIChDbGFzcyBCKSBUYW51c2l0dmFueWtpYWRvMIGfMA0GCSqG
-SIb3DQEBAQUAA4GNADCBiQKBgQCx6gTsIKAjwo84YM/HRrPVG/77uZmeBNwcf4xK
-gZjupNTKihe5In+DCnVMm8Bp2GQ5o+2So/1bXHQawEfKOml2mrriRBf8TKPV/riX
-iK+IA4kfpPIE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43WIEJessDgVkcYplswhwG08pXTP2IKlOcNl40JwuyKQ433bNXbhoLXa
-n3BukxowOR0w2y7jfLKRstE3Kfq51hdcR0/jHTjrn9V7lagonhVK0dHQKwCXoOKS
-NitjrFgBazMpUIaD8QFI
------END CERTIFICATE-----
-
-# Issuer: CN=http://www.valicert.com/ O=ValiCert, Inc. OU=ValiCert Class 3 Policy Validation Authority
-# Subject: CN=http://www.valicert.com/ O=ValiCert, Inc. OU=ValiCert Class 3 Policy Validation Authority
-# Label: "RSA Root Certificate 1"
-# Serial: 1
-# MD5 Fingerprint: a2:6f:53:b7:ee:40:db:4a:68:e7:fa:18:d9:10:4b:72
-# SHA1 Fingerprint: 69:bd:8c:f4:9c:d3:00:fb:59:2e:17:93:ca:55:6a:f3:ec:aa:35:fb
-# SHA256 Fingerprint: bc:23:f9:8a:31:3c:b9:2d:e3:bb:fc:3a:5a:9f:44:61:ac:39:49:4c:4a:e1:5a:9e:9d:f1:31:e9:9b:73:01:9a
------BEGIN CERTIFICATE-----
-MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0
-IFZhbGlkYXRpb24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAz
-BgNVBAsTLFZhbGlDZXJ0IENsYXNzIDMgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9y
-aXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG
-9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAwMjIzM1oXDTE5MDYy
-NjAwMjIzM1owgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0d29y
-azEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs
-YXNzIDMgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRw
-Oi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNl
-cnQuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDjmFGWHOjVsQaBalfD
-cnWTq8+epvzzFlLWLU2fNUSoLgRNB0mKOCn1dzfnt6td3zZxFJmP3MKS8edgkpfs
-2Ejcv8ECIMYkpChMMFp2bbFc893enhBxoYjHW5tBbcqwuI4V7q0zK89HBFx1cQqY
-JJgpp0lZpd34t0NiYfPT4tBVPwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFa7AliE
-Zwgs3x/be0kz9dNnnfS0ChCzycUs4pJqcXgn8nCDQtM+z6lU9PHYkhaM0QTLS6vJ
-n0WuPIqpsHEzXcjFV9+vqDWzf4mH6eglkrh/hXqu1rweN1gqZ8mRzyqBPu3GOd/A
-PhmcGcwTTYJBtYze4D1gCCAPRX5ron+jjBXu
------END CERTIFICATE-----
-
-# Issuer: CN=http://www.valicert.com/ O=ValiCert, Inc. OU=ValiCert Class 1 Policy Validation Authority
-# Subject: CN=http://www.valicert.com/ O=ValiCert, Inc. OU=ValiCert Class 1 Policy Validation Authority
-# Label: "ValiCert Class 1 VA"
-# Serial: 1
-# MD5 Fingerprint: 65:58:ab:15:ad:57:6c:1e:a8:a7:b5:69:ac:bf:ff:eb
-# SHA1 Fingerprint: e5:df:74:3c:b6:01:c4:9b:98:43:dc:ab:8c:e8:6a:81:10:9f:e4:8e
-# SHA256 Fingerprint: f4:c1:49:55:1a:30:13:a3:5b:c7:bf:fe:17:a7:f3:44:9b:c1:ab:5b:5a:0a:e7:4b:06:c2:3b:90:00:4c:01:04
------BEGIN CERTIFICATE-----
-MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0
-IFZhbGlkYXRpb24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAz
-BgNVBAsTLFZhbGlDZXJ0IENsYXNzIDEgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9y
-aXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG
-9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNTIyMjM0OFoXDTE5MDYy
-NTIyMjM0OFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0d29y
-azEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs
-YXNzIDEgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRw
-Oi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNl
-cnQuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDYWYJ6ibiWuqYvaG9Y
-LqdUHAZu9OqNSLwxlBfw8068srg1knaw0KWlAdcAAxIiGQj4/xEjm84H9b9pGib+
-TunRf50sQB1ZaG6m+FiwnRqP0z/x3BkGgagO4DrdyFNFCQbmD3DD+kCmDuJWBQ8Y
-TfwggtFzVXSNdnKgHZ0dwN0/cQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFBoPUn0
-LBwGlN+VYH+Wexf+T3GtZMjdd9LvWVXoP+iOBSoh8gfStadS/pyxtuJbdxdA6nLW
-I8sogTLDAHkY7FkXicnGah5xyf23dKUlRWnFSKsZ4UWKJWsZ7uW7EvV/96aNUcPw
-nXS3qT6gpf+2SQMT2iLM7XGCK5nPOrf1LXLI
------END CERTIFICATE-----
-
-# Issuer: CN=Equifax Secure eBusiness CA-1 O=Equifax Secure Inc.
-# Subject: CN=Equifax Secure eBusiness CA-1 O=Equifax Secure Inc.
-# Label: "Equifax Secure eBusiness CA 1"
-# Serial: 4
-# MD5 Fingerprint: 64:9c:ef:2e:44:fc:c6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J5gDgdSIKN
-/Bf+KpYrtWKmpj29f5JZzVoqgrI3eQ==
------END CERTIFICATE-----
-
-# Issuer: CN=Equifax Secure Global eBusiness CA-1 O=Equifax Secure Inc.
-# Subject: CN=Equifax Secure Global eBusiness CA-1 O=Equifax Secure Inc.
-# Label: "Equifax Secure Global eBusiness CA"
-# Serial: 1
-# MD5 Fingerprint: 8f:5d:77:06:27:c4:98:3c:5b:93:78:e7:d7:7d:9b:cc
-# SHA1 Fingerprint: 7e:78:4a:10:1c:82:65:cc:2d:e1:f1:6d:47:b4:40:ca:d9:0a:19:45
-# SHA256 Fingerprint: 5f:0b:62:ea:b5:e3:53:ea:65:21:65:16:58:fb:b6:53:59:f4:43:28:0a:4a:fb:d1:04:d7:7d:10:f9:f0:4c:07
------BEGIN CERTIFICATE-----
-MIICkDCCAfmgAwIBAgIBATANBgkqhkiG9w0BAQQFADBaMQswCQYDVQQGEwJVUzEc
-MBoGA1UEChMTRXF1aWZheCBTZWN1cmUgSW5jLjEtMCsGA1UEAxMkRXF1aWZheCBT
-ZWN1cmUgR2xvYmFsIGVCdXNpbmVzcyBDQS0xMB4XDTk5MDYyMTA0MDAwMFoXDTIw
-MDYyMTA0MDAwMFowWjELMAkGA1UEBhMCVVMxHDAaBgNVBAoTE0VxdWlmYXggU2Vj
-dXJlIEluYy4xLTArBgNVBAMTJEVxdWlmYXggU2VjdXJlIEdsb2JhbCBlQnVzaW5l
-c3MgQ0EtMTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAuucXkAJlsTRVPEnC
-UdXfp9E3j9HngXNBUmCbnaEXJnitx7HoJpQytd4zjTov2/KaelpzmKNc6fuKcxtc
-58O/gGzNqfTWK8D3+ZmqY6KxRwIP1ORROhI8bIpaVIRw28HFkM9yRcuoWcDNM50/
-o5brhTMhHD4ePmBudpxnhcXIw2ECAwEAAaNmMGQwEQYJYIZIAYb4QgEBBAQDAgAH
-MA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUvqigdHJQa0S3ySPY+6j/s1dr
-aGwwHQYDVR0OBBYEFL6ooHRyUGtEt8kj2Puo/7NXa2hsMA0GCSqGSIb3DQEBBAUA
-A4GBADDiAVGqx+pf2rnQZQ8w1j7aDRRJbpGTJxQx78T3LUX47Me/okENI7SS+RkA
-Z70Br83gcfxaz2TE4JaY0KNA4gGK7ycH8WUBikQtBmV1UsCGECAhX2xrD2yuCRyv
-8qIYNMR1pHMc8Y3c7635s3a0kr/clRAevsvIO1qEYBlWlKlV
------END CERTIFICATE-----
-
-# Issuer: CN=Thawte Premium Server CA O=Thawte Consulting cc OU=Certification Services Division
-# Subject: CN=Thawte Premium Server CA O=Thawte Consulting cc OU=Certification Services Division
-# Label: "Thawte Premium Server CA"
-# Serial: 1
-# MD5 Fingerprint: 06:9f:69:79:16:66:90:02:1b:8c:8c:a2:c3:07:6f:3a
-# SHA1 Fingerprint: 62:7f:8d:78:27:65:63:99:d2:7d:7f:90:44:c9:fe:b3:f3:3e:fa:9a
-# SHA256 Fingerprint: ab:70:36:36:5c:71:54:aa:29:c2:c2:9f:5d:41:91:16:3b:16:2a:22:25:01:13:57:d5:6d:07:ff:a7:bc:1f:72
------BEGIN CERTIFICATE-----
-MIIDJzCCApCgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBzjELMAkGA1UEBhMCWkEx
-FTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYD
-VQQKExRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlv
-biBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAxMYVGhhd3RlIFByZW1pdW0gU2Vy
-dmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZlckB0aGF3dGUuY29t
-MB4XDTk2MDgwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgc4xCzAJBgNVBAYTAlpB
-MRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsG
-A1UEChMUVGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRp
-b24gU2VydmljZXMgRGl2aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQcmVtaXVtIFNl
-cnZlciBDQTEoMCYGCSqGSIb3DQEJARYZcHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNv
-bTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0jY2aovXwlue2oFBYo847kkE
-VdbQ7xwblRZH7xhINTpS9CtqBo87L+pW46+GjZ4X9560ZXUCTe/LCaIhUdib0GfQ
-ug2SBhRz1JPLlyoAnFxODLz6FVL88kRu2hFKbgifLy3j+ao6hnO2RlNYyIkFvYMR
-uHM/qgeN9EJN50CdHDcCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG
-9w0BAQQFAAOBgQAmSCwWwlj66BZ0DKqqX1Q/8tfJeGBeXm43YyJ3Nn6yF8Q0ufUI
-hfzJATj/Tb7yFkJD57taRvvBxhEf8UqwKEbJw8RCfbz6q1lu1bdRiBHjpIUZa4JM
-pAwSremkrj/xw0llmozFyD4lt5SZu5IycQfwhl7tUCemDaYj+bvLpgcUQg==
------END CERTIFICATE-----
-
-# Issuer: CN=Thawte Server CA O=Thawte Consulting cc OU=Certification Services Division
-# Subject: CN=Thawte Server CA O=Thawte Consulting cc OU=Certification Services Division
-# Label: "Thawte Server CA"
-# Serial: 1
-# MD5 Fingerprint: c5:70:c4:a2:ed:53:78:0c:c8:10:53:81:64:cb:d0:1d
-# SHA1 Fingerprint: 23:e5:94:94:51:95:f2:41:48:03:b4:d5:64:d2:a3:a3:f5:d8:8b:8c
-# SHA256 Fingerprint: b4:41:0b:73:e2:e6:ea:ca:47:fb:c4:2f:8f:a4:01:8a:f4:38:1d:c5:4c:fa:a8:44:50:46:1e:ed:09:45:4d:e9
------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q43pUdniTCxZ
-qdq5snUb9kLy78fyGPmJvKP/iiMucEc=
------END CERTIFICATE-----
-
-# Issuer: O=VeriSign, Inc. OU=Class 3 Public Primary Certification Authority
-# Subject: O=VeriSign, Inc. OU=Class 3 Public Primary Certification Authority
-# Label: "Verisign Class 3 Public Primary Certification Authority"
-# Serial: 149843929435818692848040365716851702463
-# MD5 Fingerprint: 10:fc:63:5d:f6:26:3e:0d:f3:25:be:5f:79:cd:67:67
-# SHA1 Fingerprint: 74:2c:31:92:e6:07:e4:24:eb:45:49:54:2b:e1:bb:c5:3e:61:74:e2
-# SHA256 Fingerprint: e7:68:56:34:ef:ac:f6:9a:ce:93:9a:6b:25:5b:7b:4f:ab:ef:42:93:5b:50:a2:65:ac:b5:cb:60:27:e4:4e:70
------BEGIN CERTIFICATE-----
-MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkG
-A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz
-cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2
-MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV
-BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt
-YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN
-ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE
-BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is
-I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G
-CSqGSIb3DQEBAgUAA4GBALtMEivPLCYATxQT3ab7/AoRhIzzKBxnki98tsX63/Do
-lbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59AhWM1pF+NEHJwZRDmJXNyc
-AA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2OmufTqj/ZA1k
------END CERTIFICATE-----
-
-# Issuer: O=VeriSign, Inc. OU=Class 3 Public Primary Certification Authority
-# Subject: O=VeriSign, Inc. OU=Class 3 Public Primary Certification Authority
-# Label: "Verisign Class 3 Public Primary Certification Authority"
-# Serial: 80507572722862485515306429940691309246
-# MD5 Fingerprint: ef:5a:f1:33:ef:f1:cd:bb:51:02:ee:12:14:4b:96:c4
-# SHA1 Fingerprint: a1:db:63:93:91:6f:17:e4:18:55:09:40:04:15:c7:02:40:b0:ae:6b
-# SHA256 Fingerprint: a4:b6:b3:99:6f:c2:f3:06:b3:fd:86:81:bd:63:41:3d:8c:50:09:cc:4f:a3:29:c2:cc:f0:e2:fa:1b:14:03:05
------BEGIN CERTIFICATE-----
-MIICPDCCAaUCEDyRMcsf9tAbDpq40ES/Er4wDQYJKoZIhvcNAQEFBQAwXzELMAkG
-A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz
-cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2
-MDEyOTAwMDAwMFoXDTI4MDgwMjIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV
-BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt
-YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN
-ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE
-BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is
-I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G
-CSqGSIb3DQEBBQUAA4GBABByUqkFFBkyCEHwxWsKzH4PIRnN5GfcX6kb5sroc50i
-2JhucwNhkcV8sEVAbkSdjbCxlnRhLQ2pRdKkkirWmnWXbj9T/UWZYB2oK0z5XqcJ
-2HUw19JlYD1n1khVdWk/kfVIC0dpImmClr7JyDiGSnoscxlIaU5rfGW/D/xwzoiQ
------END CERTIFICATE-----
-
-# Issuer: O=VeriSign, Inc. OU=Class 3 Public Primary Certification Authority - G2/(c) 1998 VeriSign, Inc. - For authorized use only/VeriSign Trust Network
-# Subject: O=VeriSign, Inc. OU=Class 3 Public Primary Certification Authority - G2/(c) 1998 VeriSign, Inc. - For authorized use only/VeriSign Trust Network
-# Label: "Verisign Class 3 Public Primary Certification Authority - G2"
-# Serial: 167285380242319648451154478808036881606
-# MD5 Fingerprint: a2:33:9b:4c:74:78:73:d4:6c:e7:c1:f3:8d:cb:5c:e9
-# SHA1 Fingerprint: 85:37:1c:a6:e5:50:14:3d:ce:28:03:47:1b:de:3a:09:e8:f8:77:0f
-# SHA256 Fingerprint: 83:ce:3c:12:29:68:8a:59:3d:48:5f:81:97:3c:0f:91:95:43:1e:da:37:cc:5e:36:43:0e:79:c7:a8:88:63:8b
------BEGIN CERTIFICATE-----
-MIIDAjCCAmsCEH3Z/gfPqB63EHln+6eJNMYwDQYJKoZIhvcNAQEFBQAwgcExCzAJ
-BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xh
-c3MgMyBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcy
-MTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3Jp
-emVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMB4X
-DTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVTMRcw
-FQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMg
-UHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEo
-YykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5
-MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEB
-AQUAA4GNADCBiQKBgQDMXtERXVxp0KvTuWpMmR9ZmDCOFoUgRm1HP9SFIIThbbP4
-pO0M8RcPO/mn+SXXwc+EY/J8Y8+iR/LGWzOOZEAEaMGAuWQcRXfH2G71lSk8UOg0
-13gfqLptQ5GVj0VXXn7F+8qkBOvqlzdUMG+7AUcyM83cV5tkaWH4mx0ciU9cZwID
-AQABMA0GCSqGSIb3DQEBBQUAA4GBAFFNzb5cy5gZnBWyATl4Lk0PZ3BwmcYQWpSk
-U01UbSuvDV1Ai2TT1+7eVmGSX6bEHRBhNtMsJzzoKQm5EWR0zLVznxxIqbxhAe7i
-F6YM40AIOw7n60RzKprxaZLvcRTDOaxxp5EJb+RxBrO6WVcmeQD2+A2iMzAo1KpY
-oJ2daZH9
------END CERTIFICATE-----
-
-# Issuer: CN=GTE CyberTrust Global Root O=GTE Corporation OU=GTE CyberTrust Solutions, Inc.
-# Subject: CN=GTE CyberTrust Global Root O=GTE Corporation OU=GTE CyberTrust Solutions, Inc.
-# Label: "GTE CyberTrust Global Root"
-# Serial: 421
-# MD5 Fingerprint: ca:3d:d3:68:f1:03:5c:d0:32:fa:b8:2b:59:e8:5a:db
-# SHA1 Fingerprint: 97:81:79:50:d8:1c:96:70:cc:34:d8:09:cf:79:44:31:36:7e:f4:74
-# SHA256 Fingerprint: a5:31:25:18:8d:21:10:aa:96:4b:02:c7:b7:c6:da:32:03:17:08:94:e5:fb:71:ff:fb:66:67:d5:e6:81:0a:36
------BEGIN CERTIFICATE-----
-MIICWjCCAcMCAgGlMA0GCSqGSIb3DQEBBAUAMHUxCzAJBgNVBAYTAlVTMRgwFgYD
-VQQKEw9HVEUgQ29ycG9yYXRpb24xJzAlBgNVBAsTHkdURSBDeWJlclRydXN0IFNv
-bHV0aW9ucywgSW5jLjEjMCEGA1UEAxMaR1RFIEN5YmVyVHJ1c3QgR2xvYmFsIFJv
-b3QwHhcNOTgwODEzMDAyOTAwWhcNMTgwODEzMjM1OTAwWjB1MQswCQYDVQQGEwJV
-UzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMScwJQYDVQQLEx5HVEUgQ3liZXJU
-cnVzdCBTb2x1dGlvbnMsIEluYy4xIzAhBgNVBAMTGkdURSBDeWJlclRydXN0IEds
-b2JhbCBSb290MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCVD6C28FCc6HrH
-iM3dFw4usJTQGz0O9pTAipTHBsiQl8i4ZBp6fmw8U+E3KHNgf7KXUwefU/ltWJTS
-r41tiGeA5u2ylc9yMcqlHHK6XALnZELn+aks1joNrI1CqiQBOeacPwGFVw1Yh0X4
-04Wqk2kmhXBIgD8SFcd5tB8FLztimQIDAQABMA0GCSqGSIb3DQEBBAUAA4GBAG3r
-GwnpXtlR22ciYaQqPEh346B8pt5zohQDhT37qw4wxYMWM4ETCJ57NE7fQMh017l9
-3PR2VX2bY1QY6fDq81yx2YtCHrnAlU66+tXifPVoYb+O7AWXX1uw16OFNMQkpw0P
-lZPvy5TYnh+dXIVtx6quTx8itc2VrbqnzPmrC3p/
------END CERTIFICATE-----
-
-# Issuer: C=US, O=Equifax, OU=Equifax Secure Certificate Authority
-# Subject: C=US, O=Equifax, OU=Equifax Secure Certificate Authority
-# Label: "Equifax Secure Certificate Authority"
-# Serial: 903804111
-# MD5 Fingerprint: 67:cb:9d:c0:13:24:8a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wQF
-MAMBAf8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUA
-A4GBAFjOKer89961zgK5F7WF0bnj4JXMJTENAKaSbn+2kmOeUJXRmm/kEd5jhW6Y
-7qj/WsjTVbJmcVfewCHrPSqnI0kBBIZCe/zuf6IWUrVnZ9NA2zsmWLIodz2uFHdh
-1voqZiegDfqnc1zqcPGUIWVEX/r87yloqaKHee9570+sB3c4
------END CERTIFICATE-----
diff --git a/lib/certifi/weak.pem b/lib/certifi/weak.pem
deleted file mode 100644
index 380c5233af..0000000000
--- a/lib/certifi/weak.pem
+++ /dev/null
@@ -1,5248 +0,0 @@
-
-# Issuer: CN=GlobalSign Root CA O=GlobalSign nv-sa OU=Root CA
-# Subject: CN=GlobalSign Root CA O=GlobalSign nv-sa OU=Root CA
-# Label: "GlobalSign Root CA"
-# Serial: 4835703278459707669005204
-# MD5 Fingerprint: 3e:45:52:15:09:51:92:e1:b7:5d:37:9f:b1:87:29:8a
-# SHA1 Fingerprint: b1:bc:96:8b:d4:f4:9d:62:2a:a8:9a:81:f2:15:01:52:a4:1d:82:9c
-# SHA256 Fingerprint: eb:d4:10:40:e4:bb:3e:c7:42:c9:e3:81:d3:1e:f2:a4:1a:48:b6:68:5c:96:e7:ce:f3:c1:df:6c:d4:33:1c:99
------BEGIN CERTIFICATE-----
-MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkG
-A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv
-b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAw
-MDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i
-YWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJHbG9iYWxT
-aWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDaDuaZ
-jc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavp
-xy0Sy6scTHAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp
-1Wrjsok6Vjk4bwY8iGlbKk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdG
-snUOhugZitVtbNV4FpWi6cgKOOvyJBNPc1STE4U6G7weNLWLBYy5d4ux2x8gkasJ
-U26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrXgzT/LCrBbBlDSgeF59N8
-9iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8E
-BTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0B
-AQUFAAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOz
-yj1hTdNGCbM+w6DjY1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE
-38NflNUVyRRBnMRddWQVDf9VMOyGj/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymP
-AbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhHhm4qxFYxldBniYUr+WymXUad
-DKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveCX4XSQRjbgbME
-HMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A==
------END CERTIFICATE-----
-
-# Issuer: CN=GlobalSign O=GlobalSign OU=GlobalSign Root CA - R2
-# Subject: CN=GlobalSign O=GlobalSign OU=GlobalSign Root CA - R2
-# Label: "GlobalSign Root CA - R2"
-# Serial: 4835703278459682885658125
-# MD5 Fingerprint: 94:14:77:7e:3e:5e:fd:8f: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YWxzaWduLm5ldC9yb290LXIyLmNybDAfBgNVHSMEGDAWgBSb4gdXZxwewGoG
-3lm0mi3f3BmGLjANBgkqhkiG9w0BAQUFAAOCAQEAmYFThxxol4aR7OBKuEQLq4Gs
-J0/WwbgcQ3izDJr86iw8bmEbTUsp9Z8FHSbBuOmDAGJFtqkIk7mpM0sYmsL4h4hO
-291xNBrBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu01yiPqFbQfXf5WRDLenVOavS
-ot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG79G+dwfCMNYxd
-AfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7
-TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg==
------END CERTIFICATE-----
-
-# Issuer: CN=VeriSign Class 3 Public Primary Certification Authority - G3 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 1999 VeriSign, Inc. - For authorized use only
-# Subject: CN=VeriSign Class 3 Public Primary Certification Authority - G3 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 1999 VeriSign, Inc. - For authorized use only
-# Label: "Verisign Class 3 Public Primary Certification Authority - G3"
-# Serial: 206684696279472310254277870180966723415
-# MD5 Fingerprint: cd:68:b6:a7:c7:c4:ce:75:e0:1d:4f:57:44:61:92:09
-# SHA1 Fingerprint: 13:2d:0d:45:53:4b:69:97:cd:b2:d5:c3:39:e2:55:76:60:9b:5c:c6
-# SHA256 Fingerprint: eb:04:cf:5e:b1:f3:9a:fa:76:2f:2b:b1:20:f2:96:cb:a5:20:c1:b9:7d:b1:58:95:65:b8:1c:b9:a1:7b:72:44
------BEGIN CERTIFICATE-----
-MIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQUAMIHKMQsw
-CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBg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DGBvtcC1IyIuBwvLqXTLR7sdwdela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC
-/Y4wjylGsB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565p
-F4ErWjfJXir0xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGt
-TxzhT5yvDwyd93gN2PQ1VoDat20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ==
------END CERTIFICATE-----
-
-# Issuer: CN=Entrust.net Certification Authority (2048) O=Entrust.net OU=www.entrust.net/CPS_2048 incorp. by ref. (limits liab.)/(c) 1999 Entrust.net Limited
-# Subject: CN=Entrust.net Certification Authority (2048) O=Entrust.net OU=www.entrust.net/CPS_2048 incorp. by ref. (limits liab.)/(c) 1999 Entrust.net Limited
-# Label: "Entrust.net Premium 2048 Secure Server CA"
-# Serial: 946069240
-# MD5 Fingerprint: ee:29:31:bc:32:7e:9a:e6:e8:b5:f7:51:b4:34:71:90
-# SHA1 Fingerprint: 50:30:06:09:1d:97:d4:f5:ae:39:f7:cb:e7:92:7d:7d:65:2d:34:31
-# SHA256 Fingerprint: 6d:c4:71:72:e0:1c:bc:b0:bf:62:58:0d:89:5f:e2:b8:ac:9a:d4:f8:73:80:1e:0c:10:b9:c8:37:d2:1e:b1:77
------BEGIN CERTIFICATE-----
-MIIEKjCCAxKgAwIBAgIEOGPe+DANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChML
-RW50cnVzdC5uZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBp
-bmNvcnAuIGJ5IHJlZi4gKGxpbWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5
-IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNVBAMTKkVudHJ1c3QubmV0IENlcnRp
-ZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw05OTEyMjQxNzUwNTFaFw0yO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mCHG8+c8eS9enNFMFY3h7CI3zJpDC5fcgJCNs2ebb0gIFVbPv/Er
-fF6adulZkMV8gzURZVE=
------END CERTIFICATE-----
-
-# Issuer: CN=Baltimore CyberTrust Root O=Baltimore OU=CyberTrust
-# Subject: CN=Baltimore CyberTrust Root O=Baltimore OU=CyberTrust
-# Label: "Baltimore CyberTrust Root"
-# Serial: 33554617
-# MD5 Fingerprint: ac:b6:94:a5:9c:17:e0:d7:91:52:9b:b1:97:06:a6:e4
-# SHA1 Fingerprint: d4:de:20:d0:5e:66:fc:53:fe:1a:50:88:2c:78:db:28:52:ca:e4:74
-# SHA256 Fingerprint: 16:af:57:a9:f6:76:b0:ab:12:60:95:aa:5e:ba:de:f2:2a:b3:11:19:d6:44:ac:95:cd:4b:93:db:f3:f2:6a:eb
------BEGIN CERTIFICATE-----
-MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJ
-RTESMBAGA1UEChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYD
-VQQDExlCYWx0aW1vcmUgQ3liZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoX
-DTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMCSUUxEjAQBgNVBAoTCUJhbHRpbW9y
-ZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFsdGltb3JlIEN5YmVy
-VHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKMEuyKr
-mD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjr
-IZ3AQSsBUnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeK
-mpYcqWe4PwzV9/lSEy/CG9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSu
-XmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9XbIGevOF6uvUA65ehD5f/xXtabz5OTZy
-dc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjprl3RjM71oGDHweI12v/ye
-jl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoIVDaGezq1
-BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3
-DQEBBQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT92
-9hkTI7gQCvlYpNRhcL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3Wgx
-jkzSswF07r51XgdIGn9w/xZchMB5hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0
-Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsaY71k5h+3zvDyny67G7fyUIhz
-ksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9HRCwBXbsdtTLS
-R9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp
------END CERTIFICATE-----
-
-# Issuer: CN=AddTrust External CA Root O=AddTrust AB OU=AddTrust External TTP Network
-# Subject: CN=AddTrust External CA Root O=AddTrust AB OU=AddTrust External TTP Network
-# Label: "AddTrust External Root"
-# Serial: 1
-# MD5 Fingerprint: 1d:35:54:04:85:78:b0:3f:42:42:4d:bf:20:73:0a:3f
-# SHA1 Fingerprint: 02:fa:f3:e2:91:43:54:68:60:78:57:69:4d:f5:e4:5b:68:85:18:68
-# SHA256 Fingerprint: 68:7f:a4:51:38:22:78:ff:f0:c8:b1:1f:8d:43:d5:76:67:1c:6e:b2:bc:ea:b4:13:fb:83:d9:65:d0:6d:2f:f2
------BEGIN CERTIFICATE-----
-MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU
-MBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBg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IzZlj7DYd7usQWxH
-YINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5
-6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvC
-Nr4TDea9Y355e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEX
-c4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5a
-mnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ=
------END CERTIFICATE-----
-
-# Issuer: CN=Entrust Root Certification Authority O=Entrust, Inc. OU=www.entrust.net/CPS is incorporated by reference/(c) 2006 Entrust, Inc.
-# Subject: CN=Entrust Root Certification Authority O=Entrust, Inc. OU=www.entrust.net/CPS is incorporated by reference/(c) 2006 Entrust, Inc.
-# Label: "Entrust Root Certification Authority"
-# Serial: 1164660820
-# MD5 Fingerprint: d6:a5:c3:ed:5d:dd:3e:00:c1:3d:87:92:1f:1d:3f:e4
-# SHA1 Fingerprint: b3:1e:b1:b7:40:e3:6c:84:02:da:dc:37:d4:4d:f5:d4:67:49:52:f9
-# SHA256 Fingerprint: 73:c1:76:43:4f:1b:c6:d5:ad:f4:5b:0e:76:e7:27:28:7c:8d:e5:76:16:c1:e6:e6:14:1a:2b:2c:bc:7d:8e:4c
------BEGIN CERTIFICATE-----
-MIIEkTCCA3mgAwIBAgIERWtQVDANBgkqhkiG9w0BAQUFADCBsDELMAkGA1UEBhMC
-VVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsTMHd3dy5lbnRydXN0
-Lm5ldC9DUFMgaXMgaW5jb3Jwb3JhdGVkIGJ5IHJlZmVyZW5jZTEfMB0GA1UECxMW
-KGMpIDIwMDYgRW50cnVzdCwgSW5jLjEtMCsGA1UEAxMkRW50cnVzdCBSb290IENl
-cnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA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4pN0wBOeMDpQ47RgxRzwIkSNcUesyBrJ6Zua
-AGAT/3B+XxFNSRuzFVJ7yVTav52Vr2ua2J7p8eRDjeIRRDq/r72DQnNSi6q7pynP
-9WQcCk3RvKqsnyrQ/39/2n3qse0wJcGE2jTSW3iDVuycNsMm4hH2Z0kdkquM++v/
-eu6FSqdQgPCnXEqULl8FmTxSQeDNtGPPAUO6nIPcj2A781q0tHuu2guQOHXvgR1m
-0vdXcDazv/wor3ElhVsT/h5/WrQ8
------END CERTIFICATE-----
-
-# Issuer: CN=GeoTrust Global CA O=GeoTrust Inc.
-# Subject: CN=GeoTrust Global CA O=GeoTrust Inc.
-# Label: "GeoTrust Global CA"
-# Serial: 144470
-# MD5 Fingerprint: f7:75:ab:29:fb:51:4e:b7:77:5e:ff:05:3c:99:8e:f5
-# SHA1 Fingerprint: de:28:f4:a4:ff:e5:b9:2f:a3:c5:03:d1:a3:49:a7:f9:96:2a:82:12
-# SHA256 Fingerprint: ff:85:6a:2d:25:1d:cd:88:d3:66:56:f4:50:12:67:98:cf:ab:aa:de:40:79:9c:72:2d:e4:d2:b5:db:36:a7:3a
------BEGIN CERTIFICATE-----
-MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVT
-MRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9i
-YWwgQ0EwHhcNMDIwNTIxMDQwMDAwWhcNMjIwNTIxMDQwMDAwWjBCMQswCQYDVQQG
-EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEbMBkGA1UEAxMSR2VvVHJ1c3Qg
-R2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2swYYzD9
-9BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9mOSm9BXiLnTjoBbdq
-fnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIuT8rxh0PBFpVXLVDv
-iS2Aelet8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386DGXHKTubU
-1XupGc1V3sjs0l44U+VcT4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+
-bw8HHa8sHo9gOeL6NlMTOdReJivbPagUvTLrGAMoUgRx5aszPeE4uwc2hGKceeoW
-MPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTA
-ephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVkDBF9qn1l
-uMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKIn
-Z57QzxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfS
-tQWVYrmm3ok9Nns4d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcF
-PseKUgzbFbS9bZvlxrFUaKnjaZC2mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Un
-hw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6pXE0zX5IJL4hmXXeXxx12E6nV
-5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvmMw==
------END CERTIFICATE-----
-
-# Issuer: CN=GeoTrust Universal CA O=GeoTrust Inc.
-# Subject: CN=GeoTrust Universal CA O=GeoTrust Inc.
-# Label: "GeoTrust Universal CA"
-# Serial: 1
-# MD5 Fingerprint: 92:65:58:8b:a2:1a:31:72:73:68:5c:b4:a5:7a:07:48
-# SHA1 Fingerprint: e6:21:f3:35:43:79:05:9a:4b:68:30:9d:8a:2f:74:22:15:87:ec:79
-# SHA256 Fingerprint: a0:45:9b:9f:63:b2:25:59:f5:fa:5d:4c:6d:b3:f9:f7:2f:f1:93:42:03:35:78:f0:73:bf:1d:1b:46:cb:b9:12
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wEB
-/wQFMAMBAf8wHQYDVR0OBBYEFNq7LqqwDLiIJlF0XG0D08DYj3rWMB8GA1UdIwQY
-MBaAFNq7LqqwDLiIJlF0XG0D08DYj3rWMA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG
-9w0BAQUFAAOCAgEAMXjmx7XfuJRAyXHEqDXsRh3ChfMoWIawC/yOsjmPRFWrZIRc
-aanQmjg8+uUfNeVE44B5lGiku8SfPeE0zTBGi1QrlaXv9z+ZhP015s8xxtxqv6fX
-IwjhmF7DWgh2qaavdy+3YL1ERmrvl/9zlcGO6JP7/TG37FcREUWbMPEaiDnBTzyn
-ANXH/KttgCJwpQzgXQQpAvvLoJHRfNbDflDVnVi+QTjruXU8FdmbyUqDWcDaU/0z
-uzYYm4UPFd3uLax2k7nZAY1IEKj79TiG8dsKxr2EoyNB3tZ3b4XUhRxQ4K5RirqN
-Pnbiucon8l+f725ZDQbYKxek0nxru18UGkiPGkzns0ccjkxFKyDuSN/n3QmOGKja
-QI2SJhFTYXNd673nxE0pN2HrrDktZy4W1vUAg4WhzH92xH3kt0tm7wNFYGm2DFKW
-koRepqO1pD4r2czYG0eq8kTaT/kD6PAUyz/zg97QwVTjt+gKN02LIFkDMBmhLMi9
-ER/frslKxfMnZmaGrGiR/9nmUxwPi1xpZQomyB40w11Re9epnAahNt3ViZS82eQt
-DF4JbAiXfKM9fJP/P6EUp8+1Xevb2xzEdt+Iub1FBZUbrvxGakyvSOPOrg/Sfuvm
-bJxPgWp6ZKy7PtXny3YuxadIwVyQD8vIP/rmMuGNG2+k5o7Y+SlIis5z/iw=
------END CERTIFICATE-----
-
-# Issuer: CN=GeoTrust Universal CA 2 O=GeoTrust Inc.
-# Subject: CN=GeoTrust Universal CA 2 O=GeoTrust Inc.
-# Label: "GeoTrust Universal CA 2"
-# Serial: 1
-# MD5 Fingerprint: 34:fc:b8:d0:36:db:9e:14:b3:c2:f2:db:8f:e4:94:c7
-# SHA1 Fingerprint: 37:9a:19:7b:41:85:45:35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service Association
-# Subject: CN=Visa eCommerce Root O=VISA OU=Visa International Service Association
-# Label: "Visa eCommerce Root"
-# Serial: 25952180776285836048024890241505565794
-# MD5 Fingerprint: fc:11:b8:d8:08:93:30:00:6d:23:f9:7e:eb:52:1e:02
-# SHA1 Fingerprint: 70:17:9b:86:8c:00:a4:fa:60:91:52:22:3f:9f:3e:32:bd:e0:05:62
-# SHA256 Fingerprint: 69:fa:c9:bd:55:fb:0a:c7:8d:53:bb:ee:5c:f1:d5:97:98:9f:d0:aa:ab:20:a2:51:51:bd:f1:73:3e:e7:d1:22
------BEGIN CERTIFICATE-----
-MIIDojCCAoqgAwIBAgIQE4Y1TR0/BvLB+WUF1ZAcYjANBgkqhkiG9w0BAQUFADBr
-MQswCQYDVQQGEwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMmVmlzYSBJbnRl
-cm5hdGlvbmFsIFNlcnZpY2UgQXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNv
-bW1lcmNlIFJvb3QwHhcNMDIwNjI2MDIxODM2WhcNMjIwNjI0MDAxNjEyWjBrMQsw
-CQYDVQQGEwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMmVmlzYSBJbnRlcm5h
-dGlvbmFsIFNlcnZpY2UgQXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNvbW1l
-cmNlIFJvb3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvV95WHm6h
-2mCxlCfLF9sHP4CFT8icttD0b0/Pmdjh28JIXDqsOTPHH2qLJj0rNfVIsZHBAk4E
-lpF7sDPwsRROEW+1QK8bRaVK7362rPKgH1g/EkZgPI2h4H3PVz4zHvtH8aoVlwdV
-ZqW1LS7YgFmypw23RuwhY/81q6UCzyr0TP579ZRdhE2o8mCP2w4lPJ9zcc+U30rq
-299yOIzzlr3xF7zSujtFWsan9sYXiwGd/BmoKoMWuDpI/k4+oKsGGelT84ATB+0t
-vz8KPFUgOSwsAGl0lUq8ILKpeeUYiZGo3BxN77t+Nwtd/jmliFKMAGzsGHxBvfaL
-dXe6YJ2E5/4tAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQD
-AgEGMB0GA1UdDgQWBBQVOIMPPyw/cDMezUb+B4wg4NfDtzANBgkqhkiG9w0BAQUF
-AAOCAQEAX/FBfXxcCLkr4NWSR/pnXKUTwwMhmytMiUbPWU3J/qVAtmPN3XEolWcR
-zCSs00Rsca4BIGsDoo8Ytyk6feUWYFN4PMCvFYP3j1IzJL1kk5fui/fbGKhtcbP3
-LBfQdCVp9/5rPJS+TUtBjE7ic9DjkCJzQ83z7+pzzkWKsKZJ/0x9nXGIxHYdkFsd
-7v3M9+79YKWxehZx0RbQfBI8bGmX265fOZpwLwU8GUYEmSA20GBuYQa7FkKMcPcw
-++DbZqMAAb3mLNqRX6BGi01qnD093QVG/na/oAo85ADmJ7f/hC3euiInlhBx6yLt
-398znM/jra6O1I7mT1GvFpLgXPYHDw==
------END CERTIFICATE-----
-
-# Issuer: CN=Certum CA O=Unizeto Sp. z o.o.
-# Subject: CN=Certum CA O=Unizeto Sp. z o.o.
-# Label: "Certum Root CA"
-# Serial: 65568
-# MD5 Fingerprint: 2c:8f:9f:66:1d:18:90:b1:47:26:9d:8e:86:82:8c:a9
-# SHA1 Fingerprint: 62:52:dc:40:f7:11:43:a2:2f:de:9e:f7:34:8e:06:42:51:b1:81:18
-# SHA256 Fingerprint: d8:e0:fe:bc:1d:b2:e3:8d:00:94:0f:37:d2:7d:41:34:4d:99:3e:73:4b:99:d5:65:6d:97:78:d4:d8:14:36:24
------BEGIN CERTIFICATE-----
-MIIDDDCCAfSgAwIBAgIDAQAgMA0GCSqGSIb3DQEBBQUAMD4xCzAJBgNVBAYTAlBM
-MRswGQYDVQQKExJVbml6ZXRvIFNwLiB6IG8uby4xEjAQBgNVBAMTCUNlcnR1bSBD
-QTAeFw0wMjA2MTExMDQ2MzlaFw0yNzA2MTExMDQ2MzlaMD4xCzAJBgNVBAYTAlBM
-MRswGQYDVQQKExJVbml6ZXRvIFNwLiB6IG8uby4xEjAQBgNVBAMTCUNlcnR1bSBD
-QTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM6xwS7TT3zNJc4YPk/E
-jG+AanPIW1H4m9LcuwBcsaD8dQPugfCI7iNS6eYVM42sLQnFdvkrOYCJ5JdLkKWo
-ePhzQ3ukYbDYWMzhbGZ+nPMJXlVjhNWo7/OxLjBos8Q82KxujZlakE403Daaj4GI
-ULdtlkIJ89eVgw1BS7Bqa/j8D35in2fE7SZfECYPCE/wpFcozo+47UX2bu4lXapu
-Ob7kky/ZR6By6/qmW6/KUz/iDsaWVhFu9+lmqSbYf5VT7QqFiLpPKaVCjF62/IUg
-AKpoC6EahQGcxEZjgoi2IrHu/qpGWX7PNSzVttpd90gzFFS269lvzs2I1qsb2pY7
-HVkCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEA
-uI3O7+cUus/usESSbLQ5PqKEbq24IXfS1HeCh+YgQYHu4vgRt2PRFze+GXYkHAQa
-TOs9qmdvLdTN/mUxcMUbpgIKumB7bVjCmkn+YzILa+M6wKyrO7Do0wlRjBCDxjTg
-xSvgGrZgFCdsMneMvLJymM/NzD+5yCRCFNZX/OYmQ6kd5YCQzgNUKD73P9P4Te1q
-CjqTE5s7FCMTY5w/0YcneeVMUeMBrYVdGjux1XMQpNPyvG5k9VpWkKjHDkx0Dy5x
-O/fIR/RpbxXyEV6DHpx8Uq79AtoSqFlnGNu8cN2bsWntgM6JQEhqDjXKKWYVIZQs
-6GAqm4VKQPNriiTsBhYscw==
------END CERTIFICATE-----
-
-# Issuer: CN=AAA Certificate Services O=Comodo CA Limited
-# Subject: CN=AAA Certificate Services O=Comodo CA Limited
-# Label: "Comodo AAA Services root"
-# Serial: 1
-# MD5 Fingerprint: 49:79:04:b0:eb:87:19:ac:47:b0:bc:11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oBEKIz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF
-MAMBAf8wewYDVR0fBHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20v
-QUFBQ2VydGlmaWNhdGVTZXJ2aWNlcy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29t
-b2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2VzLmNybDANBgkqhkiG9w0BAQUF
-AAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm7l3sAg9g1o1Q
-GE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz
-Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2
-G9w84FoVxp7Z8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsi
-l2D4kF501KKaU73yqWjgom7C12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3
-smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg==
------END CERTIFICATE-----
-
-# Issuer: CN=QuoVadis Root Certification Authority O=QuoVadis Limited OU=Root Certification Authority
-# Subject: CN=QuoVadis Root Certification Authority O=QuoVadis Limited OU=Root Certification Authority
-# Label: "QuoVadis Root CA"
-# Serial: 985026699
-# MD5 Fingerprint: 27:de:36:fe:72:b7:00:03:00:9d:f4:f0:1e:6c:04:24
-# SHA1 Fingerprint: de:3f:40:bd:50:93:d3:9b:6c:60:f6:da:bc:07:62:01:00:89:76:c9
-# SHA256 Fingerprint: a4:5e:de:3b:bb:f0:9c:8a:e1:5c:72:ef:c0:72:68:d6:93:a2:1c:99:6f:d5:1e:67:ca:07:94:60:fd:6d:88:73
------BEGIN CERTIFICATE-----
-MIIF0DCCBLigAwIBAgIEOrZQizANBgkqhkiG9w0BAQUFADB/MQswC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jY2VwdGFuY2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJsZSBzdGFuZGFy
-ZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1c2UsIGNlcnRpZmljYXRpb24gcHJh
-Y3RpY2VzLCBhbmQgdGhlIFF1b1ZhZGlzIENlcnRpZmljYXRlIFBvbGljeS4wIgYI
-KwYBBQUHAgEWFmh0dHA6Ly93d3cucXVvdmFkaXMuYm0wHQYDVR0OBBYEFItLbe3T
-KbkGGew5Oanwl4Rqy+/fMIGuBgNVHSMEgaYwgaOAFItLbe3TKbkGGew5Oanwl4Rq
-y+/foYGEpIGBMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1p
-dGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYD
-VQQDEyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggQ6tlCL
-MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAitQUtf70mpKnGdSk
-fnIYj9lofFIk3WdvOXrEql494liwTXCYhGHoG+NpGA7O+0dQoE7/8CQfvbLO9Sf8
-7C9TqnN7Az10buYWnuulLsS/VidQK2K6vkscPFVcQR0kvoIgR13VRH56FmjffU1R
-cHhXHTMe/QKZnAzNCgVPx7uOpHX6Sm2xgI4JVrmcGmD+XcHXetwReNDWXcG31a0y
-mQM6isxUJTkxgXsTIlG6Rmyhu576BGxJJnSP0nPrzDCi5upZIof4l/UO/erMkqQW
-xFIY6iHOsfHmhIHluqmGKPJDWl0Snawe2ajlCmqnf6CHKc/yiU3U7MXi5nrQNiOK
-SnQ2+Q==
------END CERTIFICATE-----
-
-# Issuer: CN=QuoVadis Root CA 2 O=QuoVadis Limited
-# Subject: CN=QuoVadis Root CA 2 O=QuoVadis Limited
-# Label: "QuoVadis Root CA 2"
-# Serial: 1289
-# MD5 Fingerprint: 5e:39:7b:dd:f8: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cyKJloJONDO1w2AFrR4pTqHTI2KpdVGl/IsELm8VCLAAVBpQ570su9t+Oza
-8eOx79+Rj1QqCyXBJhnEUhAFZdWCEOrCMc0u
------END CERTIFICATE-----
-
-# Issuer: CN=QuoVadis Root CA 3 O=QuoVadis Limited
-# Subject: CN=QuoVadis Root CA 3 O=QuoVadis Limited
-# Label: "QuoVadis Root CA 3"
-# Serial: 1478
-# MD5 Fingerprint: 31:85:3c:62:94:97:63:b9:aa:fd:89:4e:af:6f:e0:cf
-# SHA1 Fingerprint: 1f:49:14:f7:d8:74:95:1d:dd:ae:02:c0:be:fd:3a:2d:82:75:51:85
-# SHA256 Fingerprint: 18:f1:fc:7f:20:5d:f8:ad:dd:eb:7f:e0:07:dd:57:e3:af:37:5a:9c:4d:8d:73:54:6b:f4:f1:fe:d1:e1:8d:35
------BEGIN CERTIFICATE-----
-MIIGnTCCBIWgAwIBAgICBcYwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0x
-GTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJv
-b3QgQ0EgMzAeFw0wNjExMjQxOTExMjNaFw0zMTExMjQxOTA2NDRaMEUxCzAJBgNV
-BAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMRswGQYDVQQDExJRdW9W
-YWRpcyBSb290IENBIDMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDM
-V0IWVJzmmNPTTe7+7cefQzlKZbPoFog02w1ZkXTPkrgEQK0CSzGrvI2RaNggDhoB
-4hp7Thdd4oq3P5kazethq8Jlph+3t723j/z9cI8LoGe+AaJZz3HmDyl2/7FWeUUr
-H556VOijKTVopAFPD6QuN+8bv+OPEKhyq1hX51SGyMnzW9os2l2ObjyjPtr7guXd
-8lyyBTNvijbO0BNO/79KDDRMpsMhvVAEVeuxu537RR5kFd5VAYwCdrXLoT9Cabwv
-vWhDFlaJKjdhkf2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11gUyeim/YIIirnv6By5ZwkajGxkHon24QRiSem
-d1o417+shvzuXYO8BsbRd2sPbSQvS3pspweWyuOEn62Iix2rFo1bZhfZFvSLgNLd
-+LJ2w/w4E6oM3kJpK27zPOuAJ9v1pkQNn1pVWQvVDVJIxa6f8i+AxeoyUDUSly7B
-4f/xI4hROJ/yZlZ25w9Rl6VSDE1JUZU2Pb+iSwwQHYaZTKrzchGT5Or2m9qoXadN
-t54CrnMAyNojA+j56hl0YgCUyyIgvpSnWbWCar6ZeXqp8kokUvd0/bpO5qgdAm6x
-DYBEwa7TIzdfu4V8K5Iu6H6li92Z4b8nby1dqnuH/grdS/yO9SbkbnBCbjPsMZ57
-k8HkyWkaPcBrTiJt7qtYTcbQQcEr6k8Sh17rRdhs9ZgC06DYVYoGmRmioHfRMJ6s
-zHXug/WwYjnPbFfiTNKRCw51KBuav/0aQ/HKd/s7j2G4aSgWQgRecCocIdiP4b0j
-Wy10QJLZYxkNc91pvGJHvOB0K7Lrfb5BG7XARsWhIstfTsEokt4YutUqKLsRixeT
-mJlglFwjz1onl14LBQaTNx47aTbrqZ5hHY8y2o4M1nQ+ewkk2gF3R8Q7zTSMmfXK
-4SVhM7JZG+Ju1zdXtg2pEto=
------END CERTIFICATE-----
-
-# Issuer: O=SECOM Trust.net OU=Security Communication RootCA1
-# Subject: O=SECOM Trust.net OU=Security Communication RootCA1
-# Label: "Security Communication Root CA"
-# Serial: 0
-# MD5 Fingerprint: f1:bc:63:6a:54:e0:b5:27:f5:cd:e7:1a:e3:4d:6e:4a
-# SHA1 Fingerprint: 36:b1:2b:49:f9:81:9e:d7:4c:9e:bc:38:0f:c6:56:8f:5d:ac:b2:f7
-# SHA256 Fingerprint: e7:5e:72:ed:9f:56:0e:ec:6e:b4:80:00:73:a4:3f:c3:ad:19:19:5a:39:22:82:01:78:95:97:4a:99:02:6b:6c
------BEGIN CERTIFICATE-----
-MIIDWjCCAkKgAwIBAgIBADANBgkqhkiG9w0BAQUFADBQMQswCQYDV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Xot
-RSflMMFe8toTyyVCUZVHA4xsIcx0Qu1T/zOLjw9XARYvz6buyXAiFL39vmwLAw==
------END CERTIFICATE-----
-
-# Issuer: CN=Sonera Class2 CA O=Sonera
-# Subject: CN=Sonera Class2 CA O=Sonera
-# Label: "Sonera Class 2 Root CA"
-# Serial: 29
-# MD5 Fingerprint: a3:ec:75:0f:2e:88:df:fa:48:01:4e:0b:5c:48:6f:fb
-# SHA1 Fingerprint: 37:f7:6d:e6:07:7c:90:c5:b1:3e:93:1a:b7:41:10:b4:f2:e4:9a:27
-# SHA256 Fingerprint: 79:08:b4:03:14:c1:38:10:0b:51:8d:07:35:80:7f:fb:fc:f8:51:8a:00:95:33:71:05:ba:38:6b:15:3d:d9:27
------BEGIN CERTIFICATE-----
-MIIDIDCCAgigAwIBAgIBHTANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEP
-MA0GA1UEChMGU29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MyIENBMB4XDTAx
-MDQwNjA3Mjk0MFoXDTIxMDQwNjA3Mjk0MFowOTELMAkGA1UEBhMCRkkxDzANBgNV
-BAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJhIENsYXNzMiBDQTCCASIwDQYJKoZI
-hvcNAQEBBQADggEPADCCAQoCggEBAJAXSjWdyvANlsdE+hY3/Ei9vX+ALTU74W+o
-Z6m/AxxNjG8yR9VBaKQTBME1DJqEQ/xcHf+Js+gXGM2RX/uJ4+q/Tl18GybTdXnt
-5oTjV+WtKcT0OijnpXuENmmz/V52vaMtmdOQTiMofRhj8VQ7Jp12W5dCsv+u8E7s
-3TmVToMGf+dJQMjFAbJUWmYdPfz56TwKnoG4cPABi+QjVHzIrviQHgCWctRUz2Ej
-vOr7nQKV0ba5cTppCD8PtOFCx4j1P5iop7oc4HFx71hXgVB6XGt0Rg6DA5jDjqhu
-8nYybieDwnPz3BjotJPqdURrBGAgcVeHnfO+oJAjPYok4doh28MCAwEAAaMzMDEw
-DwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQISqCqWITTXjwwCwYDVR0PBAQDAgEG
-MA0GCSqGSIb3DQEBBQUAA4IBAQBazof5FnIVV0sd2ZvnoiYw7JNn39Yt0jSv9zil
-zqsWuasvfDXLrNAPtEwr/IDva4yRXzZ299uzGxnq9LIR/WFxRL8oszodv7ND6J+/
-3DEIcbCdjdY0RzKQxmUk96BKfARzjzlvF4xytb1LyHr4e4PDKE6cCepnP7JnBBvD
-FNr450kkkdAdavphOe9r5yF1BgfYErQhIHBCcYHaPJo2vqZbDWpsmh+Re/n570K6
-Tk6ezAyNlNzZRZxe7EJQY670XcSxEtzKO6gunRRaBXW37Ndj4ro1tgQIkejanZz2
-ZrUYrAqmVCY0M9IbwdR/GjqOC6oybtv8TyWf2TLHllpwrN9M
------END CERTIFICATE-----
-
-# Issuer: CN=Chambers of Commerce Root O=AC Camerfirma SA CIF A82743287 OU=http://www.chambersign.org
-# Subject: CN=Chambers of Commerce Root O=AC Camerfirma SA CIF A82743287 OU=http://www.chambersign.org
-# Label: "Camerfirma Chambers of Commerce Root"
-# Serial: 0
-# MD5 Fingerprint: b0:01:ee:14:d9:af:29:18:94:76:8e:f1:69:33:2a:84
-# SHA1 Fingerprint: 6e:3a:55:a4:19:0c:19:5c:93:84:3c:c0:db:72:2e:31:30:61:f0:b1
-# SHA256 Fingerprint: 0c:25:8a:12:a5:67:4a:ef:25:f2:8b:a7:dc:fa:ec:ee:a3:48:e5:41:e6:f5:cc:4e:e6:3b:71:b3:61:60:6a:c3
------BEGIN CERTIFICATE-----
-MIIEvTCCA6WgAwIBAgIBADANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJFVTEn
-MCUGA1UEChMeQUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQL
-ExpodHRwOi8vd3d3LmNoYW1iZXJzaWduLm9yZzEiMCAGA1UEAxMZQ2hhbWJlcnMg
-b2YgQ29tbWVyY2UgUm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Nyb290Lmh0bWwwDQYJKoZIhvcNAQEFBQADggEB
-AAxBl8IahsAifJ/7kPMa0QOx7xP5IV8EnNrJpY0nbJaHkb5BkAFyk+cefV/2icZd
-p0AJPaxJRUXcLo0waLIJuvvDL8y6C98/d3tGfToSJI6WjzwFCm/SlCgdbQzALogi
-1djPHRPH8EjX1wWnz8dHnjs8NMiAT9QUu/wNUPf6s+xCX6ndbcj0dc97wXImsQEc
-XCz9ek60AcUFV7nnPKoF2YjpB0ZBzu9Bga5Y34OirsrXdx/nADydb47kMgkdTXg0
-eDQ8lJsm7U9xxhl6vSAiSFr+S30Dt+dYvsYyTnQeaN2oaFuzPu5ifdmA6Ap1erfu
-tGWaIZDgqtCYvDi1czyL+Nw=
------END CERTIFICATE-----
-
-# Issuer: CN=Global Chambersign Root O=AC Camerfirma SA CIF A82743287 OU=http://www.chambersign.org
-# Subject: CN=Global Chambersign Root O=AC Camerfirma SA CIF A82743287 OU=http://www.chambersign.org
-# Label: "Camerfirma Global Chambersign Root"
-# Serial: 0
-# MD5 Fingerprint: c5:e6:7b:bf:06:d0:4f:43:ed:c4:7a:65:8a:fb:6b:19
-# SHA1 Fingerprint: 33:9b:6b:14:50:24:9b:55:7a:01:87:72:84:d9:e0:2f:c3:d2:d8:e9
-# SHA256 Fingerprint: ef:3c:b4:17:fc:8e:bf:6f:97:87:6c:9e:4e:ce:39:de:1e:a5:fe:64:91:41:d1:02:8b:7d:11:c0:b2:29:8c:ed
------BEGIN CERTIFICATE-----
-MIIExTCCA62gAwIBAgIBADANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJFVTEn
-MCUGA1UEChMeQUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQL
-ExpodHRwOi8vd3d3LmNoYW1iZXJzaWduLm9yZzEgMB4GA1UEAxMXR2xvYmFsIENo
-YW1iZXJzaWduIFJvb3QwHhcNMDMwOTMwMTYxNDE4WhcNMzcwOTMwMTYxNDE4WjB9
-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qhkiG9w0B
-AQUFAAOCAQEAPDtwkfkEVCeR4e3t/mh/YV3lQWVPMvEYBZRqHN4fcNs+ezICNLUM
-bKGKfKX0j//U2K0X1S0E0T9YgOKBWYi+wONGkyT+kL0mojAt6JcmVzWJdJYY9hXi
-ryQZVgICsroPFOrGimbBhkVVi76SvpykBMdJPJ7oKXqJ1/6v/2j1pReQvayZzKWG
-VwlnRtvWFsJG8eSpUPWP0ZIV018+xgBJOm5YstHRJw0lyDL4IBHNfTIzSJRUTN3c
-ecQwn+uOuFW114hcxWokPbLTBQNRxgfvzBRydD1ucs4YKIxKoHflCStFREest2d/
-AYoFWpO+ocH/+OcOZ6RHSXZddZAa9SaP8A==
------END CERTIFICATE-----
-
-# Issuer: CN=XRamp Global Certification Authority O=XRamp Security Services Inc OU=www.xrampsecurity.com
-# Subject: CN=XRamp Global Certification Authority O=XRamp Security Services Inc OU=www.xrampsecurity.com
-# Label: "XRamp Global CA Root"
-# Serial: 107108908803651509692980124233745014957
-# MD5 Fingerprint: a1:0b:44:b3:ca:10:d8:00:6e:9d:0f:d8:0f:92:0a:d1
-# SHA1 Fingerprint: b8:01:86:d1:eb:9c:86:a5:41:04:cf:30:54:f3:4c:52:b7:e5:58:c6
-# SHA256 Fingerprint: ce:cd:dc:90:50:99:d8:da:df:c5:b1:d2:09:b7:37:cb:e2:c1:8c:fb:2c:10:c0:ff:0b:cf:0d:32:86:fc:1a:a2
------BEGIN CERTIFICATE-----
-MIIEMDCCAxigAwIBAgIQUJRs7Bjq1ZxN1ZfvdY+grTANBgkqhkiG9w0BAQUFADCB
-gjELMAkGA1UEBhMCVVMxHjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEk
-MCIGA1UEChMbWFJhbXAgU2VjdXJpdHkgU2VydmljZXMgSW5jMS0wKwYDVQQDEyRY
-UmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQxMTAxMTcx
-NDA0WhcNMzUwMTAxM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c8nnxCbHIgNsIpkQTG4DmyQJKSbXHGPurt+HBvbaoAPIbzp26a3QPSy
-i6mx5O+aGtA9aZnuqCij4Tyz8LIRnM98QObd50N9otg6tamN8jSZxNQQ4Qb9CYQQ
-O+7ETPTsJ3xCwnR8gooJybQDJbw=
------END CERTIFICATE-----
-
-# Issuer: O=The Go Daddy Group, Inc. OU=Go Daddy Class 2 Certification Authority
-# Subject: O=The Go Daddy Group, Inc. OU=Go Daddy Class 2 Certification Authority
-# Label: "Go Daddy Class 2 CA"
-# Serial: 0
-# MD5 Fingerprint: 91:de:06:25:ab:da:fd:32:17:0c:bb:25:17:2a:84:67
-# SHA1 Fingerprint: 27:96:ba:e6:3f:18:01:e2:77:26:1b:a0:d7:77:70:02:8f:20:ee:e4
-# SHA256 Fingerprint: c3:84:6b:f2:4b:9e:93:ca:64:27:4c:0e:c6:7c:1e:cc:5e:02:4f:fc:ac:d2:d7:40:19:35:0e:81:fe:54:6a:e4
------BEGIN CERTIFICATE-----
-MIIEADCCAuigAwIBAgIBADANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEh
-MB8GA1UEChMYVGhlIEdvIERhZGR5IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBE
-YWRkeSBDbGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA0MDYyOTE3
-MDYyMFoXDTM0MDYyOTE3MDYyMFowYzELMAkGA1UEBhMCVVMxITAfBgNVBAoTGFRo
-ZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28gRGFkZHkgQ2xhc3Mg
-MiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASAwDQYJKoZIhvcNAQEBBQADggEN
-ADCCAQgCggEBAN6d1+pXGEmhW+vXX0iG6r7d/+TvZxz0ZWizV3GgXne77ZtJ6XCA
-PVYYYwhv2vLM0D9/AlQiVBDYsoHUwHU9S3/Hd8M+eKsaA7Ugay9qK7HFiH7Eux6w
-wdhFJ2+qN1j3hybX2C32qRe3H3I2TqYXP2WYktsqbl2i/ojgC95/5Y0V4evLOtXi
-EqITLdiOr18SPaAIBQi2XKVlOARFmR6jYGB0xUGlcmIbYsUfb18aQr4CUWWoriMY
-avx4A6lNf4DD+qta/KFApMoZFv6yyO9ecw3ud72a9nmYvLEHZ6IVDd2gWMZEewo+
-YihfukEHU1jPEX44dMX4/7VpkI+EdOqXG68CAQOjgcAwgb0wHQYDVR0OBBYEFNLE
-sNKR1EwRcbNhyz2h/t2oatTjMIGNBgNVHSMEgYUwgYKAFNLEsNKR1EwRcbNhyz2h
-/t2oatTjoWekZTBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYVGhlIEdvIERhZGR5
-IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRpZmlj
-YXRpb24gQXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQAD
-ggEBADJL87LKPpH8EsahB4yOd6AzBhRckB4Y9wimPQoZ+YeAEW5p5JYXMP80kWNy
-OO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKtI3lpjbi2Tc7P
-TMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ
-HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mER
-dEr/VxqHD3VILs9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5Cuf
-ReYNnyicsbkqWletNw+vHX/bvZ8=
------END CERTIFICATE-----
-
-# Issuer: O=Starfield Technologies, Inc. OU=Starfield Class 2 Certification Authority
-# Subject: O=Starfield Technologies, Inc. OU=Starfield Class 2 Certification Authority
-# Label: "Starfield Class 2 CA"
-# Serial: 0
-# MD5 Fingerprint: 32:4a:4b:bb:c8:63:69:9b:be:74:9a:c6:dd:1d:46:24
-# SHA1 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CVVMxJTAjBgNVBAoTHFN0
-YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xMjAwBgNVBAsTKVN0YXJmaWVsZCBD
-bGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8w
-DQYJKoZIhvcNAQEFBQADggEBAAWdP4id0ckaVaGsafPzWdqbAYcaT1epoXkJKtv3
-L7IezMdeatiDh6GX70k1PncGQVhiv45YuApnP+yz3SFmH8lU+nLMPUxA2IGvd56D
-eruix/U0F47ZEUD0/CwqTRV/p2JdLiXTAAsgGh1o+Re49L2L7ShZ3U0WixeDyLJl
-xy16paq8U4Zt3VekyvggQQto8PT7dL5WXXp59fkdheMtlb71cZBDzI0fmgAKhynp
-VSJYACPq4xJDKVtHCN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEY
-WQPJIrSPnNVeKtelttQKbfi3QBFGmh95DmK/D5fs4C8fF5Q=
------END CERTIFICATE-----
-
-# Issuer: CN=StartCom Certification Authority O=StartCom Ltd. OU=Secure Digital Certificate Signing
-# Subject: CN=StartCom Certification Authority O=StartCom Ltd. OU=Secure Digital Certificate Signing
-# Label: "StartCom Certification Authority"
-# Serial: 1
-# MD5 Fingerprint: 22:4d:8f:8a:fc:f7:35:c2:bb:57:34:90:7b:8b:22:16
-# SHA1 Fingerprint: 3e:2b:f7:f2:03:1b:96:f3:8c:e6:c4:d8:a8:5d:3e:2d:58:47:6a:0f
-# SHA256 Fingerprint: c7:66:a9:be:f2:d4:07:1c:86:3a:31:aa:49:20:e8:13:b2:d1:98:60:8c:b7:b7:cf:e2:11:43:b8:36:df:09:ea
------BEGIN CERTIFICATE-----
-MIIHyTCCBbGgAwIBAgIBATANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJJTDEW
-MBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwg
-Q2VydGlmaWNhdGUgU2lnbmluZzEp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mezwD7dOaHZrzZVD1oNB1
-ny+v8OqCQ5j4aZyJecRDjkZy42Q2Eq/3JR44iZB3fsNrarnDy0RLrHiQi+fHLB5L
-EUTINFInzQpdn4XBidUaePKVEFMy3YCEZnXZtWgo+2EuvoSoOMCZEoalHmdkrQYu
-L6lwhceWD3yJZfWOQ1QOq92lgDmUYMA0yZZwLKMS9R9Ie70cfmu3nZD0Ijuu+Pwq
-yvqCUqDvr0tVk+vBtfAii6w0TiYiBKGHLHVKt+V9E9e4DGTANtLJL4YSjCMJwRuC
-O3NJo2pXh5Tl1njFmUNj403gdy3hZZlyaQQaRwnmDwFWJPsfvw55qVguucQJAX6V
-um0ABj6y6koQOdjQK/W/7HW/lwLFCRsI3FU34oH7N4RDYiDK51ZLZer+bMEkkySh
-NOsF/5oirpt9P/FlUQqmMGqz9IgcgA38corog14=
------END CERTIFICATE-----
-
-# Issuer: O=Government Root Certification Authority
-# Subject: O=Government Root Certification Authority
-# Label: "Taiwan GRCA"
-# Serial: 42023070807708724159991140556527066870
-# MD5 Fingerprint: 37:85:44:53:32:45:1f:20:f0:f3:95:e1:25:c4:43:4e
-# SHA1 Fingerprint: f4:8b:11:bf:de:ab:be:94:54:20:71:e6:41:de:6b:be:88:2b:40:b9
-# SHA256 Fingerprint: 76:00:29:5e:ef:e8:5b:9e:1f:d6:24:db:76:06:2a:aa:ae:59:81:8a:54:d2:77:4c:d4:c0:b2:c0:11:31:e1:b3
------BEGIN CERTIFICATE-----
-MIIFcjCCA1qgAwIBAgIQH51ZWtcvwgZEpYAIaeNe9jANBgkqhkiG9w0BAQUFADA/
-MQswCQYDVQQGEwJUVzEwMC4GA1UECgwnR292ZXJubWVudCBSb290IENlcnRpZmlj
-YXRpb24gQXV0aG9yaXR5MB4XDTAyMTIwNTEzMjMzM1oXDTMyMTIwNTEzMjMzM1ow
-PzELMAkGA1UEBhMCVFcxMDAuBgNVBAoMJ0dvdmVybm1lbnQgUm9vdCBDZXJ0aWZp
-Y2F0aW9uIEF1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wppv3ghqMKnI6mGq3ZW6A4M9hPdKmaK
-ZEk9GhiHkASfQlK3T8v+R0F2Ne//AHY2RTKbxkaFXeIksB7jSJaYV0eUVXoPQbFE
-JPPB/hprv4j9wabak2BegUqZIJxIZhm1AHlUD7gsL0u8qV1bYH+Mh6XgUmMqvtg7
-hUAV/h62ZT/FS9p+tXo1KaMuephgIqP0fSdOLeq0dDzpD6QzDxARvBMB1uUO07+1
-EqLhRSPAzAhuYbeJq4PjJB7mXQfnHyA+z2fI56wwbSdLaG5LKlwCCDTb+HbkZ6Mm
-nD+iMsJKxYEYMRBWqoTvLQr/uB930r+lWKBi5NdLkXWNiYCYfm3LU05er/ayl4WX
-udpVBrkk7tfGOB5jGxI7leFYrPLfhNVfmS8NVVvmONsuP3LpSIXLuykTjx44Vbnz
-ssQwmSNOXfJIoRIM3BKQCZBUkQM8R+XVyWXgt0t97EfTsws+rZ7QdAAO671RrcDe
-LMDDav7v3Aun+kbfYNucpllQdSNpc5Oy+fwC00fmcc4QAu4njIT/rEUNE1yDMuAl
-pYYsfPQS
------END CERTIFICATE-----
-
-# Issuer: CN=DigiCert Assured ID Root CA O=DigiCert Inc OU=www.digicert.com
-# Subject: CN=DigiCert Assured ID Root CA O=DigiCert Inc OU=www.digicert.com
-# Label: "DigiCert Assured ID Root CA"
-# Serial: 17154717934120587862167794914071425081
-# MD5 Fingerprint: 87:ce:0b:7b:2a:0e:49:00:e1:58:71:9b:37:a8:93:72
-# SHA1 Fingerprint: 05:63:b8:63:0d:62:d7:5a:bb:c8:ab:1e:4b:df:b5:a8:99:b2:4d:43
-# SHA256 Fingerprint: 3e:90:99:b5:01:5e:8f:48:6c:00:bc:ea:9d:11:1e:e7:21:fa:ba:35:5a:89:bc:f1:df:69:56:1e:3d:c6:32:5c
------BEGIN CERTIFICATE-----
-MIIDtzCCAp+gAwIBAgIQDOfg5RfYRv6P5WD8G/AwOTANBgkqhkiG9w0BAQUFADBl
-MQswCQYDVQQGEwJVUzEVMBMGA1UE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tCt/qMHt1i8b5QZ7dsvfPx
-H2sMNgcWfzd8qVttevESRmCD1ycEvkvOl77DZypoEd+A5wwzZr8TDRRu838fYxAe
-+o0bJW1sj6W3YQGx0qMmoRBxna3iw/nDmVG3KwcIzi7mULKn+gpFL6Lw8g==
------END CERTIFICATE-----
-
-# Issuer: CN=DigiCert Global Root CA O=DigiCert Inc OU=www.digicert.com
-# Subject: CN=DigiCert Global Root CA O=DigiCert Inc OU=www.digicert.com
-# Label: "DigiCert Global Root CA"
-# Serial: 10944719598952040374951832963794454346
-# MD5 Fingerprint: 79:e4:a9:84:0d:7d:3a:96:d7:c0:4f:e2:43:4c:89:2e
-# SHA1 Fingerprint: a8:98:5d:3a:65:e5:e5:c4:b2:d7:d6:6d:40:c6:dd:2f:b1:9c:54:36
-# SHA256 Fingerprint: 43:48:a0:e9:44:4c:78:cb:26:5e:05:8d:5e:89:44:b4:d8:4f:96:62:bd:26:db:25:7f:89:34:a4:43:c7:01:61
------BEGIN CERTIFICATE-----
-MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh
-MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
-d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD
-QTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAwMDAwMDBaMGExCzAJBgNVBAYTAlVT
-MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j
-b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkqhkiG
-9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsB
-CSDMAZOnTjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97
-nh6Vfe63SKMI2tavegw5BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt
-43C/dxC//AH2hdmoRBBYMql1GNXRor5H4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7P
-T19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y7vrTC0LUq7dBMtoM1O/4
-gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQABo2MwYTAO
-BgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbR
-TLtm8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUw
-DQYJKoZIhvcNAQEFBQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/Esr
-hMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg
-06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJF
-PnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls
-YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk
-CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4=
------END CERTIFICATE-----
-
-# Issuer: CN=DigiCert High Assurance EV Root CA O=DigiCert Inc OU=www.digicert.com
-# Subject: CN=DigiCert High Assurance EV Root CA O=DigiCert Inc OU=www.digicert.com
-# Label: "DigiCert High Assurance EV Root CA"
-# Serial: 3553400076410547919724730734378100087
-# MD5 Fingerprint: d4:74:de:57:5c:39:b2:d3:9c:85:83:c5:c0:65:49:8a
-# SHA1 Fingerprint: 5f:b7:ee:06:33:e2:59:db:ad:0c:4c:9a:e6:d3:8f:1a:61:c7:dc:25
-# SHA256 Fingerprint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DMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3Nec
-nzyIZgYIVyHbIUf4KmeqvxgydkAQV8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6z
-eM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFpmyPInngiK3BD41VHMWEZ71jF
-hS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkKmNEVX58Svnw2
-Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe
-vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep
-+OkuE6N36B9K
------END CERTIFICATE-----
-
-# Issuer: CN=Class 2 Primary CA O=Certplus
-# Subject: CN=Class 2 Primary CA O=Certplus
-# Label: "Certplus Class 2 Primary CA"
-# Serial: 177770208045934040241468760488327595043
-# MD5 Fingerprint: 88:2c:8c:52:b8:a2:3c:f3:f7:bb:03:ea:ae:ac:42:0b
-# SHA1 Fingerprint: 74:20:74:41:72:9c:dd:92:ec:79:31:d8:23:10:8d:c2:81:92:e2:bb
-# SHA256 Fingerprint: 0f:99:3c:8a:ef:97:ba:af:56:87:14:0e:d5:9a:d1:82:1b:b4:af:ac:f0:aa:9a:58:b5:d5:7a:33:8a:3a:fb:cb
------BEGIN CERTIFICATE-----
-MIIDkjCCAnqgAwIBAgIRAIW9S/PY2uNp9pTXX8OlRCMwDQYJKoZIhvcNAQEFBQAw
-PTELMAkGA1UEBhMCRlIxETAPBgNVBAoTCENlcnRwbHVzMRswGQYDVQQDExJDbGFz
-cyAyIFByaW1hcnkgQ0EwHhcNOTkwNzA3MTcwNTAwWhcNMTkwNzA2MjM1OTU5WjA9
-MQswCQYDVQQGEwJGUjERMA8GA1UEChMIQ2VydHBsdXMxGzAZBgNVBAMTEkNsYXNz
-IDIgUHJpbWFyeSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANxQ
-ltAS+DXSCHh6tlJw/W/uz7kRy1134ezpfgSN1sxvc0NXYKwzCkTsA18cgCSR5aiR
-VhKC9+Ar9NuuYS6JEI1rbLqzAr3VNsVINyPi8Fo3UjMXEuLRYE2+L0ER4/YXJQyL
-kcAbmXuZVg2v7tK8R1fjeUl7NIknJITesezpWE7+Tt9avkGtrAjFGA7v0lPubNCd
-EgETjdyAYveVqUSISnFOYFWe2yMZeVYHDD9jC1yw4r5+FfyUM1hBOHTE4Y+L3yas
-H7WLO7dDWWuwJKZtkIvEcupdM5i3y95ee++U8Rs+yskhwcWYAqqi9lt3m/V+llU0
-HGdpwPFC40es/CgcZlUCAwEAAaOBjDCBiTAPBgNVHRMECDAGAQH/AgEKMAsGA1Ud
-DwQEAwIBBjAdBgNVHQ4EFgQU43Mt38sOKAze3bOkynm4jrvoMIkwEQYJYIZIAYb4
-QgEBBAQDAgEGMDcGA1UdHwQwMC4wLKAqoCiGJmh0dHA6Ly93d3cuY2VydHBsdXMu
-Y29tL0NSTC9jbGFzczIuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQCnVM+IRBnL39R/
-AN9WM2K191EBkOvDP9GIROkkXe/nFL0gt5o8AP5tn9uQ3Nf0YtaLcF3n5QRIqWh8
-yfFC82x/xXp8HVGIutIKPidd3i1RTtMTZGnkLuPT55sJmabglZvOGtd/vjzOUrMR
-FcEPF80Du5wlFbqidon8BvEY0JNLDnyCt6X09l/+7UCmnYR0ObncHoUW2ikbhiMA
-ybuJfm6AiB4vFLQDJKgybwOaRywwvlbGp0ICcBvqQNi6BQNwB6SW//1IMwrh3KWB
-kJtN3X3n57LNXMhqlfil9o3EXXgIvnsG1knPGTZQIy4I5p4FTUcY1Rbpsda2ENW7
-l7+ijrRU
------END CERTIFICATE-----
-
-# Issuer: CN=DST Root CA X3 O=Digital Signature Trust Co.
-# Subject: CN=DST Root CA X3 O=Digital Signature Trust Co.
-# Label: "DST Root CA X3"
-# Serial: 91299735575339953335919266965803778155
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3Or+Dxz9LwwmglSBd49lZRNI+DT69
-ikugdB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXr
-AvHRAosZy5Q6XkjEGB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZz
-R8srzJmwN0jP41ZL9c8PDHIyh8bwRLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5
-JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubSfZGL+T0yjWW06XyxV3bqxbYo
-Ob8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ
------END CERTIFICATE-----
-
-# Issuer: CN=DST ACES CA X6 O=Digital Signature Trust OU=DST ACES
-# Subject: CN=DST ACES CA X6 O=Digital Signature Trust OU=DST ACES
-# Label: "DST ACES CA X6"
-# Serial: 17771143917277623872238992636097467865
-# MD5 Fingerprint: 21:d8:4c:82:2b:99:09:33:a2:eb:14:24:8d:8e:5f:e8
-# SHA1 Fingerprint: 40:54:da:6f:1c:3f:40:74:ac:ed:0f:ec:cd:db:79:d1:53:fb:90:1d
-# SHA256 Fingerprint: 76:7c:95:5a:76:41:2c:89:af:68:8e:90:a1:c7:0f:55:6c:fd:6b:60:25:db:ea:10:41:6d:7e:b6:83:1f:8c:40
------BEGIN CERTIFICATE-----
-MIIECTCCAvGgAwIBAgIQDV6ZCtadt3js2AdWO4YV2TANBgkqhkiG9w0BAQUFADBb
-MQswCQYDVQQGEwJVUzEgMB4GA1UEChMXRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3Qx
-ETAPBgNVBAsTCERTVCBBQ0VTMRcwFQYDVQQDEw5EU1QgQUNFUyBDQSBYNjAeFw0w
-MzExMjAyMTE5NThaFw0xNzExMjAyMTE5NThaMFsxCzAJBgNVBAYTAlVTMSAwHgYD
-VQQKExdEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdDERMA8GA1UECxMIRFNUIEFDRVMx
-FzAVBgNVBAMTDkRTVCBBQ0V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ERTIFICATE-----
-
-# Issuer: CN=SwissSign Gold CA - G2 O=SwissSign AG
-# Subject: CN=SwissSign Gold CA - G2 O=SwissSign AG
-# Label: "SwissSign Gold CA - G2"
-# Serial: 13492815561806991280
-# MD5 Fingerprint: 24:77:d9:a8:91:d1:3b:fa:88:2d:c2:ff:f8:cd:33:93
-# SHA1 Fingerprint: d8:c5:38:8a:b7:30:1b:1b:6e:d4:7a:e6:45:25:3a:6f:9f:1a:27:61
-# SHA256 Fingerprint: 62:dd:0b:e9:b9:f5:0a:16:3e:a0:f8:e7:5c:05:3b:1e:ca:57:ea:55:c8:68:8f:64:7c:68:81:f2:c8:35:7b:95
------BEGIN CERTIFICATE-----
-MIIFujCCA6KgAwIBAgIJALtAHEP1Xk+wMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV
-BAYTAkNIMRUwEwYDVQQKEwxTd2lzc1NpZ24gQUcxHzAdBgNVBAMTFlN3aXNzU2ln
-biBHb2xkIENBIC0gRzIwHhcNMDYxMDI1MDgzMDM1WhcNMzYxMDI1MDgzMDM1WjBF
-MQswCQYDVQQGEwJDSDEVMBMGA1UEChMMU3dpc3NTaWduIEFHMR8wHQYDVQQDExZT
-d2lzc1NpZ24gR29sZCBDQSAtIEcyMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIIC
-CgKCAgEAr+TufoskDhJuqVAtFkQ7kpJcyrhdhJJCEyq8ZVeCQD5XJM1QiyUqt2/8
-76LQwB8CJEoTlo8jE+YoWACjR8cGp4QjK7u9lit/VcyLwVcfDmJlD909Vopz2q5+
-bbqBHH5CjCA12UNNhPqE21Is8w4ndwtrvxEvcnifLtg+5hg3Wipy+dpikJKVyh+c
-6bM8K8vzARO/Ws/BtQpgvd21mWRTuKCWs2/iJneRjOBiEAKfNA+k1ZIzUd6+jbqE
-emA8atufK+ze3gE/bk3lUIbLtK/tREDFylqM2tIrfKjuvqblCqoOpd8FUrdVxyJd
-MmqXl2MT28nbeTZ7hTpKxVKJ+STnnXepgv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ttqtKay20EIhid3
-92qgQmwLOM7XdVAyksLfKzAiSNDVQTglXaTpXZ/GlHXQRf0wl0OPkKsKx4ZzYEpp
-Ld6leNcG2mqeSz53OiATIgHQv2ieY2BrNU0LbbqhPcCT4H8js1WtciVORvnSFu+w
-ZMEBnunKoGqYDs/YYPIvSbjkQuE4NRb0yG5P94FW6LqjviOvrv1vA+ACOzB2+htt
-Qc8Bsem4yWb02ybzOqR08kkkW8mw0FfB+j564ZfJ
------END CERTIFICATE-----
-
-# Issuer: CN=SwissSign Silver CA - G2 O=SwissSign AG
-# Subject: CN=SwissSign Silver CA - G2 O=SwissSign AG
-# Label: "SwissSign Silver CA - G2"
-# Serial: 5700383053117599563
-# MD5 Fingerprint: e0:06:a1:c9:7d:cf:c9:fc:0d:c0:56:75:96:d8:62:13
-# SHA1 Fingerprint: 9b:aa:e5:9f:56:ee:21:cb:43:5a:be:25:93:df:a7:f0:40:d1:1d:cb
-# SHA256 Fingerprint: be:6c:4d:a2:bb:b9:ba:59:b6:f3:93:97:68:37:42:46:c3:c0:05:99:3f:a9:8f:02:0d:1d:ed:be:d4:8a:81:d5
------BEGIN CERTIFICATE-----
-MIIFvTCCA6WgAwIBAgIITxvUL1S7L0swDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UE
-BhMCQ0gxFTATBgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWdu
-IFNpbHZlciBDQSAtIEcyMB4XDTA2MTAyNTA4MzI0NloXDTM2MTAyNTA4MzI0Nlow
-RzELMAkGA1UEBhMCQ0gxFTATBgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMY
-U3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMIICIjANBgkqhkiG9w0BAQEFAAOCAg8A
-MIICCgKCAgEAxPGHf9N4Mfc4yfjDmUO8x/e8N+dOcbpLj6VzHVxumK4DV644N0Mv
-Fz0fyM5oEMF4rhkDKxD6LHmD9ui5aLlV8gREpzn5/AS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WQ
-2K34ArZv02DdQEsixT2tOnqfGhpHkXkzuoLcMmkDlm4fS/Bx/uNncqCxv1yL5PqZ
-IseEuRuNI5c/7SXgz2W79WEE790eslpBIlqhn10s6FvJbakMDHiqYMZWjwFaDGi8
-aRl5xB9+lwW/xekkUV7U1UtT7dkjWjYDZaPBA61BMPNGG4WQr2W11bHkFlt4dR2X
-em1ZqSqPe97Dh4kQmUlzeMg9vVE1dCrV8X5pGyq7O70luJpaPXJhkGaH7gzWTdQR
-dAtq/gsD/KNVV4n+SsuuWxcFyPKNIzFTONItaj+CuY0IavdeQXRuwxF+B6wpYJE/
-OMpXEA29MC/HpeZBoNquBYeaoKRlbEwJDIm6uNO5wJOKMPqN5ZprFQFOZ6raYlY+
-hAhm0sQ2fac+EPyI4NSA5QC9qvNOBqN6avlicuMJT+ubDgEj8Z+7fNzcbBGXJbLy
-tGMU0gYqZ4yD9c7qB9iaah7s5Aq7KkzrCWA5zspi2C5u
------END CERTIFICATE-----
-
-# Issuer: CN=GeoTrust Primary Certification Authority O=GeoTrust Inc.
-# Subject: CN=GeoTrust Primary Certification Authority O=GeoTrust Inc.
-# Label: "GeoTrust Primary Certification Authority"
-# Serial: 32798226551256963324313806436981982369
-# MD5 Fingerprint: 02:26:c3:01:5e:08:30:37:43:a9:d0:7d:cf:37:e6:bf
-# SHA1 Fingerprint: 32:3c:11:8e:1b:f7:b8:b6:52:54:e2:e2:10:0d:d6:02:90:37:f0:96
-# SHA256 Fingerprint: 37:d5:10:06:c5:12:ea:ab:62:64:21:f1:ec:8c:92:01:3f:c5:f8:2a:e9:8e:e5:33:eb:46:19:b8:de:b4:d0:6c
------BEGIN CERTIFICATE-----
-MIIDfDCCAmSgAwIBAgIQGKy1av1pthU6Y2yv2vrEoTANBgkqhkiG9w0BAQUFADBY
-MQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjExMC8GA1UEAxMo
-R2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY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vk=
------END CERTIFICATE-----
-
-# Issuer: CN=thawte Primary Root CA O=thawte, Inc. OU=Certification Services Division/(c) 2006 thawte, Inc. - For authorized use only
-# Subject: CN=thawte Primary Root CA O=thawte, Inc. OU=Certification Services Division/(c) 2006 thawte, Inc. - For authorized use only
-# Label: "thawte Primary Root CA"
-# Serial: 69529181992039203566298953787712940909
-# MD5 Fingerprint: 8c:ca:dc:0b:22:ce:f5:be:72:ac:41:1a:11:a8:d8:12
-# SHA1 Fingerprint: 91:c6:d6:ee:3e:8a:c8:63:84:e5:48:c2:99:29:5c:75:6c:81:7b:81
-# SHA256 Fingerprint: 8d:72:2f:81:a9:c1:13:c0:79:1d:f1:36:a2:96:6d:b2:6c:95:0a:97:1d:b4:6b:41:99:f4:ea:54:b7:8b:fb:9f
------BEGIN CERTIFICATE-----
-MIIEIDCCAwigAwIBAgIQNE7VVyDV7exJ9C/ON9srbTANBgkqhkiG9w0BAQUFADCB
-qTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMf
-Q2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIw
-MDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxHzAdBgNV
-BAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwHhcNMDYxMTE3MDAwMDAwWhcNMzYw
-NzE2MjM1OTU5WjCBqTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5j
-LjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYG
-A1UECxMvKGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl
-IG9ubHkxHzAdBgNVBAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwggEiMA0GCSqG
-SIb3DQEBAQUAA4IBDwAwggEKAoIBAQCsoPD7gFnUnMekz52hWXMJEEUMDSxuaPFs
-W0hoSVk3/AszGcJ3f8wQLZU0HObrTQmnHNK4yZc2AreJ1CRfBsDMRJSUjQJib+ta
-3RGNKJpchJAQeg29dGYvajig4tVUROsdB58Hum/u6f1OCyn1PoSgAfGcq/gcfomk
-6KHYcWUNo1F77rzSImANuVud37r8UVsLr5iy6S7pBOhih94ryNdOwUxkHt3Ph1i6
-Sk/KaAcdHJ1KxtUvkcx8cXIcxcBn6zL9yZJclNqFwJu/U30rCfSMnZEfl2pSy94J
-NqR32HuHUETVPm4pafs5SSYeCaWAe0At6+gnhcn+Yf1+5nyXHdWdAgMBAAGjQjBA
-MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBR7W0XP
-r87Lev0xkhpqtvNG61dIUDANBgkqhkiG9w0BAQUFAAOCAQEAeRHAS7ORtvzw6WfU
-DW5FvlXok9LOAz/t2iWwHVfLHjp2oEzsUHboZHIMpKnxuIvW1oeEuzLlQRHAd9mz
-YJ3rG9XRbkREqaYB7FViHXe4XI5ISXycO1cRrK1zN44veFyQaEfZYGDm/Ac9IiAX
-xPcW6cTYcvnIc3zfFi8VqT79aie2oetaupgf1eNNZAqdE8hhuvU5HIe6uL17In/2
-/qxAeeWsEG89jxt5dovEN7MhGITlNgDrYyCZuen+MwS7QcjBAvlEYyCegc5C09Y/
-LHbTY5xZ3Y+m4Q6gLkH3LpVHz7z9M/P2C2F+fpErgUfCJzDupxBdN49cOSvkBPB7
-jVaMaA==
------END CERTIFICATE-----
-
-# Issuer: CN=VeriSign Class 3 Public Primary Certification Authority - G5 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 2006 VeriSign, Inc. - For authorized use only
-# Subject: CN=VeriSign Class 3 Public Primary Certification Authority - G5 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 2006 VeriSign, Inc. - For authorized use only
-# Label: "VeriSign Class 3 Public Primary Certification Authority - G5"
-# Serial: 33037644167568058970164719475676101450
-# MD5 Fingerprint: cb:17:e4:31:67:3e:e2:09:fe:45:57:93:f3:0a:fa:1c
-# SHA1 Fingerprint: 4e:b6:d5:78:49:9b:1c:cf:5f:58:1e:ad:56:be:3d:9b:67:44:a5:e5
-# SHA256 Fingerprint: 9a:cf:ab:7e:43:c8:d8:80:d0:6b:26:2a:94:de:ee:e4:b4:65:99:89:c3:d0:ca:f1:9b:af:64:05:e4:1a:b7:df
------BEGIN CERTIFICATE-----
-MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCB
-yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL
-ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJp
-U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxW
-ZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0
-aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCByjEL
-MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZW
-ZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2ln
-biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJp
-U2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9y
-aXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvJAgIKXo1
-nmAMqudLO07cfLw8RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKzj/i5Vbex
-t0uz/o9+B1fs70PbZmIVYc9gDaTY3vjgw2IIPVQT60nKWVSFJuUrjxuf6/WhkcIz
-SdhDY2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQG
-BO+QueQA5N06tRn/Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+
-rCpSx4/VBEnkjWNHiDxpg8v+R70rfk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/
-NIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8E
-BAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEwHzAH
-BgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy
-aXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKv
-MzEzMA0GCSqGSIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzE
-p6B4Eq1iDkVwZMXnl2YtmAl+X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y
-5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKEKQsTb47bDN0lAtukixlE0kF6BWlK
-WE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiCKm0oHw0LxOXnGiYZ
-4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vEZV8N
-hnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq
------END CERTIFICATE-----
-
-# Issuer: CN=SecureTrust CA O=SecureTrust Corporation
-# Subject: CN=SecureTrust CA O=SecureTrust Corporation
-# Label: "SecureTrust CA"
-# Serial: 17199774589125277788362757014266862032
-# MD5 Fingerprint: dc:32:c3:a7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R0fBC0wKzApoCeg
-JYYjaHR0cDovL2NybC5zZWN1cmV0cnVzdC5jb20vU1RDQS5jcmwwEAYJKwYBBAGC
-NxUBBAMCAQAwDQYJKoZIhvcNAQEFBQADggEBADDtT0rhWDpSclu1pqNlGKa7UTt3
-6Z3q059c4EVlew3KW+JwULKUBRSuSceNQQcSc5R+DCMh/bwQf2AQWnL1mA6s7Ll/
-3XpvXdMc9P+IBWlCqQVxyLesJugutIxq/3HcuLHfmbx8IVQr5Fiiu1cprp6poxkm
-D5kuCLDv/WnPmRoJjeOnnyvJNjR7JLN4TJUXpAYmHrZkUjZfYGfZnMUFdAvnZyPS
-CPyI6a6Lf+Ew9Dd+/cYy2i2eRDAwbO4H3tI0/NL/QPZL9GZGBlSm8jIKYyYwa5vR
-3ItHuuG51WLQoqD0ZwV4KWMabwTW+MZMo5qxN7SN5ShLHZ4swrhovO0C7jE=
------END CERTIFICATE-----
-
-# Issuer: CN=Secure Global CA O=SecureTrust Corporation
-# Subject: CN=Secure Global CA O=SecureTrust Corporation
-# Label: "Secure Global CA"
-# Serial: 9751836167731051554232119481456978597
-# MD5 Fingerprint: cf:f4:27:0d:d4:ed:dc:65:16:49:6d:3d:da:bf:6e:de
-# SHA1 Fingerprint: 3a:44:73:5a:e5:81:90:1f:24:86:61:46:1e:3b:9c:c4:5f:f5:3a:1b
-# SHA256 Fingerprint: 42:00:f5:04:3a:c8:59:0e:bb:52:7d:20:9e:d1:50:30:29:fb:cb:d4:1c:a1:b5:06:ec:27:f1:5a:de:7d:ac:69
------BEGIN CERTIFICATE-----
-MIIDvDCCAqSgAwIBAgIQB1YipOjUiolN9BPI8PjqpTANBgkqhkiG9w0BAQUFADBK
-MQswCQYDVQQGEwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24x
-GTAXBgNVBAMTEFNlY3VyZSBHbG9iYWwgQ0EwHhcNMDYxMTA3MTk0MjI4WhcNMjkx
-MjMxMTk1MjA2WjBKMQswCQYD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vDA1VZDRIuJK58bRQKfJPIx/abKwfROHdI3hRW8cW
------END CERTIFICATE-----
-
-# Issuer: CN=COMODO Certification Authority O=COMODO CA Limited
-# Subject: CN=COMODO Certification Authority O=COMODO CA Limited
-# Label: "COMODO Certification Authority"
-# Serial: 104350513648249232941998508985834464573
-# MD5 Fingerprint: 5c:48:dc:f7:42:72:ec:56:94:6d:1c:cc:71:35:80:75
-# SHA1 Fingerprint: 66:31:bf:9e:f7:4f:9e:b6:c9:d5:a6:0c:ba:6a:be:d1:f7:bd:ef:7b
-# SHA256 Fingerprint: 0c:2c:d6:3d:f7:80:6f:a3:99:ed:e8:09:11:6b:57:5b:f8:79:89:f0:65:18:f9:80:8c:86:05:03:17:8b:af:66
------BEGIN CERTIFICATE-----
-MIIEHTCCAwWgAwIBAgIQToEtioJl4AsC7j41AkblPTANBgkqhkiG9w0BAQUFADCB
-gTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G
-A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxJzAlBgNV
-BAMTHkNPTU9ETyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjEyMDEwMDAw
-MDBaFw0yOTEyMzEyMzU5NTlaMIGBMQswCQYDVQQGEwJHQjEbMBkGA1UECBMSR3Jl
-YXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRowGAYDVQQKExFDT01P
-RE8gQ0EgTGltaXRlZDEnMCUGA1UEAxMeQ09NT0RPIENlcnRpZmljYXRpb24gQXV0
-aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0ECLi3LjkRv3
-UcEbVASY06m/weaKXTuH+7uIzg3jLz8GlvCiKVCZrts7oVewdFFxze1CkU1B/qnI
-2GqGd0S7WWaXUF601CxwRM/aN5VCaTwwxHGzUvAhTaHYujl8HJ6jJJ3ygxaYqhZ8
-Q5sVW7euNJH+1GImGEaaP+vB+fGQV+useg2L23IwambV4EajcNxo2f8ESIl33rXp
-+2dtQem8Ob0y2WIC8bGoPW43nOIv4tOiJovGuFVDiOEjPqXSJDlqR6sA1KGzqSX+
-DT+nHbrTUcELpNqsOO9VUCQFZUaTNE8tja3G1CEZ0o7KBWFxB3NH5YoZEr0ETc5O
-nKVIrLsm9wIDAQABo4GOMIGLMB0GA1UdDgQWBBQLWOWLxkwVN6RAqTCpIb5HNlpW
-/zAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zBJBgNVHR8EQjBAMD6g
-PKA6hjhodHRwOi8vY3JsLmNvbW9kb2NhLmNvbS9DT01PRE9DZXJ0aWZpY2F0aW9u
-QXV0aG9yaXR5LmNybDANBgkqhkiG9w0BAQUFAAOCAQEAPpiem/Yb6dc5t3iuHXIY
-SdOH5EOC6z/JqvWote9VfCFSZfnVDeFs9D6Mk3ORLgLETgdxb8CPOGEIqB6BCsAv
-IC9Bi5HcSEW88cbeunZrM8gALTFGTO3nnc+IlP8zwFboJIYmuNg4ON8qa90SzMc/
-RxdMosIGlgnW2/4/PEZB31jiVg88O8EckzXZOFKs7sjsLjBOlDW0JB9LeGna8gI4
-zJVSk/BwJVmcIGfE7vmLV2H0knZ9P4SNVbfo5azV8fUZVqZa+5Acr5Pr5RzUZ5dd
-BA6+C4OmF4O5MBKgxTMVBbkN+8cFduPYSo38NBejxiEovjBFMR7HeL5YYTisO+IB
-ZQ==
------END CERTIFICATE-----
-
-# Issuer: CN=Network Solutions Certificate Authority O=Network Solutions L.L.C.
-# Subject: CN=Network Solutions Certificate Authority O=Network Solutions L.L.C.
-# Label: "Network Solutions Certificate Authority"
-# Serial: 116697915152937497490437556386812487904
-# MD5 Fingerprint: d3:f3:a6:16:c0:fa:6b:1d:59:b1:2d:96:4d:0e:11:2e
-# SHA1 Fingerprint: 74:f8:a3:c3:ef:e7:b3:90:06:4b:83:90:3c:21:64:60:20:e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
-bmV0c29sc3NsLmNvbS9OZXR3b3JrU29sdXRpb25zQ2VydGlmaWNhdGVBdXRob3Jp
-dHkuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQC7rkvnt1frf6ott3NHhWrB5KUd5Oc8
-6fRZZXe1eltajSU24HqXLjjAV2CDmAaDn7l2em5Q4LqILPxFzBiwmZVRDuwduIj/
-h1AcgsLj4DKAv6ALR8jDMe+ZZzKATxcheQxpXN5eNK4CtSbqUN9/GGUsyfJj4akH
-/nxxH2szJGoeBfcFaMBqEssuXmHLrijTfsK0ZpEmXzwuJF/LWA/rKOyvEZbz3Htv
-wKeI8lN3s2Berq4o2jUsbzRF0ybh3uxbTydrFny9RAQYgrOJeRcQcT16ohZO9QHN
-pGxlaKFJdlxDydi8NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey
------END CERTIFICATE-----
-
-# Issuer: CN=COMODO ECC Certification Authority O=COMODO CA Limited
-# Subject: CN=COMODO ECC Certification Authority O=COMODO CA Limited
-# Label: "COMODO ECC Certification Authority"
-# Serial: 41578283867086692638256921589707938090
-# MD5 Fingerprint: 7c:62:ff:74:9d:31:53:5e:68:4a:d5:78:aa:1e:bf:23
-# SHA1 Fingerprint: 9f:74:4e:9f:2b:4d:ba:ec:0f:31:2c:50:b6:56:3b:8e:2d:93:c3:11
-# SHA256 Fingerprint: 17:93:92:7a:06:14:54:97:89:ad:ce:2f:8f:34:f7:f0:b6:6d:0f:3a:e3:a3:b8:4d:21:ec:15:db:ba:4f:ad:c7
------BEGIN CERTIFICATE-----
-MIICiTCCAg+gAwIBAgIQH0evqmIAcFBUTAGem2OZKjAKBggqhkjOPQQDAzCBhTEL
-MAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE
-BxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMT
-IkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDgwMzA2MDAw
-MDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdy
-ZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09N
-T0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlv
-biBBdXRob3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQDR3svdcmCFYX7deSR
-FtSrYpn1PlILBs5BAH+X4QokPB0BBO490o0JlwzgdeT6+3eKKvUDYEs2ixYjFq0J
-cfRK9ChQtP6IHG4/bC8vCVlbpVsLM5niwz2J+Wos77LTBumjQjBAMB0GA1UdDgQW
-BBR1cacZSBm8nZ3qQUfflMRId5nTeTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/
-BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjEA7wNbeqy3eApyt4jf/7VGFAkK+qDm
-fQjGGoe9GKhzvSbKYAydzpmfz1wPMOG+FDHqAjAU9JM8SaczepBGR7NjfRObTrdv
-GDeAU/7dIOA1mjbRxwG55tzd8/8dLDoWV9mSOdY=
------END CERTIFICATE-----
-
-# Issuer: O=SECOM Trust Systems CO.,LTD. OU=Security Communication EV RootCA1
-# Subject: O=SECOM Trust Systems CO.,LTD. OU=Security Communication EV RootCA1
-# Label: "Security Communication EV RootCA1"
-# Serial: 0
-# MD5 Fingerprint: 22:2d:a6:01:ea:7c:0a:f7:f0:6c:56:43:3f:77:76:d3
-# SHA1 Fingerprint: fe:b8:c4:32:dc:f9:76:9a:ce:ae:3d:d8:90:8f:fd:28:86:65:64:7d
-# SHA256 Fingerprint: a2:2d:ba:68:1e:97:37:6e:2d:39:7d:72:8a:ae:3a:9b:62:96:b9:fd:ba:60:bc:2e:11:f6:47:f2:c6:75:fb:37
------BEGIN CERTIFICATE-----
-MIIDfTCCA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QsNY6llsf9g/BYxnnWmHyojf6GPgcWkuF75x3sM3Z+
-Qi5KhfmRiWiEA4Glm5q+4zfFVKtWOxgtQaQM+ELbmaDgcm+7XeEWT1MKZPlO9L9O
-VL14bIjqv5wTJMJwaaJ/D8g8rQjJsJhAoyrniIPtd490
------END CERTIFICATE-----
-
-# Issuer: CN=OISTE WISeKey Global Root GA CA O=WISeKey OU=Copyright (c) 2005/OISTE Foundation Endorsed
-# Subject: CN=OISTE WISeKey Global Root GA CA O=WISeKey OU=Copyright (c) 2005/OISTE Foundation Endorsed
-# Label: "OISTE WISeKey Global Root GA CA"
-# Serial: 86718877871133159090080555911823548314
-# MD5 Fingerprint: bc:6c:51:33:a7:e9:d3:66:63:54:15:72:1b:21:92:93
-# SHA1 Fingerprint: 59:22:a1:e1:5a:ea:16:35:21:f8:98:39:6a:46:46:b0:44:1b:0f:a9
-# SHA256 Fingerprint: 41:c9:23:86:6a:b4:ca:d6:b7:ad:57:80:81:58:2e:02:07:97:a6:cb:df:4f:ff:78:ce:83:96:b3:89:37:d7:f5
------BEGIN CERTIFICATE-----
-MIID8TCCAtmgAwIBAgIQQT1yx/RrH4FDffHSKFTfmjANBgkqhkiG9w0BAQUFADCB
-ijELMAkGA1UEBhMCQ0gxEDAOBgNVBAoTB1dJU2VLZXkxGzAZBgNVBAsTEkNvcHly
-aWdodCAoYykgMjAwNTEiMCAGA1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNl
-ZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBHbG9iYWwgUm9vdCBHQSBDQTAeFw0w
-NTEyMTExNjAzNDRaFw0zNzEyMTExNjA5NTFaMIGKMQswCQYDVQQGEwJDSDEQMA4G
-A1UEChMHV0lTZUtleTEbMBkGA1UECxMSQ29weXJpZ2h0IChjKSAyMDA1MSIwIAYD
-VQQLExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBX
-SVNlS2V5IEdsb2JhbCBSb290IEdBIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A
-MIIBCgKCAQEAy0+zAJs9Nt350UlqaxBJH+zYK7LG+DKBKUOVTJoZIyEVRd7jyBxR
-VVuuk+g3/ytr6dTqvirdqFEr12bDYVxgAsj1znJ7O7jyTmUIms2kahnBAbtzptf2
-w93NvKSLtZlhuAGio9RN1AU9ka34tAhxZK9w8RxrfvbDd50kc3vkDIzh2TbhmYsF
-mQvtRTEJysIA2/dyoJaqlYfQjse2YXMNdmaM3Bu0Y6Kff5MTMPGhJ9vZ/yxViJGg
-4E8HsChWjBgbl0SOid3gF27nKu+POQoxhILYQBRJLnpB5Kf+42TMwVlxSywhp1t9
-4B3RLoGbw9ho972WG6xwsRYUC9tguSYBBQIDAQABo1EwTzALBgNVHQ8EBAMCAYYw
-DwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUswN+rja8sHnR3JQmthG+IbJphpQw
-EAYJKwYBBAGCNxUBBAMCAQAwDQYJKoZIhvcNAQEFBQADggEBAEuh/wuHbrP5wUOx
-SPMowB0uyQlB+pQAHKSkq0lPjz0e701vvbyk9vImMMkQyh2I+3QZH4VFvbBsUfk2
-ftv1TDI6QU9bR8/oCy22xBmddMVHxjtqD6wU2zz0c5ypBd8A3HR4+vg1YFkCExh8
-vPtNsCBtQ7tgMHpnM1zFmdH4LTlSc/uMqpclXHLZCB6rTjzjgTGfA6b7wP4piFXa
-hNVQA7bihKOmNqoROgHhGEvWRGizPflTdISzRpFGlgC3gCy24eMQ4tui5yiPAZZi
-Fj4A4xylNoEYokxSdsARo27mHbrjWr42U8U+dY+GaSlYU7Wcu2+fXMUY7N0v4ZjJ
-/L7fCg0=
------END CERTIFICATE-----
-
-# Issuer: CN=Certigna O=Dhimyotis
-# Subject: CN=Certigna O=Dhimyotis
-# Label: "Certigna"
-# Serial: 18364802974209362175
-# MD5 Fingerprint: ab:57:a6:5b:7d:42:82:19:b5:d8:58:26:28:5e:fd:ff
-# SHA1 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H/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIABzANBgkqhkiG
-9w0BAQUFAAOCAQEAhQMeknH2Qq/ho2Ge6/PAD/Kl1NqV5ta+aDY9fm4fTIrv0Q8h
-bV6lUmPOEvjvKtpv6zf+EwLHyzs+ImvaYS5/1HI93TDhHkxAGYwP15zRgzB7mFnc
-fca5DClMoTOi62c6ZYTTluLtdkVwj7Ur3vkj1kluPBS1xp81HlDQwY9qcEQCYsuu
-HWhBp6pX6FOqB9IG9tUUBguRA3UsbHK1YZWaDYu5Def131TN3ubY1gkIl2PlwS6w
-t0QmwCbAr1UwnjvVNioZBPRcHv/PLLf/0P2HQBHVESO7SMAhqaQoLf0V+LBOK/Qw
-WyH8EZE0vkHve52Xdf+XlcCWWC/qu0bXu+TZLg==
------END CERTIFICATE-----
-
-# Issuer: CN=Deutsche Telekom Root CA 2 O=Deutsche Telekom AG OU=T-TeleSec Trust Center
-# Subject: CN=Deutsche Telekom Root CA 2 O=Deutsche Telekom AG OU=T-TeleSec Trust Center
-# Label: "Deutsche Telekom Root CA 2"
-# Serial: 38
-# MD5 Fingerprint: 74:01:4a:91:b1:08:c4:58:ce:47:cd:f0:dd:11:53:08
-# SHA1 Fingerprint: 85:a4:08:c0:9c:19:3e:5d:51:58:7d:cd:d6:13:30:fd:8c:de:37:bf
-# SHA256 Fingerprint: b6:19:1a:50:d0:c3:97:7f:7d:a9:9b:cd:aa:c8:6a:22:7d:ae:b9:67:9e:c7:0b:a3:b0:c9:d9:22:71:c1:70:d3
------BEGIN CERTIFICATE-----
-MIIDnzCCAoegAwIBAgIBJjANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJERTEc
-MBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxlU2Vj
-IFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290IENB
-IDIwHhcNOTkwNzA5MTIxMTAwWhcNMTkwNzA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issuer: CN=Cybertrust Global Root O=Cybertrust, Inc
-# Subject: CN=Cybertrust Global Root O=Cybertrust, Inc
-# Label: "Cybertrust Global Root"
-# Serial: 4835703278459682877484360
-# MD5 Fingerprint: 72:e4:4a:87:e3:69:40:80:77:ea:bc:e3:f4:ff:f0:e1
-# SHA1 Fingerprint: 5f:43:e5:b1:bf:f8:78:8c:ac:1c:c7:ca:4a:9a:c6:22:2b:cc:34:c6
-# SHA256 Fingerprint: 96:0a:df:00:63:e9:63:56:75:0c:29:65:dd:0a:08:67:da:0b:9c:bd:6e:77:71:4a:ea:fb:23:49:ab:39:3d:a3
------BEGIN CERTIFICATE-----
-MIIDoTCCAomgAwIBAgILBAAAAAABD4WqLUgwDQYJKoZIhvcNAQEFBQAwOzEYMBYG
-A1UEChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2Jh
-bCBSb290MB4XDTA2MTIxNTA4MDAwMFoXDTIxMTIxNTA4MDAwMFowOzEYMBYGA1UE
-ChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2JhbCBS
-b290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA+Mi8vRRQZhP/8NN5
-7CPytxrHjoXxEnOmGaoQ25yiZXRadz5RfVb23CO21O1fWLE3TdVJDm71aofW0ozS
-J8bi/zafmGWgE07GKmSb1ZASzxQG9Dvj1Ci+6A74q05IlG2OlTEQXO2iLb3VOm2y
-HLtgwEZLAfVJrn5GitB0jaEMAs7u/OePuGtm839EAL9mJRQr3RAwHQeWP032a7iP
-t3sMpTjr3kfb1V05/Iin89cqdPHoWqI7n1C6poxFNcJQZZXcY4Lv3b93TZxiyWNz
-FtApD0mpSPCzqrdsxacwOUBdrsTiXSZT8M4cIwhhqJQZugRiQOwfOHB3EgZxpzAY
-XSUnpQIDAQABo4GlMIGiMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/
-MB0GA1UdDgQWBBS2CHsNesysIEyGVjJez6tuhS1wVzA/BgNVHR8EODA2MDSgMqAw
-hi5odHRwOi8vd3d3Mi5wdWJsaWMtdHJ1c3QuY29tL2NybC9jdC9jdHJvb3QuY3Js
-MB8GA1UdIwQYMBaAFLYIew16zKwgTIZWMl7Pq26FLXBXMA0GCSqGSIb3DQEBBQUA
-A4IBAQBW7wojoFROlZfJ+InaRcHUowAl9B8Tq7ejhVhpwjCt2BWKLePJzYFa+HMj
-Wqd8BfP9IjsO0QbE2zZMcwSO5bAi5MXzLqXZI+O4Tkogp24CJJ8iYGd7ix1yCcUx
-XOl5n4BHPa2hCwcUPUf/A2kaDAtE52Mlp3+yybh2hO0j9n0Hq0V+09+zv+mKts2o
-omcrUtW3ZfA5TGOgkXmTUg9U3YO7n9GPp1Nzw8v/MOx8BLjYRB+TX3EJIrduPuoc
-A06dGiBh+4E37F78CkWr1+cXVdCg6mCbpvbjjFspwgZgFJ0tl0ypkxWdYcQBX0jW
-WL1WMRJOEcgh4LMRkWXbtKaIOM5V
------END CERTIFICATE-----
-
-# Issuer: O=Chunghwa Telecom Co., Ltd. OU=ePKI Root Certification Authority
-# Subject: O=Chunghwa Telecom Co., Ltd. OU=ePKI Root Certification Authority
-# Label: "ePKI Root Certification Authority"
-# Serial: 28956088682735189655030529057352760477
-# MD5 Fingerprint: 1b:2e:00:ca:26:06:90:3d:ad:fe:6f:15:68:d3:6b:b3
-# SHA1 Fingerprint: 67:65:0d:f1:7e:8e:7e:5b:82:40:a4:f4:56:4b:cf:e2:3d:69:c6:f0
-# SHA256 Fingerprint: c0:a6:f4:dc:63:a2:4b:fd:cf:54:ef:2a:6a:08:2a:0a:72:de:35:80:3e:2f:f5:ff:52:7a:e5:d8:72:06:df:d5
------BEGIN CERTIFICATE-----
-MIIFsDCCA5igAwIBAgIQFci9ZUdcr7iXAF7kBtK8nTANBgkqhkiG9w0BAQUFADBe
-MQswCQYDVQQGEwJUVzEjMCEGA1UECg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GSJglFwFU5Lnc/QkqiMAwGA1UdEwQF
-MAMBAf8wOQYEZyoHAAQxMC8wLQIBADAJBgUrDgMCGgUAMAcGBWcqAwAABBRFsMLH
-ClZ87lt4DJX5GFPBphzYEDANBgkqhkiG9w0BAQUFAAOCAgEACbODU1kBPpVJufGB
-uvl2ICO1J2B01GqZNF5sAFPZn/KmsSQHRGoqxqWOeBLoR9lYGxMqXnmbnwoqZ6Yl
-PwZpVnPDimZI+ymBV3QGypzqKOg4ZyYr8dW1P2WT+DZdjo2NQCCHGervJ8A9tDkP
-JXtoUHRVnAxZfVo9QZQlUgjgRywVMRnVvwdVxrsStZf0X4OFunHB2WyBEXYKCrC/
-gpf36j36+uwtqSiUO1bd0lEursC9CBWMd1I0ltabrNMdjmEPNXubrjlpC2JgQCA2
-j6/7Nu4tCEoduL+bXPjqpRugc6bY+G7gMwRfaKonh+3ZwZCc7b3jajWvY9+rGNm6
-5ulK6lCKD2GTHuItGeIwlDWSXQ62B68ZgI9HkFFLLk3dheLSClIKF5r8GrBQAuUB
-o2M3IUxExJtRmREOc5wGj1QupyheRDmHVi03vYVElOEMSyycw5KFNGHLD7ibSkNS
-/jQ6fbjpKdx2qcgw+BRxgMYeNkh0IkFch4LoGHGLQYlE535YW6i4jRPpp2zDR+2z
-Gp1iro2C6pSe3VkQw63d4k3jMdXH7OjysP6SHhYKGvzZ8/gntsm+HbRsZJB/9OTE
-W9c3rkIO3aQab3yIVMUWbuF6aC74Or8NpDyJO3inTmODBCEIZ43ygknQW/2xzQ+D
-hNQ+IIX3Sj0rnP0qCglN6oH4EZw=
------END CERTIFICATE-----
-
-# Issuer: CN=T\xdcB\u0130TAK UEKAE K\xf6k Sertifika Hizmet Sa\u011flay\u0131c\u0131s\u0131 - S\xfcr\xfcm 3 O=T\xfcrkiye Bilimsel ve Teknolojik Ara\u015ft\u0131rma Kurumu - T\xdcB\u0130TAK OU=Ulusal Elektronik ve Kriptoloji Ara\u015ft\u0131rma Enstit\xfcs\xfc - UEKAE/Kamu Sertifikasyon Merkezi
-# Subject: CN=T\xdcB\u0130TAK UEKAE K\xf6k Sertifika Hizmet Sa\u011flay\u0131c\u0131s\u0131 - S\xfcr\xfcm 3 O=T\xfcrkiye Bilimsel ve Teknolojik Ara\u015ft\u0131rma Kurumu - T\xdcB\u0130TAK OU=Ulusal Elektronik ve Kriptoloji Ara\u015ft\u0131rma Enstit\xfcs\xfc - UEKAE/Kamu Sertifikasyon Merkezi
-# Label: "T\xc3\x9c\x42\xC4\xB0TAK UEKAE K\xC3\xB6k Sertifika Hizmet Sa\xC4\x9Flay\xc4\xb1\x63\xc4\xb1s\xc4\xb1 - S\xC3\xBCr\xC3\xBCm 3"
-# Serial: 17
-# MD5 Fingerprint: ed:41:f5:8c:50:c5:2b:9c:73:e6:ee:6c:eb:c2:a8:26
-# SHA1 Fingerprint: 1b:4b:39:61:26:27:6b:64:91:a2:68:6d:d7:02:43:21:2d:1f:1d:96
-# SHA256 Fingerprint: e4:c7:34:30:d7:a5:b5:09:25:df:43:37:0a:0d:21:6e:9a:79:b9:d6:db:83:73:a0:c6:9e:b1:cc:31:c7:c5:2a
------BEGIN CERTIFICATE-----
-MIIFFzCCA/+gAwIBAgIBETANBgkqhkiG9w0BAQUFADCCASsxCzAJBgNVBAYTAlRS
-MRgwFgYDVQQHDA9HZWJ6ZSAtIEtvY2FlbGkxRzBFBgNVBAoMPlTDvHJraXllIEJp
-bGltc2VsIHZlIFRla25vbG9qaWsgQXJhxZ90xLFybWEgS3VydW11IC0gVMOcQsSw
-VEFLMUgwRgYDVQQLDD9VbHVzYWwgRWxla3Ryb25payB2ZSBLcmlwdG9sb2ppIEFy
-YcWfdMSxcm1hIEVuc3RpdMO8c8O8IC0gVUVLQUUxIzAhBgNVBAsMGkthbXUgU2Vy
-dGlmaWthc3lvbiBNZXJrZXppMUowSAYDVQQDDEFUw5xCxLBUQUsgVUVLQUUgS8O2
-ayBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEs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krGG2AA1nJrvhY0D7t
-wyOfaTyGOBye79oneNGEN3GKPEs5z35FBtYt2IpNeBLWrcLTy9LQQfMmNkqblWwM
-7uXRQydmwYj3erMgbOqwaSvHIOgMA8RBBZniP+Rr+KCGgceExh/VS4ESshYhLBOh
-gLJeDEoTniDYYkCrkOpkSi+sDQESeUWoL4cZaMjihccwsnX5OD+ywJO0a+IDRM5n
-oN+J1q2MdqMTw5RhK2vZbMEHCiIHhWyFJEapvj+LeISCfiQMnf2BN+MlqO02TpUs
-yZyQ2uypQjyttgI=
------END CERTIFICATE-----
-
-# Issuer: O=certSIGN OU=certSIGN ROOT CA
-# Subject: O=certSIGN OU=certSIGN ROOT CA
-# Label: "certSIGN ROOT CA"
-# Serial: 35210227249154
-# MD5 Fingerprint: 18:98:c0:d6:e9:3a:fc:f9:b0:f5:0c:f7:4b:01:44:17
-# SHA1 Fingerprint: fa:b7:ee:36:97:26:62:fb:2d:b0:2a:f6:bf:03:fd:e8:7c:4b:2f:9b
-# SHA256 Fingerprint: ea:a9:62:c4:fa:4a:6b:af:eb:e4:15:19:6d:35:1c:cd:88:8d:4f:53:f3:fa:8a:e6:d7:c4:66:a9:4e:60:42:bb
------BEGIN CERTIFICATE-----
-MIIDODCCAiCgAwIBAgIGIAYFFnACMA0GCSqGSIb3DQEBBQUAMDsxCzAJBgNVBAYT
-AlJPMREwDwYDVQQKEwhjZXJ0U0lHTjEZMBcGA1UECxMQY2VydFNJR04gUk9PVCBD
-QTAeFw0wNjA3MDQxNzIwMDRaFw0zMTA3MDQxNzIwMDRaMDsxCzAJBgNVBAYTAlJP
-MREwDwYDVQQKEwhjZXJ0U0lHTjEZMBcGA1UECxMQY2VydFNJR04gUk9PVCBDQTCC
-ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALczuX7IJUqOtdu0KBuqV5Do
-0SLTZLrTk+jUrIZhQGpgV2hUhE28alQCBf/fm5oqrl0Hj0rDKH/v+yv6efHHrfAQ
-UySQi2bJqIirr1qjAOm+ukbuW3N7LBeCgV5iLKECZbO9xSsAfsT8AzNXDe3i+s5d
-RdY4zTW2ssHQnIFKquSyAVwdj1+ZxLGt24gh65AIgoDzMKND5pCCrlUoSe1b16kQ
-OA7+j0xbm0bqQfWwCHTD0IgztnzXdN/chNFDDnU5oSVAKOp4yw4sLjmdjItuFhwv
-JoIQ4uNllAoEwF73XVv4EOLQunpL+943AAAaWyjj0pxzPjKHmKHJUS/X3qwzs08C
-AwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAcYwHQYDVR0O
-BBYEFOCMm9slSbPxfIbWskKHC9BroNnkMA0GCSqGSIb3DQEBBQUAA4IBAQA+0hyJ
-LjX8+HXd5n9liPRyTMks1zJO890ZeUe9jjtbkw9QSSQTaxQGcu8J06Gh40CEyecY
-MnQ8SG4Pn0vU9x7Tk4ZkVJdjclDVVc/6IJMCopvDI5NOFlV2oHB5bc0hH88vLbwZ
-44gx+FkagQnIl6Z0x2DEW8xXjrJ1/RsCCdtZb3KTafcxQdaIOL+Hsr0Wefmq5L6I
-Jd1hJyMctTEHBDa0GpC9oHRxUIltvBTjD4au8as+x6AJzKNI0eDbZOeStc+vckNw
-i/nDhDwTqn6Sm1dTk/pwwpEOMfmbZ13pljheX7NzTogVZ96edhBiIL5VaZVDADlN
-9u6wWk5JRFRYX0KD
------END CERTIFICATE-----
-
-# Issuer: CN=GeoTrust Primary Certification Authority - G3 O=GeoTrust Inc. OU=(c) 2008 GeoTrust Inc. - For authorized use only
-# Subject: CN=GeoTrust Primary Certification Authority - G3 O=GeoTrust Inc. OU=(c) 2008 GeoTrust Inc. - For authorized use only
-# Label: "GeoTrust Primary Certification Authority - G3"
-# Serial: 28809105769928564313984085209975885599
-# MD5 Fingerprint: b5:e8:34:36:c9:10:44:58:48:70:6d:2e:83:d4:b8:05
-# SHA1 Fingerprint: 03:9e:ed:b8:0b:e7:a0:3c:69:53:89:3b:20:d2:d9:32:3a:4c:2a:fd
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QH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYw
-HQYDVR0OBBYEFMR5yo6hTgMdHNxr2zFblD4/MH8tMA0GCSqGSIb3DQEBCwUAA4IB
-AQAtxRPPVoB7eni9n64smefv2t+UXglpp+duaIy9cr5HqQ6XErhK8WTTOd8lNNTB
-zU6B8A8ExCSzNJbGpqow32hhc9f5joWJ7w5elShKKiePEI4ufIbEAp7aDHdlDkQN
-kv39sxY2+hENHYwOB4lqKVb3cvTdFZx3NWZXqxNT2I7BQMXXExZacse3aQHEerGD
-AWh9jUGhlBjBJVz88P6DAod8DQ3PLghcSkANPuyBYeYk28rgDi0Hsj5W3I31QYUH
-SJsMC8tJP33st/3LjWeJGqvtux6jAAgIFyqCXDFdRootD4abdNlF+9RAsXqqaC2G
-spki4cErx5z481+oghLrGREt
------END CERTIFICATE-----
-
-# Issuer: CN=thawte Primary Root CA - G2 O=thawte, Inc. OU=(c) 2007 thawte, Inc. - For authorized use only
-# Subject: CN=thawte Primary Root CA - G2 O=thawte, Inc. OU=(c) 2007 thawte, Inc. - For authorized use only
-# Label: "thawte Primary Root CA - G2"
-# Serial: 71758320672825410020661621085256472406
-# MD5 Fingerprint: 74:9d:ea:60:24:c4:fd:22:53:3e:cc:3a:72:d9:29:4f
-# SHA1 Fingerprint: aa:db:bc:22:23:8f:c4:01:a1:27:bb:38:dd:f4:1d:db:08:9e:f0:12
-# SHA256 Fingerprint: a4:31:0d:50:af:18:a6:44:71:90:37:2a:86:af:af:8b:95:1f:fb:43:1d:83:7f:1e:56:88:b4:59:71:ed:15:57
------BEGIN CERTIFICATE-----
-MIICiDCCAg2gAwIBAgIQNfwmXNmET8k9Jj1Xm67XVjAKBggqhkjOPQQDAzCBhDEL
-MAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjE4MDYGA1UECxMvKGMp
-IDIwMDcgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAi
-BgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMjAeFw0wNzExMDUwMDAw
-MDBaFw0zODAxMTgyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhh
-d3RlLCBJbmMuMTgwNgYDVQQLEy8oYykgMjAwNyB0aGF3dGUsIEluYy4gLSBGb3Ig
-YXV0aG9yaXplZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9v
-dCBDQSAtIEcyMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEotWcgnuVnfFSeIf+iha/
-BebfowJPDQfGAFG6DAJSLSKkQjnE/o/qycG+1E3/n3qe4rF8mq2nhglzh9HnmuN6
-papu+7qzcMBniKI11KOasf2twu8x+qi58/sIxpHR+ymVo0IwQDAPBgNVHRMBAf8E
-BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUmtgAMADna3+FGO6Lts6K
-DPgR4bswCgYIKoZIzj0EAwMDaQAwZgIxAN344FdHW6fmCsO99YCKlzUNG4k8VIZ3
-KMqh9HneteY4sPBlcIx/AlTCv//YoT7ZzwIxAMSNlPzcU9LcnXgWHxUzI1NS41ox
-XZ3Krr0TKUQNJ1uo52icEvdYPy5yAlejj6EULg==
------END CERTIFICATE-----
-
-# Issuer: CN=thawte Primary Root CA - G3 O=thawte, Inc. OU=Certification Services Division/(c) 2008 thawte, Inc. - For authorized use only
-# Subject: CN=thawte Primary Root CA - G3 O=thawte, Inc. OU=Certification Services Division/(c) 2008 thawte, Inc. - For authorized use only
-# Label: "thawte Primary Root CA - G3"
-# Serial: 127614157056681299805556476275995414779
-# MD5 Fingerprint: fb:1b:5d:43:8a:94:cd:44:c6:76:f2:43:4b:47:e7:31
-# SHA1 Fingerprint: f1:8b:53:8d:1b:e9:03:b6:a6:f0:56:43:5b:17:15:89:ca:f3:6b:f2
-# SHA256 Fingerprint: 4b:03:f4:58:07:ad:70:f2:1b:fc:2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TEoYRFsZ5aNOZnLwkUk
-OQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNV
-HQ4EFgQUrWyqlGCc7eT/+j4KdCtjA/e2Wb8wDQYJKoZIhvcNAQELBQADggEBABpA
-2JVlrAmSicY59BDlqQ5mU1143vokkbvnRFHfxhY0Cu9qRFHqKweKA3rD6z8KLFIW
-oCtDuSWQP3CpMyVtRRooOyfPqsMpQhvfO0zAMzRbQYi/aytlryjvsvXDqmbOe1bu
-t8jLZ8HJnBoYuMTDSQPxYA5QzUbF83d597YV4Djbxy8ooAw/dyZ02SUS2jHaGh7c
-KUGRIjxpp7sC8rZcJwOJ9Abqm+RyguOhCcHpABnTPtRwa7pxpqpYrvS76Wy274fM
-m7v/OeZWYdMKp8RcTGB7BXcmer/YB1IsYvdwY9k5vG8cwnncdimvzsUsZAReiDZu
-MdRAGmI0Nj81Aa6sY6A=
------END CERTIFICATE-----
-
-# Issuer: CN=GeoTrust Primary Certification Authority - G2 O=GeoTrust Inc. OU=(c) 2007 GeoTrust Inc. - For authorized use only
-# Subject: CN=GeoTrust Primary Certification Authority - G2 O=GeoTrust Inc. OU=(c) 2007 GeoTrust Inc. - For authorized use only
-# Label: "GeoTrust Primary Certification Authority - G2"
-# Serial: 80682863203381065782177908751794619243
-# MD5 Fingerprint: 01:5e:d8:6b:bd:6f:3d:8e:a1:31:f8:12:e0:98:73:6a
-# SHA1 Fingerprint: 8d:17:84:d5:37:f3:03:7d:ec:70:fe:57:8b:51:9a:99:e6:10:d7:b0
-# SHA256 Fingerprint: 5e:db:7a:c4:3b:82:a0:6a:87:61:e8:d7:be:49:79:eb:f2:61:1f:7d:d7:9b:f9:1c:1c:6b:56:6a:21:9e:d7:66
------BEGIN CERTIFICATE-----
-MIICrjCCAjWgAwIBAgIQPLL0SAoA4v7rJDteYD7DazAKBggqhkjOPQQDAzCBmDEL
-MAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChj
-KSAyMDA3IEdlb1RydXN0IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2
-MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0
-eSAtIEcyMB4XDTA3MTEwNTAwMDAwMFoXDTM4MDExODIzNTk1OVowgZgxCzAJBgNV
-BAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykgMjAw
-NyBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNV
-BAMTLUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBH
-MjB2MBAGByqGSM49AgEGBSuBBAAiA2IABBWx6P0DFUPlrOuHNxFi79KDNlJ9RVcL
-So17VDs6bl8VAsBQps8lL33KSLjHUGMcKiEIfJo22Av+0SbFWDEwKCXzXV2juLal
-tJLtbCyf691DiaI8S0iRHVDsJt/WYC69IaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAO
-BgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBVfNVdRVfslsq0DafwBo/q+EVXVMAoG
-CCqGSM49BAMDA2cAMGQCMGSWWaboCd6LuvpaiIjwH5HTRqjySkwCY/tsXzjbLkGT
-qQ7mndwxHLKgpxgceeHHNgIwOlavmnRs9vuD4DPTCF+hnMJbn0bWtsuRBmOiBucz
-rD6ogRLQy7rQkgu2npaqBA+K
------END CERTIFICATE-----
-
-# Issuer: CN=VeriSign Universal Root Certification Authority O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 2008 VeriSign, Inc. - For authorized use only
-# Subject: CN=VeriSign Universal Root Certification Authority O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 2008 VeriSign, Inc. - For authorized use only
-# Label: "VeriSign Universal Root Certification Authority"
-# Serial: 85209574734084581917763752644031726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ee5Y2A7Cs0WTwCznmhcrewA3ekEzeOEz4vMQGn+H
-LL729fdC4uW/h2KJXwBL38Xd5HVEMkE6HnFuacsLdUYI0crSK5XQz/u5QGtkjFdN
-/BMReYTtXlT2NJ8IAfMQJQYXStrxHXpma5hgZqTZ79IugvHw7wnqRMkVauIDbjPT
-rJ9VAMf2CGqUuV/c4DPxhGD5WycRtPwW8rtWaoAljQIDAQABo4GyMIGvMA8GA1Ud
-EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMG0GCCsGAQUFBwEMBGEwX6FdoFsw
-WTBXMFUWCWltYWdlL2dpZjAhMB8wBwYFKw4DAhoEFI/l0xqGrI2Oa8PPgGrUSBgs
-exkuMCUWI2h0dHA6Ly9sb2dvLnZlcmlzaWduLmNvbS92c2xvZ28uZ2lmMB0GA1Ud
-DgQWBBS2d/ppSEefUxLVwuoHMnYH0ZcHGTANBgkqhkiG9w0BAQsFAAOCAQEASvj4
-sAPmLGd75JR3Y8xuTPl9Dg3cyLk1uXBPY/ok+myDjEedO2Pzmvl2MpWRsXe8rJq+
-seQxIcaBlVZaDrHC1LGmWazxY8u4TB1ZkErvkBYoH1quEPuBUDgMbMzxPcP1Y+Oz
-4yHJJDnp/RVmRvQbEdBNc6N9Rvk97ahfYtTxP/jgdFcrGJ2BtMQo2pSXpXDrrB2+
-BxHw1dvd5Yzw1TKwg+ZX4o+/vqGqvz0dtdQ46tewXDpPaj+PwGZsY6rp2aQW9IHR
-lRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WIg0vvBZIGcfK4mJO3
-7M2CYfE45k+XmCpajQ==
------END CERTIFICATE-----
-
-# Issuer: CN=VeriSign Class 3 Public Primary Certification Authority - G4 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 2007 VeriSign, Inc. - For authorized use only
-# Subject: CN=VeriSign Class 3 Public Primary Certification Authority - G4 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 2007 VeriSign, Inc. - For authorized use only
-# Label: "VeriSign Class 3 Public Primary Certification Authority - G4"
-# Serial: 63143484348153506665311985501458640051
-# MD5 Fingerprint: 3a:52:e1:e7:fd:6f:3a:e3:6f:f3:6f:99:1b:f9:22:41
-# SHA1 Fingerprint: 22:d5:d8:df:8f:02:31:d1:8d:f7:9d:b7:cf:8a:2d:64:c9:3f:6c:3a
-# SHA256 Fingerprint: 69:dd:d7:ea:90:bb:57:c9:3e:13:5d:c8:5e:a6:fc:d5:48:0b:60:32:39:bd:c4:54:fc:75:8b:2a:26:cf:7f:79
------BEGIN CERTIFICATE-----
-MIIDhDCCAwqgAwIBAgIQL4D+I4wOIg9IZxIokYesszAKBggqhkjOPQQDAzCByjEL
-MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZW
-ZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2ln
-biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJp
-U2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9y
-aXR5IC0gRzQwHhcNMDcxMTA1MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCByjELMAkG
-A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJp
-U2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwg
-SW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2ln
-biBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5
-IC0gRzQwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAASnVnp8Utpkmw4tXNherJI9/gHm
-GUo9FANL+mAnINmDiWn6VMaaGF5VKmTeBvaNSjutEDxlPZCIBIngMGGzrl0Bp3ve
-fLK+ymVhAIau2o970ImtTR1ZmkGxvEeA3J5iw/mjgbIwga8wDwYDVR0TAQH/BAUw
-AwEB/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJ
-aW1hZ2UvZ2lmMCEwHzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYj
-aHR0cDovL2xvZ28udmVyaXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFLMW
-kf3upm7ktS5Jj4d4gYDs5bG1MAoGCCqGSM49BAMDA2gAMGUCMGYhDBgmYFo4e1ZC
-4Kf8NoRRkSAsdk1DPcQdhCPQrNZ8NQbOzWm9kA3bbEhCHQ6qQgIxAJw9SDkjOVga
-FRJZap7v1VmyHVIsmXHNxynfGyphe3HR3vPA5Q06Sqotp9iGKt0uEA==
------END CERTIFICATE-----
-
-# Issuer: CN=NetLock Arany (Class Gold) F\u0151tan\xfas\xedtv\xe1ny O=NetLock Kft. OU=Tan\xfas\xedtv\xe1nykiad\xf3k (Certification Services)
-# Subject: CN=NetLock Arany (Class Gold) F\u0151tan\xfas\xedtv\xe1ny O=NetLock Kft. OU=Tan\xfas\xedtv\xe1nykiad\xf3k (Certification Services)
-# Label: "NetLock Arany (Class Gold) F\u0151tan\xfas\xedtv\xe1ny"
-# Serial: 80544274841616
-# MD5 Fingerprint: c5:a1:b7:ff:73:dd:d6:d7:34:32:18:df:fc:3c:ad:88
-# SHA1 Fingerprint: 06:08:3f:59:3f:15:a1:04:a0:69:a4:6b:a9:03:d0:06:b7:97:09:91
-# SHA256 Fingerprint: 6c:61:da:c3:a2:de:f0:31:50:6b:e0:36:d2:a6:fe:40:19:94:fb:d1:3d:f9:c8:d4:66:59:92:74:c4:46:ec:98
------BEGIN CERTIFICATE-----
-MIIEFTCCAv2gAwIBAgIGSUEs5AAQMA0GCSqGSIb3DQEBCwUAMIGnMQsw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aeZ5m8BiFRh
-bvG5GK1Krf6BQCOUL/t1fC8oS2IkgYIL9WHxHG64YTjrgfpioTtaYtOUZcTh5m2C
-+C8lcLIhJsFyUR+MLMOEkMNaj7rP9KdlpeuY0fsFskZ1FSNqb4VjMIDw1Z4fKRzC
-bLBQWV2QWzuoDTDPv31/zvGdg73JRm4gpvlhUbohL3u+pRVjodSVh/GeufOJ8z2F
-uLjbvrW5KfnaNwUASZQDhETnv0Mxz3WLJdH0pmT1kvarBes96aULNmLazAZfNou2
-XjG4Kvte9nHfRCaexOYNkbQudZWAUWpLMKawYqGT8ZvYzsRjdT9ZR7E=
------END CERTIFICATE-----
-
-# Issuer: CN=Staat der Nederlanden Root CA - G2 O=Staat der Nederlanden
-# Subject: CN=Staat der Nederlanden Root CA - G2 O=Staat der Nederlanden
-# Label: "Staat der Nederlanden Root CA - G2"
-# Serial: 10000012
-# MD5 Fingerprint: 7c:a5:0f:f8:5b:9a:7d:6d:30:ae:54:5a:e3:42:a2:8a
-# SHA1 Fingerprint: 59:af:82:79:91:86:c7:b4:75:07:cb:cf:03:57:46:eb:04:dd:b7:16
-# SHA256 Fingerprint: 66:8c:83:94:7d:a6:3b:72:4b:ec:e1:74:3c:31:a0:e6:ae:d0:db:8e:c5:b3:1b:e3:77:bb:78:4f:91:b6:71:6f
------BEGIN CERTIFICATE-----
-MIIFyjCCA7KgAwIBAgIEAJiWjDANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJO
-TDEeMBwGA1UECgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSswKQYDVQQDDCJTdGFh
-dCBkZXIgTmVkZXJsYW5kZW4gUm9vdCBDQSAtIEcyMB4XDTA4MDMyNjExMTgxN1oX
-DTIwMDMyNTExMDMxMFowWjELMAkGA1UEBhMCTkwxHjAcBgNVBAoMFVN0YWF0IGRl
-ciBOZWRlcmxhbmRlbjErMCkGA1UEAwwiU3RhYXQgZGVyIE5lZGVybGFuZGVuIFJv
-b3QgQ0EgLSBH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BQ4EffkdAHOV6CMqqi3WtFMTC6GY8ggen
-5ieCWxjmD27ZUD6KQhgpxrRW/FYQoAUXvQwjf/ST7ZwaUb7dRUG/kSS0H4zpX897
-IZmflZ85OkYcbPnNe5yQzSipx6lVu6xiNGI1E0sUOlWDuYaNkqbG9AclVMwWVxJK
-gnjIFNkXgiYtXSAfea7+1HAWFpWD2DU5/1JddRwWxRNVz0fMdWVSSt7wsKfkCpYL
-+63C4iWEst3kvX5ZbJvw8NjnyvLplzh+ib7M+zkXYT9y2zqR2GUBGR2tUKRXCnxL
-vJxxcypFURmFzI79R6d0lR2o0a9OF7FpJsKqeFdbxU2n5Z4FF5TKsl+gSRiNNOkm
-bEgeqmiSBeGCc1qb3AdbCG19ndeNIdn8FCCqwkXfP+cAslHkwvgFuXkajDTznlvk
-N1trSt8sV4pAWja63XVECDdCcAz+3F4hoKOKwJCcaNpQ5kUQR3i2TtJlycM33+FC
-Y7BXN0Ute4qcvwXqZVUz9zkQxSgqIXobisQk+T8VyJoVIPVVYpbtbZNQvOSqeK3Z
-ywplh6ZmwcSBo3c6WB4L7oOLnR7SUqTMHW+wmG2UMbX4cQrcufx9MmDm66+KAQ==
------END CERTIFICATE-----
-
-# Issuer: CN=Hongkong Post Root CA 1 O=Hongkong Post
-# Subject: CN=Hongkong Post Root CA 1 O=Hongkong Post
-# Label: "Hongkong Post Root CA 1"
-# Serial: 1000
-# MD5 Fingerprint: a8:0d:6f:39:78:b9:43:6d:77:42:6d:98:5a:cc:23:ca
-# SHA1 Fingerprint: d6:da:a8:20:8d:09:d2:15:4d:24:b5:2f:cb:34:6e:b2:58:b2:8a:58
-# SHA256 Fingerprint: f9:e6:7d:33:6c:51:00:2a:c0:54:c6:32:02:2d:66:dd:a2:e7:e3:ff:f1:0a:d0:61:ed:31:d8:bb:b4:10:cf:b2
------BEGIN CERTIFICATE-----
-MIIDMDCCAhigAwIBAgICA+gwDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCSEsx
-FjAU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# Issuer: CN=SecureSign RootCA11 O=Japan Certification Services, Inc.
-# Subject: CN=SecureSign RootCA11 O=Japan Certification Services, Inc.
-# Label: "SecureSign RootCA11"
-# Serial: 1
-# MD5 Fingerprint: b7:52:74:e2:92:b4:80:93:f2:75:e4:cc:d7:f2:ea:26
-# SHA1 Fingerprint: 3b:c4:9f:48:f8:f3:73:a0:9c:1e:bd:f8:5b:b1:c3:65:c7:d8:11:b3
-# SHA256 Fingerprint: bf:0f:ee:fb:9e:3a:58:1a:d5:f9:e9:db:75:89:98:57:43:d2:61:08:5c:4d:31:4f:6f:5d:72:59:aa:42:16:12
------BEGIN CERTIFICATE-----
-MIIDbTCCAlWgAwIBAgIBATANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQGEwJKUDEr
-MCkGA1UEChMiSmFwYW4gQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcywgSW5jLjEcMBoG
-A1UEAxMTU2VjdXJlU2lnbiBSb290Q0ExMTAeFw0wOTA0MDgwNDU2NDdaFw0yOTA0
-MDgwNDU2NDdaMFgxCzAJBgNVBAYTAkpQMSswKQYDVQQKEyJKYXBhbiBDZXJ0aWZp
-Y2F0aW9uIFNlcnZpY2VzLCBJbmMuMRwwGgYDVQQDExNTZWN1cmVTaWduIFJvb3RD
-QTExMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA/XeqpRyQBTvLTJsz
-i1oURaTnkBbR31fSIRCkF/3frNYfp+TbfPfs37gD2pRY/V1yfIw/XwFndBWW4wI8
-h9uuywGOwvNmxoVF9ALGOrVisq/6nL+k5tSAMJjzDbaTj6nU2DbysPyKyiyhFTOV
-MdrAG/LuYpmGYz+/3ZMqg6h2uRMft85OQoWPIucuGvKVCbIFtUROd6EgvanyTgp9
-UK31BQ1FT0Zx/Sg+U/sE2C3XZR1KG/rPO7AxmjVuyIsG0wCR8pQIZUyxNAYAeoni
-8McDWc/V1uinMrPmmECGxc0nEovMe863ETxiYAcjPitAbpSACW22s293bzUIUPsC
-h8U+iQIDAQABo0IwQDAdBgNVHQ4EFgQUW/hNT7KlhtQ60vFjmqC+CfZXt94wDgYD
-VR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEB
-AKChOBZmLqdWHyGcBvod7bkixTgm2E5P7KN/ed5GIaGHd48HCJqypMWvDzKYC3xm
-KbabfSVSSUOrTC4rbnpwrxYO4wJs+0LmGJ1F2FXI6Dvd5+H0LgscNFxsWEr7jIhQ
-X5Ucv+2rIrVls4W6ng+4reV6G4pQOh29Dbx7VFALuUKvVaAYga1lme++5Jy/xIWr
-QbJUb9wlze144o4MjQlJ3WN7WmmWAiGovVJZ6X01y8hSyn+B/tlr0/cR7SXf+Of5
-pPpyl4RTDaXQMhhRdlkUbA/r7F+AjHVDg8OFmP9Mni0N5HeDk061lgeLKBObjBmN
-QSdJQO7e5iNEOdyhIta6A/I=
------END CERTIFICATE-----
-
-# Issuer: CN=ACEDICOM Root O=EDICOM OU=PKI
-# Subject: CN=ACEDICOM Root O=EDICOM OU=PKI
-# Label: "ACEDICOM Root"
-# Serial: 7029493972724711941
-# MD5 Fingerprint: 42:81:a0:e2:1c:e3:55:10:de:55:89:42:65:96:22:e6
-# SHA1 Fingerprint: e0:b4:32:2e:b2:f6:a5:68:b6:54:53:84:48:18:4a:50:36:87:43:84
-# SHA256 Fingerprint: 03:95:0f:b4:9a:53:1f:3e:19:91:94:23:98:df:a9:e0:ea:32:d7:ba:1c:dd:9b:c8:5d:b5:7e:d9:40:0b:43:4a
------BEGIN CERTIFICATE-----
-MIIFtTCCA52gAwIBAgIIYY3HhjsBggUwDQYJKoZIhvcNAQEFBQAwRDEWMBQGA1UE
-AwwNQUNFRElDT00gUm9vdDEMMAoGA1UECwwDUEtJMQ8wDQYDVQQKDAZFRElDT00x
-CzAJBgNVBAYTAkVTMB4XDTA4MDQxODE2MjQyMloXDTI4MDQxMzE2MjQyMlowRDEW
-MBQGA1UEAwwNQUN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A0GCSqGSIb3DQEBBQUAA4ICAQDOLAtSUWIm
-fQwng4/F9tqgaHtPkl7qpHMyEVNEskTLnewPeUKzEKbHDZ3Ltvo/Onzqv4hTGzz3
-gvoFNTPhNahXwOf9jU8/kzJPeGYDdwdY6ZXIfj7QeQCM8htRM5u8lOk6e25SLTKe
-I6RF+7YuE7CLGLHdztUdp0J/Vb77W7tH1PwkzQSulgUV1qzOMPPKC8W64iLgpq0i
-5ALudBF/TP94HTXa5gI06xgSYXcGCRZj6hitoocf8seACQl1ThCojz2GuHURwCRi
-ipZ7SkXp7FnFvmuD5uHorLUwHv4FB4D54SMNUI8FmP8sX+g7tq3PgbUhh8oIKiMn
-MCArz+2UW6yyetLHKKGKC5tNSixthT8Jcjxn4tncB7rrZXtaAWPWkFtPF2Y9fwsZ
-o5NjEFIqnxQWWOLcpfShFosOkYuByptZ+thrkQdlVV9SH686+5DdaaVbnG0OLLb6
-zqylfDJKZ0DcMDQj3dcEI2bw/FWAp/tmGYI1Z2JwOV5vx+qQQEQIHriy1tvuWacN
-GHk0vFQYXlPKNFHtRQrmjseCNj6nOGOpMCwXEGCSn1WHElkQwg9naRHMTh5+Spqt
-r0CodaxWkHS4oJyleW/c6RrIaQXpuvoDs3zk4E7Czp3otkYNbn5XOmeUwssfnHdK
-Z05phkOTOPu220+DkdRgfks+KzgHVZhepA==
------END CERTIFICATE-----
-
-# Issuer: CN=Microsec e-Szigno Root CA 2009 O=Microsec Ltd.
-# Subject: CN=Microsec e-Szigno Root CA 2009 O=Microsec Ltd.
-# Label: "Microsec e-Szigno Root CA 2009"
-# Serial: 14014712776195784473
-# MD5 Fingerprint: f8:49:f4:03:bc:44:2d:83:be:48:69:7d:29:64:fc:b1
-# SHA1 Fingerprint: 89:df:74:fe:5c:f4:0f:4a:80:f9:e3:37:7d:54:da:91:e1:01:31:8e
-# SHA256 Fingerprint: 3c:5f:81:fe:a5:fa:b8:2c:64:bf:a2:ea:ec:af:cd:e8:e0:77:fc:86:20:a7:ca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qmKrs0aDAbBgNVHREEFDASgRBpbmZvQGUtc3ppZ25vLmh1MA0GCSqG
-SIb3DQEBCwUAA4IBAQDJ0Q5eLtXMs3w+y/w9/w0olZMEyL/azXm4Q5DwpL7v8u8h
-mLzU1F0G9u5C7DBsoKqpyvGvivo/C3NqPuouQH4frlRheesuCDfXI/OMn74dseGk
-ddug4lQUsbocKaQY9hK6ohQU4zE1yED/t+AFdlfBHFny+L/k7SViXITwfn4fs775
-tyERzAMBVnCnEJIeGzSBHq2cGsMEPO0CYdYeBvNfOofyK/FFh+U9rNHHV4S9a67c
-2Pm2G2JwCz02yULyMtd6YebS2z3PyKnJm9zbWETXbzivf3jTo60adbocwTZ8jx5t
-HMN1Rq41Bab2XD0h7lbwyYIiLXpUq3DDfSJlgnCW
------END CERTIFICATE-----
-
-# Issuer: CN=GlobalSign O=GlobalSign OU=GlobalSign Root CA - R3
-# Subject: CN=GlobalSign O=GlobalSign OU=GlobalSign Root CA - R3
-# Label: "GlobalSign Root CA - R3"
-# Serial: 4835703278459759426209954
-# MD5 Fingerprint: c5:df:b8:49:ca:05:13:55:ee:2d:ba:1a:c3:3e:b0:28
-# SHA1 Fingerprint: d6:9b:56:11:48:f0:1c:77:c5:45:78:c1:09:26:df:5b:85:69:76:ad
-# SHA256 Fingerprint: cb:b5:22:d7:b7:f1:27:ad:6a:01:13:86:5b:df:1c:d4:10:2e:7d:07:59:af:63:5a:7c:f4:72:0d:c9:63:c5:3b
------BEGIN CERTIFICATE-----
-MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4G
-A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNp
-Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4
-MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEG
-A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI
-hvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWtiHL8
-RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsT
-gHeMCOFJ0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmm
-KPZpO/bLyCiR5Z2KYVc3rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zd
-QQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjlOCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZ
-XriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2xmmFghcCAwEAAaNCMEAw
-DgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFI/wS3+o
-LkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZU
-RUm7lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMp
-jjM5RcOO5LlXbKr8EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK
-6fBdRoyV3XpYKBovHd7NADdBj+1EbddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQX
-mcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJrlAGomecs
-Mx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH
-WD9f
------END CERTIFICATE-----
-
-# Issuer: CN=Autoridad de Certificacion Firmaprofesional CIF A62634068
-# Subject: CN=Autoridad de Certificacion Firmaprofesional CIF A62634068
-# Label: "Autoridad de Certificacion Firmaprofesional CIF A62634068"
-# Serial: 6047274297262753887
-# MD5 F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VM
-ZcFwgbg4/EMxsvYDNEeyrPsiBsse3RdHHF9mudMaotoRsaS8I8nkvof/uZS2+F0g
-StRf571oe2XyFR7SOqkt6dhrJKyXWERHrVkY8SFlcN7ONGCoQPHzPKTDKCOM/icz
-Q0CgFzzr6juwcqajuUpLXhZI9LK8yIySxZ2frHI2vDSANGupi5LAuBft7HZT9SQB
-jLMi6Et8Vcad+qMUu2WFbm5PEn4KPJ2V
------END CERTIFICATE-----
-
-# Issuer: CN=Izenpe.com O=IZENPE S.A.
-# Subject: CN=Izenpe.com O=IZENPE S.A.
-# Label: "Izenpe.com"
-# Serial: 917563065490389241595536686991402621
-# MD5 Fingerprint: a6:b0:cd:85:80:da:5c:50:34:a3:39:90:2f:55:67:73
-# SHA1 Fingerprint: 2f:78:3d:25:52:18:a7:4a:65:39:71:b5:2c:a2:9c:45:15:6f:e9:19
-# SHA256 Fingerprint: 25:30:cc:8e:98:32:15:02:ba:d9:6f:9b:1f:ba:1b:09:9e:2d:29:9e:0f:45:48:bb:91:4f:36:3b:c0:d4:53:1f
------BEGIN CERTIFICATE-----
-MIIF8TCCA9mgAwIBAgIQALC3WhZIX7/hy/WL1xnmfTANBgkqhkiG9w0BAQsFADA4
-MQswCQYDVQQGEwJFUzEUMBIGA1UECgwLSVpFTlBFIFMuQS4xEzARBgNVBAMMCkl6
-ZW5wZS5jb20wHhcNMDcxMjEzMTMwODI4WhcNMzcxMjEzMDgyNzI1WjA4MQswCQYD
-VQQGEwJFUzEUMBIGA1UECgwLSVpFTlBFIFMuQS4xEzARBgNVBAMMCkl6ZW5wZS5j
-b20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDJ03rKDx6sp4boFmVq
-scIbRTJxldn+EFvMr+eleQGPicPK8lVx93e+d5TzcqQsRNiekpsUOqHnJJAKClaO
-xdgmlOHZSOEtPtoKct2jmRXagaKH9HtuJneJWK3W6wyyQXpzbm3benhB6QiIEn6H
-LmYRY2xU+zydcsC8Lv/Ct90NduM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rfIxwYJOubv5vr8qhT/AQKM6WfxZSzwo
-JNu0FXWuDYi6LnPAvViH5ULy617uHjAimcs30cQhbIHsvm0m5hzkQiCeR7Csg1lw
-LDXWrzY0tM07+DKo7+N4ifuNRSzanLh+QBxh5z6ikixL8s36mLYp//Pye6kfLqCT
-VyvehQP5aTfLnnhqBbTFMXiJ7HqnheG5ezzevh55hM6fcA5ZwjUukCox2eRFekGk
-LhObNA5me0mrZJfQRsN5nXJQY6aYWwa9SG3YOYNw6DXwBdGqvOPbyALqfP2C2sJb
-UjWumDqtujWTI6cfSN01RpiyEGjkpTHCClguGYEQyVB1/OpaFs4R1+7vUIgtYf8/
-QnMFlEPVjjxOAToZpR9GTnfQXeWBIiGH/pR9hNiTrdZoQ0iy2+tzJOeRf1SktoA+
-naM8THLCV8Sg1Mw4J87VBp6iSNnpn86CcDaTmjvfliHjWbcM2pE38P1ZWrOZyGls
-QyYBNWNgVYkDOnXYukrZVP/u3oDYLdE41V4tC5h9Pmzb/CaIxw==
------END CERTIFICATE-----
-
-# Issuer: CN=Chambers of Commerce Root - 2008 O=AC Camerfirma S.A.
-# Subject: CN=Chambers of Commerce Root - 2008 O=AC Camerfirma S.A.
-# Label: "Chambers of Commerce Root - 2008"
-# Serial: 11806822484801597146
-# MD5 Fingerprint: 5e:80:9e:84:5a:0e:65:0b:17:02:f3:55:18:2a:3e:d7
-# SHA1 Fingerprint: 78:6a:74:ac:76:ab:14:7f:9c:6a:30:50:ba:9e:a8:7e:fe:9a:ce:3c
-# SHA256 Fingerprint: 06:3e:4a:fa:c4:91:df:d3:32:f3:08:9b:85:42:e9:46:17:d8:93:d7:fe:94:4e:10:a7:93:7e:e2:9d:96:93:c0
------BEGIN CERTIFICATE-----
-MIIHTzCCBTegAwIBAgIJAKPaQn6ksa7aMA0GCSqGSIb3DQEBBQUAMIGuMQswCQYD
-VQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0
-IHd3dy5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uScvfaAFPDRLLmF9dijscilIeUcE5fuDr3fKanvNFNb0+RqE4QG
-tjICxFKuItLcsiFCGtpA8CnJ7AoMXOLQusxI0zcKzBIKinmwPQN/aUv0NCB9szTq
-jktk9T79syNnFQ0EuPAtwQlRPLJsFfClI9eDdOTlLsn+mCdCxqvGnrDQWzilm1De
-fhiYtUU79nm06PcaewaD+9CL2rvHvRirCG88gGtAPxkZumWK5r7VXNM21+9AUiRg
-OGcEMeyP84LG3rlV8zsxkVrctQgVrXYlCg17LofiDKYGvCYQbTed7N14jHyAxfDZ
-d0jQ
------END CERTIFICATE-----
-
-# Issuer: CN=Global Chambersign Root - 2008 O=AC Camerfirma S.A.
-# Subject: CN=Global Chambersign Root - 2008 O=AC Camerfirma S.A.
-# Label: "Global Chambersign Root - 2008"
-# Serial: 14541511773111788494
-# MD5 Fingerprint: 9e:80:ff:78:01:0c:2e:c1:36:bd:fe:96:90:6e:08:f3
-# SHA1 Fingerprint: 4a:bd:ee:ec:95:0d:35:9c:89:ae:c7:52:a1:2c:5b:29:f6:d6:aa:0c
-# SHA256 Fingerprint: 13:63:35:43:93:34:a7:69:80:16:a0:d3:24:de:72:28:4e:07:9d:7b:52:20:bb:8f:bd:74:78:16:ee:be:ba:ca
------BEGIN CERTIFICATE-----
-MIIHSTCCBTGgAwIBAgIJAMnN0+nVfSPOMA0GCSqGSIb3DQEBBQUAMIGsMQswCQYD
-VQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0
-IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3
-MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xJzAlBgNVBAMTHkdsb2JhbCBD
-aGFtYmVyc2lnbiBSb290IC0gMjAwODAeFw0wODA4MDExMjMxNDBaFw0zODA3MzEx
-MjMxNDBaMIGsMQswCQYDVQQGEwJFVTFDMEEGA1UEBxM6TWFkc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MNTxXJhLynSC34MCN32EZLeW32jO06f2ARePTpm67VVMB0gNELQp/B
------END CERTIFICATE-----
-
-# Issuer: CN=Go Daddy Root Certificate Authority - G2 O=GoDaddy.com, Inc.
-# Subject: CN=Go Daddy Root Certificate Authority - G2 O=GoDaddy.com, Inc.
-# Label: "Go Daddy Root Certificate Authority - G2"
-# Serial: 0
-# MD5 Fingerprint: 80:3a:bc:22:c1:e6:fb:8d:9b:3b:27:4a:32:1b:9a:01
-# SHA1 Fingerprint: 47:be:ab:c9:22:ea:e8:0e:78:78:34:62:a7:9f:45:c2:54:fd:e6:8b
-# SHA256 Fingerprint: 45:14:0b:32:47:eb:9c:c8:c5:b4:f0:d7:b5:30:91:f7:32:92:08:9e:6e:5a:63:e2:74:9d:d3:ac:a9:19:8e:da
------BEGIN CERTIFICATE-----
-MIIDxTCCAq2gAwIBAgIBADANBgkqhkiG9w0BAQsFADCBgzELMAkGA1UEBhMCVVMx
-EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAYBgNVBAoT
-EUdvRGFkZHkuY29tLCBJbmMuMTEwLwYDVQQDEyhHbyBEYWRkeSBSb290IENlcnRp
-ZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIz
-NTk1OVowgYMxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQH
-EwpTY290dHNkYWxlMRowGAYDVQQKExFHb0RhZGR5LmNvbSwgSW5jLjExMC8GA1UE
-AxMoR28gRGFkZHkgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIw
-DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL9xYgjx+lk09xvJGKP3gElY6SKD
-E6bFIEMBO4Tx5oVJnyfq9oQbTqC023CYxzIBsQU+B07u9PpPL1kwIuerGVZr4oAH
-/PMWdYA5UXvl+TW2dE6pjYIT5LY/qQOD+qK+ihVqf94Lw7YZFAXK6sOoBJQ7Rnwy
-DfMAZiLIjWltNowRGLfTshxgtDj6AozO091GB94KPutdfMh8+7ArU6SSYmlRJQVh
-GkSBjCypQ5Yj36w6gZoOKcUcqeldHraenjAKOc7xiID7S13MMuyFYkMlNAJWJwGR
-tDtwKj9useiciAF9n9T521NtYJ2/LOdYq7hfRvzOxBsDPAnrSTFcaUaz4EcCAwEA
-AaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYE
-FDqahQcQZyi27/a9BUFuIMGU2g/eMA0GCSqGSIb3DQEBCwUAA4IBAQCZ21151fmX
-WWcDYfF+OwYxdS2hII5PZYe096acvNjpL9DbWu7PdIxztDhC2gV7+AJ1uP2lsdeu
-9tfeE8tTEH6KRtGX+rcuKxGrkLAngPnon1rpN5+r5N9ss4UXnT3ZJE95kTXWXwTr
-gIOrmgIttRD02JDHBHNA7XIloKmf7J6raBKZV8aPEjoJpL1E/QYVN8Gb5DKj7Tjo
-2GTzLH4U/ALqn83/B2gX2yKQOC16jdFU8WnjXzPKej17CuPKf1855eJ1usV2GDPO
-LPAvTK33sefOT6jEm0pUBsV/fdUID+Ic/n4XuKxe9tQWskMJDE32p2u0mYRlynqI
-4uJEvlz36hz1
------END CERTIFICATE-----
-
-# Issuer: CN=Starfield Root Certificate Authority - G2 O=Starfield Technologies, Inc.
-# Subject: CN=Starfield Root Certificate Authority - G2 O=Starfield Technologies, Inc.
-# Label: "Starfield Root Certificate Authority - G2"
-# Serial: 0
-# MD5 Fingerprint: d6:39:81:c6:52:7e:96:69:fc:fc:ca:66:ed:05:f2:96
-# SHA1 Fingerprint: b5:1c:06:7c:ee:2b:0c:3d:f8:55:ab:2d:92:f4:fe:39:d4:e7:0f:0e
-# SHA256 Fingerprint: 2c:e1:cb:0b:f9:d2:f9:e1:02:99:3f:be:21:51:52:c3:b2:dd:0c:ab:de:1c:68:e5:31:9b:83:91:54:db:b7:f5
------BEG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HU48TRqneSfioYmUeYs0cYtbpUgSpIB7LiKZ3sx4mcujJUDJi5DnUox9g61DLu3
-4jd/IroAow57UvtruzvE03lRTs2Q9GcHGcg8RnoNAX3FWOdt5oUwF5okxBDgBPfg
-8n/Uqgr/Qh037ZTlZFkSIHc40zI+OIF1lnP6aI+xy84fxez6nH7PfrHxBy22/L/K
-pL/QlwVKvOoYKAKQvVR4CSFx09F9HdkWsKlhPdAKACL8x3vLCWRFCztAgfd9fDL1
-mMpYjn0q7pBZc2T5NnReJaH1ZgUufzkVqSr7UIuOhWn0
------END CERTIFICATE-----
-
-# Issuer: CN=Starfield Services Root Certificate Authority - G2 O=Starfield Technologies, Inc.
-# Subject: CN=Starfield Services Root Certificate Authority - G2 O=Starfield Technologies, Inc.
-# Label: "Starfield Services Root Certificate Authority - G2"
-# Serial: 0
-# MD5 Fingerprint: 17:35:74:af:7b:61:1c:eb:f4:f9:3c:e2:ee:40:f9:a2
-# SHA1 Fingerprint: 92:5a:8f:8d:2c:6d:04:e0:66:5f:59:6a:ff:22:d8:63:e8:25:6f:3f
-# SHA256 Fingerprint: 56:8d:69:05:a2:c8:87:08:a4:b3:02:51:90:ed:cf:ed:b1:97:4a:60:6a:13:c6:e5:29:0f:cb:2a:e6:3e:da:b5
------BEGIN CERTIFICATE-----
-MIID7zCCAtegAwIBAgIBADANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UEBhMCVVMx
-EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoT
-HFN0YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xOzA5BgNVBAMTMlN0YXJmaWVs
-ZCBTZXJ2aWNlcyBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5
-MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgZgxCzAJBgNVBAYTAlVTMRAwDgYD
-VQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWx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-# Subject: CN=AffirmTrust Commercial O=AffirmTrust
-# Label: "AffirmTrust Commercial"
-# Serial: 8608355977964138876
-# MD5 Fingerprint: 82:92:ba:5b:ef:cd:8a:6f:a6:3d:55:f9:84:f6:d6:b7
-# SHA1 Fingerprint: f9:b5:b6:32:45:5f:9c:be:ec:57:5f:80:dc:e9:6e:2c:c7:b2:78:b7
-# SHA256 Fingerprint: 03:76:ab:1d:54:c5:f9:80:3c:e4:b2:e2:01:a0:ee:7e:ef:7b:57:b6:36:e8:a9:3c:9b:8d:48:60:c9:6f:5f:a7
------BEGIN CERTIFICATE-----
-MIIDTDCCAjSgAwIBAgIId3cGJyapsXwwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UE
-BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVz
-dCBDb21tZXJjaWFsMB4XDTEwMDEyOTE0MDYwNloXDTMwMTIzMTE0MDYwNlowRDEL
-MAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZp
-cm1UcnVzdCBDb21tZXJjaWFsMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC
-AQEA9htPZwcroRX1BiLLHwGy43NFBkRJLLtJJRTWzsO3qyxPxkEylFf6EqdbDuKP
-Hx6GGaeqtS25Xw2Kwq+FNXkyLbscYjfysVtKPcrNcV/pQr6U6Mje+SJIZMblq8Yr
-ba0F8PrVC8+a5fBQpIs7R6UjW3p6+DM/uO+Zl+MgwdYoic+U+7lF7eNAFxHUdPAL
-MeIrJmqbTFeurCA+ukV6BfO9m2kVrn1OIGPENXY6BwLJN/3HR+7o8XYdcxXyl6S1
-yHp52UKqK39c/s4mT6NmgTWvRLpUHhwwMmWd5jyTXlBOeuM61G7MGvv50jeuJCqr
-VwMiKA1JdX+3KNp1v47j3A55MQIDAQABo0IwQDAdBgNVHQ4EFgQUnZPGU4teyq8/
-nx4P5ZmVvCT2lI8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwDQYJ
-KoZIhvcNAQELBQADggEBAFis9AQOzcAN/wr91LoWXym9e2iZWEnStB03TX8nfUYG
-XUPGhi4+c7ImfU+TqbbEKpqrIZcUsd6M06uJFdhrJNTxFq7YpFzUf1GO7RgBsZNj
-vbz4YYCanrHOQnDiqX0GJX0nof5v7LMeJNrjS1UaADs1tDvZ110w/YETifLCBivt
-Z8SOyUOyXGsViQK8YvxO8rUzqrJv0wqiUOP2O+guRMLbZjipM1ZI8W0bM40NjD9g
-N53Tym1+NH4Nn3J2ixufcv1SNUFFApYvHLKac0khsUlHRUe072o0EclNmsxZt9YC
-nlpOZbWUrhvfKbAW8b8Angc6F2S1BLUjIZkKlTuXfO8=
------END CERTIFICATE-----
-
-# Issuer: CN=AffirmTrust Networking O=AffirmTrust
-# Subject: CN=AffirmTrust Networking O=AffirmTrust
-# Label: "AffirmTrust Networking"
-# Serial: 8957382827206547757
-# MD5 Fingerprint: 42:65:ca:be:01:9a:9a:4c:a9:8c:41:49:cd:c0:d5:7f
-# SHA1 Fingerprint: 29:36:21:02:8b:20:ed:02:f5:66:c5:32:d1:d6:ed:90:9f:45:00:2f
-# SHA256 Fingerprint: 0a:81:ec:5a:92:97:77:f1:45:90:4a:f3:8d:5d:50:9f:66:b5:e2:c5:8f:cd:b5:31:05:8b:0e:17:f3:f0:b4:1b
------BEGIN CERTIFICATE-----
-MIIDTDCCAjSgAwIBAgIIfE8EORzUmS0wDQYJKoZIhvcNAQEFBQAwRDELMAkGA1UE
-BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVz
-dCBOZXR3b3JraW5nMB4XDTEwMDEyOTE0MDgyNFoXDTMwMTIzMTE0MDgyNFowRDEL
-MAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZp
-cm1UcnVzdCBOZXR3b3JraW5nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC
-AQEAtITMMxcua5Rsa2FSoOujz3mUTOWUgJnLVWREZY9nZOIG41w3SfYvm4SEHi3y
-YJ0wTsyEheIszx6e/jarM3c1RNg1lho9Nuh6DtjVR6FqaYvZ/Ls6rnla1fTWcbua
-kCNrmreIdIcMHl+5ni36q1Mr3Lt2PpNMCAiMHqIjHNRqrSK6mQEubWXLviRmVSRL
-QESxG9fhwoXA3hA/Pe24/PHxI1Pcv2WXb9n5QHGNfb2V1M6+oF4nI979ptAmDgAp
-6zxG8D1gvz9Q0twmQVGeFDdCBKNwV6gbh+0t+nvujArjqWaJGctB+d1ENmHP4ndG
-yH329JKBNv3bNPFyfvMMFr20FQIDAQABo0IwQDAdBgNVHQ4EFgQUBx/S55zawm6i
-QLSwelAQUHTEyL0wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwDQYJ
-KoZIhvcNAQEFBQADggEBAIlXshZ6qML91tmbmzTCnLQyFE2npN/svqe++EPbkTfO
-tDIuUFUaNU52Q3Eg75N3ThVwLofDwR1t3Mu1J9QsVtFSUzpE0nPIxBsFZVpikpzu
-QY0x2+c06lkh1QF612S4ZDnNye2v7UsDSKegmQGA3GWjNq5lWUhPgkvIZfFXHeVZ
-Lgo/bNjR9eUJtGxUAArgFU2HdW23WJZa3W3SAKD0m0i+wzekujbgfIeFlxoVot4u
-olu9rxj5kFDNcFn4J2dHy8egBzp90SxdbBk6ZrV9/ZFvgrG+CJPbFEfxojfHRZ48
-x3evZKiT3/Zpg4Jg8klCNO1aAFSFHBY2kgxc+qatv9s=
------END CERTIFICATE-----
-
-# Issuer: CN=AffirmTrust Premium O=AffirmTrust
-# Subject: CN=AffirmTrust Premium O=AffirmTrust
-# Label: "AffirmTrust Premium"
-# Serial: 7893706540734352110
-# MD5 Fingerprint: c4:5d:0e:48:b6:ac:28:30:4e:0a:bc:f9:38:16:87:57
-# SHA1 Fingerprint: d8:a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ust Premium ECC"
-# Serial: 8401224907861490260
-# MD5 Fingerprint: 64:b0:09:55:cf:b1:d5:99:e2:be:13:ab:a6:5d:ea:4d
-# SHA1 Fingerprint: b8:23:6b:00:2f:1d:16:86:53:01:55:6c:11:a4:37:ca:eb:ff:c3:bb
-# SHA256 Fingerprint: bd:71:fd:f6:da:97:e4:cf:62:d1:64:7a:dd:25:81:b0:7d:79:ad:f8:39:7e:b4:ec:ba:9c:5e:84:88:82:14:23
------BEGIN CERTIFICATE-----
-MIIB/jCCAYWgAwIBAgIIdJclisc/elQwCgYIKoZIzj0EAwMwRTELMAkGA1UEBhMC
-VVMxFDASBgNVBAoMC0FmZmlybVRydXN0MSAwHgYDVQQDDBdBZmZpcm1UcnVzdCBQ
-cmVtaXVtIEVDQzAeFw0xMDAxMjkxNDIwMjRaFw00MDEyMzExNDIwMjRaMEUxCzAJ
-BgNVBAYTAlVTMRQwEgYDVQQKDAtBZmZpcm1UcnVzdDEgMB4GA1UEAwwXQWZmaXJt
-VHJ1c3QgUHJlbWl1bSBFQ0MwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQNMF4bFZ0D
-0KF5Nbc6PJJ6yhUczWLznCZcBz3lVPqj1swS6vQUX+iOGasvLkjmrBhDeKzQN8O9
-ss0s5kfiGuZjuD0uL3jET9v0D6RoTFVya5UdThhClXjMNzyR4ptlKymjQjBAMB0G
-A1UdDgQWBBSaryl6wBE1NSZRMADDav5A1a7WPDAPBgNVHRMBAf8EBTADAQH/MA4G
-A1UdDwEB/wQEAwIBBjAKBggqhkjOPQQDAwNnADBkAjAXCfOHiFBar8jAQr9HX/Vs
-aobgxCd05DhT1wV/GzTjxi+zygk8N53X57hG8f2h4nECMEJZh0PUUd+60wkyWs6I
-flc9nF9Ca/UHLbXwgpP5WW+uZPpY5Yse42O+tYHNbwKMeQ==
------END CERTIFICATE-----
-
-# Issuer: CN=Certum Trusted Network CA O=Unizeto Technologies S.A. OU=Certum Certification Authority
-# Subject: CN=Certum Trusted Network CA O=Unizeto Technologies S.A. OU=Certum Certification Authority
-# Label: "Certum Trusted Network CA"
-# Serial: 279744
-# MD5 Fingerprint: d5:e9:81:40:c5:18:69:fc:46:2c:89:75:62:0f:aa:78
-# SHA1 Fingerprint: 07:e0:32:e0:20:b7:2c:3f:19:2f:06:28:a2:59:3a:19:a7:0f:06:9e
-# SHA256 Fingerprint: 5c:58:46:8d:55:f5:8e:49:7e:74:39:82:d2:b5:00:10:b6:d1:65:37:4a:cf:83:a7:d4:a3:2d:b7:68:c4:40:8e
------BEGIN CERTIFICATE-----
-MIIDuzCCAqOgAwIBAgIDBETAMA0GCSqGSIb3DQEBBQUAMH4xCzAJBgNVBAYTAlBM
-MSIwIAYDVQQKExlVbml6ZXRvIFRlY2hub2xvZ2llcyBTLkEuMScwJQYDVQQLEx5D
-ZXJ0dW0gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxIjAgBgNVBAMTGUNlcnR1bSBU
-cnVzdGVkIE5ldHdvcmsgQ0EwHhcNMDgxMDIyMTIwNzM3WhcNMjkxMjMxMTIwNzM3
-WjB+MQswCQYDVQQGEwJQTDEiMCAGA1UEChMZVW5pemV0byBUZWNobm9sb2dpZXMg
-Uy5BLjEnMCUGA1UECxMeQ2VydHVtIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MSIw
-IAYDVQQDExlDZXJ0dW0gVHJ1c3RlZCBOZXR3b3JrIENBMIIBIjANBgkqhkiG9w0B
-AQEFAAOCAQ8AMIIBCgKCAQEA4/t9o3K6wvDJFIf1awFO4W5AB7ptJ11/91sts1rH
-UV+rpDKmYYe2bg+G0jACl/jXaVehGDldamR5xgFZrDwxSjh80gTSSyjoIF87B6LM
-TXPb865Px1bVWqeWifrzq2jUI4ZZJ88JJ7ysbnKDHDBy3+Ci6dLhdHUZvSqeexVU
-BBvXQzmtVSjF4hq79MDkrjhJM8x2hZ85RdKknvISjFH4fOQtf/WsX+sWn7Et0brM
-kUJ3TCXJkDhv2/DM+44el1k+1WBO5gUo7Ul5E0u6SNsv+XLTOcr+H9g0cvW0QM8x
-AcPs3hEtF10fuFDRXhmnad4HMyjKUJX5p1TLVIZQRan5SQIDAQABo0IwQDAPBgNV
-HRMBAf8EBTADAQH/MB0GA1UdDgQWBBQIds3LB/8k9sXN7buQvOKEN0Z19zAOBgNV
-HQ8BAf8EBAMCAQYwDQYJKoZIhvcNAQEFBQADggEBAKaorSLOAT2mo/9i0Eidi15y
-sHhE49wcrwn9I0j6vSrEuVUEtRCjjSfeC4Jj0O7eDDd5QVsisrCaQVymcODU0HfL
-I9MA4GxWL+FpDQ3Zqr8hgVDZBqWo/5U30Kr+4rP1mS1FhIrlQgnXdAIv94nYmem8
-J9RHjboNRhx3zxSkHLmkMcScKHQDNP8zGSal6Q10tz6XxnboJ5ajZt3hrvJBW8qY
-VoNzcOSGGtIxQbovvi0TWnZvTuhOgQ4/WwMioBK+ZlgRSssDxLQqKi2WF+A5VLxI
-03YnnZotBqbJ7DnSq9ufmgsnAjUpsUCV5/nonFWIGUbWtzT1fs45mtk48VH3Tyw=
------END CERTIFICATE-----
-
-# Issuer: CN=Certinomis - Autorit\xe9 Racine O=Certinomis OU=0002 433998903
-# Subject: CN=Certinomis - Autorit\xe9 Racine O=Certinomis OU=0002 433998903
-# Label: "Certinomis - Autorit\xe9 Racine"
-# Serial: 1
-# MD5 Fingerprint: 7f:30:78:8c:03:e3:ca:c9:0a:e2:c9:ea:1e:aa:55:1a
-# SHA1 Fingerprint: 2e:14:da:ec:28:f0:fa:1e:8e:38:9a:4e:ab:eb:26:c0:0a:d3:83:c3
-# SHA256 Fingerprint: fc:bf:e2:88:62:06:f7:2b:27:59:3c:8b:07:02:97:e1:2d:76:9e:d1:0e:d7:93:07:05:a8:09:8e:ff:c1:4d:17
------BEGIN CERTIFICATE-----
-MIIFnDCCA4SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJGUjET
-MBEGA1UEChMKQ2VydGlub21pczEXMBUGA1UECxMOMDAw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DVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBQN
-jLZh2kS40RR9w759XkjwzspqsDAXBgNVHSAEEDAOMAwGCiqBegFWAgIAAQEwDQYJ
-KoZIhvcNAQEFBQADggIBACQ+YAZ+He86PtvqrxyaLAEL9MW12Ukx9F1BjYkMTv9s
-ov3/4gbIOZ/xWqndIlgVqIrTseYyCYIDbNc/CMf4uboAbbnW/FIyXaR/pDGUu7ZM
-OH8oMDX/nyNTt7buFHAAQCvaR6s0fl6nVjBhK4tDrP22iCj1a7Y+YEq6QpA0Z43q
-619FVDsXrIvkxmUP7tCMXWY5zjKn2BCXwH40nJ+U8/aGH88bc62UeYdocMMzpXDn
-2NU4lG9jeeu/Cg4I58UvD0KgKxRA/yHgBcUn4YQRE7rWhh1BCxMjidPJC+iKunqj
-o3M3NYB9Ergzd0A4wPpeMNLytqOx1qKVl4GbUu1pTP+A5FPbVFsDbVRfsbjvJL1v
-nxHDx2TCDyhihWZeGnuyt++uNckZM6i4J9szVb9o4XVIRFb7zdNIu0eJOqxp9YDG
-5ERQL1TEqkPFMTFYvZbF6nVsmnWxTfj3l/+WFvKXTej28xH5On2KOG4Ey+HTRRWq
-pdEdnV1j6CTmNhTih60bWfVEm/vXd3wfAXBioSAaosUaKPQhA+4u2cGA6rnZgtZb
-dsLLO7XSAPCjDuGtbkD326C00EauFddEwk01+dIL8hf2rGbVJLJP0RyZwG71fet0
-BLj5TXcJ17TPBzAJ8bgAVtkXFhYKK4bfjwEZGuW7gmP/vgt2Fl43N+bYdJeimUV5
------END CERTIFICATE-----
-
-# Issuer: CN=TWCA Root Certification Authority O=TAIWAN-CA OU=Root CA
-# Subject: CN=TWCA Root Certification Authority O=TAIWAN-CA OU=Root CA
-# Label: "TWCA Root Certification Authority"
-# Serial: 1
-# MD5 Fingerprint: aa:08:8f:f6:f9:7b:b7:f2:b1:a7:1e:9b:ea:ea:bd:79
-# SHA1 Fingerprint: cf:9e:87:6d:d3:eb:fc:42:26:97:a3:b5:a3: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q56YAf4lCmtYR5VPOL8zy2gXE/uJQxDqGfczafhAJO5I1KlOy/usrBdls
-XebQ79NqZp4VKIV66IIArB6nCWlWQtNoURi+VJq/REG6Sb4gumlc7rh3zc5sH62D
-lhh9DrUUOYTxKOkto557HnpyWoOzeW/vtPzQCqVYT0bf+215WfKEIlKuD8z7fDvn
-aspHYcN6+NOSBB+4IIThNlQWx0DeO4pz3N/GCUzf7Nr/1FNCocnyYh0igzyXxfkZ
-YiesZSLX0zzG5Y6yU8xJzrww/nsOM5D77dIUkR8Hrw==
------END CERTIFICATE-----
-
-# Issuer: O=SECOM Trust Systems CO.,LTD. OU=Security Communication RootCA2
-# Subject: O=SECOM Trust Systems CO.,LTD. OU=Security Communication RootCA2
-# Label: "Security Communication RootCA2"
-# Serial: 0
-# MD5 Fingerprint: 6c:39:7d:a4:0e:55:59:b2:3f:d6:41:b1:12:50:de:43
-# SHA1 Fingerprint: 5f:3b:8c:f2:f8:10:b3:7d:78:b4:ce:ec:19:19:c3:73:34:b9:c7:74
-# SHA256 Fingerprint: 51:3b:2c:ec:b8:10:d4:cd:e5:dd:85:39:1a:df:c6:c2:dd:60:d8:7b:b7:36:d2:b5:21:48:4a:a4:7a:0e:be:f6
------BEGIN CERTIFICATE-----
-MIIDdzCCAl+gAwIBAgIBADANBgkqhkiG9w0BAQsFADBdMQswCQYDVQQGEwJKUDEl
-MCMGA1UEChMcU0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEnMCUGA1UECxMe
-U2VjdXJpdHkgQ29tbXVuaWNhdGlvbiBSb290Q0EyMB4XDTA5MDUyOTA1MDAzOVoX
-DTI5MDUyOTA1MDAzOVowXTELMAkGA1UEBhMCSlAxJTAjBgNVBAoTHFNFQ09NIFRy
-dXN0IFN5c3RlbXMgQ08uLExURC4xJzAlBgNVBAsTHlNlY3VyaXR5IENvbW11bmlj
-YXRpb24gUm9vdENBMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANAV
-OVKxUrO6xVmCxF1SrjpDZYBLx/KWvNs2l9amZIyoXvDjChz335c9S672XewhtUGr
-zbl+dp+++T42NKA7wfYxEUV0kz1XgMX5iZnK5atq1LXaQZAQwdbWQonCv/Q4EpVM
-VAX3NuRFg3sUZdbcDE3R3n4MqzvEFb46VqZab3ZpUql6ucjrappdUtAtCms1FgkQ
-hNBqyjoGADdH5H5XTz+L62e4iKrFvlNVspHEfbmwhRkGeC7bYRr6hfVKkaHnFtWO
-ojnflLhwHyg/i/xAXmODPIMqGplrz95Zajv8bxbXH/1KEOtOghY6rCcMU/Gt1SSw
-awNQwS08Ft1ENCcadfsCAwEAAaNCMEAwHQYDVR0OBBYEFAqFqXdlBZh8QIH4D5cs
-OPEK7DzPMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3
-DQEBCwUAA4IBAQBMOqNErLlFsceTfsgLCkLfZOoc7llsCLqJX2rKSpWeeo8HxdpF
-coJxDjrSzG+ntKEju/Ykn8sX/oymzsLS28yN/HH8AynBbF0zX2S2ZTuJbxh2ePXc
-okgfGT+Ok+vx+hfuzU7jBBJV1uXk3fs+BXziHV7Gp7yXT2g69ekuCkO2r1dcYmh8
-t/2jioSgrGK+KwmHNPBqAbubKVY8/gA3zyNs8U6qtnRGEmyR7jTV7JqR50S+kDFy
-1UkC9gLl9B/rfNmWVan/7Ir5mUf/NVoCqgTLiluHcSmRvaS0eg29mvVXIwAHIRc/
-SjnRBUkLp7Y3gaVdjKozXoEofKd9J+sAro03
------END CERTIFICATE-----
-
-# Issuer: CN=Hellenic Academic and Research Institutions RootCA 2011 O=Hellenic Academic and Research Institutions Cert. Authority
-# Subject: CN=Hellenic Academic and Research Institutions RootCA 2011 O=Hellenic Academic and Research Institutions Cert. Authority
-# Label: "Hellenic Academic and Research Institutions RootCA 2011"
-# Serial: 0
-# MD5 Fingerprint: 73:9f:4c:4b:73:5b:79:e9:fa:ba:1c:ef:6e:cb:d5:c9
-# SHA1 Fing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+UCAwEAAaOBiTCBhjAPBgNV
-HRMBAf8EBTADAQH/MAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQUppFC/RNhSiOeCKQp
-5dgTBCPuQSUwRwYDVR0eBEAwPqA8MAWCAy5ncjAFggMuZXUwBoIELmVkdTAGggQu
-b3JnMAWBAy5ncjAFgQMuZXUwBoEELmVkdTAGgQQub3JnMA0GCSqGSIb3DQEBBQUA
-A4IBAQAf73lB4XtuP7KMhjdCSk4cNx6NZrokgclPEg8hwAOXhiVtXdMiKahsog2p
-6z0GW5k6x8zDmjR/qw7IThzh+uTczQ2+vyT+bOdrwg3IBp5OjWEopmr95fZi6hg8
-TqBTnbI6nOulnJEWtk2C4AwFSKls9cz4y51JtPACpf1wA+2KIaWuE4ZJwzNzvoc7
-dIsXRSZMFpGD/md9zU1jZ/rzAxKWeAaNsWftjj++n08C9bMJL/NMh98qy5V8Acys
-Nnq/onN694/BtZqhFLKPM58N7yLcZnuEvUUXBj08yrl3NI/K6s8/MT7jiOOASSXI
-l7WdmplNsDz4SgCbZN2fOUvRJ9e4
------END CERTIFICATE-----
-
-# Issuer: CN=Actalis Authentication Root CA O=Actalis S.p.A./03358520967
-# Subject: CN=Actalis Authentication Root CA O=Actalis S.p.A./03358520967
-# Label: "Actalis Authentication Root CA"
-# Serial: 6271844772424770508
-# MD5 Fingerprint: 69:c1:0d:4f:07:a3:1b:c3:fe:56:3d:04:bc:11:f6:a6
-# SHA1 Fingerprint: f3:73:b3:87:06:5a:28:84:8a:f2:f3:4a:ce:19:2b:dd:c7:8e:9c:ac
-# SHA256 Fingerprint: 55:92:60:84:ec:96:3a:64:b9:6e:2a:be:01:ce:0b:a8:6a:64:fb:fe:bc:c7:aa:b5:af:c1:55:b3:7f:d7:60:66
------BEGIN CERTIFICATE-----
-MIIFuzCCA6OgAwIBAgIIVwoRl0LE48wwDQYJKoZIhvcNAQELBQAwazELMAkGA1UE
-BhMCSVQxDjAMBgNVBAcMBU1pbGFuMSMwIQYDVQQ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z
-ezhwlMkCAjbQMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUUtiIOsifeGbt
-ifN7OHCUyQICNtAwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBCwUAA4ICAQAL
-e3KHwGCmSUyIWOYdiPcUZEim2FgKDk8TNd81HdTtBjHIgT5q1d07GjLukD0R0i70
-jsNjLiNmsGe+b7bAEzlgqqI0JZN1Ut6nna0Oh4lScWoWPBkdg/iaKWW+9D+a2fDz
-WochcYBNy+A4mz+7+uAwTc+G02UQGRjRlwKxK3JCaKygvU5a2hi/a5iB0P2avl4V
-SM0RFbnAKVy06Ij3Pjaut2L9HmLecHgQHEhb2rykOLpn7VU+Xlff1ANATIGk0k9j
-pwlCCRT8AKnCgHNPLsBA2RF7SOp6AsDT6ygBJlh0wcBzIm2Tlf05fbsq4/aC4yyX
-X04fkZT6/iyj2HYauE2yOE+b+h1IYHkm4vP9qdCa6HCPSXrW5b0KDtst842/6+Ok
-fcvHlXHo2qN8xcL4dJIEG4aspCJTQLas/kx2z/uUMsA1n3Y/buWQbqCmJqK4LL7R
-K4X9p2jIugErsWx0Hbhzlefut8cl8ABMALJ+tguLHPPAUJ4lueAI3jZm/zel0btU
-ZCzJJ7VLkn5l/9Mt4blOvH+kQSGQQXemOR/qnuOf0GZvBeyqdn6/axag67XH/JJU
-LysRJyU3eExRarDzzFhdFPFqSBX/wge2sY0PjlxQRrM9vwGYT7JZVEc+NHt4bVaT
-LnPqZih4zR0Uv6CPLy64Lo7yFIrM6bV8+2ydDKXhlg==
------END CERTIFICATE-----
-
-# Issuer: O=Trustis Limited OU=Trustis FPS Root CA
-# Subject: O=Trustis Limited OU=Trustis FPS Root CA
-# Label: "Trustis FPS Root CA"
-# Serial: 36053640375399034304724988975563710553
-# MD5 Fingerprint: 30:c9:e7:1e:6b:e6:14:eb:65:b2:16:69:20:31:67:4d
-# SHA1 Fingerprint: 3b:c0:38:0b:33:c3:f6:a6:0c:86:15:22:93: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BJV+JOCyinpXj9WV4s4NvdFGkwozZ5BuO1WTISkQMi4sKUraXAEasP4
-1BIy+Q7DsdwyhEQsb8tGD+pmQQ9P8Vilpg0ND2HepZ5dfWWhPBfnqFVO76DH7cZE
-f1T1o+CP8HxVIo8ptoGj4W1OLBuAZ+ytIJ8MYmHVl/9D7S3B2l0pKoU/rGXuhg8F
-jZBf3+6f9L/uHfuY5H+QK4R4EA5sSVPvFVtlRkpdr7r7OnIdzfYliB6XzCGcKQEN
-ZetX2fNXlrtIzYE=
------END CERTIFICATE-----
-
-# Issuer: CN=StartCom Certification Authority O=StartCom Ltd. OU=Secure Digital Certificate Signing
-# Subject: CN=StartCom Certification Authority O=StartCom Ltd. OU=Secure Digital Certificate Signing
-# Label: "StartCom Certification Authority"
-# Serial: 45
-# MD5 Fingerprint: c9:3b:0d:84:41:fc:a4:76:79:23:08:57:de:10:19:16
-# SHA1 Fingerprint: a3:f1:33:3f:e2:42:bf:cf:c5:d1:4e:8f:39:42:98:40:68:10:d1:a0
-# SHA256 Fingerprint: e1:78:90:ee:09:a3:fb:f4:f4:8b:9c:41:4a:17:d6:37:b7:a5:06:47:e9:bc:75:23:22:72:7f:cc:17:42:a9:11
------BEGIN CERTIFICATE-----
-MIIHhzCCBW+gAwIBAgIBLTANBgkqhkiG9w0BAQsFADB9MQswCQYDVQQGEwJJTDEW
-MBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwg
-Q2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNh
-dGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0NjM3WhcNMzYwOTE3MTk0NjM2WjB9
-MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMi
-U2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3Rh
-cnRDb20g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a4FTbzrqpMrUi9nNBCV24F10OD5mQ1kfabwo6YigUZ4LZ
-8dCAWZvLMdibD4x3TrVoivJs9iQOLWxwxXPR3hTQcY+203sC9uO41Alua551hDnm
-fyWl8kgAwKQB2j8=
------END CERTIFICATE-----
-
-# Issuer: CN=StartCom Certification Authority G2 O=StartCom Ltd.
-# Subject: CN=StartCom Certification Authority G2 O=StartCom Ltd.
-# Label: "StartCom Certification Authority G2"
-# Serial: 59
-# MD5 Fingerprint: 78:4b:fb:9e:64:82:0a:d3:b8:4c:62:f3:64:f2:90:64
-# SHA1 Fingerprint: 31:f1:fd:68:22:63:20:ee:c6:3b:3f:9d:ea:4a:3e:53:7c:7c:39:17
-# SHA256 Fingerprint: c7:ba:65:67:de:93:a7:98:ae:1f:aa:79:1e:71:2d:37:8f:ae:1f:93:c4:39:7f:ea:44:1b:b7:cb:e6:fd:59:95
------BEGIN CERTIFICATE-----
-MIIFYzCCA0ugAwIBAgIBOzANBgkqhkiG9w0BAQsFADBTMQswCQYDVQQGEwJJTDEW
-MBQGA1UEChMNU3RhcnRDb20gTHRkLjEsMCoGA1UEAxMjU3RhcnRDb20gQ2VydGlm
-aWNhdGlvbiBBdXRob3JpdHkgRzIwHhcNMTAwMTAxMDEwMDAxWhcNMzkxMjMxMjM1
-OTAxWjBTMQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjEsMCoG
-A1UEAxMjU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgRzIwggIiMA0G
-CSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2iTZbB7cgNr2Cu+EWIAOVeq8Oo1XJ
-JZlKxdBWQYeQTSFgpBSHO839sj60ZwNq7eEPS8CRhXBF4EKe3ikj1AENoBB5uNsD
-vfOpL9HG4A/LnooUCri99lZi8cVytjIl2bLzvWXFDSxu1ZJvGIsAQRSCb0AgJnoo
-D/Uefyf3lLE3PbfHkffiAez9lInhzG7TNtYKGXmu1zSCZf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zD8AK6vM8EOTmy6p6ahfzLbOOCxchcKK5HsamMm7YnUeMx0HgX4a/6ManY5Ka5l
-IxKVCCIcl85bBu4M4ru8H0ST9tg4RQUh7eStqxK2A6RCLi3ECToDZ2mEmuFZkIoo
-hdVddLHRDiBYmxOlsGOm7XtH/UVVMKTumtTm4ofvmMkyghEpIrwACjFeLQ/Ajulr
-so8uBtjRkcfGEvRM/TAXw8HaOFvjqermobp573PYtlNXLfbQ4ddI
------END CERTIFICATE-----
-
-# Issuer: CN=Buypass Class 2 Root CA O=Buypass AS-983163327
-# Subject: CN=Buypass Class 2 Root CA O=Buypass AS-983163327
-# Label: "Buypass Class 2 Root CA"
-# Serial: 2
-# MD5 Fingerprint: 46:a7:d2:fe:45:fb:64:5a:a8:59:90:9b:78:44:9b:29
-# SHA1 Fingerprint: 49:0a:75:74:de:87:0a:47:fe:58:ee:f6:c7:6b:eb:c6:0b:12:40:99
-# SHA256 Fingerprint: 9a:11:40:25:19:7c:5b:b9:5d:94:e6:3d:55:cd:43:79:08:47:b6:46:b2:3c:df:11:ad:a4:a0:0e:ff:15:fb:48
------BEGIN CERTIFICATE-----
-MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEd
-MBsGA1UECgwUQnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3Mg
-Q2xhc3MgMiBSb290IENBMB4XDTEwMTAyNjA4MzgwM1oXDTQwMTAyNjA4MzgwM1ow
-TjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBhc3MgQVMtOTgzMTYzMzI3MSAw
-HgYDVQQDDBdCdXlwYXNzIENsYXNzIDIgUm9vdCBDQTCCAiIwDQYJKoZIhvcNAQEB
-BQADggIPADCCAgoCggIBANfHXvfBB9R3+0Mh9PT1aeTuMgHbo4Yf5FkNuud1g1Lr
-6hxhFUi7HQfKjK6w3Jad6sNgkoaCKHOcVgb/S2TwDCo3SbXlzwx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Oula9+ZEsuK1V6ADJHgJgg2SMX6OBE1/yWDLfJ6v9r9jv6ly0Us
-H8SIU653DtmadsWOLB2jutXsMq7Aqqz30XpN69QH4kj3Io6wpJ9qzo6ysmD0oyLQ
-I+uUWnpp3Q+/QFesa1lQ2aOZ4W7+jQF5JyMV3pKdewlNWudLSDBaGOYKbeaP4NK7
-5t98biGCwWg5TbSYWGZizEqQXsP6JwSxeRV0mcy+rSDeJmAc61ZRpqPq5KM/p/9h
-3PFaTWwyI0PurKju7koSCTxdccK+efrCh2gdC/1cacwG0Jp9VJkqyTkaGa9LKkPz
-Y11aWOIv4x3kqdbQCtCev9eBCfHJxyYNrJgWVqA=
------END CERTIFICATE-----
-
-# Issuer: CN=Buypass Class 3 Root CA O=Buypass AS-983163327
-# Subject: CN=Buypass Class 3 Root CA O=Buypass AS-983163327
-# Label: "Buypass Class 3 Root CA"
-# Serial: 2
-# MD5 Fingerprint: 3d:3b:18:9e:2c:64:5a:e8:d5:88:ce:0e:f9:37:c2:ec
-# SHA1 Fingerprint: da:fa:f7:fa:66:84:ec:06:8f:14:50:bd:c7:c2:81:a5:bc:a9:64:57
-# SHA256 Fingerprint: ed:f7:eb:bc:a2:7a:2a:38:4d:38:7b:7d:40:10:c6:66:e2:ed:b4:84:3e:4c:29:b4:ae:1d:5b:93:32:e6:b2:4d
------BEGIN CERTIFICATE-----
-MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEd
-MBsGA1UECgwUQnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3Mg
-Q2xhc3MgMyBSb290IENBMB4XDTEwMTAyNjA4Mjg1OFoXDTQwMTAyNjA4Mjg1OFow
-TjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBhc3MgQVMtOTgzMTYzMzI3MSAw
-HgYDVQQDDBdCdXlwYXNzIENsYXNzIDMgUm9vdCBDQTCCAiIwDQYJKoZIhvcNAQ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Js4j1xrG0aGQ0JfPgEHU1RdZX33inOhmlRaHylDFCfChQ+1iHsa
-O5S3HWCntZznKWlXWpuTekMwGwPXYshApqr8ZORK15FTAaggiG6cX0S5y2CBNOxv
-033aSF/rtJC8LakcC6wc1aJoIIAE1vyxjy+7SjENSoYc6+I2KSb12tjE8nVhz36u
-dmNKekBlk4f4HoCMhuWG1o8O/FMsYOgWYRqiPkN7zTlgVGr18okmAWiDSKIz6MkE
-kbIRNBE+6tBDGR8Dk5AM/1E9V/RBbuHLoL7ryWPNbczk+DaqaJ3tvV2XcEQNtg41
-3OEMXbugUZTLfhbrES+jkkXITHHZvMmZUldGL1DPvTVp9D0VzgalLA8+9oG6lLvD
-u79leNKGef9JOxqDDPDeeOzI8k1MGt6CKfjBWtrt7uYnXuhF0J0cUahoq0Tj0Itq
-4/g7u9xN12TyUb7mqqta6THuBrxzvxNiCp/HuZc=
------END CERTIFICATE-----
-
-# Issuer: CN=T-TeleSec GlobalRoot Class 3 O=T-Systems Enterprise Services GmbH OU=T-Systems Trust Center
-# Subject: CN=T-TeleSec GlobalRoot Class 3 O=T-Systems Enterprise Services GmbH OU=T-Systems Trust Center
-# Label: "T-TeleSec GlobalRoot Class 3"
-# Serial: 1
-# MD5 Fingerprint: ca:fb:40:a8:4e:39:92:8a:1d:fe:8e:2f:c4:27:ea:ef
-# SHA1 Fingerprint: 55:a6:72:3e:cb:f2:ec:cd:c3:23:74:70:19:9d:2a:be:11:e3:81:d1
-# SHA256 Fingerprint: fd:73:da:d3:1c:64:4f:f1:b4:3b:ef:0c:cd:da:96:71:0b:9c:d9:87:5e:ca:7e:31:70:7a:f3:e9:6d:52:2b:bd
------BEGIN CERTIFICATE-----
-MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUx
-KzApBgNVBAoMIlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAd
-BgNVBAsMFlQtU3lzdGVtcyBUcnV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ZLZGOMivgkeGj5asuRrDFR6fUNOuIml
-e9eiPZaGzPImNC1qkp2aGtAw4l1OBLBfiyB+d8E9lYLRRpo7PHi4b6HQDWSieB4p
-TpPDpFQUWw==
------END CERTIFICATE-----
-
-# Issuer: CN=EE Certification Centre Root CA O=AS Sertifitseerimiskeskus
-# Subject: CN=EE Certification Centre Root CA O=AS Sertifitseerimiskeskus
-# Label: "EE Certification Centre Root CA"
-# Serial: 112324828676200291871926431888494945866
-# MD5 Fingerprint: 43:5e:88:d4:7d:1a:4a:7e:fd:84:2e:52:eb:01:d4:6f
-# SHA1 Fingerprint: c9:a8:b9:e7:55:80:5e:58:e3:53:77:a7:25:eb:af:c3:7b:27:cc:d7
-# SHA256 Fingerprint: 3e:84:ba:43:42:90:85:16:e7:75:73:c0:99:2f:09:79:ca:08:4e:46:85:68:1f:f1:95:cc:ba:8a:22:9b:8a:76
------BEGIN CERTIFICATE-----
-MIIEAzCCAuugAwIBAgIQVID5oHPtPwBMyonY43HmSjANBgkqhkiG9w0BAQUFADB1
-MQswCQYDVQQGEwJFRTEiMCAGA1UECgwZQVMgU2VydGlmaXRzZWVyaW1pc2tlc2t1
-czEoMCYGA1UEAwwfRUUgQ2VydGlmaWNhdGlvbiBDZW50cmUgUm9vdCBDQTEYMBYG
-CSqGSIb3DQEJARYJcGtpQHNrLmVlMCIYDzIwMTAxMDMwMTAxMDMwWhgPMjAzMDEy
-MTcyMzU5NTlaMHUxCzAJBgNVBAYTAkVFMSIwIAYDVQQKDBlBUyBTZXJ0aWZpdHNl
-ZXJpbWlza2Vza3VzMSgwJgYDVQQDDB9FRSBDZXJ0aWZpY2F0aW9uIENlbnRyZSBS
-b290IENBMRgwFgYJKoZIhvcNAQkBFglwa2lAc2suZWUwggEiMA0GCSqGSIb3DQEB
-AQUAA4IBDwAwggEKAoIBAQDIIMDs4MVLqwd4lfNE7vsLDP90jmG7sWLqI9iroWUy
-euuOF0+W2Ap7kaJjbMeMTC55v6kF/GlclY1i+blw7cNRfdCT5mzrMEvhvH2/UpvO
-bntl8jixwKIy72KyaOBhU8E2lf/slLo2rpwcpzIP5Xy0xm90/XsY6KxX7QYgSzIw
-WFv9zajmofxwvI6Sc9uXp3whrj3B9UiHbCe9nyV0gVWw93X2PaRka9ZP585ArQ/d
-MtO8ihJTmMmJ+xAdTX7Nfh9WDSFwhfYggx/2uh8Ej+p3iDXE/+pOoYtNP2MbRMNE
-1CV2yreN1x5KZmTNXMWcg+HCCIia7E6j8T4cLNlsHaFLAgMBAAGjgYowgYcwDwYD
-VR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBLyWj7qVhy/
-zQas8fElyalL1BSZMEUGA1UdJQQ+MDwGCCsGAQUFBwMCBggrBgEFBQcDAQYIKwYB
-BQUHAwMGCCsGAQUFBwMEBggrBgEFBQcDCAYIKwYBBQUHAwkwDQYJKoZIhvcNAQEF
-BQADggEBAHv25MANqhlHt01Xo/6tu7Fq1Q+e2+RjxY6hUFaTlrg4wCQiZrxTFGGV
-v9DHKpY5P30osxBAIWrEr7BSdxjhlthWXePdNl4dp1BUoMUq5KqMlIpPnTX/dqQG
-E5Gion0ARD9V04I8GtVbvFZMIi5GQ4okQC3zErg7cBqklrkar4dBGmoYDQZPxz5u
-uSlNDUmJEYcyW+ZLBMjkXOZ0c5RdFpgTlf7727FE5TpwrDdr5rMzcijJs1eg9gIW
-iAYLtqZLICjU3j2LrTcFU3T+bsy8QxdxXvnFzBqpYe73dgzzcvRyrc9yAjYHR8/v
-GVCJYMzpJJUPwssd8m92kMfMdcGWxZ0=
------END CERTIFICATE-----
-
-# Issuer: CN=T\xdcRKTRUST Elektronik Sertifika Hizmet Sa\u011flay\u0131c\u0131s\u0131 O=T\xdcRKTRUST Bilgi \u0130leti\u015fim ve Bili\u015fim G\xfcvenli\u011fi Hizmetleri A.\u015e. (c) Aral\u0131k 2007
-# Subject: CN=T\xdcRKTRUST Elektronik Sertifika Hizmet Sa\u011flay\u0131c\u0131s\u0131 O=T\xdcRKTRUST Bilgi \u0130leti\u015fim ve Bili\u015fim G\xfcvenli\u011fi Hizmetleri A.\u015e. (c) Aral\u0131k 2007
-# Label: "TURKTRUST Certificate Services Provider Root 2007"
-# Serial: 1
-# MD5 Fingerprint: 2b:70:20:56:86:82:a0:18:c8:07:53:12:28:70:21:72
-# SHA1 Fingerprint: f1:7f:6f:b6:31:dc:99:e3:a3:c8:7f:fe:1c:f1:81:10:88:d9:60:33
-# SHA256 Fingerprint: 97:8c:d9:66:f2:fa:a0:7b:a7:aa:95:00:d9:c0:2e:9d:77:f2:cd:ad:a6:ad:6b:a7:4a:f4:b9:1c:66:59:3c:50
------BEGIN CERTIFICATE-----
-MIIEPTCCAyWgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBvzE/MD0GA1UEAww2VMOc
-UktUUlVTVCBFbGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sx
-c8SxMQswCQYDVQQGEwJUUjEPMA0GA1UEBwwGQW5rYXJhMV4wXAYDVQQKDFVUw5xS
-S1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUgQmlsacWfaW0gR8O8dmVubGnEn2kg
-SGl6bWV0bGVyaSBBLsWeLiAoYykgQXJhbMSxayAyMDA3MB4XDTA3MTIyNTE4Mzcx
-OVoXDTE3MTIyMjE4MzcxOVowgb8xPzA9BgNVBAMMNlTDnFJLVFJVU1QgRWxla3Ry
-b25payBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsTELMAkGA1UEBhMC
-VFIxDzANBgNVBAcMBkFua2FyYTFeMFwGA1UECgxVVMOcUktUUlVTVCBCaWxnaSDE
-sGxldGnFn2ltIHZlIEJpbGnFn2ltIEfDvHZlbmxpxJ9pIEhpem1ldGxlcmkgQS7F
-ni4gKGMpIEFyYWzEsWsgMjAwNzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
-ggEBAKu3PgqMyKVYFeaK7yc9SrToJdPNM8Ig3BnuiD9NYvDdE3ePYakqtdTyuTFY
-KTsvP2qcb3N2Je40IIDu6rfwxArNK4aUyeNgsURSsloptJGXg9i3phQvKUmi8wUG
-+7RP2qFsmmaf8EMJyupyj+sA1zU511YXRxcw9L6/P8JorzZAwan0qafoEGsIiveG
-HtyaKhUG9qPw9ODHFNRRf8+0222vR5YXm3dx2KdxnSQM9pQ/hTEST7ruToK4uT6P
-IzdezKKqdfcYbwnTrqdUKDT74eA7YH2gvnmJhsifLfkKS8RQouf9eRbHegsYz85M
-733WB2+Y8a+xwXrXgTW4qhe04MsCAwEAAaNCMEAwHQYDVR0OBBYEFCnFkKslrxHk
-Yb+j/4hhkeYO/pyBMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0G
-CSqGSIb3DQEBBQUAA4IBAQAQDdr4Ouwo0RSVgrESLFF6QSU2TJ/sPx+EnWVUXKgW
-AkD6bho3hO9ynYYKVZ1WKKxmLNA6VpM0ByWtCLCPyA8JWcqdmBzlVPi5RX9ql2+I
-aE1KBiY3iAIOtsbWcpnOa3faYjGkVh+uX4132l32iPwa2Z61gfAyuOOI0JzzaqC5
-mxRZNTZPz/OOXl0XrRWV2N2y1RVuAE6zS89mlOTgzbUF2mNXi+WzqtvALhyQRNsa
-XRik7r4EW5nVcV9VZWRi1aKbBFmGyGJ353yCRWo9F7/snXUMrqNvWtMvmDb08PUZ
-qxFdyKbjKlhqQgnDvZImZjINXQhVdP+MmNAKpoRq0Tl9
------END CERTIFICATE-----
-
-# Issuer: CN=D-TRUST Root Class 3 CA 2 2009 O=D-Trust GmbH
-# Subject: CN=D-TRUST Root Class 3 CA 2 2009 O=D-Trust GmbH
-# Label: "D-TRUST Root Class 3 CA 2 2009"
-# Serial: 623603
-# MD5 Fingerprint: cd:e0:25:69:8d:47:ac:9c:89:35:90:f7:fd:51:3d:2f
-# SHA1 Fingerprint: 58:e8:ab:b0:36:15:33:fb:80:f7:9b:1b:6d:29:d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MDIwMDksTz1ELVRydXN0JTIwR21iSCxDPURFP2NlcnRpZmljYXRl
-cmV2b2NhdGlvbmxpc3QwQ6BBoD+GPWh0dHA6Ly93d3cuZC10cnVzdC5uZXQvY3Js
-L2QtdHJ1c3Rfcm9vdF9jbGFzc18zX2NhXzJfMjAwOS5jcmwwDQYJKoZIhvcNAQEL
-BQADggEBAH+X2zDI36ScfSF6gHDOFBJpiBSVYEQBrLLpME+bUMJm2H6NMLVwMeni
-acfzcNsgFYbQDfC+rAF1hM5+n02/t2A7nPPKHeJeaNijnZflQGDSNiH+0LS4F9p0
-o3/U37CYAqxva2ssJSRyoWXuJVrl5jLn8t+rSfrzkGkj2wTZ51xY/GXUl77M/C4K
-zCUqNQT4YJEVdT1B/yMfGchs64JTBKbkTCJNjYy6zltz7GRUUG3RnFX7acM2w4y8
-PIWmawomDeCTmGCufsYkl4phX5GOZpIJhzbNi5stPvZR1FDUWSi9g/LMKHtThm3Y
-Johw1+qRzT65ysCQblrGXnRl11z+o+I=
------END CERTIFICATE-----
-
-# Issuer: CN=D-TRUST Root Class 3 CA 2 EV 2009 O=D-Trust GmbH
-# Subject: CN=D-TRUST Root Class 3 CA 2 EV 2009 O=D-Trust GmbH
-# Label: "D-TRUST Root Class 3 CA 2 EV 2009"
-# Serial: 623604
-# MD5 Fingerprint: aa:c6:43:2c:5e:2d:cd:c4:34:c0:50:4f:11:02:4f:b6
-# SHA1 Fingerprint: 96:c9:1b:0b:95:b4:10:98:42:fa:d0:d8:22:79:fe:60:fa:b9:16:83
-# SHA256 Fingerprint: ee:c5:49:6b:98:8c:e9:86:25:b9:34:09:2e:ec:29:08:be:d0:b0:f3:16:c2:d4:73:0c:84:ea:f1:f3:d3:48:81
------BEGIN CERTIFICATE-----
-MIIEQzCCAyugAwIBAgIDCYP0MA0GCSqGSIb3DQEBCwUAMFAxCzAJBgNVBAYTAkRF
-MRUwEwYDVQQKDAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9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p
-3uDx1MYkCenBz1UbtDDZzhr+BlGmFaQt77JLvyAoJUnRpjZ3NOhk31KxEcdzes05
-nsKtjHEh8lprr988TlWvsoRlFIm5d8sqMb7Po23Pb0iUMkZv53GMoKaEGTcH8gNF
-CSuGdXzfX2lXANtu2KZyIktQ1HWYVt+3GP9DQ1CuekR78HlR10M9p9OB0/DJT7na
-xpeG0ILD5EJt/rDiZE4OJudANCa1CInXCGNjOCd1HjPqbqjdn5lPdE2BiYBL3ZqX
-KVwvvoFBuYz/6n1gBp7N1z3TLqMVvKjmJuVvw9y4AyHqnxbxLFS1
------END CERTIFICATE-----
-
-# Issuer: CN=Autoridad de Certificacion Raiz del Estado Venezolano O=Sistema Nacional de Certificacion Electronica OU=Superintendencia de Servicios de Certificacion Electronica
-# Subject: CN=PSCProcert O=Sistema Nacional de Certificacion Electronica OU=Proveedor de Certificados PROCERT
-# Label: "PSCProcert"
-# Serial: 11
-# MD5 Fingerprint: e6:24:e9:12:01:ae:0c:de:8e:85:c4:ce:a3:12:dd:ec
-# SHA1 Fingerprint: 70:c1:8d:74:b4:28:81:0a:e4:fd:a5:75:d7:01:9f:99:b0:3d:50:74
-# SHA256 Fingerprint: 3c:fc:3c:14:d1:f6:84:ff:17:e3:8c:43:ca:44:0c:00:b9:67:ec:93:3e:8b:fe:06:4c:a1:d7:2c:90:f2:ad:b0
------BEGIN CERTIFICATE-----
-MIIJhjCCB26gAwIBAgIBCzANBgkqhkiG9w0BAQsFADCCAR4xPjA8BgNVBAMTNUF1
-dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIFJhaXogZGVsIEVzdGFkbyBWZW5lem9s
-YW5vMQswCQYDVQQGEwJWRTEQMA4GA1UEBxMHQ2FyYWNhczEZMBcGA1UECBMQRGlz
-dHJpdG8gQ2FwaXRhbDE2MDQGA1UEChMtU2lzdGVtYSBOYWNpb25hbCBkZSBDZXJ0
-aWZpY2FjaW9uIEVsZWN0cm9uaWNhMUMwQQYDVQQLEzpTdXBlc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RlLmdvYi52ZTA3BggrBgEFBQcBAQQrMCkwJwYIKwYBBQUHMAGGG2h0dHA6Ly9v
-Y3NwLnN1c2NlcnRlLmdvYi52ZTBBBgNVHSAEOjA4MDYGBmCGXgMBAjAsMCoGCCsG
-AQUFBwIBFh5odHRwOi8vd3d3LnN1c2NlcnRlLmdvYi52ZS9kcGMwDQYJKoZIhvcN
-AQELBQADggIBACtZ6yKZu4SqT96QxtGGcSOeSwORR3C7wJJg7ODU523G0+1ng3dS
-1fLld6c2suNUvtm7CpsR72H0xpkzmfWvADmNg7+mvTV+LFwxNG9s2/NkAZiqlCxB
-3RWGymspThbASfzXg0gTB1GEMVKIu4YXx2sviiCtxQuPcD4quxtxj7mkoP3Yldmv
-Wb8lK5jpY5MvYB7Eqvh39YtsL+1+LrVPQA3uvFd359m21D+VJzog1eWuq2w1n8Gh
-HVnchIHuTQfiSLaeS5UtQbHh6N5+LwUeaO6/u5BlOsju6rEYNxxik6SgMexxbJHm
-pHmJWhSnFFAFTKQAVzAswbVhltw+HoSvOULP5dAssSS830DD7X9jSr3hTxJkhpXz
-sOfIt+FTvZLm8wyWuevo5pLtp4EJFAv8lXrPj9Y0TzYS3F7RNHXGRoAvlQSMx4bE
-qCaJqD8Zm4G7UaRKhqsLEQ+xrmNTbSjq3TNWOByyrYDT13K9mmyZY+gAu0F2Bbdb
-mRiKw7gSXFbPVgx96OLP7bx0R/vu0xdOIk9W/1DzLuY5poLWccret9W6aAjtmcz9
-opLLabid+Qqkpj5PkygqYWwHJgD/ll9ohri4zspV4KuxPX+Y1zMOWj3YeMLEYC/H
-YvBhkdI4sPaeVdtAgAUSM84dkpvRabP/v/GSCmE1P93+hvS84Bpxs2Km
------END CERTIFICATE-----
-
-# Issuer: CN=CA Disig Root R1 O=Disig a.s.
-# Subject: CN=CA Disig Root R1 O=Disig a.s.
-# Label: "CA Disig Root R1"
-# Serial: 14052245610670616104
-# MD5 Fingerprint: be:ec:11:93:9a:f5:69:21:bc:d7:c1:c0:67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 O=Disig a.s.
-# Subject: CN=CA Disig Root R2 O=Disig a.s.
-# Label: "CA Disig Root R2"
-# Serial: 10572350602393338211
-# MD5 Fingerprint: 26:01:fb:d8:27:a7:17:9a:45:54:38:1a:43:01:3b:03
-# SHA1 Fingerprint: b5:61:eb:ea:a4:de:e4:25:4b:69:1a:98:a5:57:47:c2:34:c7:d9:71
-# SHA256 Fingerprint: e2:3d:4a:03:6d:7b:70:e9:f5:95:b1:42:20:79:d2:b9:1e:df:bb:1f:b6:51:a0:63:3e:aa:8a:9d:c5:f8:07:03
------BEGIN CERTIFICATE-----
-MIIFaTCCA1GgAwIBAgIJAJK4iNuwisFjMA0GCSqGSIb3DQEBCwUAMFIxCzAJBgNV
-BAYTAlNLMRMwEQYDVQQHEwpCcmF0aXNsYXZhMRMwEQYDVQQKEwpEaXNpZyBhLnMu
-MRkwFwYDVQQDExBDQSBEaXNpZyBSb290IFIyMB4XDTEyMDcxOTA5MTUzMFoXDTQy
-MDcxOTA5MTUzMFowUjELMAkGA1UEBhMCU0sxEzARBgNVBAcTCkJyYXRpc2xhdmEx
-EzARBgNVBAoTCkRpc2lnIGEucy4xGTAXBgNVBAMTEENBIERpc2lnIFJvb3QgUjIw
-ggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCio8QACdaFXS1tFPbCw3Oe
-NcJxVX6B+6tGUODBfEl45qt5WDza/3wcn9iXAng+a0EE6UG9vgMsRfYvZNSrXaNH
-PWSb6WiaxswbP7q+sos0Ai6YVRn8jG+qX9pMzk0DIaPY0jSTVpbLTAwAFjxfGs3I
-x2ymrdMxp7zo5eFm1tL7A7RBZckQrg4FY8aAamkw/dLukO8NJ9+flXP04SXabBbe
-QTg06ov80egEFGEtQX6sx3dOy1FU+16SGBsEWmjGycT6txOgmLcRK7fWV8x8nhfR
-yyX+hk4kLlYMeE2eARKmK6cBZW58Yh2EhN/qwGu1pSqVg8NTEQxzHQuyRpDRQjrO
-QG6Vrf/GlK1ul4SOfW+eioAN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yu8x
-L4ysEr3vQCj8KWefshNPZiTEUxnpHikV7+ZtsH8tZ/3zbBt1RqPlShfppNcL
------END CERTIFICATE-----
-
-# Issuer: CN=ACCVRAIZ1 O=ACCV OU=PKIACCV
-# Subject: CN=ACCVRAIZ1 O=ACCV OU=PKIACCV
-# Label: "ACCVRAIZ1"
-# Serial: 6828503384748696800
-# MD5 Fingerprint: d0:a0:5a:ee:05:b6:09:94:21:a1:7d:f1:b2:29:82:02
-# SHA1 Fingerprint: 93:05:7a:88:15:c6:4f:ce:88:2f:fa:91:16:52:28:78:bc:53:64:17
-# SHA256 Fingerprint: 9a:6e:c0:12:e1:a7:da:9d:be:34:19:4d:47:8a:d7:c0:db:18:22:fb:07:1d:f1:29:81:49:6e:d1:04:38:41:13
------BEGIN CERTIFICATE-----
-MIIH0zCCBbugAwIBAgIIXsO3pkN/pOAwDQYJKoZIhvcNAQEFBQAwQjESMBAGA1UE
-AwwJQUNDVlJBSVoxMRAwDgYDVQQLDAdQS0lBQ0NWMQ0wCwYDVQQKDARBQ0NWMQsw
-CQYDVQQGEwJFUzAeFw0xMTA1MDUwOTM3MzdaFw0zMDEyMzEwOTM3MzdaMEIxEjAQ
-BgNVBAMMCUFDQ1ZSQUlaMTEQMA4GA1UECwwHUEtJQUNDVjENMAsGA1UECgwEQUND
-VjELMAkGA1UEBhMCRVMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCb
-qau/YUqXry+XZpp0X9DZlv3P4uRm7x8fRzPCRKPfmt4ftVTdFXxpNRFvu8gMjmoY
-HtiP2Ra8EEg2XPBjs5BaXCQ316PWywlxufEBcoSwfdtNgM3802/J+Nq2DoLSRYWo
-G2ioPej0RGy9ocLLA76MPhMAhN9KSMDjIgro6TenGEyxCQ0jVn8ETdkXhBilyNpA
-lHPrzg5XPAOBOp0KoVdDaaxXbXmQeOW1tDvYvEyNKKGno6e6Ak4l0Squ7a4DIrhr
-IA8wKFSVf+DuzgpmndFALW4ir50awQUZ0m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CERTIFICATE-----
-
-# Issuer: CN=TWCA Global Root CA O=TAIWAN-CA OU=Root CA
-# Subject: CN=TWCA Global Root CA O=TAIWAN-CA OU=Root CA
-# Label: "TWCA Global Root CA"
-# Serial: 3262
-# MD5 Fingerprint: f9:03:7e:cf:e6:9e:3c:73:7a:2a:90:07:69:ff:2b:96
-# SHA1 Fingerprint: 9c:bb:48:53:f6:a4:f6:d3:52:a4:e8:32:52:55:60:13:f5:ad:af:65
-# SHA256 Fingerprint: 59:76:90:07:f7:68:5d:0f:cd:50:87:2f:9f:95:d5:75:5a:5b:2b:45:7d:81:f3:69:2b:61:0a:98:67:2f:0e:1b
------BEGIN CERTIFICATE-----
-MIIFQTCCAymgAwIBAgICDL4wDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVFcx
-EjAQBgNVBAoTCVRBSVdBTi1DQTEQMA4GA1UECxMHUm9vdCBDQTEcMBoGA1UEAxMT
-VFdDQSBHbG9iYWwgUm9vdCBDQTAeFw0xMjA2MjcwNjI4MzNaFw0zMDEyMzExNTU5
-NTlaMFExCzAJBgNVBAYTAlRXMRIwEAYDVQQKEwlUQUlXQU4tQ0ExEDAOBgNVBAsT
-B1Jvb3QgQ0ExHDAaBgNVBAMTE1RXQ0EgR2xvYmFsIFJvb3QgQ0EwggIiMA0GCSqG
-SIb3DQEBAQUAA4ICDwAwggIKAoICAQCwBdvI64zEbooh745NnHEKH1Jw7W2CnJfF
-10xORUnLQEK1EjRsGcJ0pDFfhQKX7EMzClPSnIyOt7h52yvVavKOZsTuKwEHktSz
-0ALfUPZVr2YOy+BHYC8rMjk1Ujoog/h7FsYYuGLWRyWRzvAZEk2tY/XTP3VfKfCh
-MBwqoJimFb3u/Rk28OKRQ4/6ytYQJ0lM793B8YVwm8rqqFpD/G2Gb3PpN0Wp8DbH
-zIh1HrtsBv+baz4X7GGqcXzGHaL3SekVtTzWoWH1EfcFbx39Eb7QMAfCKbAJTibc
-46KokWofwpFFiFzlmLhxpRUZyXx1Ec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6xx6QddVfP5VhK8E7zeWz
-aGHQRiapIVJpLesux+t3zqY6tQMzT3bR51xUAV3LePTJDL/PEo4XLSNolOer/qmy
-KwbQBM0=
------END CERTIFICATE-----
-
-# Issuer: CN=TeliaSonera Root CA v1 O=TeliaSonera
-# Subject: CN=TeliaSonera Root CA v1 O=TeliaSonera
-# Label: "TeliaSonera Root CA v1"
-# Serial: 199041966741090107964904287217786801558
-# MD5 Fingerprint: 37:41:49:1b:18:56:9a:26:f5:ad:c2:66:fb:40:a5:4c
-# SHA1 Fingerprint: 43:13:bb:96:f1:d5:86:9b:c1:4e:6a:92:f6:cf:f6:34:69:87:82:37
-# SHA256 Fingerprint: dd:69:36:fe:21:f8:f0:77:c1:23:a1:a5:21:c1:22:24:f7:22:55:b7:3e:03:a7:26:06:93:e8:a2:4b:0f:a3:89
------BEGIN CERTIFICATE-----
-MIIFODCCAyCgAwIBAgIRAJW+FqD3LkbxezmCcvqLzZYwDQYJKoZIhvcNAQEFBQAw
-NzEUMBIGA1UECgwLVGVsaWFTb25lcmExHzAdBgNVBAMMFlRlbGlhU29uZXJhIFJv
-b3QgQ0EgdjEwHhcNMDcxMDE4MTIwMDUwWhcNMzIxMDE4MTIwMDUwWjA3MRQwEgYD
-VQQKDAtUZWxpYVNvbmVyYTEfMB0GA1UEAwwWVGVsaWFTb25lcmEgUm9vdCBDQSB2
-MTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMK+6yfwIaPzaSZVfp3F
-VRaRXP3vIb9TgHot0pGMYzHw7CTww6XScnwQbfQ3t+XmfHnqjLWCi65ItqwA3GV1
-7CpNX8GH9SBlK4GoRz6JI5UwFpB/6FcHSOcZrr9FZ7E3GwYq/t75rH2D+1665I+X
-Z75Ljo1kB1c4VWk0Nj0TSO9P4tNmHqTPGrdeNjPUtAa9GAH9d4RQAEX1jF3oI7x+
-/jXh7VB7qTCNGdMJjmhnXb88lxhTuylixcpecsHHltTbLaC0H2kD7OriUPEMPPCs
-81M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mYSdGe/mBEciG5Ge3C9THxOUiIkCR1VBatzvT4aRRkOfujuLpwQMcn
-HL/EVlP6Y2XQ8xwOFvVrhlhNGNTkDY6lnVuR3HYkUD/GKvvZt5y11ubQ2egZixVx
-SK236thZiNSQvxaz2emsWWFUyBy6ysHK4bkgTI86k4mloMy/0/Z1pHWWbVY=
------END CERTIFICATE-----
-
-# Issuer: CN=E-Tugra Certification Authority O=E-Tu\u011fra EBG Bili\u015fim Teknolojileri ve Hizmetleri A.\u015e. OU=E-Tugra Sertifikasyon Merkezi
-# Subject: CN=E-Tugra Certification Authority O=E-Tu\u011fra EBG Bili\u015fim Teknolojileri ve Hizmetleri A.\u015e. OU=E-Tugra Sertifikasyon Merkezi
-# Label: "E-Tugra Certification Authority"
-# Serial: 7667447206703254355
-# MD5 Fingerprint: b8:a1:03:63:b0:bd:21:71:70:8a:6f:13:3a:bb:79:49
-# SHA1 Fingerprint: 51:c6:e7:08:49:06:6e:f3:92:d4:5c:a0:0d:6d:a3:62:8f:c3:52:39
-# SHA256 Fingerprint: b0:bf:d5:2b:b0:d7:d9:bd:92:bf:5d:4d:c1:3d:a2:55:c0:2c:54:2f:37:83:65:ea:89:39:11:f5:5e:55:f2:3c
------BEGIN CERTIFICATE-----
-MIIGSzCCBDOgAwIBAgIIamg+nFGby1MwDQYJKoZIhvcNAQELBQAwgbIxCzAJBgNV
-BAYTAlRSMQ8wDQYDVQQHDAZBbmthcmExQDA+BgNVBAoMN0UtVHXEn3JhIEVCRyBC
-aWxpxZ9pbSBUZWtub2xvamlsZXJpIHZlIEhpem1ldGxlcmkgQS7Fni4xJjAkBgNV
-BAsMHUUtVHVncmEgU2VydGlmaWthc3lvbiBNZXJrZXppMSgwJgYDVQQDDB9FLVR1
-Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTEzMDMwNTEyMDk0OFoXDTIz
-MDMwMzEyMDk0OFowgbIxCzAJBgNVBAYTAlRSMQ8wDQYDVQQHDAZBbmthcmExQDA+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7MTtLoTlQwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBCwUAA4ICAQAF
-Nzr0TbdF4kV1JI+2d1LoHNgQk2Xz8lkGpD4eKexd0dCrfOAKkEh47U6YA5n+KGCR
-HTAduGN8qOY1tfrTYXbm1gdLymmasoR6d5NFFxWfJNCYExL/u6Au/U5Mh/jOXKqY
-GwXgAEZKgoClM4so3O0409/lPun++1ndYYRP0lSWE2ETPo+Aab6TR7U1Q9Jauz1c
-77NCR807VRMGsAnb/WP2OogKmW9+4c4bU2pEZiNRCHu8W1Ki/QY3OEBhj0qWuJA3
-+GbHeJAAFS6LrVE1Uweoa2iu+U48BybNCAVwzDk/dr2l02cmAYamU9JgO3xDf1WK
-vJUawSg5TB9D0pH0clmKuVb8P7Sd2nCcdlqMQ1DujjByTd//SffGqWfZbawCEeI6
-FiWnWAjLb1NBnEg4R2gz0dfHj9R0IdTDBZB6/86WiLEVKV0jq9BgoRJP3vQXzTLl
-yb/IQ639Lo7xr+L0mPoSHyDYwKcMhcWQ9DstliaxLL5Mq+ux0orJ23gTDx4JnW2P
-AJ8C2sH6H3p6CcRK5ogql5+Ji/03X186zjhZhkuvcQu02PJwT58yE+Owp1fl2tpD
-y4Q08ijE6m30Ku/Ba3ba+367hTzSU8JNvnHhRdH9I2cNE3X7z2VnIp2usAnRCf8d
-NL/+I5c30jn6PQ0GC7TbO6Orb1wdtn7os4I07QZcJA==
------END CERTIFICATE-----
-
-# Issuer: CN=T-TeleSec GlobalRoot Class 2 O=T-Systems Enterprise Services GmbH OU=T-Systems Trust Center
-# Subject: CN=T-TeleSec GlobalRoot Class 2 O=T-Systems Enterprise Services GmbH OU=T-Systems Trust Center
-# Label: "T-TeleSec GlobalRoot Class 2"
-# Serial: 1
-# MD5 Fingerprint: 2b:9b:9e:e4:7b:6c:1f:00:72:1a:cc:c1:77:79:df:6a
-# SHA1 Fingerprint: 59:0d:2d:7d:88:4f:40:2e:61:7e:a5:62:32:17:65:cf:17:d8:94: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4LMuCSjANBgkqhkiG9w0BAQsFAAOCAQEAMQOiYQsfdOhy
-NsZt+U2e+iKo4YFWz827n+qrkRk4r6p8FU3ztqONpfSO9kSpp+ghla0+AGIWiPAC
-uvxhI+YzmzB6azZie60EI4RYZeLbK4rnJVM3YlNfvNoBYimipidx5joifsFvHZVw
-IEoHNN/q/xWA5brXethbdXwFeilHfkCoMRN3zUA7tFFHei4R40cR3p1m0IvVVGb6
-g1XqfMIpiRvpb7PO4gWEyS8+eIVibslfwXhjdFjASBgMmTnrpMwatXlajRWc2BQN
-9noHV8cigwUtPJslJj0Ys6lDfMjIq2SPDqO/nBudMNva0Bkuqjzx+zOAduTNrRlP
-BSeOE6Fuwg==
------END CERTIFICATE-----
-
-# Issuer: CN=Atos TrustedRoot 2011 O=Atos
-# Subject: CN=Atos TrustedRoot 2011 O=Atos
-# Label: "Atos TrustedRoot 2011"
-# Serial: 6643877497813316402
-# MD5 Fingerprint: ae:b9:c4:32:4b:ac:7f:5d:66:cc:77:94:bb:2a:77:56
-# SHA1 Fingerprint: 2b:b1:f5:3e:55:0c:1d:c5:f1:d4:e6:b7:6a:46:4b:55:06:02:ac:21
-# SHA256 Fingerprint: f3:56:be:a2:44:b7:a9:1e:b3:5d:53:ca:9a:d7:86:4a:ce:01:8e:2d:35:d5:f8:f9:6d:df:68:a6:f4:1a:a4:74
------BEGIN CERTIFICATE-----
-MIIDdzCCAl+gAwIBAgIIXDPLYixfszIwDQYJKoZIhvcNAQELBQAwPDEeMBwGA1UE
-AwwVQXRvcyBUcnVzdGVkUm9vdCAyMDExMQ0wCwYDVQQKDARBdG9zMQswCQYDVQQG
-EwJERTAeFw0xMTA3MDcxNDU4MzBaFw0zMDEyMzEyMzU5NTlaMDwxHjAcBgNVBAMM
-FUF0b3MgVHJ1c3RlZFJvb3QgMjAxMTENMAsGA1UECgwEQXRvczELMAkGA1UEBhMC
-REUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCVhTuXbyo7LjvPpvMp
-Nb7PGKw+qtn4TaA+Gke5vJrf8v7MPkfoepbCJI419KkM/IL9bcFyYie96mvr54rM
-VD6QUM+A1JX76LWC1BTFtqlVJVfbsVD2sGBkWXppzwO3bw2+yj5vdHLqqjAqc2K+
-SZFhyBH+DgMq92og3AIVDV4VavzjgsG1xZ1kCWyjWZgHJ8cblithdHFsQ/H3NYkQ
-4J7sVaE3IqKHBAUsR320HLliKWYoyrfhk/WklAOZuXCFteZI6o1Q/NnezG8HDt0L
-cp2AMBYHlT8oDv3FdU9T1nSatCQujgKRz3bFmx5VdJx4IbHwLfELn8LVlhgf8FQi
-eowHAgMBAAGjfTB7MB0GA1UdDgQWBBSnpQaxLKYJYO7Rl+lwrrw7GWzbITAPBgNV
-HRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFKelBrEspglg7tGX6XCuvDsZbNshMBgG
-A1UdIAQRMA8wDQYLKwYBBAGwLQMEAQEwDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3
-DQEBCwUAA4IBAQAmdzTblEiGKkGdLD4GkGDEjKwLVLgfuXvTBznk+j57sj1O7Z8j
-vZfza1zv7v1Apt+hk6EKhqzvINB5Ab149xnYJDE0BAGmuhWawyfc2E8PzBhj/5kP
-DpFrdRbhIfzYJsdHt6bPWHJxfrrhTZVHO8mvbaG0weyJ9rQPOLXiZNwlz6bb65pc
-maHFCN795trV1lpFDMS3wrUU77QR/w4VtfX128a961qn8FYiqTxlVMYVqL2Gns2D
-lmh6cYGJ4Qvh6hEbaAjMaZ7snkGeRDImeuKHCnE96+RapNLbxc3G3mB/ufNPRJLv
-KrcYPqcZ2Qt9sTdBQrC6YB3y/gkRsPCHe6ed
------END CERTIFICATE-----
-
-# Issuer: CN=QuoVadis Root CA 1 G3 O=QuoVadis Limited
-# Subject: CN=QuoVadis Root CA 1 G3 O=QuoVadis Limited
-# Label: "QuoVadis Root CA 1 G3"
-# Serial: 687049649626669250736271037606554624078720034195
-# MD5 Fingerprint: a4:bc:5b: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ICATE-----
-
-# Issuer: CN=QuoVadis Root CA 2 G3 O=QuoVadis Limited
-# Subject: CN=QuoVadis Root CA 2 G3 O=QuoVadis Limited
-# Label: "QuoVadis Root CA 2 G3"
-# Serial: 390156079458959257446133169266079962026824725800
-# MD5 Fingerprint: af:0c:86:6e:bf:40:2d:7f:0b:3e:12:50:ba:12:3d:06
-# SHA1 Fingerprint: 09:3c:61:f3:8b:8b:dc:7d:55:df:75:38:02:05:00:e1:25:f5:c8:36
-# SHA256 Fingerprint: 8f:e4:fb:0a:f9:3a:4d:0d:67:db:0b:eb:b2:3e:37:c7:1b:f3:25:dc:bc:dd:24:0e:a0:4d:af:58:b4:7e:18:40
------BEGIN CERTIFICATE-----
-MIIFYDCCA0igAwIBAgIURFc0JFuBiZs18s64KztbpybwdSgwDQYJKoZIhvcNAQEL
-BQAwSDELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAc
-BgNVBAMTFVF1b1ZhZGlzIFJvb3QgQ0EgMiBHMzAeFw0xMjAxMTIxODU5MzJaFw00
-MjAxMTIxODU5MzJaMEgxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM
-aW1pdGVkMR4wHAYDVQQDExVRdW9WYWRpcyBSb290IENBIDIgRzMwggIiMA0GCSqG
-SIb3DQEBAQUAA4ICDwAwggIKAoICAQChriWyARjcV4g/Ruv5r+LrI3HimtFhZiFf
-qq8nUeVuGxbULX1QsFN3vXg6YOJkApt8hpvWGo6t/x8Vf9WVHhLL5hSEBMHfNrMW
-n4rjyduYNM7YMxcoRvynyfDStNVNCXJJ+fKH46nafaF9a7I6JaltUkSs+L5u+9ym
-c5GQYaYDFCDy54ejiK2toIz/pgslUiXnFgHVy7g1gQyjO/Dh4fxaXc6AcW34Sas+
-O7q414AB+6XrW7PFXmAqMaCvN+ggOp+oMiwMzAkd056OXbxMmO7FGmh77FOm6RQ1
-o9/NgJ8MSPsc9PG/Srj61YxxSscf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ESBT/8twNJAlvIJebiVDj1eYeM
-HVOyToV7BjjHLPj4sHKNJeV3UvQDHEimUF+IIDBu8oJDqz2XhOdT+yHBTw8imoa4
-WSr2Rz0ZiC3oheGe7IUIarFsNMkd7EgrO3jtZsSOeWmD3n+M
------END CERTIFICATE-----
-
-# Issuer: CN=QuoVadis Root CA 3 G3 O=QuoVadis Limited
-# Subject: CN=QuoVadis Root CA 3 G3 O=QuoVadis Limited
-# Label: "QuoVadis Root CA 3 G3"
-# Serial: 268090761170461462463995952157327242137089239581
-# MD5 Fingerprint: df:7d:b9:ad:54:6f:68:a1:df:89:57:03:97:43:b0:d7
-# SHA1 Fingerprint: 48:12:bd:92:3c:a8:c4:39:06:e7:30:6d:27:96:e6:a4:cf:22:2e:7d
-# SHA256 Fingerprint: 88:ef:81:de:20:2e:b0:18:45:2e:43:f8:64:72:5c:ea:5f:bd:1f:c2:d9:d2:05:73:07:09:c5:d8:b8:69:0f:46
------BEGIN CERTIFICATE-----
-MIIFYDCCA0igAwIBAgIULvWbAiin23r/1aOp7r0DoM8Sah0wDQYJKoZIhvcNAQEL
-BQAwSDELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAc
-BgNVBAMTFVF1b1ZhZGlzIFJvb3QgQ0EgMyBHMzAeFw0xMjAxMTIyMDI2MzJaFw00
-MjAxMTIyMDI2MzJaMEgxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM
-aW1pdGVkMR4wHAYDVQQDExVRdW9WYWRpcyBSb290IENBIDMgRzMwggIiMA0GCSqG
-SIb3DQEBAQUAA4ICDwAwggIKAoICAQCzyw4QZ47qFJenMioKVjZ/aEzHs286IxSR
-/xl/pcqs7rN2nXrpixurazHb+gtTTK/FpRp5PIpM/6zfJd5O2YIyC0TeytuMrKNu
-FoM7pmRLMon7FhY4futD4tN0SsJiCnMK3UmzV9KwCoWdcTzeo8vAMvMBOSBDGzXR
-U7Ox7sWTaY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MpTwATwiKp9Dwi7DmDkHOHv8XgBCH/MyJnmDhPbl
-8MFREsALHgQjDFSlTC9JxUrRtm5gDWv8a4uFJGS3iQ6rJUdbPM9+Sb3H6QrG2vd+
-DhcI00iX0HGS8A85PjRqHH3Y8iKuu2n0M7SmSFXRDw4m6Oy2Cy2nhTXN/VnIn9HN
-PlopNLk9hM6xZdRZkZFWdSHBd575euFgndOtBBj0fOtek49TSiIp+EgrPk2GrFt/
-ywaZWWDYWGWVjUTR939+J399roD1B0y2PpxxVJkES/1Y+Zj0
------END CERTIFICATE-----
-
-# Issuer: CN=DigiCert Assured ID Root G2 O=DigiCert Inc OU=www.digicert.com
-# Subject: CN=DigiCert Assured ID Root G2 O=DigiCert Inc OU=www.digicert.com
-# Label: "DigiCert Assured ID Root G2"
-# Serial: 15385348160840213938643033620894905419
-# MD5 Fingerprint: 92:38:b9:f8:63:24:82:65:2c:57:33:e6:fe:81:8f:9d
-# SHA1 Fingerprint: a1:4b:48:d9:43:ee:0a:0e:40:90:4f:3c:e0:a4:c0:91:93:51:5d:3f
-# SHA256 Fingerprint: 7d:05:eb:b6:82:33:9f:8c:94:51:ee:09:4e:eb:fe:fa:79:53:a1:14:ed:b2:f4:49:49:45:2f:ab:7d:2f:c1:85
------BEGIN CERTIFICATE-----
-MIIDljCCAn6gAwIBAgIQC5McOtY5Z+pnI7/Dr5r0SzANBgkqhkiG9w0BAQsFADBl
-MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
-d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJv
-b3QgRzIwHhcNMTMwODAxMTIwMDAwWhcNMzgwMTE1MTIwMDAwWjBlMQswCQYDVQQG
-EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNl
-cnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzIwggEi
-MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDZ5ygvUj82ckmIkzTz+GoeMVSA
-n61UQbVH35ao1K+ALbkKz3X9iaV9JPrjIgwrvJUXCzO/GU1BBpAAvQxNEP4Htecc
-biJVMWWXvdMX0h5i89vqbFCMP4QMls+3ywPgym2hFEwbid3tALBSfK+RbLE4E9Hp
-EgjAALAcKxHad3A2m67OeYfcgnDmCXRwVWmvo2ifv922ebPynXApVfSr/5Vh88lA
-bx3RvpO704gqu52/clpWcTs/1PPRCv4o76Pu2ZmvA9OPYLfykqGxvYmJHzDNw6Yu
-YjOuFgJ3RFrngQo8p0Quebg/BLxcoIfhG69Rjs3sLPr4/m3wOnyqi+RnlTGNAgMB
-AAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQW
-BBTOw0q5mVXyuNtgv6l+vVa1lzan1jANBgkqhkiG9w0BAQsFAAOCAQEAyqVVjOPI
-QW5pJ6d1Ee88hjZv0p3GeDgdaZaikmkuOGybfQTUiaWxMTeKySHMq2zNixya1r9I
-0jJmwYrA8y8678Dj1JGG0VDjA9tzd29KOVPt3ibHtX2vK0LRdWLjSisCx1BL4Gni
-lmwORGYQRI+tBev4eaymG+g3NJ1TyWGqolKvSnAWhsI6yLETcDbYz+70CjTVW0z9
-B5yiutkBclzzTcHdDrEcDcRjvq30FPuJ7KJBDkzMyFdA0G4Dqs0MjomZmWzwPDCv
-ON9vvKO+KSAnq3T/EyJ43pdSVR6DtVQgA+6uwE9W3jfMw3+qBCe703e4YtsXfJwo
-IhNzbM8m9Yop5w==
------END CERTIFICATE-----
-
-# Issuer: CN=DigiCert Assured ID Root G3 O=DigiCert Inc OU=www.digicert.com
-# Subject: CN=DigiCert Assured ID Root G3 O=DigiCert Inc OU=www.digicert.com
-# Label: "DigiCert Assured ID Root G3"
-# Serial: 15459312981008553731928384953135426796
-# MD5 Fingerprint: 7c:7f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uer: CN=DigiCert Global Root G2 O=DigiCert Inc OU=www.digicert.com
-# Subject: CN=DigiCert Global Root G2 O=DigiCert Inc OU=www.digicert.com
-# Label: "DigiCert Global Root G2"
-# Serial: 4293743540046975378534879503202253541
-# MD5 Fingerprint: e4:a6:8a:c8:54:ac:52:42:46:0a:fd:72:48:1b:2a:44
-# SHA1 Fingerprint: df:3c:24:f9:bf:d6:66:76:1b:26:80:73:fe:06:d1:cc:8d:4f:82:a4
-# SHA256 Fingerprint: cb:3c:cb:b7:60:31:e5:e0:13:8f:8d:d3:9a:23:f9:de:47:ff:c3:5e:43:c1:14:4c:ea:27:d4:6a:5a:b1:cb:5f
------BEGIN CERTIFICATE-----
-MIIDjjCCAnagAwIBAgIQAzrx5qcRqaC7KGSxHQn65TANBgkqhkiG9w0BAQsFADBh
-MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3
-d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBH
-MjAeFw0xMzA4MDExMjAwMDBaFw0zODAxMTUxMjAwMDBaMGExCzAJBgNVBAYTAlVT
-MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j
-b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEcyMIIBIjANBgkqhkiG
-9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuzfNNNx7a8myaJCtSnX/RrohCgiN9RlUyfuI
-2/Ou8jqJkTx65qsGGmvPrC3oXgkkRLpimn7Wo6h+4FR1IAWsULecYxpsMNzaHxmx
-1x7e/dfgy5SDN67sH0NO3Xss0r0upS/kqbitOtSZpLYl6ZtrAGCSYP9PIUkY92eQ
-q2EGnI/yuum06ZIya7XzV+hdG82MHauVBJVJ8zUtluNJbd134/tJS7SsVQepj5Wz
-tCO7TG1F8PapspUwtP1MVYwnSlcUfIKdzXOS0xZKBgyMUNGPHgm+F6HmIcr9g+UQ
-vIOlCsRnKPZzFBQ9RnbDhxSJITRNrw9FDKZJobq7nMWxM4MphQIDAQABo0IwQDAP
-BgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUTiJUIBiV
-5uNu5g/6+rkS7QYXjzkwDQYJKoZIhvcNAQELBQADggEBAGBnKJRvDkhj6zHd6mcY
-1Yl9PMWLSn/pvtsrF9+wX3N3KjITOYFnQoQj8kVnNeyIv/iPsGEMNKSuIEyExtv4
-NeF22d+mQrvHRAiGfzZ0JFrabA0UWTW98kndth/Jsw1HKj2ZL7tcu7XUIOGZX1NG
-Fdtom/DzMNU+MeKNhJ7jitralj41E6Vf8PlwUHBHQRFXGU7Aj64GxJUTFy8bJZ91
-8rGOmaFvE7FBcf6IKshPECBV1/MUReXgRPTqh5Uykw7+U0b6LJ3/iyK5S9kJRaTe
-pLiaWN0bfVKfjllDiIGknibVb63dDcY3fe0Dkhvld1927jyNxF1WW6LZZm6zNTfl
-MrY=
------END CERTIFICATE-----
-
-# Issuer: CN=DigiCert Global Root G3 O=DigiCert Inc OU=www.digicert.com
-# Subject: CN=DigiCert Global Root G3 O=DigiCert Inc OU=www.digicert.com
-# Label: "DigiCert Global Root G3"
-# Serial: 7089244469030293291760083333884364146
-# MD5 Fingerprint: f5:5d:a4:50:a5:fb:28:7e:1e:0f:0d:cc:96:57:56:ca
-# SHA1 Fingerprint: 7e:04:de:89:6a:3e:66:6d:00:e6:87:d3:3f:fa:d9:3b:e8:3d:34:9e
-# SHA256 Fingerprint: 31:ad:66:48:f8:10:41:38:c7:38:f3:9e:a4:32:01:33:39:3e:3a:18:cc:02:29:6e:f9:7c:2a:c9:ef:67:31:d0
------BEGIN CERTIFICATE-----
-MIICPzCCAcWgAwIBAgIQBVVWvPJepDU1w6QP1atFcjAKBggqhkjOPQQDAzBhMQsw
-CQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cu
-ZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBHMzAe
-Fw0xMzA4MDExMjAwMDBaFw0zODAxMTUxMjAwMDBaMGExCzAJBgNVBAYTAlVTMRUw
-EwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5jb20x
-IDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEczMHYwEAYHKoZIzj0CAQYF
-K4EEACIDYgAE3afZu4q4C/sLfyHS8L6+c/MzXRq8NOrexpu80JX28MzQC7phW1FG
-fp4tn+6OYwwX7Adw9c+ELkCDnOg/QW07rdOkFFk2eJ0DQ+4QE2xy3q6Ip6FrtUPO
-Z9wj/wMco+I+o0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAd
-BgNVHQ4EFgQUs9tIpPmhxdiuNkHMEWNpYim8S8YwCgYIKoZIzj0EAwMDaAAwZQIx
-AK288mw/EkrRLTnDCgmXc/SINoyIJ7vmiI1Qhadj+Z4y3maTD/HMsQmP3Wyr+mt/
-oAIwOWZbwmSNuJ5Q3KjVSaLtx9zRSX8XAbjIho9OjIgrqJqpisXRAL34VOKa5Vt8
-sycX
------END CERTIFICATE-----
-
-# Issuer: CN=DigiCert Trusted Root G4 O=DigiCert Inc OU=www.digicert.com
-# Subject: CN=DigiCert Trusted Root G4 O=DigiCert Inc OU=www.digicert.com
-# Label: "DigiCert Trusted Root G4"
-# Serial: 7451500558977370777930084869016614236
-# MD5 Fingerprint: 78:f2:fc:aa:60:1f:2f:b4:eb:c9:37:ba:53:2e:75:49
-# SHA1 Fingerprint: dd:fb:16:cd:49:31:c9:73:a2:03:7d:3f:c8:3a:4d:7d:77:5d:05:e4
-# SHA256 Fingerprint: 55:2f:7b:dc:f1:a7:af:9e:6c:e6:72:01:7f:4f:12:ab:f7:72:40:c7:8e:76:1a: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rLZBdd56rF+NP8m800ERElvlEFDrMcXK
-chYiCd98THU/Y+whX8QgUWtvsauGi0/C1kVfnSD8oR7FwI+isX4KJpn15GkvmB0t
-9dmpsh3lGwIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIB
-hjAdBgNVHQ4EFgQU7NfjgtJxXWRM3y5nP+e6mK4cD08wDQYJKoZIhvcNAQEMBQAD
-ggIBALth2X2pbL4XxJEbw6GiAI3jZGgPVs93rnD5/ZpKmbnJeFwMDF/k5hQpVgs2
-SV1EY+CtnJYYZhsjDT156W1r1lT40jzBQ0CuHVD1UvyQO7uYmWlrx8GnqGikJ9yd
-+SeuMIW59mdNOj6PWTkiU0TryF0Dyu1Qen1iIQqAyHNm0aAFYF/opbSnr6j3bTWc
-fFqK1qI4mfN4i/RN0iAL3gTujJtHgXINwBQy7zBZLq7gcfJW5GqXb5JQbZaNaHqa
-sjYUegbyJLkJEVDXCLG4iXqEI2FCKeWjzaIgQdfRnGTZ6iahixTXTBmyUEFxPT9N
-cCOGDErcgdLMMpSEDQgJlxxPwO5rIHQw0uA5NBCFIRUBCOhVMt5xSdkoF1BN5r5N
-0XWs0Mr7QbhDparTwwVETyw2m+L64kW4I1NsBm9nVX9GtUw/bihaeSbSpKhil9Ie
-4u1Ki7wb/UdKDd9nZn6yW0HQO+T0O/QEY+nvwlQAUaCKKsnOeMzV6ocEGLPOr0mI
-r/OSmbaz5mEP0oUA51Aa5BuVnRmhuZyxm7EAHu/QD09CbMkKvO5D+jpxpchNJqU1
-/YldvIViHTLSoCtU7ZpXwdv6EM8Zt4tKG48BtieVU+i2iW1bvGjUI+iLUaJW+fCm
-gKDWHrO8Dw9TdSmq6hN35N6MgSGtBxBHEa2HPQfRdbzP82Z+
------END CERTIFICATE-----
-
-# Issuer: CN=Certification Authority of WoSign O=WoSign CA Limited
-# Subject: CN=Certification Authority of WoSign O=WoSign CA Limited
-# Label: "WoSign"
-# Serial: 125491772294754854453622855443212256657
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b+zCB0oy2pLmvLwIIRIbWT
-ee5Ehr7XHuQe+w==
------END CERTIFICATE-----
-
-# Issuer: CN=CA \u6c83\u901a\u6839\u8bc1\u4e66 O=WoSign CA Limited
-# Subject: CN=CA \u6c83\u901a\u6839\u8bc1\u4e66 O=WoSign CA Limited
-# Label: "WoSign China"
-# Serial: 106921963437422998931660691310149453965
-# MD5 Fingerprint: 78:83:5b:52:16:76:c4:24:3b:83:78:e8:ac:da:9a:93
-# SHA1 Fingerprint: 16:32:47:8d:89:f9:21:3a:92:00:85:63:f5:a4:a7:d3:12:40:8a:d6
-# SHA256 Fingerprint: d6:f0:34:bd:94:aa:23:3f:02:97:ec:a4:24:5b:28:39:73:e4:47:aa:59:0f:31:0c:77:f4:8f:df:83:11:22:54
------BEGIN CERTIFICATE-----
-MIIFWDCCA0CgAwIBAgIQUHBrzdgT/BtOOzNy0hFIjTANBgkqhkiG9w0BAQsFADBG
-MQswCQYDVQQGEwJDTjEaMBgGA1UEChMRV29TaWduIENBIExpbWl0ZWQxGzAZBgNV
-BAMMEkNBIOayg+mAmuagueivgeS5pjAeFw0wOTA4MDgwMTAwMDFaFw0zOTA4MDgw
-MTAwMDFaMEYxCzAJBgNVBAYTAkNOMRowGAYDVQQKExFXb1NpZ24gQ0EgTGltaXRl
-ZDEbMBkGA1UEAwwSQ0Eg5rKD6YCa5qC56K+B5LmmMIICIjANBgkqhkiG9w0BAQEF
-AAOCAg8AMIICCgKCAgEA0EkhHiX8h8EqwqzbdoYGTufQdDTc7WU1/FDWiD+k8H/r
-D195L4mx/bxjWDeTmzj4t1up+thxx7S8gJeNbEvxUNUqKaqoGXqW5pWOdO2XCld1
-9AXbbQs5uQF/qvbW2mzmBeCkTVL829B0txGMe41P/4eDrv8FAxNXUDf+jJZSEExf
-v5RxadmWPgxDT74wwJ85dE8GRV2j1lY5aAfMh09Qd5Nx2UQIsYo06Yms25tO4dnk
-UkWMLhQfkWsZHWgpLFbE4h4TV2TwYeO5Ed+w4VegG63XX9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10l
-O1Hm13ZBONFLAzkopR6RctR9q5czxNM+4Gm2KHmgCY0c0f9BckgG/Jou5yD5m6Le
-ie2uPAmvylezkolwQOQvT8Jwg0DXJCxr5wkf09XHwQj02w47HAcLQxGEIYbpgNR1
-2KvxAmLBsX5VYc8T1yaw15zLKYs4SgsOkI26oQ==
------END CERTIFICATE-----
-
-# Issuer: CN=COMODO RSA Certification Authority O=COMODO CA Limited
-# Subject: CN=COMODO RSA Certification Authority O=COMODO CA Limited
-# Label: "COMODO RSA Certification Authority"
-# Serial: 101909084537582093308941363524873193117
-# MD5 Fingerprint: 1b:31:b0:71:40:36:cc:14:36:91:ad:c4:3e:fd:ec:18
-# SHA1 Fingerprint: af:e5:d2:44:a8:d1:19:42:30:ff:47:9f:e2:f8:97:bb:cd:7a:8c:b4
-# SHA256 Fingerprint: 52:f0:e1:c4:e5:8e:c6:29:29:1b:60:31:7f:07:46:71:b8:5d:7e:a8:0d:5b:07:27:34:63:53:4b:32:b4:02:34
------BEGIN CERTIFICATE-----
-MIIF2DCCA8CgAwIBAgIQTKr5yttjb+Af907YWwOGnTANBgkqhkiG9w0BAQwFADCB
-hTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G
-A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNV
-BAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMTAwMTE5
-MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0IxGzAZBgNVBAgT
-EkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMR
-Q09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNh
-dGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICD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8uk2Intzna
-FxiuvTwJaP+EmzzV1gsD41eeFPfR60/IvYcjt7ZJQ3mFXLrrkguhxuhoqEwWsRqZ
-CuhTLJK7oQkYdQxlqHvLI7cawiiFwxv/0Cti76R7CZGYZ4wUAc1oBmpjIXUDgIiK
-boHGhfKppC3n9KUkEEeDys30jXlYsQab5xoq2Z0B15R97QNKyvDb6KkBPvVWmcke
-jkk9u+UJueBPSZI9FoJAzMxZxuY67RIuaTxslbH9qh17f4a+Hg4yRvv7E491f0yL
-S0Zj/gA0QHDBw7mh3aZw4gSzQbzpgJHqZJx64SIDqZxubw5lT2yHh17zbqD5daWb
-QOhTsiedSrnAdyGN/4fy3ryM7xfft0kL0fJuMAsaDk527RH89elWsn2/x20Kk4yl
-0MC2Hb46TpSi125sC8KKfPog88Tk5c0NqMuRkrF8hey1FGlmDoLnzc7ILaZRfyHB
-NVOFBkpdn627G190
------END CERTIFICATE-----
-
-# Issuer: CN=USERTrust RSA Certification Authority O=The USERTRUST Network
-# Subject: CN=USERTrust RSA Certification Authority O=The USERTRUST Network
-# Label: "USERTrust RSA Certification Authority"
-# Serial: 2645093764781058787591871645665788717
-# MD5 Fingerprint: 1b:fe:69:d1:91:b7:19:33:a3:72:a8:0f:e1:55:e5:b5
-# SHA1 Fingerprint: 2b:8f:1b:57:33:0d:bb:a2:d0:7a:6c:51:f7:0e:e9:0d:da:b9:ad:8e
-# SHA256 Fingerprint: e7:93:c9:b0:2f:d8:aa:13:e2:1c:31:22:8a:cc:b0:81:19:64:3b:74:9c:89:89:64:b1:74:6d:46:c3:d4:cb:d2
------BEGIN CERTIFICATE-----
-MIIF3jCCA8agAwIBAgIQAf1tMPyjylGoG7xkDjUDLTANBgkqhkiG9w0BAQwFADCB
-iDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0pl
-cnNleSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNV
-BAMTJ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3m/WqorSs9UgOHYm8Cd8rIDZsswDgYDVR0PAQH/BAQDAgEGMA8G
-A1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEMBQADggIBAFzUfA3P9wF9QZllDHPF
-Up/L+M+ZBn8b2kMVn54CVVeWFPFSPCeHlCjtHzoBN6J2/FNQwISbxmtOuowhT6KO
-VWKR82kV2LyI48SqC/3vqOlLVSoGIG1VeCkZ7l8wXEskEVX/JJpuXior7gtNn3/3
-ATiUFJVDBwn7YKnuHKsSjKCaXqeYalltiz8I+8jRRa8YFWSQEg9zKC7F4iRO/Fjs
-8PRF/iKz6y+O0tlFYQXBl2+odnKPi4w2r78NBc5xjeambx9spnFixdjQg3IM8WcR
-iQycE0xyNN+81XHfqnHd4blsjDwSXWXavVcStkNr/+XeTWYRUc+ZruwXtuhxkYze
-Sf7dNXGiFSeUHM9h4ya7b6NnJSFd5t0dCy5oGzuCr+yDZ4XUmFF0sbmZgIn/f3gZ
-XHlKYC6SQK5MNyosycdiyA5d9zZbyuAlJQG03RoHnHcAP9Dc1ew91Pq7P8yF1m9/
-qS3fuQL39ZeatTXaw2ewh0qpKJ4jjv9cJ2vhsE/zB+4ALtRZh8tSQZXq9EfX7mRB
-VXyNWQKV3WKdwrnuWih0hKWbt5DHDAff9Yk2dDLWKMGwsAvgnEzDHNb842m1R0aB
-L6KCq9NjRHDEjf8tM7qtj3u1cIiuPhnPQCjY/MiQu12ZIvVS5ljFH4gxQ+6IHdfG
-jjxDah2nGN59PRbxYvnKkKj9
------END CERTIFICATE-----
-
-# Issuer: CN=USERTrust ECC Certification Authority O=The USERTRUST Network
-# Subject: CN=USERTrust ECC Certification Authority O=The USERTRUST Network
-# Label: "USERTrust ECC Certification Authority"
-# Serial: 123013823720199481456569720443997572134
-# MD5 Fingerprint: fa:68:bc:d9:b5:7f:ad:fd:c9:1d:06:83:28:cc:24:c1
-# SHA1 Fingerprint: d1:cb:ca:5d:b2:d5:2a:7f:69:3b:67:4d:e5:f0:5a:1d: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ATE-----
-
-# Issuer: CN=GlobalSign O=GlobalSign OU=GlobalSign ECC Root CA - R4
-# Subject: CN=GlobalSign O=GlobalSign OU=GlobalSign ECC Root CA - R4
-# Label: "GlobalSign ECC Root CA - R4"
-# Serial: 14367148294922964480859022125800977897474
-# MD5 Fingerprint: 20:f0:27:68:d1:7e:a0:9d:0e:e6:2a:ca:df:5c:89:8e
-# SHA1 Fingerprint: 69:69:56:2e:40:80:f4:24:a1:e7:19:9f:14:ba:f3:ee:58:ab:6a:bb
-# SHA256 Fingerprint: be:c9:49:11:c2:95:56:76:db:6c:0a:55:09:86:d7:6e:3b:a0:05:66:7c:44:2c:97:62:b4:fb:b7:73:de:22:8c
------BEGIN CERTIFICATE-----
-MIIB4TCCAYegAwIBAgIRKjikHJYKBN5CsiilC+g0mAIwCgYIKoZIzj0EAwIwUDEk
-MCIGA1UECxMbR2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI0MRMwEQYDVQQKEwpH
-bG9iYWxTaWduMRMwEQYDVQQDEwpHbG9iYWxTaWduMB4XDTEyMTExMzAwMDAwMFoX
-DTM4MDExOTAzMTQwN1owUDEkMCIGA1UECxMbR2xvYmFsU2lnbiBFQ0MgUm9vdCBD
-QSAtIFI0MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQDEwpHbG9iYWxTaWdu
-MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEuMZ5049sJQ6fLjkZHAOkrprlOQcJ
-FspjsbmG+IpXwVfOQvpzofdlQv8ewQCybnMO/8ch5RikqtlxP6jUuc6MHaNCMEAw
-DgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFFSwe61F
-uOJAf/sKbvu+M8k8o4TVMAoGCCqGSM49BAMCA0gAMEUCIQDckqGgE6bPA7DmxCGX
-kPoUVy0D7O48027KqGx2vKLeuwIgJ6iFJzWbVsaj8kfSt24bAgAXqmemFZHe+pTs
-ewv4n4Q=
------END CERTIFICATE-----
-
-# Issuer: CN=GlobalSign O=GlobalSign OU=GlobalSign ECC Root CA - R5
-# Subject: CN=GlobalSign O=GlobalSign OU=GlobalSign ECC Root CA - R5
-# Label: "GlobalSign ECC Root CA - R5"
-# Serial: 32785792099990507226680698011560947931244
-# MD5 Fingerprint: 9f:ad:3b:1c:02:1e:8a:ba:17:74:38:81:0c:a2:bc:08
-# SHA1 Fingerprint: 1f:24:c6:30:cd:a4:18:ef:20:69:ff:ad:4f:dd:5f:46:3a:1b:69:aa
-# SHA256 Fingerprint: 17:9f:bc:14:8a:3d:d0:0f:d2:4e:a1:34:58:cc:43:bf:a7:f5:9c:81:82:d7:83:a5:13:f6:eb:ec:10:0c:89:24
------BEGIN CERTIFICATE-----
-MIICHjCCAaSgAwIBAgIRYFlJ4CYuu1X5CneKcflK2GwwCgYIKoZIzj0EAwMwUDEk
-MCIGA1UECxMbR2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI1MRMwEQYDVQQKEwpH
-bG9iYWxTaWduMRMwEQYDVQQDEwpHbG9iYWxTaWduMB4XDTEyMTExMzAwMDAwMFoX
-DTM4MDExOTAzMTQwN1owUDEkMCIGA1UECxMbR2xvYmFsU2lnbiBFQ0MgUm9vdCBD
-QSAtIFI1MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQDEwpHbG9iYWxTaWdu
-MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAER0UOlvt9Xb/pOdEh+J8LttV7HpI6SFkc
-8GIxLcB6KP4ap1yztsyX50XUWPrRd21DosCHZTQKH3rd6zwzocWdTaRvQZU4f8ke
-hOvRnkmSh5SHDDqFSmafnVmTTZdhBoZKo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYD
-VR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUPeYpSJvqB8ohREom3m7e0oPQn1kwCgYI
-KoZIzj0EAwMDaAAwZQIxAOVpEslu28YxuglB4Zf4+/2a4n0Sye18ZNPLBSWLVtmg
-515dTguDnFt2KaAJJiFqYgIwcdK1j1zqO+F4CYWodZI7yFz9SO8NdCKoCOJuxUnO
-xwy8p2Fp8fc74SrL+SvzZpA3
------END CERTIFICATE-----
-
-# Issuer: CN=Staat der Nederlanden Root CA - G3 O=Staat der Nederlanden
-# Subject: CN=Staat der Nederlanden Root CA - G3 O=Staat der Nederlanden
-# Label: "Staat der Nederlanden Root CA - G3"
-# Serial: 10003001
-# MD5 Fingerprint: 0b:46:67:07:db:10:2f:19:8c:35:50:60:d1:0b:f4:37
-# SHA1 Fingerprint: d8:eb:6b:41:51:92:59:e0:f3:e7:85:00:c0:3d:b6:88:97:c9:ee:fc
-# SHA256 Fingerprint: 3c:4f:b0:b9:5a:b8:b3:00:32:f4:32:b8:6f:53:5f:e1:72:c1:85:d0:fd:39:86:58:37:cf:36:18:7f:a6:f4:28
------BEGIN CERTIFICATE-----
-MIIFdDCCA1ygAwIBAgIEAJiiOTANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJO
-TDEeMBwGA1UECgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSswKQYDVQQDDCJTdGFh
-dCBkZXIgTmVkZXJsYW5kZW4gUm9vdCBDQSAtIEczMB4XDTEzMTExNDExMjg0MloX
-DTI4MTExMzIzMDAwMFowWjELMAkGA1UEBhMCTkwxHjAcBgNVBAoMFVN0YWF0IGRl
-ciBOZWRlcmxhbmRlbjErMCkGA1UEAwwiU3RhYXQgZGVyIE5lZGVybGFuZGVuIFJv
-b3QgQ0EgLSBHMzCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAL4yolQP
-cPssXFnrbMSkUeiFKrPMSjTysF/zDsccPVMeiAho2G89rcKezIJnByeHaHE6n3WW
-IkYFsO2tx1ueKt6c/DrGlaf1F2cY5y9JCAxcz+bMNO14+1Cx3Gsy8KL+tjzk7FqX
-xz8ecAgwoNzFs21v0IJyEavSgWhZghe3eJJg+szeP4TrjTgzkApyI/o1zCZxMdFy
-K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2gw7OyLnflJNZoaLNmzlTnVHpL3prllL+U9bTpITAjc5CgSKL59NVzq
-4BZ+Extq1z7XnvwtdbLBFNUjA9tbbws+eC8N3jONFrdI54OagQ97wUNNVQQXOEpR
-1VmiiXTTn74eS9fGbbeIJG9gkaSChVtWQbzQRKtqE77RLFi3EjNYsjdj3BP1lB0/
-QFH1T/U67cjF68IeHRaVesd+QnGTbksVtzDfqu1XhUisHWrdOWnk4Xl4vs4Fv6EM
-94B7IWcnMFk=
------END CERTIFICATE-----
-
-# Issuer: CN=Staat der Nederlanden EV Root CA O=Staat der Nederlanden
-# Subject: CN=Staat der Nederlanden EV Root CA O=Staat der Nederlanden
-# Label: "Staat der Nederlanden EV Root CA"
-# Serial: 10000013
-# MD5 Fingerprint: fc:06:af:7b:e8:1a:f1:9a:b4:e8:d2:70:1f:c0:f5:ba
-# SHA1 Fingerprint: 76:e2:7e:c1:4f:db:82:c1:c0:a6:75:b5:05:be:3d:29:b4:ed:db:bb
-# SHA256 Fingerprint: 4d:24:91:41:4c:fe:95:67:46:ec:4c:ef:a6:cf:6f:72:e2:8a:13:29:43:2f:9d:8a:90:7a:c4:cb:5d:ad:c1:5a
------BEGIN CERTIFICATE-----
-MIIFcDCCA1igAwIBAgIEAJiWjTANBgkqhkiG9w0BAQsFADBYMQswCQYDVQQGEwJO
-TDEeMBwGA1UECgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSkwJwYDVQQDDCBTdGFh
-dCBkZXIgTmVkZXJsYW5kZW4gRVYgUm9vdCBDQTAeFw0xMDEyMDgxMTE5MjlaFw0y
-MjEyMDgxMTEwMjhaMFgxCzAJBgNVBAYTAk5MMR4wHAYDVQQKDBVTdGFhdCBkZXIg
-TmVkZXJsYW5kZW4xKTAnBgNVBAMMIFN0YWF0IGRlciBOZWRlcmxhbmRlbiBFViBS
-b290IENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA48d+ifkkSzrS
-M4M1LGns3Amk41GoJSt5uAg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DXLldRqANb/9Zjr7dn3LDWyvfjFvO5QxGbJKy
-CqNMVEIYFRIYvdr8unRu/8G2oGTYqV9Vrp9canaW2HNnh/tNf1zuacpzEPuKqf2e
-vTY4SUmH9A4U8OmHuD+nT3pajnnUk+S7aFKErGzp85hwVXIy+TSrK0m1zSBi5Dp6
-Z2Orltxtrpfs/J92VoguZs9btsmksNcFuuEnL5O7Jiqik7Ab846+HUCjuTaPPoIa
-Gl6I6lD4WeKDRikL40Rc4ZW2aZCaFG+XroHPaO+Zmr615+F/+PoTRxZMzG0IQOeL
-eG9QgkRQP2YGiqtDhFZKDyAthg710tvSeopLzaXoTvFeJiUBWSOgftL2fiFX1ye8
-FVdMpEbB4IMeDExNH08GGeL5qPQ6gqGyeUN51q1veieQA6TqJIc/2b3Z6fJfUEkc
-7uzXLg==
------END CERTIFICATE-----
-
-# Issuer: CN=IdenTrust Commercial Root CA 1 O=IdenTrust
-# Subject: CN=IdenTrust Commercial Root CA 1 O=IdenTrust
-# Label: "IdenTrust Commercial Root CA 1"
-# Serial: 13298821034946342390520003877796839426
-# MD5 Fingerprint: b3:3e:77:73:75:ee:a0:d3:e3:7e:49:63:49:59:bb:c7
-# SHA1 Fingerprint: df:71:7e:aa:4a:d9:4e:c9:55:84:99:60:2d:48:de:5f:bc:f0:3a:25
-# SHA256 Fingerprint: 5d:56:49:9b:e4:d2:e0:8b:cf:ca:d0:8a:3e:38:72:3d:50:50:3b:de:70:69:48:e4:2f:55:60:30:19:e5:28:ae
------BEGIN CERTIFICATE-----
-MIIFYDCCA0igAwIBAgIQCgFCgAAAAUUjyES1AAAAAjANBgkqhkiG9w0BAQsFADBK
-MQswCQYDVQQGEwJVUzESMBAGA1UEChMJSWRlblRydXN0MScwJQYDVQQDEx5JZGVu
-VHJ1c3QgQ29tbWVyY2lhbCBSb290IENBIDEwHhcNMTQwMTE2MTgxMjIzWhcNMzQw
-MTE2MTgxMjIzWjBKMQswCQYDVQQGEwJVUzESMBAGA1UEChMJSWRlblR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RvM7Kqas6pgghstO8OEPVeKlh6cdbjTMM1gCIOQ045U8U1mwF10A0Cj7oV+wh93
-nAbowacYXVKV7cndJZ5t+qntozo00Fl72u1Q8zW/7esUTTHHYPTa8Yec4kjixsU3
-+wYQ+nVZZjFHKdp2mhzpgq7vmrlR94gjmmmVYjzlVYA211QC//G5Xc7UI2/YRYRK
-W2XviQzdFKcgyxilJbQN+QHwotL0AMh0jqEqSI5l2xPE4iUXfeu+h1sXIFRRk0pT
-AwvsXcoz7WL9RccvW9xYoIA55vrX/hMUpu09lEpCdNTDd1lzzY9GvlU47/rokTLq
-l1gEIt44w8y8bckzOmoKaT+gyOpyj4xjhiO9bTyWnpXgSUyqorkqG5w2gXjtw+hG
-4iZZRHUe2XWJUc0QhJ1hYMtd+ZciTY6Y5uN/9lu7rs3KSoFrXgvzUeF0K+l+J6fZ
-mUlO+KWA2yUPHGNiiskzZ2s8EIPGrd6ozRaOjfAHN3Gf8qv8QfXBi+wAN10J5U6A
-7/qxXDgGpRtK4dw4LTzcqx+QGtVKnO7RcGzM7vRX+Bi6hG6H
------END CERTIFICATE-----
-
-# Issuer: CN=IdenTrust Public Sector Root CA 1 O=IdenTrust
-# Subject: CN=IdenTrust Public Sector Root CA 1 O=IdenTrust
-# Label: "IdenTrust Public Sector Root CA 1"
-# Serial: 13298821034946342390521976156843933698
-# MD5 Fingerprint: 37:06:a5:b0:fc:89:9d:ba:f4:6b:8c:1a:64:cd:d5:ba
-# SHA1 Fingerprint: ba:29:41:60:77:98:3f:f4:f3:ef:f2:31:05:3b:2e:ea:6d:4d:45:fd
-# SHA256 Fingerprint: 30:d0:89:5a:9a:44:8a:26:20:91:63:55:22:d1:f5:20:10:b5:86:7a:ca:e1:2c:78:ef:95:8f:d4:f4:38:9f:2f
------BEGIN CERTIFICATE-----
-MIIFZjCCA06gAwIBAgIQCgFCgAAAAUUjz0Z8AAAAAjANBgkqhkiG9w0BAQsFADBN
-MQswCQYDVQQGEwJVUzESMBAGA1UEChMJSW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cN
-AQELBQADggIBAEf63QqwEZE4rU1d9+UOl1QZgkiHVIyqZJnYWv6IAcVYpZmxI1Qj
-t2odIFflAWJBF9MJ23XLblSQdf4an4EKwt3X9wnQW3IV5B4Jaj0z8yGa5hV+rVHV
-DRDtfULAj+7AmgjVQdZcDiFpboBhDhXAuM/FSRJSzL46zNQuOAXeNf0fb7iAaJg9
-TaDKQGXSc3z1i9kKlT/YPyNtGtEqJBnZhbMX73huqVjRI9PHE+1yJX9dsXNw0H8G
-lwmEKYBhHfpe/3OsoOOJuBxxFcbeMX8S3OFtm6/n6J91eEyrRjuazr8FGF1NFTwW
-mhlQBJqymm9li1JfPFgEKCXAZmExfrngdbkaqIHWchezxQMxNRF4eKLg6TCMf4Df
-WN88uieW4oA0beOY02QnrEh+KHdcxiVhJfiFDGX6xDIvpZgF5PgLZxYWxoK4Mhn5
-+bl53B/N66+rDt0b20XkeucC4pVd/GnwU2lhlXV5C15V5jgclKlZM57IcXR5f1GJ
-tshquDDIajjDbp7hNxbqBWJMWxJH7ae0s1hWx0nzfxJoCTFx8G34Tkf71oXuxVhA
-GaQdp/lLQzfcaFpPz+vCZHTetBXZ9FRUGi8c15dxVJCO2SCdUyt/q4/i6jC8UDfv
-8Ue1fXwsBOxonbRJRBD0ckscZOf85muQ3Wl9af0AVqW3rLatt8o+Ae+c
------END CERTIFICATE-----
-
-# Issuer: CN=Entrust Root Certification Authority - G2 O=Entrust, Inc. OU=See www.entrust.net/legal-terms/(c) 2009 Entrust, Inc. - for authorized use only
-# Subject: CN=Entrust Root Certification Authority - G2 O=Entrust, Inc. OU=See www.entrust.net/legal-terms/(c) 2009 Entrust, Inc. - for authorized use only
-# Label: "Entrust Root Certification Authority - G2"
-# Serial: 1246989352
-# MD5 Fingerprint: 4b:e2:c9:91:96:65:0c:f4:0e:5a:93:92:a0:0a:fe:b2
-# SHA1 Fingerprint: 8c:f4:27:fd:79:0c:3a:d1:66:06:8d:e8:1e:57:ef:bb:93:22:72:d4
-# SHA256 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xR57d+tVOxMyLlbc9wPBr64ptntoP0
-jaWvYkxN4FisZDQSA/i2jZRjJKRxAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAP
-BgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqciZ60B7vfec7aVHUbI2fkBJmqzAN
-BgkqhkiG9w0BAQsFAAOCAQEAeZ8dlsa2eT8ijYfThwMEYGprmi5ZiXMRrEPR9RP/
-jTkrwPK9T3CMqS/qF8QLVJ7UG5aYMzyorWKiAHarWWluBh1+xLlEjZivEtRh2woZ
-Rkfz6/djwUAFQKXSt/S1mja/qYh2iARVBCuch38aNzx+LaUa2NSJXsq9rD1s2G2v
-1fN2D807iDginWyTmsQ9v4IbZT+mD12q/OWyFcq1rca8PdCE6OoGcrBNOTJ4vz4R
-nAuknZoh8/CbCzB428Hch0P+vGOaysXCHMnHjf87ElgI5rY97HosTvuDls4MPGmH
-VHOkc8KT/1EQrBVUAdj8BbGJoX90g5pJ19xOe4pIb4tF9g==
------END CERTIFICATE-----
-
-# Issuer: CN=Entrust Root Certification Authority - EC1 O=Entrust, Inc. OU=See www.entrust.net/legal-terms/(c) 2012 Entrust, Inc. - for authorized use only
-# Subject: CN=Entrust Root Certification Authority - EC1 O=Entrust, Inc. OU=See www.entrust.net/legal-terms/(c) 2012 Entrust, Inc. - for authorized use only
-# Label: "Entrust Root Certification Authority - EC1"
-# Serial: 51543124481930649114116133369
-# MD5 Fingerprint: b6:7e:1d:f0:58:c5:49:6c:24:3b:3d:ed:98:18:ed:bc
-# SHA1 Fingerprint: 20:d8:06:40:df:9b:25:f5:12:25:3a:11:ea:f7:59:8a:eb:14:b5:47
-# SHA256 Fingerprint: 02:ed:0e:b2:8c:14:da:45:16:5c:56:67:91:70:0d:64:51:d7:fb:56:f0:b2:ab:1d:3b:8e:b0:70:e5:6e:df:f5
------BEGIN CERTIFICATE-----
-MIIC+TCCAoCgAwIBAgINAKaLeSkAAAAAUNCR+TAKBggqhkjOPQQDAzCBvzELM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financial Certification Authority
-# Label: "CFCA EV ROOT"
-# Serial: 407555286
-# MD5 Fingerprint: 74:e1:b6:ed:26:7a:7a:44:30:33:94:ab:7b:27:81:30
-# SHA1 Fingerprint: e2:b8:29:4b:55:84:ab:6b:58:c2:90:46:6c:ac:3f:b8:39:8f:84:83
-# SHA256 Fingerprint: 5c:c3:d7:8e:4e:1d:5e:45:54:7a:04:e6:87:3e:64:f9:0c:f9:53:6d:1c:cc:2e:f8:00:f3:55:c4:c5:fd:70:fd
------BEGIN CERTIFICATE-----
-MIIFjTCCA3WgAwIBAgIEGErM1jANBgkqhkiG9w0BAQsFADBWMQswCQYDVQQGEwJD
-TjEwMC4GA1UECgwnQ2hpbmEgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9y
-aXR5MRUwEwYDVQQDDAxDRkNBIEVWIFJPT1QwHhcNMTIwODA4MDMwNzAxWhcNMjkx
-MjMxMDMwNzAxWjBWMQswCQYDVQQGEwJDTjEwMC4GA1UECgwnQ2hpbmEgRmluYW5j
-aWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRUwEwYDVQQDDAxDRkNBIEVWIFJP
-T1QwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDXXWvNED8fBVnVBU03
-sQ7smCuOFR36k0sXgiFxEFLXUWRwFsJVaU2OFW2fvwwbwuCjZ9YMrM8irq93VCpL
-TIpTUnrD7i7es3ElweldPe6hL6P3KjzJIx1qqx2hp/Hz7KDVRM8Vz3IvHWOX6Jn5
-/ZOkVIBMUtRSqy5J35DNuF++P96hyk0g1CXohClTt7GIH//62pCfCqktQT+x8Rgp
-7hZZLDRJGqgG16iI0gNyejLi6mhNbiyWZXvKWfry4t3uMCz7zEasxGPrb382KzRz
-EpR/38wmnvFyXVBlWY9ps4deMm/DGIq1lY+wejfeWkU7xzbh72fROdOXW3NiGUgt
-hxwG+3SYIElz8AXSG7Ggo7cbcNOIabla1jj0Ytwli3i/+Oh+uFzJlU9fpy25IG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xGV2lZFA4gKn2fQ1XmxqI1AbQ3CekD6819kR5LLU7m7Wc5P/dAVUwHY3+vZ
-5nbv0CO7O6l5s9UCKc2Jo5YPSjXnTkLAdc0Hz+Ys63su
------END CERTIFICATE-----
-
-# Issuer: CN=T\xdcRKTRUST Elektronik Sertifika Hizmet Sa\u011flay\u0131c\u0131s\u0131 H5 O=T\xdcRKTRUST Bilgi \u0130leti\u015fim ve Bili\u015fim G\xfcvenli\u011fi Hizmetleri A.\u015e.
-# Subject: CN=T\xdcRKTRUST Elektronik Sertifika Hizmet Sa\u011flay\u0131c\u0131s\u0131 H5 O=T\xdcRKTRUST Bilgi \u0130leti\u015fim ve Bili\u015fim G\xfcvenli\u011fi Hizmetleri A.\u015e.
-# Label: "T\xdcRKTRUST Elektronik Sertifika Hizmet Sa\u011flay\u0131c\u0131s\u0131 H5"
-# Serial: 156233699172481
-# MD5 Fingerprint: da:70:8e:f0:22:df:93:26:f6:5f:9f:d3:15:06:52:4e
-# SHA1 Fingerprint: c4:18:f6:4d:46:d1:df:00:3d:27:30:13:72:43:a9:12:11:c6:75:fb
-# SHA256 Fingerprint: 49:35:1b:90:34:44:c1:85:cc:dc:5c:69:3d:24:d8:55:5c:b2:08:d6:a8:14:13:07:69:9f:4a:f0:63:19:9d:78
------BEGIN CERTIFICATE-----
-MIIEJzCCAw+gAwIBAgIHAI4X/iQggTANBgkqhkiG9w0BAQsFADCBsTELMAkGA1UE
-BhMCVFIxDzANBgNVBAcMBkFua2FyYTFNMEsGA1UECgxEVMOcUktUUlVTVCBCaWxn
-aSDEsGxldGnFn2ltIHZlIEJpbGnFn2ltIEfDvHZlbmxpxJ9pIEhpem1ldGxlcmkg
-QS7Fni4xQjBABgNVBAMMOVTDnFJLVFJVU1QgRWxla3Ryb25payBTZXJ0aWZpa2Eg
-SGl6bWV0IFNhxJ9sYXnEsWPEsXPEsSBINTAeFw0xMzA0MzAwODA3MDFaFw0yMzA0
-MjgwODA3MDFaMIGxMQswCQYDVQQGEw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3eaxynFNExc5JsUpISuTKWqW
-+qtB4Uu2NQvAmxU=
------END CERTIFICATE-----
-
-# Issuer: CN=Certinomis - Root CA O=Certinomis OU=0002 433998903
-# Subject: CN=Certinomis - Root CA O=Certinomis OU=0002 433998903
-# Label: "Certinomis - Root CA"
-# Serial: 1
-# MD5 Fingerprint: 14:0a:fd:8d:a8:28:b5:38:69:db:56:7e:61:22:03:3f
-# SHA1 Fingerprint: 9d:70:bb:01:a5:a4:a0:18:11:2e:f7:1c:01:b9:32:c5:34:e7:88:a8
-# SHA256 Fingerprint: 2a:99:f5:bc:11:74:b7:3c:bb:1d:62:08:84:e0:1c:34:e5:1c:cb:39:78:da:12:5f:0e:33:26:88:83:bf:41:58
------BEGIN CERTIFICATE-----
-MIIFkjCCA3qgAwIBAgIBATANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJGUjET
-MBEGA1UEChMKQ2VydGlub21pczEXMBUGA1UECxMOMDAwMiA0MzM5OTg5MDMxHTAb
-BgNVBAMTFENlcnRpbm9taXMgLSBSb290IENBMB4XDTEzMTAyMTA5MTcxOFoXDTMz
-MTAyMTA5MTcxOFowWjELMAkGA1UEBhMCRlIxEzARBgNVBAoTCkNlcnRpbm9taXMx
-FzAVBgNVBAsTDjAwMDIgNDMzOTk4OTAzMR0wGwYDVQQDExRDZXJ0aW5vbWlzIC0g
-Um9vdCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANTMCQosP5L2
-fxSeC5yaah1AMGT9qt8OHgZbn1CF6s2Nq0Nn3rD6foCWnoR4kkjW4znuzuRZWJfl
-LieY6pOod5tK8O90gC3rMB+12ceAnGInkYjwSond3IjmFPnVAy//ldu9n+ws+hQV
-WZUKxkd8aRi5pwP5ynapz8dvtF4F/u7BUrJ1Mofs7SlmO/NKFoL21prbcpjp3vDF
-TKWrteoB4owuZH9kb/2jJZOLyKIOSY008B/sWEUuNKqEUL3nskoTuLAPrjhdsKkb
-5nPJWqHZZkCqqU2mN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VpnzBMwQUAR1JIGkLGZOdblgi90AMRgwj
-Y/M50n92Uaf0yKHxDHYiI0ZSKS3io0EHVmmY0gUJvGnHWmHNj4FgFU2A3ZDifcRQ
-8ow7bkrHxuaAKzyBvBGAFhAn1/DNP3nMcyrDflOR1m749fPH0FFNjkulW+YZFzvW
-gQncItzujrnEj1PhZ7szuIgVRs/taTX/dQ1G885x4cVrhkIGuUE=
------END CERTIFICATE-----
-
-# Issuer: CN=OISTE WISeKey Global Root GB CA O=WISeKey OU=OISTE Foundation Endorsed
-# Subject: CN=OISTE WISeKey Global Root GB CA O=WISeKey OU=OISTE Foundation Endorsed
-# Label: "OISTE WISeKey Global Root GB CA"
-# Serial: 157768595616588414422159278966750757568
-# MD5 Fingerprint: a4:eb:b9:61:28:2e:b7:2f:98:b0:35:26:90:99:51:1d
-# SHA1 Fingerprint: 0f:f9:40:76:18:d3:d7:6a:4b:98:f0:a8:35:9e:0c:fd:27:ac:cc:ed
-# SHA256 Fingerprint: 6b:9c:08:e8:6e:b0:f7:67:cf:ad:65:cd:98:b6:21:49:e5:49:4a:67:f5:84:5e:7b:d1:ed:01:9f:27:b8:6b:d6
------BEGIN CERTIFICATE-----
-MIIDtTCCAp2gAwIBAgIQdrEgUnTwhYdGs/gjGvbCwDANBgkqhkiG9w0BAQsFADBt
-MQswCQYDVQQGEwJDSDEQMA4GA1UEChMHV0lTZUtleTEiMCAGA1UECxMZT0lTVEUg
-Rm91bmRhdGlvbiBFbmRvcnNlZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBHbG9i
-YWwgUm9vdCBHQiBDQTAeFw0xNDEyMDExNTAwMzJaFw0zOTEyMDExNTEwMzFaMG0x
-CzAJBgNVBAYTAkNIMRAwDgYDVQQKEwdXSVNlS2V5MSIwIAYDVQQLExlPSVNURSBG
-b3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBXSVNlS2V5IEdsb2Jh
-bCBSb290IEdCIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2Be3
-HEokKtaXscriHvt9OO+Y9bI5mE4nuBFde9IllIiCFSZqGzG7qFshISvYD06fWvGx
-WuR51jIjK+FTzJlFXHtPrby/h0oLS5daqPZI7H17Dc0hBt+eFf1Biki3IPShehtX
-1F1Q/7pn2COZH8g/497/b1t3sWtuuMlk9+HKQUYOKXHQuSP8yYFfTvdv37+ErXNk
-u7dCjmn21HYdfp2nuFeKUWdy19SouJVUQHMD9ur06/4oQnc/nSMbsrY9gBQHTC5P
-99UKFg29ZkM3fiNDecNAhvVMKdqOmq0NpQSHiB6F4+lT1ZvIiwNjeOvgGUpuuy9r
-M2RYk61pv48b74JIxwIDAQABo1EwTzALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUw
-AwEB/zAdBgNVHQ4EFgQUNQ/INmNe4qPs+TtmFc5RUuORmj0wEAYJKwYBBAGCNxUB
-BAMCAQAwDQYJKoZIhvcNAQELBQADggEBAEBM+4eymYGQfp3FsLAmzYh7KzKNbrgh
-cViXfa43FK8+5/ea4n32cZiZBKpDdHij40lhPnOMTZTg+XHEthYOU3gf1qKHLwI5
-gSk8rxWYITD+KJAAjNHhy/peyP34EEY7onhCkRd0VQreUGdNZtGn//3ZwLWoo4rO
-ZvUPQ82nK1d7Y0Zqqi5S2PTt4W2tKZB4SLrhI6qjiey1q5bAtEuiHZeeevJuQHHf
-aPFlTc58Bd9TZaml8LGXBHAVRgOY1NK/VLSgWH1Sb9pWJmLU2NuJMW8c8CLC02Ic
-Nc1MaRVUGpCY3useX8p3x8uOPUNpnJpY0CQ73xtAln41rYHHTnG6iBM=
------END CERTIFICATE-----
-
-# Issuer: CN=Certification Authority of WoSign G2 O=WoSign CA Limited
-# Subject: CN=Certification Authority of WoSign G2 O=WoSign CA Limited
-# Label: "Certification Authority of WoSign G2"
-# Serial: 142423943073812161787490648904721057092
-# MD5 Fingerprint: c8:1c:7d:19:aa:cb:71:93:f2:50:f8:52:a8:1e:ba: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DejaCnI2Y4qtAqkePx6db7XznPWZaOzG73/MWM5H8
-fHulwqZm46qwtyeYP0nXYGdnPzZPSsvxFPpahygc7Y9BMsaV+X3avXtbwrAh449G
-3CE4Q3RM+zD4F3LBMvzIkRfEzFg3TgvMWvchNSiDbGAtROtSjFA9tWwS1/oJu2yy
-SrHFieT801LYYRf+epSEj3m2M1m6D8QL4nCgS3gu+sif/a+RZQp4OBXllxcU3fng
-LDT4ONCEIgDAFFEYKwLcMFrw6AF8NTojrwjkr6qOKEJJLvD1mTS+7Q9LGOHSJDy7
-XUe3IfKN0QqZjuNuPq1w4I+5ysxugTH2e5x6eeRncRg=
------END CERTIFICATE-----
-
-# Issuer: CN=CA WoSign ECC Root O=WoSign CA Limited
-# Subject: CN=CA WoSign ECC Root O=WoSign CA Limited
-# Label: "CA WoSign ECC Root"
-# Serial: 138625735294506723296996289575837012112
-# MD5 Fingerprint: 80:c6:53:ee:61:82:28:72:f0:ff:21:b9:17:ca:b2:20
-# SHA1 Fingerprint: d2:7a:d2:be:ed:94:c0:a1:3c:c7:25:21:ea:5d:71:be:81:19:f3:2b
-# SHA256 Fingerprint: 8b:45:da:1c:06:f7:91:eb:0c:ab:f2:6b:e5:88:f5:fb:23:16:5c:2e:61:4b:f8:85:56:2d:0d:ce:50:b2:9b:02
------BEGIN CERTIFICATE-----
-MIICCTCCAY+gAwIBAgIQaEpYcIBr8I8C+vbe6LCQkDAKBggqhkjOPQQDAzBGMQsw
-CQYDVQQGEwJDTjEaMBgGA1UEChMRV29TaWduIENBIExpbWl0ZWQxGzAZBgNVBAMT
-EkNBIFdvU2lnbiBFQ0MgUm9vdDAeFw0xNDExMDgwMDU4NThaFw00NDExMDgwMDU4
-NThaMEYxCzAJBgNVBAYTAkNOMRowGAYDVQQKExFXb1NpZ24gQ0EgTGltaXRlZDEb
-MBkGA1UEAxMSQ0EgV29TaWduIEVDQyBSb290MHYwEAYHKoZIzj0CAQYFK4EEACID
-YgAE4f2OuEMkq5Z7hcK6C62N4DrjJLnSsb6IOsq/Srj57ywvr1FQPEd1bPiUt5v8
-KB7FVMxjnRZLU8HnIKvNrCXSf4/CwVqCXjCLelTOA7WRf6qU0NGKSMyCBSah1VES
-1ns2o0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4E
-FgQUqv3VWqP2h4syhf3RMluARZPzA7gwCgYIKoZIzj0EAwMDaAAwZQIxAOSkhLCB
-1T2wdKyUpOgOPQB0TKGXa/kNUTyh2Tv0Daupn75OcsqF1NnstTJFGG+rrQIwfcf3
-aWMvoeGY7xMQ0Xk/0f7qO3/eVvSQsRUR2LIiFdAvwyYua/GRspBl9JrmkO5K
------END CERTIFICATE-----
-
-# Issuer: CN=SZAFIR ROOT CA2 O=Krajowa Izba Rozliczeniowa S.A.
-# Subject: CN=SZAFIR ROOT CA2 O=Krajowa Izba Rozliczeniowa S.A.
-# Label: "SZAFIR ROOT CA2"
-# Serial: 357043034767186914217277344587386743377558296292
-# MD5 Fingerprint: 11:64:c1:89:b0:24:b1:8c:b1:07:7e:89:9e:51:9e:99
-# SHA1 Fingerprint: e2:52:fa:95:3f:ed:db:24:60:bd:6e:28:f3:9c:cc:cf:5e:b3:3f:de
-# SHA256 Fingerprint: a1:33:9d:33:28:1a:0b:56:e5:57:d3:d3:2b:1c:e7:f9:36:7e:b0:94:bd:5f:a7:2a:7e:50:04:c8:de:d7:ca:fe
------BEGIN CERTIFICATE-----
-MIIDcjCCAlqgAwIBAgIUPopdB+xV0jLVt+O2XwHrLdzk1uQwDQYJKoZIhvcNAQEL
-BQAwUTELMAkGA1UEBhMCUEwxKDAmBgNVBAoMH0tyYWpvd2EgSXpiYSBSb3psaWN6
-ZW5pb3dhIFMuQS4xGDAWBgNVBAMMD1NaQUZJUiBST09UIENBMjAeFw0xNTEwMTkw
-NzQzMzBaFw0zNTEwMTkwNzQzMzBaMFExCzAJBgNVBAYTAlBMMSgwJgYDVQQKDB9L
-cmFqb3dhIEl6YmEgUm96bGljemVuaW93YSBTLkEuMRgwFgYDVQQDDA9TWkFGSVIg
-Uk9PVCBDQTIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC3vD5QqEvN
-QLXOYeeWyrSh2gwisPq1e3YAd4wLz32ohswmUeQgPYUM1ljj5/QqGJ3a0a4m7utT
-3PSQ1hNKDJA8w/Ta0o4NkjrcsbH/ON7Dui1fgLkCvUqdGw+0w8LBZwPd3BucPbOw
-3gAeqDRHu5rr/gsUvTaE2g0gv/pby6kWIK05YO4vdbbnl5z5Pv1+TW9NL++IDWr6
-3fE9biCloBK0TXC5ztdyO4mTp4CEHCdJckm1/zuVnsHMyAHs6A6KCpbns6aH5db5
-BSsNl0BwPLqsdVqc1U2dAgrSS5tmS0YHF2Wtn2yIANwiieDhZNRnvDF5YTy7ykHN
-XGoAyDw4jlivAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQD
-AgEGMB0GA1UdDgQWBBQuFqlKGLXLzPVvUPMjX/hd56zwyDANBgkqhkiG9w0BAQsF
-AAOCAQEAtXP4A9xZWx126aMqe5Aosk3AM0+qmrHUuOQn/6mWmc5G4G18TKI4pAZw
-8PRBEew/R40/cof5O/2kbytTAOD/OblqBw7rHRz2onKQy4I9EYKL0rufKq8h5mOG
-nXkZ7/e7DDWQw4rtTw/1zBLZpD67oPwglV9PJi8RI4NOdQcPv5vRtB3pEAT+ymCP
-oky4rc/hkA/NrgrHXXu3UNLUYfrVFdvXn4dRVOul4+vJhaAlIDf7js4MNIThPIGy
-d05DpYhfhmehPea0XGG2Ptv+tyjFogeutcrKjSoS75ftwjCkySp6+/NNIxuZMzSg
-LvWpCz/UXeHPhJ/iGcJfitYgHuNztw==
------END CERTIFICATE-----
-
-# Issuer: CN=Certum Trusted Network CA 2 O=Unizeto Technologies S.A. OU=Certum Certification Authority
-# Subject: CN=Certum Trusted Network CA 2 O=Unizeto Technologies S.A. OU=Certum Certification Authority
-# Label: "Certum Trusted Network CA 2"
-# Serial: 44979900017204383099463764357512596969
-# MD5 Fingerprint: 6d:46:9e:d9:25:6d:08:23:5b:5e:74:7d:1e:27:db:f2
-# SHA1 Fingerprint: d3:dd:48:3e:2b:bf:4c:05:e8:af:10:f5:fa:76:26:cf:d3:dc:30:92
-# SHA256 Fingerprint: b6:76:f2:ed:da:e8:77:5c:d3:6c:b0:f6:3c:d1:d4:60:39:61:f4:9e:62:65:ba:01:3a:2f:03:07:b6:d0:b8:04
------BEGIN CERTIFICATE-----
-MIIF0jCCA7qgAwIBAgIQIdbQSk8lD8kyN/yqXhKN6TANBgkqhkiG9w0BAQ0FADCB
-gDELMAkGA1UEBhMCUEwxIjAgBgNVBAoTGVVuaXpldG8gVGVjaG5vbG9naWVzIFMu
-QS4xJzAlBgNVBAsTHkNlcnR1bSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEkMCIG
-A1UEAxMbQ2VydHVtIFRydXN0ZWQgTmV0d29yayBDQSAyMCIYDzIwMTExMDA2MDgz
-OTU2WhgPMjA0NjEwMDYwODM5NTZaMIGAMQswCQYDVQQGEwJQTDEiMCAGA1UEChMZ
-VW5pemV0byBUZWNobm9sb2dpZXMgUy5BLjEnMCUGA1UECxMeQ2VydHVtIENlcnRp
-ZmljYXRpb24gQXV0aG9yaXR5MSQwIgYDVQQDExtDZXJ0dW0gVHJ1c3RlZCBOZXR3
-b3JrIENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC9+Xj45tWA
-DGSdhhuWZGc/IjoedQF97/tcZ4zJzFxrqZHmuULlIEub2pt7uZld2ZuAS9eEQCsn
-0+i6MLs+CRqnSZXvK0AkwpfHp+6bJe+oCgCXhVqqndwpyeI1B+twTUrWwbNWuKFB
-OJvR+zF/j+Bf4bE/D44WSWDXBo0Y+aomEKsq09DRZ40bRr5HMNUuctHFY9rnY3lE
-fktjJImGLjQ/KUxSiyqnwOKRKIm5wFv5HdnnJ63/mgKXwc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7a6bINDd82Kkhehnlt4Fj1F4jNy3eFmypnTycUm/Q1oBEauttmbjL4ZvrHG8hnj
-XALKLNhvSgfZyTXaQHXyxKcZb55CEJh15pWLYLztxRLXis7VmFxWlgPF7ncGNf/P
-5O4/E2Hu29othfDNrp2yGAlFw5Khchf8R7agCyzxxN5DaAhqXzvwdmP7zAYspsbi
-DrW5viSP
------END CERTIFICATE-----
-
-# Issuer: CN=Hellenic Academic and Research Institutions RootCA 2015 O=Hellenic Academic and Research Institutions Cert. Authority
-# Subject: CN=Hellenic Academic and Research Institutions RootCA 2015 O=Hellenic Academic and Research Institutions Cert. Authority
-# Label: "Hellenic Academic and Research Institutions RootCA 2015"
-# Serial: 0
-# MD5 Fingerprint: ca:ff:e2:db:03:d9:cb:4b:e9:0f:ad:84:fd:7b:18:ce
-# SHA1 Fingerprint: 01:0c:06:95:a6:98:19:14:ff:bf:5f:c6:b0:b6:95:ea:29:e9:12:a6
-# SHA256 Fingerprint: a0:40:92:9a:02:ce:53:b4:ac:f4:f2:ff:c6:98:1c:e4:49:6f:75:5e:6d:45:fe:0b:2a:69:2b:cd:52:52:3f:36
------BEGIN CERTIFICATE-----
-MIIGCzCCA/OgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBpjELMAkGA1UEBhMCR1Ix
-DzANBgNVBAcTBkF0aGVuczFEMEIGA1UEChM7SGVsbGVuaWMgQWNhZGVtaWMgYW5k
-IFJlc2VhcmNoIEluc3RpdHV0aW9ucyBDZXJ0LiBBdXRob3JpdHkxQDA+BgNVBAMT
-N0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgUm9v
-dENBIDIwMTUwHhcNMTUwNzA3MTAxMTIxWhcNNDAwNjMwMTAxMTIxWjCBpjELMAkG
-A1UEBhMCR1IxDzANBgNVBAcTBkF0aGVuczFEMEIGA1UEChM7SGVsbGVuaWMgQWNh
-ZGVtaWMgYW5kIFJlc2VhcmNoIEluc3RpdHV0aW9ucy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+hFjtyp8iY/xnmMsVMI
-M4GwVhO+5lFc2JsKT0ucVlMC6U/2DWDqTUJV6HwbISHTGzrMd/K4kPFox/la/vot
-9L/J9UUbzjgQKjeKeaO04wlshYaT/4mWJ3iBj2fjRnRUjtkNaeJK9E10A/+yd+2V
-Z5fkscWrv2oj6NSU4kQoYsRL4vDY4ilrGnB+JGGTe08DMiUNRSQrlrRGar9KC/ea
-j8GsGsVn82800vpzY4zvFrCopEYq+OsS7HK07/grfoxSwIuEVPkvPuNVqNxmsdnh
-X9izjFk0WaSrT2y7HxjbdavYy5LNlDhhDgcGH0tGEPEVvo2FXDtKK4F5D7Rpn0lQ
-l033DlZdwJVqwjbDG2jJ9SrcR5q+ss7FJej6A7na+RZukYT1HCjI/CbM1xyQVqdf
-bzoEvM14iQuODy+jqk+iGxI9FghAD/FGTNeqewjBCvVtJ94Cj8rDtSvK6evIIVM4
-pcw72Hc3MKJP2W/R8kCtQXoXxdZKNYm3QdV8hn9VTYNKpXMgwDqvkPGaJI7ZjnHK
-e7iG2rKPmT4dEw0SEe7Uq/DpFXYC5ODfqiAeW2GFZECpkJcNrVPSWh2HagCXZWK0
-vm9qp/UsQu0yrbYhnr68
------END CERTIFICATE-----
-
-# Issuer: CN=Hellenic Academic and Research Institutions ECC RootCA 2015 O=Hellenic Academic and Research Institutions Cert. Authority
-# Subject: CN=Hellenic Academic and Research Institutions ECC RootCA 2015 O=Hellenic Academic and Research Institutions Cert. Authority
-# Label: "Hellenic Academic and Research Institutions ECC RootCA 2015"
-# Serial: 0
-# MD5 Fingerprint: 81:e5:b4:17:eb:c2:f5:e1:4b:0d:41:7b:49:92:fe:ef
-# SHA1 Fingerprint: 9f:f1:71:8d:92:d5:9a:f3:7d:74:97:b4:bc:6f:84:68:0b:ba:b6:66
-# SHA256 Fingerprint: 44:b5:45:aa:8a:25:e6:5a:73:ca:15:dc:27:fc:36:d2:4c:1c:b9:95:3a:06:65:39:b1:15:82:dc:48:7b:48:33
------BEGIN CERTIFICAT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# Label: "Certplus Root CA G1"
-# Serial: 1491911565779898356709731176965615564637713
-# MD5 Fingerprint: 7f:09:9c:f7:d9:b9:5c:69:69:56:d5:37:3e:14:0d:42
-# SHA1 Fingerprint: 22:fd:d0:b7:fd:a2:4e:0d:ac:49:2c:a0:ac:a6:7b:6a:1f:e3:f7:66
-# SHA256 Fingerprint: 15:2a:40:2b:fc:df:2c:d5:48:05:4d:22:75:b3:9c:7f:ca:3e:c0:97:80:78:b0:f0:ea:76:e5:61:a6:c7:43:3e
------BEGIN CERTIFICATE-----
-MIIFazCCA1OgAwIBAgISESBVg+QtPlRWhS2DN7cs3EYRMA0GCSqGSIb3DQEBDQUA
-MD4xCzAJBgNVBAYTAkZSMREwDwYDVQQKDAhDZXJ0cGx1czEcMBoGA1UEAwwTQ2Vy
-dHBsdXMgUm9vdCBDQSBHMTAeFw0xNDA1MjYwMDAwMDBaFw0zODAxMTUwMDAwMDBa
-MD4xCzAJBgNVBAYTAkZSMREwDwYDVQQKDAhDZXJ0cGx1czEcMBoGA1UEAwwTQ2Vy
-dHBsdXMgUm9vdCBDQSBHMTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIB
-ANpQh7bauKk+nWT6VjOaVj0W5QOVsjQcmm1iBdTYj+eJZJ+622SLZOZ5KmHNr49a
-iZFluVj8tANfkT8tEBXgfs+8/H9DZ6itXjYj2JizTfNDnjl8KvzsiNWI7nC9hRYt
-6kuJPKNxQv4c/dMcLRC4hlTqQ7jbxofaqK6AJc96Jh2qkbBIb6613p7Y1/oA/caP
-0FG7Yn2ksYyy/yARujVjBYZHYEMzkPZHogNPlk2dT8Hq6pyi/jQu3rfKG3akt62f
-6ajUeD94/vI4CTYd0hYCyOwqaK/1jpTvLRN6HkJKHRUxrgwEV/xhc/MxVoYxgKDE
-EW4wduOU8F8ExKyHcomYxZ3MVwia9Az8fXoFOvpHgDm2z4QTd28n6v+WZxcIbekN
-1iNQMLAVdBM+5S//Ds3EC0pd8NgAM0lm66EYf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qAHVcweMcDvOrRl
-++O/QmueD6i9a5jc2NvLi6Td11n0bt3+qsOR0C5CB8AMTVPNJLFMWx5R9N/pkvo=
------END CERTIFICATE-----
-
-# Issuer: CN=Certplus Root CA G2 O=Certplus
-# Subject: CN=Certplus Root CA G2 O=Certplus
-# Label: "Certplus Root CA G2"
-# Serial: 1492087096131536844209563509228951875861589
-# MD5 Fingerprint: a7:ee:c4:78:2d:1b:ee:2d:b9:29:ce:d6:a7:96:32:31
-# SHA1 Fingerprint: 4f:65:8e:1f:e9:06:d8:28:02:e9:54:47:41:c9:54:25:5d:69:cc:1a
-# SHA256 Fingerprint: 6c:c0:50:41:e6:44:5e:74:69:6c:4c:fb:c9:f8:0f:54:3b:7e:ab:bb:44:b4:ce:6f:78:7c:6a:99:71:c4:2f:17
------BEGIN CERTIFICATE-----
-MIICHDCCAaKgAwIBAgISESDZkc6uo+jF5//pAq/Pc7xVMAoGCCqGSM49BAMDMD4x
-CzAJBgNVBAYTAkZSMREwDwYDVQQKDAhDZXJ0cGx1czEcMBoGA1UEAwwTQ2VydHBs
-dXMgUm9vdCBDQSBHMjAeFw0xNDA1MjYwMDAwMDBaFw0zODAxMTUwMDAwMDBaMD4x
-CzAJBgNVBAYTAkZSMREwDwYDVQQKDAhDZXJ0cGx1czEcMBoGA1UEAwwTQ2VydHBs
-dXMgUm9vdCBDQSBHMjB2MBAGByqGSM49AgEGBSuBBAAiA2IABM0PW1aC3/BFGtat
-93nwHcmsltaeTpwftEIRyoa/bfuFo8XlGVzX7qY/aWfYeOKmycTbLXku54uNAm8x
-Ik0G42ByRZ0OQneezs/lf4WbGOT8zC5y0xaTTsqZY1yhBSpsBqNjMGEwDgYDVR0P
-AQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNqDYwJ5jtpMxjwj
-FNiPwyCrKGBZMB8GA1UdIwQYMBaAFNqDYwJ5jtpMxjwjFNiPwyCrKGBZMAoGCCqG
-SM49BAMDA2gAMGUCMHD+sAvZ94OX7PNVHdTcswYO/jOYnYs5kGuUIe22113WTNch
-p+e/IQ8rzfcq3IUHnQIxAIYUFuXcsGXCwI4Un78kFmjlvPl5adytRSv3tjFzzAal
-U5ORGpOucGpnutee5WEaXw==
------END CERTIFICATE-----
-
-# Issuer: CN=OpenTrust Root CA G1 O=OpenTrust
-# Subject: CN=OpenTrust Root CA G1 O=OpenTrust
-# Label: "OpenTrust Root CA G1"
-# Serial: 1492036577811947013770400127034825178844775
-# MD5 Fingerprint: 76:00:cc:81:29:cd:55:5e:88:6a:7a:2e:f7:4d:39:da
-# SHA1 Fingerprint: 79:91:e8:34:f7:e2:ee:dd:08:95:01:52:e9:55:2d:14:e9:58:d5:7e
-# SHA256 Fingerprint: 56:c7:71:28:d9:8c:18:d9:1b:4c:fd:ff:bc:25:ee:91:03:d4:75:8e:a2:ab:ad:82:6a:90:f3:45:7d:46:0e:b4
------BEGIN CERTIFICATE-----
-MIIFbzCCA1egAwIBAgISESCzkFU5fX82bWTCp59rY45nMA0GCSqGSIb3DQEBCwUA
-MEAxCzAJBgNVBAYTAkZSMRIwEAYDVQQKDAlPcGVuVHJ1c3QxHTAbBgNVBAMMFE9w
-ZW5UcnVzdCBSb290IENBIEcxMB4XDTE0MDUyNjA4NDU1MFoXDTM4MDExNTAwMDAw
-MFowQDELMAkGA1UEBhMCRlIxEjAQBgNVBAoMCU9wZW5UcnVzdDEdMBsGA1UEAwwU
-T3BlblRydXN0IFJvb3QgQ0EgRzEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIK
-AoICAQD4eUbalsUwXopxAy1wpLuwxQjczeY1wICkES3d5oeuXT2R0odsN7faYp6b
-wiTXj/HbpqbfRm9RpnHLPhsxZ2L3EVs0J9V5ToybWL0iEA1cJwzdMOWo010hOHQX
-/uMftk87ay3bfWAfjH1MBcLrARYVmBSO0ZB3Ij/swjm4eTrwSSTilZHcYTSSjFR0
-77F9jAHiOH3BX2pfJLKOYheteSCtqx234LSWSE9mQxAG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ZTGMKcmGS3t
-TAZQMPH9WD25SxdfGbRqhFS0OE85og2WaMMolP3tLR9Ka0OWLpABEPs4poEL0L91
-09S5zvE/bw4cHjdx5RiHdRk/ULlepEU0rbDK5uUTdg8xFKmOLZTW1YVNcxVPS/Ky
-Pu1svf0OnWZzsD2097+o4BGkxK51CUpjAEggpsadCwmKtODmzj7HPiY46SvepghJ
-AwSQiumPv+i2tCqjI40cHLI5kqiPAlxAOXXUc0ECd97N4EOH1uS6SsNsEn/+KuYj
-1oxx
------END CERTIFICATE-----
-
-# Issuer: CN=OpenTrust Root CA G2 O=OpenTrust
-# Subject: CN=OpenTrust Root CA G2 O=OpenTrust
-# Label: "OpenTrust Root CA G2"
-# Serial: 1492012448042702096986875987676935573415441
-# MD5 Fingerprint: 57:24:b6:59:24:6b:ae:c8:fe:1c:0c:20:f2:c0:4e:eb
-# SHA1 Fingerprint: 79:5f:88:60:c5:ab:7c:3d:92:e6:cb:f4:8d:e1:45:cd:11:ef:60:0b
-# SHA256 Fingerprint: 27:99:58:29:fe:6a:75:15:c1:bf:e8:48:f9:c4:76:1d:b1:6c:22:59:29:25:7b:f4:0d:08:94:f2:9e:a8:ba:f2
------BEGIN CERTIFICATE-----
-MIIFbzCCA1egAwIBAgISESChaRu/vbm9UpaPI+hIvyYRMA0GCSqGSIb3DQEBDQUA
-MEAxCzAJBgNVBAYTAkZSMRIwEAYDVQQKDAlPcGVuVHJ1c3QxHTAbBgNVBAMMFE9w
-ZW5UcnVzdCBSb290IENBIEcyMB4XDTE0MDUyNjAwMDAwMFoXDTM4MDExNTAwMDAw
-MFowQDELMAkGA1UEBhMCRlIxEjAQBgNVBAoMCU9wZW5UcnVzdDEdMBsGA1UEAwwU
-T3BlblRydXN0IFJvb3QgQ0EgRzIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIK
-AoICAQDMtlelM5QQgTJT32F+D3Y5z1zCU3UdSXqWON2ic2rxb95eolq5cSG+Ntmh
-/LzubKh8NBpxGuga2F8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RwkqWOOAgfZDC2
-t0v7NqwQjqBSM2OdAzVWxWm9xiNaJ5T2pBL4LTM8oValX9YZ6e18CL13zSdkzJTa
-TkZQh+D5wVOAHrut+0dSixv9ovneDiK3PTNZbNTe9ZUGMg1RGUFcPk8G97krgCf2
-o6p6fAbhQ8MTOWIaNr3gKC6UAuQpLmBVrkA9sHSSXvAgZJY/X0VdiLWK2gKgW0VU
-3jg9CcCoSmVGFvyqv1ROTVu+OEO3KMqLM6oaJbolXCkvW0pujOotnCr2BXbgd5eA
-iN1nE28daCSLT7d0geX0YJ96Vdc+N9oWaz53rK4YcJUIeSkDiv7BO7M/Gg+kO14f
-WKGVyasvc0rQLW6aWQ9VGHgtPFGml4vmu7JwqkwR3v98KzfUetF3NI/n+UL3PIEM
-S1IK
------END CERTIFICATE-----
-
-# Issuer: CN=OpenTrust Root CA G3 O=OpenTrust
-# Subject: CN=OpenTrust Root CA G3 O=OpenTrust
-# Label: "OpenTrust Root CA G3"
-# Serial: 1492104908271485653071219941864171170455615
-# MD5 Fingerprint: 21:37:b4:17:16:92:7b:67:46:70:a9:96:d7:a8:13:24
-# SHA1 Fingerprint: 6e:26:64:f3:56:bf:34:55:bf:d1:93:3f:7c:01:de:d8:13:da:8a:a6
-# SHA256 Fingerprint: b7:c3:62:31:70:6e:81:07:8c:36:7c:b8:96:19:8f:1e:32:08:dd:92:69:49:dd:8f:57:09:a4:10:f7:5b:62:92
------BEGIN CERTIFICATE-----
-MIICITCCAaagAwIBAgISESDm+Ez8JLC+BUCs2oMbNGA/MAoGCCqGSM49BAMDMEAx
-CzAJBgNVBAYTAkZSMRIwEAYDVQQKDAlPcGVuVHJ1c3QxHTAbBgNVBAMMFE9wZW5U
-cnVzdCBSb290IENBIEczMB4XDTE0MDUyNjAwMDAwMFoXDTM4MDExNTAwMDAwMFow
-QDELMAkGA1UEBhMCRlIxEjAQBgNVBAoMCU9wZW5UcnVzdDEdMBsGA1UEAwwUT3Bl
-blRydXN0IFJvb3QgQ0EgRzMwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAARK7liuTcpm
-3gY6oxH84Bjwbhy6LTAMidnW7ptzg6kjFYwvWYpa3RTqnVkrQ7cG7DK2uu5Bta1d
-oYXM6h0UZqNnfkbilPPntlahFVmhTzeXuSIevRHr9LIfXsMUmuXZl5mjYzBhMA4G
-A1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRHd8MUi2I5
-DMlv4VBN0BBY3JWIbTAfBgNVHSMEGDAWgBRHd8MUi2I5DMlv4VBN0BBY3JWIbTAK
-BggqhkjOPQQDAwNpADBmAjEAj6jcnboMBBf6Fek9LykBl7+BFjNAk2z8+e2AcG+q
-j9uEwov1NcoG3GRvaBbhj5G5AjEA2Euly8LQCGzpGPta3U1fJAuwACEl74+nBCZx
-4nxp5V2a+EEfOzmTk51V6s2N8fvB
------END CERTIFICATE-----
-
-# Issuer: CN=ISRG Root X1 O=Internet Security Research Group
-# Subject: CN=ISRG Root X1 O=Internet Security Research Group
-# Label: "ISRG Root X1"
-# Serial: 172886928669790476064670243504169061120
-# MD5 Fingerprint: 0c:d2:f9:e0:da:17:73:e9:ed:86:4d:a5:e3:70:e7:4e
-# SHA1 Fingerprint: ca:bd:2a:79:a1:07:6a:31:f2:1d:25:36:35:cb:03:9d:43:29:a5:e8
-# SHA256 Fingerprint: 96:bc:ec:06:26:49:76:f3:74:60:77:9a:cf:28:c5:a7:cf:e8:a3:c0:aa:e1:1a:8f:fc:ee:05:c0:bd:df:08:c6
------BEGIN CERTIFICATE-----
-MIIFazCCA1OgAwIBAgIRAIIQz7DSQONZRGPgu2OCiwAwDQYJKoZIhvcNAQELBQAw
-TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh
-cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMTUwNjA0MTEwNDM4
-WhcNMzUwNjA0MTEwNDM4WjBPMQsw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lnrzuBZ6brJFe+GnY+EgPbk6ZGQ
-3BebYhtF8GaV0nxvwuo77x/Py9auJ/GpsMiu/X1+mvoiBOv/2X/qkSsisRcOj/KK
-NFtY2PwByVS5uCbMiogziUwthDyC3+6WVwW6LLv3xLfHTjuCvjHIInNzktHCgKQ5
-ORAzI4JMPJ+GslWYHb4phowim57iaztXOoJwTdwJx4nLCgdNbOhdjsnvzqvHu7Ur
-TkXWStAmzOVyyghqpZXjFaH3pO3JLF+l+/+sKAIuvtd7u+Nxe5AW0wdeRlN8NwdC
-jNPElpzVmbUq4JUagEiuTDkHzsxHpFKVK7q4+63SM1N95R1NbdWhscdCb+ZAJzVc
-oyi3B43njTOQ5yOf+1CceWxG1bQVs5ZufpsMljq4Ui0/1lvh+wjChP4kqKOJ2qxq
-4RgqsahDYVvTH9w7jXbyLeiNdd8XM2w9U/t7y0Ff/9yi0GE44Za4rF2LN9d11TPA
-mRGunUHBcnWEvgJBQl9nJEiU0Zsnvgc/ubhPgXRR4Xq37Z0j4r7g1SgEEzwxA57d
-emyPxgcYxn/eR44/KJ4EBs+lVDR3veyJm+kXQ99b21/+jh5Xos1AnX5iItreGCc=
------END CERTIFICATE-----
-
-# Issuer: O=FNMT-RCM OU=AC RAIZ FNMT-RCM
-# Subject: O=FNMT-RCM OU=AC RAIZ FNMT-RCM
-# Label: "AC RAIZ FNMT-RCM"
-# Serial: 485876308206448804701554682760554759
-# MD5 Fingerprint: e2:09:04:b4:d3:bd:d1:a0:14:fd:1a:d2:47:c4:57:1d
-# SHA1 Fingerprint: ec:50:35:07:b2:15:c4:95:62:19:e2:a8:9a:5b:42:99:2c:4c:2c:20
-# SHA256 Fingerprint: eb:c5:57:0c:29:01:8c:4d:67:b1:aa:12:7b:af:12:f7:03:b4:61:1e:bc:17:b7:da:b5:57:38:94:17:9b:93:fa
------BEGIN CERTIFICATE-----
-MIIFgzCCA2ugAwIBAgIPXZONMGc2yAYdGsdUhGkHMA0GCSqGSIb3DQEBCwUAMDsx
-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DUwMwYEVR0gADArMCkGCCsGAQUFBwIBFh1odHRwOi8vd3d3
-LmNlcnQuZm5tdC5lcy9kcGNzLzANBgkqhkiG9w0BAQsFAAOCAgEAB5BK3/MjTvDD
-nFFlm5wioooMhfNzKWtN/gHiqQxjAb8EZ6WdmF/9ARP67Jpi6Yb+tmLSbkyU+8B1
-RXxlDPiyN8+sD8+Nb/kZ94/sHvJwnvDKuO+3/3Y3dlv2bojzr2IyIpMNOmqOFGYM
-LVN0V2Ue1bLdI4E7pWYjJ2cJj+F3qkPNZVEI7VFY/uY5+ctHhKQV8Xa7pO6kO8Rf
-77IzlhEYt8llvhjho6Tc+hj507wTmzl6NLrTQfv6MooqtyuGC2mDOL7Nii4LcK2N
-JpLuHvUBKwrZ1pebbuCoGRw6IYsMHkCtA+fdZn71uSANA+iW+YJF1DngoABd15jm
-fZ5nc8OaKveri6E6FO80vFIOiZiaBECEHX5FaZNXzuvO+FB8TxxuBEOb+dY7Ixjp
-6o7RTUaN8Tvkasq6+yO3m/qZASlaWFot4/nUbQ4mrcFuNLwy+AwF+mWj2zs3gyLp
-1txyM/1d8iC9djwj2ij3+RvrWWTV3F9yfiD8zYm1kGdNYno/Tq0dwzn+evQoFt9B
-9kiABdcPUXmsEKvU7ANm5mqwujGSQkBqvjrTcuFqN1W8rB2Vt2lh8kORdOag0wok
-RqEIr9baRRmW1FMdW4R58MD3R++Lj8UGrp1MYp3/RgT408m2ECVAdf4WqslKYIYv
-uu8wd+RU4riEmViAqhOLUTpPSPaLtrM=
------END CERTIFICATE-----
-
-# Issuer: CN=Amazon Root CA 1 O=Amazon
-# Subject: CN=Amazon Root CA 1 O=Amazon
-# Label: "Amazon Root CA 1"
-# Serial: 143266978916655856878034712317230054538369994
-# MD5 Fingerprint: 43:c6:bf:ae:ec:fe:ad:2f:18:c6:88:68:30:fc:c8:e6
-# SHA1 Fingerprint: 8d:a7:f9:65:ec:5e:fc:37:91:0f:1c:6e:59:fd:c1:cc:6a:6e:de:16
-# SHA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q2V8viTO96LXFvKWlJbYK8U90vv
-o/ufQJVtMVT8QtPHRh8jrdkPSHCa2XV4cdFyQzR1bldZwgJcJmApzyMZFo6IQ6XU
-5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2xJNDd2ZhwLnoQdeXeGADbkpy
-rqXRfboQnoZsG4q5WTP468SQvvG5
------END CERTIFICATE-----
-
-# Issuer: CN=Amazon Root CA 2 O=Amazon
-# Subject: CN=Amazon Root CA 2 O=Amazon
-# Label: "Amazon Root CA 2"
-# Serial: 143266982885963551818349160658925006970653239
-# MD5 Fingerprint: c8:e5:8d:ce:a8:42:e2:7a:c0:2a:5c:7c:9e:26:bf:66
-# SHA1 Fingerprint: 5a:8c:ef:45:d7:a6:98:59:76:7a:8c:8b:44:96:b5:78:cf:47:4b:1a
-# SHA256 Fingerprint: 1b:a5:b2:aa:8c:65:40:1a:82:96:01:18:f8:0b:ec:4f:62:30:4d:83:ce:c4:71:3a:19:c3:9c:01:1e:a4:6d:b4
------BEGIN CERTIFICATE-----
-MIIFQTCCAymgAwIBAgITBmyf0pY1hp8KD+WGePhbJruKNzANBgkqhkiG9w0BAQwF
-ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6
-b24gUm9vdCBDQSAyMB4XDTE1MDUyNjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTEL
-MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv
-b3QgQ0EgMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAK2Wny2cSkxK
-gXlRmeyKy2tgURO8TW0G/LAIjd0ZEGrHJgw12MBvIITplLGbhQPDW9tK6Mj4kHbZ
-W0/jTOgGNk3Mmqw9DJArktQGGWCsN0R5hYGCrVo34A3MnaZMUnbqQ523BNFQ9lXg
-1dKmSYXpN+nKfq5clU1Imj+uIFptiJXZNLhSGkOQsL9sBbm2eL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
-fUwPfHJ5elnNXkoOrJupmHN5fLT0zLm4BwyydFy4x2+IoZCn9Kr5v2c69BoVYh63
-n749sSmvZ6ES8lgQGVMDMBu4Gon2nL2XA46jCfMdiyHxtN/kHNGfZQIG6lzWE7OE
-76KlXIx3KadowGuuQNKotOrN8I1LOJwZmhsoVLiJkO/KdYE+HvJkJMcYr07/R54H
-9jVlpNMKVv/1F2Rs76giJUmTtt8AF9pYfl3uxRuw0dFfIRDH+fO6AgonB8Xx1sfT
-4PsJYGw=
------END CERTIFICATE-----
-
-# Issuer: CN=Amazon Root CA 3 O=Amazon
-# Subject: CN=Amazon Root CA 3 O=Amazon
-# Label: "Amazon Root CA 3"
-# Serial: 143266986699090766294700635381230934788665930
-# MD5 Fingerprint: a0:d4:ef:0b:f7:b5:d8:49:95:2a:ec:f5:c4:fc:81:87
-# SHA1 Fingerprint: 0d:44:dd:8c:3c:8c:1a:1a:58:75:64:81:e9:0f:2e:2a:ff:b3:d2:6e
-# SHA256 Fingerprint: 18:ce:6c:fe:7b:f1:4e:60:b2:e3:47:b8:df:e8:68:cb:31:d0:2e:bb:3a:da:27:15:69:f5:03:43:b4:6d:b3:a4
------BEGIN CERTIFICATE-----
-MIIBtjCCAVugAwIBAgITBmyf1XSXNmY/Owua2eiedgPySjAKBggqhkjOPQQDAjA5
-MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24g
-Um9vdCBDQSAzMB4XDTE1MDUyNjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTELMAkG
-A1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJvb3Qg
-Q0EgMzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABCmXp8ZBf8ANm+gBG1bG8lKl
-ui2yEujSLtf6ycXYqm0fc4E7O5hrOXwzpcVOho6AF2hiRVd9RFgdszflZwjrZt6j
-QjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBSr
-ttvXBp43rDCGB5Fwx5zEGbF4wDAKBggqhkjOPQQDAgNJADBGAiEA4IWSoxe3jfkr
-BqWTrBqYaGFy+uGh0PsceGCmQ5nFuMQCIQCcAu/xlJyzlvnrxir4tiz+OpAUFteM
-YyRIHN8wfdVoOw==
------END CERTIFICATE-----
-
-# Issuer: CN=Amazon Root CA 4 O=Amazon
-# Subject: CN=Amazon Root CA 4 O=Amazon
-# Label: "Amazon Root CA 4"
-# Serial: 143266989758080763974105200630763877849284878
-# MD5 Fingerprint: 89:bc:27:d5:eb:17:8d:06:6a:69:d5:fd:89:47:b4:cd
-# SHA1 Fingerprint: f6:10:84:07:d6:f8:bb:67:98:0c:c2:e2:44:c2:eb:ae:1c:ef:63:be
-# SHA256 Fingerprint: e3:5d:28:41:9e:d0:20:25:cf:a6:90:38:cd:62:39:62:45:8d:a5:c6:95:fb:de:a3:c2:2b:0b:fb:25:89:70:92
------BEGIN CERTIFICATE-----
-MIIB8jCCAXigAwIBAgITBmyf18G7EEwpQ+Vxe3ssyBrBDjAKBggqhkjOPQQDAzA5
-MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24g
-Um9vdCBDQSA0MB4XDTE1MDUyNjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTELMAkG
-A1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJvb3Qg
-Q0EgNDB2MBAGByqGSM49AgEGBSuBBAAiA2IABNKrijdPo1MN/sGKe0uoe0ZLY7Bi
-9i0b2whxIdIA6GO9mif78DluXeo9pcmBqqNbIJhFXRbb/egQbeOc4OO9X4Ri83Bk
-M6DLJC9wuoihKqB1+IGuYgbEgds5bimwHvouXKNCMEAwDwYDVR0TAQH/BAUwAwEB
-/zAOBgNVHQ8BAf8EBAMCAYYwHQYDVR0OBBYEFNPsxzplbszh2naaVvuc84ZtV+WB
-MAoGCCqGSM49BAMDA2gAMGUCMDqLIfG9fhGt0O9Yli/W651+kI0rz2ZVwyzjKKlw
-CkcO8DdZEv8tmZQoTipPNU0zWgIxAOp1AE47xDqUEpHJWEadIRNyp4iciuRMStuW
-1KyLa2tJElMzrdfkviT8tQp21KW8EA==
------END CERTIFICATE-----
-
-# Issuer: CN=LuxTrust Global Root 2 O=LuxTrust S.A.
-# Subject: CN=LuxTrust Global Root 2 O=LuxTrust S.A.
-# Label: "LuxTrust Global Root 2"
-# Serial: 59914338225734147123941058376788110305822489521
-# MD5 Fingerprint: b2:e1:09:00:61:af:f7:f1:91:6f:c4:ad:8d:5e:3b:7c
-# SHA1 Fingerprint: 1e:0e:56:19:0a:d1:8b:25:98:b2:04:44:ff:66:8a:04:17:99:5f:3f
-# SHA256 Fingerprint: 54:45:5f:71:29:c2:0b:14:47:c4:18:f9:97:16:8f:24:c5:8f:c5:02:3b:f5:da:5b:e2:eb:6e:1d:d8:90:2e:d5
------BEGIN CERTIFICATE-----
-MIIFwzCCA6ugAwIBAgIUCn6m30tEntpqJIWe5rgV0xZ/u7EwDQYJKoZIhvcNAQEL
-BQAwRjELMAkGA1UEBhMCTFUxFjAUBgNVBAoMDUx1eFRydXN0IFMuQS4xHzAdBgNV
-BAMMFkx1eFRydXN0IEdsb2JhbCBSb290IDIwHhcNMTUwMzA1MTMyMTU3WhcNMzUw
-MzA1MTMyMTU3WjBGMQswCQYDVQQGEwJMVTEWMBQGA1UECgwNTHV4VHJ1c3QgUy5B
-LjEfMB0GA1UEAwwWTHV4VHJ1c3QgR2xvYmFsIFJvb3QgMjCCAiIwDQYJKoZIhvcN
-AQEBBQADggIPADCCAgoCggIBANeFl78RmOnwYoNMPIf5U2o3C/IPPIfOb9wmKb3F
-ibrJgz337spbxm1Jc7TJRqMbNBM/wYlFV/TZsfs2ZUv7COJIcRHIbjuend+JZTem
-hfY7RBi2xjcwYkSSl2l9QjAk5A0MiWtj3sXh306pFGxT4GHO9hcvH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055c
-qqmkoCUUBpvsT34tC38ddfEz2O3OuHVtPlu5mB0xDVbYQw8wkbIEa91WvpWAVWe+
-2M2D2RjuLg+GLZKecBPs3lHJQ3gCpU3I+V/EkVhGFndadKpAvAefMLmx9xIX3eP/
-JEAdemrRTxgKqpAd60Ae36EeRJIQmvKN4dFLRp7oRUKX6kWZ8+xm1QL68qZKJKre
-zrnK+T+Tb/mjuuqlPpmt/f97mfVl7vBZKGfXkJWkE4SphMHozs51k2MavDzq1WQf
-LSoSOcbDWjLtR5EWDrw4wVDej8oqkDQc7kGUnF4ZLvhFSZl0kbAEb+MEWrGrKqv+
-x9CWttrhSmQGbmBNvUJO/3jaJMobtNeWOWyu8Q6qp31IiyBMz2TWuJdGsE7RKlY6
-oJO9r4Ak4Ap+58rVyuiFVdw2KuGUaJPHZnJED4AhMmwlxyOAgwrr
------END CERTIFICATE-----
-
-# Issuer: CN=TUBITAK Kamu SM SSL Kok Sertifikasi - Surum 1 O=Turkiye Bilimsel ve Teknolojik Arastirma Kurumu - TUBITAK OU=Kamu Sertifikasyon Merkezi - Kamu SM
-# Subject: CN=TUBITAK Kamu SM SSL Kok Sertifikasi - Surum 1 O=Turkiye Bilimsel ve Teknolojik Arastirma Kurumu - TUBITAK OU=Kamu Sertifikasyon Merkezi - Kamu SM
-# Label: "TUBITAK Kamu SM SSL Kok Sertifikasi - Surum 1"
-# Serial: 1
-# MD5 Fingerprint: dc:00:81:dc:69:2f:3e:2f:b0:3b:f6:3d:5a:91:8e:49
-# SHA1 Fingerprint: 31:43:64:9b:ec:ce:27:ec:ed:3a:3f:0b:8f:0d:e4:e8:91:dd:ee:ca
-# SHA256 Fingerprint: 46:ed:c3:68:90:46:d5:3a:45:3f:b3:10:4a:b8:0d:ca:ec:65:8b:26:60:ea:16:29:dd:7e:86:79:90:64:87:16
------BEGIN CERTIFICATE-----
-MIIEYzCCA0ugAwIBAgIBATANBgkqhkiG9w0BAQsFADCB0jELMAkGA1UEBhMCVFIx
-GDAWBgNV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1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEL
-BQADggEBACo/4fEyjq7hmFxLXs9rHmoJ0iKpEsdeV31zVmSAhHqT5Am5EM2fKifh
-AHe+SMg1qIGf5LgsyX8OsNJLN13qudULXjS99HMpw+0mFZx+CFOKWI3QSyjfwbPf
-IPP54+M638yclNhOT8NrF7f3cuitZjO1JVOr4PhMqZ398g26rrnZqsZr+ZO7rqu4
-lzwDGrpDxpa5RXI4s6ehlj2Re37AIVNMh+3yC1SVUZPVIqUNivGTDj5UDrDYyU7c
-8jEyVupk+eq1nRZmQnLzf9OxMUP8pI4X8W0jq5Rm+K37DwhuJi1/FwcJsoz7UMCf
-lo3Ptv0AnVoUmr8CRPXBwp8iXqIPoeM=
------END CERTIFICATE-----
-# Issuer: CN=Entrust.net Secure Server Certification Authority O=Entrust.net OU=www.entrust.net/CPS incorp. by ref. (limits liab.)/(c) 1999 Entrust.net Limited
-# Subject: CN=Entrust.net Secure Server Certification Authority O=Entrust.net OU=www.entrust.net/CPS incorp. by ref. (limits liab.)/(c) 1999 Entrust.net Limited
-# Label: "Entrust.net Secure Server CA"
-# Serial: 927650371
-# MD5 Fingerprint: df:f2:80:73:cc:f1:e6:61:73:fc:f5:42:e9:c5:7c:ee
-# SHA1 Fingerprint: 99:a6:9b:e6:1a:fe:88:6b:4d:2b:82:00:7c:b8:54:fc:31:7e:15:39
-# SHA256 Fingerprint: 62:f2:40:27:8c:56:4c:4d:d8:bf:7d:9d:4f:6f:36:6e:a8:94:d2:2f:5f:34:d9:89:a9:83:ac:ec:2f:ff:ed:50
------BEGIN CERTIFICATE-----
-MIIE2DCCBEGgAwIBAgIEN0rSQzANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMC
-VVMxFDASBgNVBAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5u
-ZXQvQ1BTIGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMc
-KGM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V0L0NSTC9uZXQxLmNybDArBgNVHRAEJDAigA8xOTk5MDUyNTE2MDk0
-MFqBDzIwMTkwNTI1MTYwOTQwWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAU8Bdi
-E1U9s/8KAGv7UISX8+1i0BowHQYDVR0OBBYEFPAXYhNVPbP/CgBr+1CEl/PtYtAa
-MAwGA1UdEwQFMAMBAf8wGQYJKoZIhvZ9B0EABAwwChsEVjQuMAMCBJAwDQYJKoZI
-hvcNAQEFBQADgYEAkNwwAvpkdMKnCqV8IY00F6j7Rw7/JXyNEwr75Ji174z4xRAN
-95K+8cPV1ZVqBLssziY2ZcgxxufuP+NXdYR6Ee9GTxj005i7qIcyunL2POI9n9cd
-2cNgQ4xYDiKWL2KjLB+6rQXvqzJ4h6BUcxm1XAX5Uj5tLUUL9wqT6u0G+bI=
------END CERTIFICATE-----
-
-# Issuer: CN=http://www.valicert.com/ O=ValiCert, Inc. OU=ValiCert Class 2 Policy Validation Authority
-# Subject: CN=http://www.valicert.com/ O=ValiCert, Inc. OU=ValiCert Class 2 Policy Validation Authority
-# Label: "ValiCert Class 2 VA"
-# Serial: 1
-# MD5 Fingerprint: a9:23:75:9b:ba:49:36:6e:31:c2:db:f2:e7:66:ba:87
-# SHA1 Fingerprint: 31:7a:2a:d0:7f:2b:33:5e:f5:a1:c3:4e:4b:57:e8:b7:d8:f1:fc:a6
-# SHA256 Fingerprint: 58:d0:17:27:9c:d4:dc:63:ab:dd:b1:96:a6:c9:90:6c:30:c4:e0:87:83:ea:e8:c1:60:99:54:d6:93:55:59:6b
------BEGIN CERTIFICATE-----
-MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0
-IFZhbGlkYXRpb24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAz
-BgNVBAsTLFZhbGlDZXJ0IENsYXNzIDIgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9y
-aXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG
-9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAwMTk1NFoXDTE5MDYy
-NjAwMTk1NFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0d29y
-azEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs
-YXNzIDIgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRw
-Oi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNl
-cnQuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDOOnHK5avIWZJV16vY
-dA757tn2VUdZZUcOBVXc65g2PFxTXdMwzzjsvUGJ7SVCCSRrCl6zfN1SLUzm1NZ9
-WlmpZdRJEy0kTRxQb7XBhVQ7/nHk01xC+YDgkRoKWzk2Z/M/VXwbP7RfZHM047QS
-v4dk+NoS/zcnwbNDu+97bi5p9wIDAQABMA0GCSqGSIb3DQEBBQUAA4GBADt/UG9v
-UJSZSWI4OB9L+KXIPqeCgfYrx+jFzug6EILLGACOTb2oWH+heQC1u+mNr0HZDzTu
-IYEZoDJJKPTEjlbVUjP9UNV+mWwD5MlM/Mtsq2azSiGM5bUMMj4QssxsodyamEwC
-W/POuZ6lcg5Ktz885hZo+L7tdEy8W9ViH0Pd
------END CERTIFICATE-----
-
-# Issuer: CN=NetLock Expressz (Class C) Tanusitvanykiado O=NetLock Halozatbiztonsagi Kft. OU=Tanusitvanykiadok
-# Subject: CN=NetLock Expressz (Class C) Tanusitvanykiado O=NetLock Halozatbiztonsagi Kft. OU=Tanusitvanykiadok
-# Label: "NetLock Express (Class C) Root"
-# Serial: 104
-# MD5 Fingerprint: 4f:eb:f1:f0:70:c2:80:63:5d:58:9f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Tanusitvanykiado O=NetLock Halozatbiztonsagi Kft. OU=Tanusitvanykiadok
-# Subject: CN=NetLock Uzleti (Class B) Tanusitvanykiado O=NetLock Halozatbiztonsagi Kft. OU=Tanusitvanykiadok
-# Label: "NetLock Business (Class B) Root"
-# Serial: 105
-# MD5 Fingerprint: 39:16:aa:b9:6a:41:e1:14:69:df:9e:6c:3b:72:dc:b6
-# SHA1 Fingerprint: 87:9f:4b:ee:05:df:98:58:3b:e3:60:d6:33:e7:0d:3f:fe:98:71:af
-# SHA256 Fingerprint: 39:df:7b:68:2b:7b:93:8f:84:71:54:81:cc:de:8d:60:d8:f2:2e:c5:98:87:7d:0a:aa:c1:2b:59:18:2b:03:12
------BEGIN CERTIFICATE-----
-MIIFSzCCBLSgAwIBAgIBaTANBgkqhkiG9w0BAQQFADCBmTELMAkGA1UEBhMCSFUx
-ETAPBgNVBAcTCEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0
-b25zYWdpIEtmdC4xGjAYBgNVBAsTEVRhbnVzaXR2YW55a2lhZG9rMTIwMAYDVQQD
-EylOZXRMb2NrIFV6bGV0aSAoQ2xhc3MgQikgVGFudXNpdHZhbnlraWFkbzAeFw05
-OTAyMjUxNDEwMjJaFw0xOTAyMjAxNDEwMjJaMIGZMQswCQYDVQQGEwJIVTERMA8G
-A1UEBxMIQnVkYXBlc3QxJzAlBgNVBAoTHk5ldExvY2sgSGFsb3phdGJpenRvbnNh
-Z2kgS2Z0LjEaMBgGA1UECxMRVGFudXNpdHZhbnlraWFkb2sxMjAwBgNVBAMTKU5l
-dExvY2sgVXpsZXRpIChDbGFzcyBCKSBUYW51c2l0dmFueWtpYWRvMIGfMA0GCSqG
-SIb3DQEBAQUAA4GNADCBiQKBgQCx6gTsIKAjwo84YM/HRrPVG/77uZmeBNwcf4xK
-gZjupNTKihe5In+DCnVMm8Bp2GQ5o+2So/1bXHQawEfKOml2mrriRBf8TKPV/riX
-iK+IA4kfpPIEPs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IEJessDgVkcYplswhwG08pXTP2IKlOcNl40JwuyKQ433bNXbhoLXa
-n3BukxowOR0w2y7jfLKRstE3Kfq51hdcR0/jHTjrn9V7lagonhVK0dHQKwCXoOKS
-NitjrFgBazMpUIaD8QFI
------END CERTIFICATE-----
-
-# Issuer: CN=http://www.valicert.com/ O=ValiCert, Inc. OU=ValiCert Class 3 Policy Validation Authority
-# Subject: CN=http://www.valicert.com/ O=ValiCert, Inc. OU=ValiCert Class 3 Policy Validation Authority
-# Label: "RSA Root Certificate 1"
-# Serial: 1
-# MD5 Fingerprint: a2:6f:53:b7:ee:40:db:4a:68:e7:fa:18:d9:10:4b:72
-# SHA1 Fingerprint: 69:bd:8c:f4:9c:d3:00:fb:59:2e:17:93:ca:55:6a:f3:ec:aa:35:fb
-# SHA256 Fingerprint: bc:23:f9:8a:31:3c:b9:2d:e3:bb:fc:3a:5a:9f:44:61:ac:39:49:4c:4a:e1:5a:9e:9d:f1:31:e9:9b:73:01:9a
------BEGIN CERTIFICATE-----
-MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0
-IFZhbGlkYXRpb24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAz
-BgNVBAsTLFZhbGlDZXJ0IENsYXNzIDMgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9y
-aXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG
-9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAwMjIzM1oXDTE5MDYy
-NjAwMjIzM1owgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0d29y
-azEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs
-YXNzIDMgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRw
-Oi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNl
-cnQuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDjmFGWHOjVsQaBalfD
-cnWTq8+epvzzFlLWLU2fNUSoLgRNB0mKOCn1dzfnt6td3zZxFJmP3MKS8edgkpfs
-2Ejcv8ECIMYkpChMMFp2bbFc893enhBxoYjHW5tBbcqwuI4V7q0zK89HBFx1cQqY
-JJgpp0lZpd34t0NiYfPT4tBVPwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFa7AliE
-Zwgs3x/be0kz9dNnnfS0ChCzycUs4pJqcXgn8nCDQtM+z6lU9PHYkhaM0QTLS6vJ
-n0WuPIqpsHEzXcjFV9+vqDWzf4mH6eglkrh/hXqu1rweN1gqZ8mRzyqBPu3GOd/A
-PhmcGcwTTYJBtYze4D1gCCAPRX5ron+jjBXu
------END CERTIFICATE-----
-
-# Issuer: CN=http://www.valicert.com/ O=ValiCert, Inc. OU=ValiCert Class 1 Policy Validation Authority
-# Subject: CN=http://www.valicert.com/ O=ValiCert, Inc. OU=ValiCert Class 1 Policy Validation Authority
-# Label: "ValiCert Class 1 VA"
-# Serial: 1
-# MD5 Fingerprint: 65:58:ab:15:ad:57:6c:1e:a8:a7:b5:69:ac:bf:ff:eb
-# SHA1 Fingerprint: e5:df:74:3c:b6:01:c4:9b:98:43:dc:ab:8c:e8:6a:81:10:9f:e4:8e
-# SHA256 Fingerprint: f4:c1:49:55:1a:30:13:a3:5b:c7:bf:fe:17:a7:f3:44:9b:c1:ab:5b:5a:0a:e7:4b:06:c2:3b:90:00:4c:01:04
------BEGIN CERTIFICATE-----
-MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0
-IFZhbGlkYXRpb24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAz
-BgNVBAsTLFZhbGlDZXJ0IENsYXNzIDEgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9y
-aXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG
-9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNTIyMjM0OFoXDTE5MDYy
-NTIyMjM0OFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0d29y
-azEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs
-YXNzIDEgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRw
-Oi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNl
-cnQuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDYWYJ6ibiWuqYvaG9Y
-LqdUHAZu9OqNSLwxlBfw8068srg1knaw0KWlAdcAAxIiGQj4/xEjm84H9b9pGib+
-TunRf50sQB1ZaG6m+FiwnRqP0z/x3BkGgagO4DrdyFNFCQbmD3DD+kCmDuJWBQ8Y
-TfwggtFzVXSNdnKgHZ0dwN0/cQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFBoPUn0
-LBwGlN+VYH+Wexf+T3GtZMjdd9LvWVXoP+iOBSoh8gfStadS/pyxtuJbdxdA6nLW
-I8sogTLDAHkY7FkXicnGah5xyf23dKUlRWnFSKsZ4UWKJWsZ7uW7EvV/96aNUcPw
-nXS3qT6gpf+2SQMT2iLM7XGCK5nPOrf1LXLI
------END CERTIFICATE-----
-
-# Issuer: CN=Equifax Secure eBusiness CA-1 O=Equifax Secure Inc.
-# Subject: CN=Equifax Secure eBusiness CA-1 O=Equifax Secure Inc.
-# Label: "Equifax Secure eBusiness CA 1"
-# Serial: 4
-# MD5 Fingerprint: 64:9c:ef:2e:44:fc:c6:8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5gDgdSIKN
-/Bf+KpYrtWKmpj29f5JZzVoqgrI3eQ==
------END CERTIFICATE-----
-
-# Issuer: CN=Equifax Secure Global eBusiness CA-1 O=Equifax Secure Inc.
-# Subject: CN=Equifax Secure Global eBusiness CA-1 O=Equifax Secure Inc.
-# Label: "Equifax Secure Global eBusiness CA"
-# Serial: 1
-# MD5 Fingerprint: 8f:5d:77:06:27:c4:98:3c:5b:93:78:e7:d7:7d:9b:cc
-# SHA1 Fingerprint: 7e:78:4a:10:1c:82:65:cc:2d:e1:f1:6d:47:b4:40:ca:d9:0a:19:45
-# SHA256 Fingerprint: 5f:0b:62:ea:b5:e3:53:ea:65:21:65:16:58:fb:b6:53:59:f4:43:28:0a:4a:fb:d1:04:d7:7d:10:f9:f0:4c:07
------BEGIN CERTIFICATE-----
-MIICkDCCAfmgAwIBAgIBATANBgkqhkiG9w0BAQQFADBaMQswCQYDVQQGEwJVUzEc
-MBoGA1UEChMTRXF1aWZheCBTZWN1cmUgSW5jLjEtMCsGA1UEAxMkRXF1aWZheCBT
-ZWN1cmUgR2xvYmFsIGVCdXNpbmVzcyBDQS0xMB4XDTk5MDYyMTA0MDAwMFoXDTIw
-MDYyMTA0MDAwMFowWjELMAkGA1UEBhMCVVMxHDAaBgNVBAoTE0VxdWlmYXggU2Vj
-dXJlIEluYy4xLTArBgNVBAMTJEVxdWlmYXggU2VjdXJlIEdsb2JhbCBlQnVzaW5l
-c3MgQ0EtMTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAuucXkAJlsTRVPEnC
-UdXfp9E3j9HngXNBUmCbnaEXJnitx7HoJpQytd4zjTov2/KaelpzmKNc6fuKcxtc
-58O/gGzNqfTWK8D3+ZmqY6KxRwIP1ORROhI8bIpaVIRw28HFkM9yRcuoWcDNM50/
-o5brhTMhHD4ePmBudpxnhcXIw2ECAwEAAaNmMGQwEQYJYIZIAYb4QgEBBAQDAgAH
-MA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUvqigdHJQa0S3ySPY+6j/s1dr
-aGwwHQYDVR0OBBYEFL6ooHRyUGtEt8kj2Puo/7NXa2hsMA0GCSqGSIb3DQEBBAUA
-A4GBADDiAVGqx+pf2rnQZQ8w1j7aDRRJbpGTJxQx78T3LUX47Me/okENI7SS+RkA
-Z70Br83gcfxaz2TE4JaY0KNA4gGK7ycH8WUBikQtBmV1UsCGECAhX2xrD2yuCRyv
-8qIYNMR1pHMc8Y3c7635s3a0kr/clRAevsvIO1qEYBlWlKlV
------END CERTIFICATE-----
-
-# Issuer: CN=Thawte Premium Server CA O=Thawte Consulting cc OU=Certification Services Division
-# Subject: CN=Thawte Premium Server CA O=Thawte Consulting cc OU=Certification Services Division
-# Label: "Thawte Premium Server CA"
-# Serial: 1
-# MD5 Fingerprint: 06:9f:69:79:16:66:90:02:1b:8c:8c:a2:c3:07:6f:3a
-# SHA1 Fingerprint: 62:7f:8d:78:27:65:63:99:d2:7d:7f:90:44:c9:fe:b3:f3:3e:fa:9a
-# SHA256 Fingerprint: ab:70:36:36:5c:71:54:aa:29:c2:c2:9f:5d:41:91:16:3b:16:2a:22:25:01:13:57:d5:6d:07:ff:a7:bc:1f:72
------BEGIN CERTIFICATE-----
-MIIDJzCCApCgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBzjELMAkGA1UEBhMCWkEx
-FTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYD
-VQQKExRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlv
-biBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAxMYVGhhd3RlIFByZW1pdW0gU2Vy
-dmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZlckB0aGF3dGUuY29t
-MB4XDTk2MDgwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgc4xCzAJBgNVBAYTAlpB
-MRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsG
-A1UEChMUVGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRp
-b24gU2VydmljZXMgRGl2aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQcmVtaXVtIFNl
-cnZlciBDQTEoMCYGCSqGSIb3DQEJARYZcHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNv
-bTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0jY2aovXwlue2oFBYo847kkE
-VdbQ7xwblRZH7xhINTpS9CtqBo87L+pW46+GjZ4X9560ZXUCTe/LCaIhUdib0GfQ
-ug2SBhRz1JPLlyoAnFxODLz6FVL88kRu2hFKbgifLy3j+ao6hnO2RlNYyIkFvYMR
-uHM/qgeN9EJN50CdHDcCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG
-9w0BAQQFAAOBgQAmSCwWwlj66BZ0DKqqX1Q/8tfJeGBeXm43YyJ3Nn6yF8Q0ufUI
-hfzJATj/Tb7yFkJD57taRvvBxhEf8UqwKEbJw8RCfbz6q1lu1bdRiBHjpIUZa4JM
-pAwSremkrj/xw0llmozFyD4lt5SZu5IycQfwhl7tUCemDaYj+bvLpgcUQg==
------END CERTIFICATE-----
-
-# Issuer: CN=Thawte Server CA O=Thawte Consulting cc OU=Certification Services Division
-# Subject: CN=Thawte Server CA O=Thawte Consulting cc OU=Certification Services Division
-# Label: "Thawte Server CA"
-# Serial: 1
-# MD5 Fingerprint: c5:70:c4:a2:ed:53:78:0c:c8:10:53:81:64:cb:d0:1d
-# SHA1 Fingerprint: 23:e5:94:94:51:95:f2:41:48:03:b4:d5:64:d2:a3:a3:f5:d8:8b:8c
-# SHA256 Fingerprint: b4:41:0b:73:e2:e6:ea:ca:47:fb:c4:2f:8f:a4:01:8a:f4:38:1d:c5:4c:fa:a8:44:50:46:1e:ed:09:45:4d:e9
------BE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pUdniTCxZ
-qdq5snUb9kLy78fyGPmJvKP/iiMucEc=
------END CERTIFICATE-----
-
-# Issuer: O=VeriSign, Inc. OU=Class 3 Public Primary Certification Authority
-# Subject: O=VeriSign, Inc. OU=Class 3 Public Primary Certification Authority
-# Label: "Verisign Class 3 Public Primary Certification Authority"
-# Serial: 149843929435818692848040365716851702463
-# MD5 Fingerprint: 10:fc:63:5d:f6:26:3e:0d:f3:25:be:5f:79:cd:67:67
-# SHA1 Fingerprint: 74:2c:31:92:e6:07:e4:24:eb:45:49:54:2b:e1:bb:c5:3e:61:74:e2
-# SHA256 Fingerprint: e7:68:56:34:ef:ac:f6:9a:ce:93:9a:6b:25:5b:7b:4f:ab:ef:42:93:5b:50:a2:65:ac:b5:cb:60:27:e4:4e:70
------BEGIN CERTIFICATE-----
-MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkG
-A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz
-cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2
-MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV
-BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt
-YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN
-ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE
-BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is
-I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G
-CSqGSIb3DQEBAgUAA4GBALtMEivPLCYATxQT3ab7/AoRhIzzKBxnki98tsX63/Do
-lbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59AhWM1pF+NEHJwZRDmJXNyc
-AA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2OmufTqj/ZA1k
------END CERTIFICATE-----
-
-# Issuer: O=VeriSign, Inc. OU=Class 3 Public Primary Certification Authority
-# Subject: O=VeriSign, Inc. OU=Class 3 Public Primary Certification Authority
-# Label: "Verisign Class 3 Public Primary Certification Authority"
-# Serial: 80507572722862485515306429940691309246
-# MD5 Fingerprint: ef:5a:f1:33:ef:f1:cd:bb:51:02:ee:12:14:4b:96:c4
-# SHA1 Fingerprint: a1:db:63:93:91:6f:17:e4:18:55:09:40:04:15:c7:02:40:b0:ae:6b
-# SHA256 Fingerprint: a4:b6:b3:99:6f:c2:f3:06:b3:fd:86:81:bd:63:41:3d:8c:50:09:cc:4f:a3:29:c2:cc:f0:e2:fa:1b:14:03:05
------BEGIN CERTIFICATE-----
-MIICPDCCAaUCEDyRMcsf9tAbDpq40ES/Er4wDQYJKoZIhvcNAQEFBQAwXzELMAkG
-A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz
-cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2
-MDEyOTAwMDAwMFoXDTI4MDgwMjIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV
-BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt
-YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN
-ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE
-BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is
-I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G
-CSqGSIb3DQEBBQUAA4GBABByUqkFFBkyCEHwxWsKzH4PIRnN5GfcX6kb5sroc50i
-2JhucwNhkcV8sEVAbkSdjbCxlnRhLQ2pRdKkkirWmnWXbj9T/UWZYB2oK0z5XqcJ
-2HUw19JlYD1n1khVdWk/kfVIC0dpImmClr7JyDiGSnoscxlIaU5rfGW/D/xwzoiQ
------END CERTIFICATE-----
-
-# Issuer: O=VeriSign, Inc. OU=Class 3 Public Primary Certification Authority - G2/(c) 1998 VeriSign, Inc. - For authorized use only/VeriSign Trust Network
-# Subject: O=VeriSign, Inc. OU=Class 3 Public Primary Certification Authority - G2/(c) 1998 VeriSign, Inc. - For authorized use only/VeriSign Trust Network
-# Label: "Verisign Class 3 Public Primary Certification Authority - G2"
-# Serial: 167285380242319648451154478808036881606
-# MD5 Fingerprint: a2:33:9b:4c:74:78:73:d4:6c:e7:c1:f3:8d:cb:5c:e9
-# SHA1 Fingerprint: 85:37:1c:a6:e5:50:14:3d:ce:28:03:47:1b:de:3a:09:e8:f8:77:0f
-# SHA256 Fingerprint: 83:ce:3c:12:29:68:8a:59:3d:48:5f:81:97:3c:0f:91:95:43:1e:da:37:cc:5e:36:43:0e:79:c7:a8:88:63:8b
------BEGIN CERTIFICATE-----
-MIIDAjCCAmsCEH3Z/gfPqB63EHln+6eJNMYwDQYJKoZIhvcNAQEFBQAwgcExCzAJ
-BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xh
-c3MgMyBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcy
-MTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3Jp
-emVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMB4X
-DTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVTMRcw
-FQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMg
-UHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEo
-YykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5
-MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEB
-AQUAA4GNADCBiQKBgQDMXtERXVxp0KvTuWpMmR9ZmDCOFoUgRm1HP9SFIIThbbP4
-pO0M8RcPO/mn+SXXwc+EY/J8Y8+iR/LGWzOOZEAEaMGAuWQcRXfH2G71lSk8UOg0
-13gfqLptQ5GVj0VXXn7F+8qkBOvqlzdUMG+7AUcyM83cV5tkaWH4mx0ciU9cZwID
-AQABMA0GCSqGSIb3DQEBBQUAA4GBAFFNzb5cy5gZnBWyATl4Lk0PZ3BwmcYQWpSk
-U01UbSuvDV1Ai2TT1+7eVmGSX6bEHRBhNtMsJzzoKQm5EWR0zLVznxxIqbxhAe7i
-F6YM40AIOw7n60RzKprxaZLvcRTDOaxxp5EJb+RxBrO6WVcmeQD2+A2iMzAo1KpY
-oJ2daZH9
------END CERTIFICATE-----
-
-# Issuer: CN=GTE CyberTrust Global Root O=GTE Corporation OU=GTE CyberTrust Solutions, Inc.
-# Subject: CN=GTE CyberTrust Global Root O=GTE Corporation OU=GTE CyberTrust Solutions, Inc.
-# Label: "GTE CyberTrust Global Root"
-# Serial: 421
-# MD5 Fingerprint: ca:3d:d3:68:f1:03:5c:d0:32:fa:b8:2b:59:e8:5a:db
-# SHA1 Fingerprint: 97:81:79:50:d8:1c:96:70:cc:34:d8:09:cf:79:44:31:36:7e:f4:74
-# SHA256 Fingerprint: a5:31:25:18:8d:21:10:aa:96:4b:02:c7:b7:c6:da:32:03:17:08:94:e5:fb:71:ff:fb:66:67:d5:e6:81:0a:36
------BEGIN CERTIFICATE-----
-MIICWjCCAcMCAgGlMA0GCSqGSIb3DQEBBAUAMHUxCzAJBgNVBAYTAlVTMRgwFgYD
-VQQKEw9HVEUgQ29ycG9yYXRpb24xJzAlBgNVBAsTHkdURSBDeWJlclRydXN0IFNv
-bHV0aW9ucywgSW5jLjEjMCEGA1UEAxMaR1RFIEN5YmVyVHJ1c3QgR2xvYmFsIFJv
-b3QwHhcNOTgwODEzMDAyOTAwWhcNMTgwODEzMjM1OTAwWjB1MQswCQYDVQQGEwJV
-UzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMScwJQYDVQQLEx5HVEUgQ3liZXJU
-cnVzdCBTb2x1dGlvbnMsIEluYy4xIzAhBgNVBAMTGkdURSBDeWJlclRydXN0IEds
-b2JhbCBSb290MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCVD6C28FCc6HrH
-iM3dFw4usJTQGz0O9pTAipTHBsiQl8i4ZBp6fmw8U+E3KHNgf7KXUwefU/ltWJTS
-r41tiGeA5u2ylc9yMcqlHHK6XALnZELn+aks1joNrI1CqiQBOeacPwGFVw1Yh0X4
-04Wqk2kmhXBIgD8SFcd5tB8FLztimQIDAQABMA0GCSqGSIb3DQEBBAUAA4GBAG3r
-GwnpXtlR22ciYaQqPEh346B8pt5zohQDhT37qw4wxYMWM4ETCJ57NE7fQMh017l9
-3PR2VX2bY1QY6fDq81yx2YtCHrnAlU66+tXifPVoYb+O7AWXX1uw16OFNMQkpw0P
-lZPvy5TYnh+dXIVtx6quTx8itc2VrbqnzPmrC3p/
------END CERTIFICATE-----
-
-# Issuer: C=US, O=Equifax, OU=Equifax Secure Certificate Authority
-# Subject: C=US, O=Equifax, OU=Equifax Secure Certificate Authority
-# Label: "Equifax Secure Certificate Authority"
-# Serial: 903804111
-# MD5 Fingerprint: 67:cb:9d:c0:13:24:8a:82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F
-MAMBAf8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUA
-A4GBAFjOKer89961zgK5F7WF0bnj4JXMJTENAKaSbn+2kmOeUJXRmm/kEd5jhW6Y
-7qj/WsjTVbJmcVfewCHrPSqnI0kBBIZCe/zuf6IWUrVnZ9NA2zsmWLIodz2uFHdh
-1voqZiegDfqnc1zqcPGUIWVEX/r87yloqaKHee9570+sB3c4
------END CERTIFICATE-----
diff --git a/lib/cffi-1.11.5.dist-info/DESCRIPTION.rst b/lib/cffi-1.11.5.dist-info/DESCRIPTION.rst
deleted file mode 100644
index 33035cd3e2..0000000000
--- a/lib/cffi-1.11.5.dist-info/DESCRIPTION.rst
+++ /dev/null
@@ -1,12 +0,0 @@
-CFFI
-====
-
-Foreign Function Interface for Python calling C code.
-Please see the `Documentation `_.
-
-Contact
--------
-
-`Mailing list `_
-
-
diff --git a/lib/cffi-1.11.5.dist-info/INSTALLER b/lib/cffi-1.11.5.dist-info/INSTALLER
deleted file mode 100644
index a1b589e38a..0000000000
--- a/lib/cffi-1.11.5.dist-info/INSTALLER
+++ /dev/null
@@ -1 +0,0 @@
-pip
diff --git a/lib/cffi-1.11.5.dist-info/METADATA b/lib/cffi-1.11.5.dist-info/METADATA
deleted file mode 100644
index 4ae95bc9d9..0000000000
--- a/lib/cffi-1.11.5.dist-info/METADATA
+++ /dev/null
@@ -1,36 +0,0 @@
-Metadata-Version: 2.0
-Name: cffi
-Version: 1.11.5
-Summary: Foreign Function Interface for Python calling C code.
-Home-page: http://cffi.readthedocs.org
-Author: Armin Rigo, Maciej Fijalkowski
-Author-email: python-cffi@googlegroups.com
-License: MIT
-Description-Content-Type: UNKNOWN
-Platform: UNKNOWN
-Classifier: Programming Language :: Python
-Classifier: Programming Language :: Python :: 2
-Classifier: Programming Language :: Python :: 2.6
-Classifier: Programming Language :: Python :: 2.7
-Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.2
-Classifier: Programming Language :: Python :: 3.3
-Classifier: Programming Language :: Python :: 3.4
-Classifier: Programming Language :: Python :: 3.5
-Classifier: Programming Language :: Python :: 3.6
-Classifier: Programming Language :: Python :: Implementation :: CPython
-Classifier: Programming Language :: Python :: Implementation :: PyPy
-Requires-Dist: pycparser
-
-CFFI
-====
-
-Foreign Function Interface for Python calling C code.
-Please see the `Documentation `_.
-
-Contact
--------
-
-`Mailing list `_
-
-
diff --git a/lib/cffi-1.11.5.dist-info/RECORD b/lib/cffi-1.11.5.dist-info/RECORD
deleted file mode 100644
index 376ce6170f..0000000000
--- a/lib/cffi-1.11.5.dist-info/RECORD
+++ /dev/null
@@ -1,43 +0,0 @@
-_cffi_backend.so,sha256=qE_EY1tcAz704EWB6DDm_c_E8HXAargU_AvrakOHG28,365544
-cffi-1.11.5.dist-info/DESCRIPTION.rst,sha256=h6Cj7InY14S1SCpsWM30ybgmJDa11U-QvDw4Hsp2eis,219
-cffi-1.11.5.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
-cffi-1.11.5.dist-info/METADATA,sha256=d2A1JTmHBbU2TkwF7oA0CIe63MfkC31g5GHOeVXhZUQ,1173
-cffi-1.11.5.dist-info/RECORD,,
-cffi-1.11.5.dist-info/WHEEL,sha256=QfBrr-v-LqolR7nGotztNhXjPPuTAHMSOUkWAWkvuGg,109
-cffi-1.11.5.dist-info/entry_points.txt,sha256=Q9f5C9IpjYxo0d2PK9eUcnkgxHc9pHWwjEMaANPKNCI,76
-cffi-1.11.5.dist-info/metadata.json,sha256=RXOOgcnmFjmFHJ1ozMttnvadZ0ZAyCU9n7x-Bomhr8g,1192
-cffi-1.11.5.dist-info/top_level.txt,sha256=rE7WR3rZfNKxWI9-jn6hsHCAl7MDkB-FmuQbxWjFehQ,19
-cffi/__init__.py,sha256=tkdd-U33cNehJMK3RvWczZysS-WV4dURynsbf7y0TQ0,479
-cffi/__init__.pyc,,
-cffi/_cffi_errors.h,sha256=NLNuKgpRUJ4x0ku4pi-Pe1vT1mzovxBTeHjPZTxCB7U,3804
-cffi/_cffi_include.h,sha256=JuFfmwpRE65vym3Nxr9vDMOIEuv21tXdarkL1l2WNms,12149
-cffi/_embedding.h,sha256=GEPP-nC_-XMq2fed14l_IJas-3qYTgZNkciqN0bVwy8,16030
-cffi/api.py,sha256=KRUjvivJuas_WV9FxxqlWZCbSjJXLzyav0SwPCadHQc,40590
-cffi/api.pyc,,
-cffi/backend_ctypes.py,sha256=XxMfz3Kn_QZhvLLqNXmIL_Z9M8CGlGAa1YWtH6k8wYQ,42086
-cffi/backend_ctypes.pyc,,
-cffi/cffi_opcode.py,sha256=v9RdD_ovA8rCtqsC95Ivki5V667rAOhGgs3fb2q9xpM,5724
-cffi/cffi_opcode.pyc,,
-cffi/commontypes.py,sha256=QS4uxCDI7JhtTyjh1hlnCA-gynmaszWxJaRRLGkJa1A,2689
-cffi/commontypes.pyc,,
-cffi/cparser.py,sha256=R0_gdB8vL1YNf-W5G_5KvV1pOTnZwvuLeioaDvODI6c,39250
-cffi/cparser.pyc,,
-cffi/error.py,sha256=L_J76qbh6LSxH4A64muOUwJKL6zVHC32E3gG1ntUM-A,666
-cffi/error.pyc,,
-cffi/ffiplatform.py,sha256=HMXqR8ks2wtdsNxGaWpQ_PyqIvtiuos_vf1qKCy-cwg,4046
-cffi/ffiplatform.pyc,,
-cffi/lock.py,sha256=l9TTdwMIMpi6jDkJGnQgE9cvTIR7CAntIJr8EGHt3pY,747
-cffi/lock.pyc,,
-cffi/model.py,sha256=Ukhsop9ZJflzz_qwLEB4p4jl04SEQQi2qJpBy1rszlY,21552
-cffi/model.pyc,,
-cffi/parse_c_type.h,sha256=OdwQfwM9ktq6vlCB43exFQmxDBtj2MBNdK8LYl15tjw,5976
-cffi/recompiler.py,sha256=5zhY5dLL2OyPuMlTNxG972TNopQq74rYsMvO2WB_G8o,63412
-cffi/recompiler.pyc,,
-cffi/setuptools_ext.py,sha256=wpp5xFM3IinU6piZop-li-LqHZInC8NY-83g2elvg1c,8198
-cffi/setuptools_ext.pyc,,
-cffi/vengine_cpy.py,sha256=hdyjjZNijLrg_uGMnnFyC-7GG_LxWtwB8BlS2vvVDQ0,41470
-cffi/vengine_cpy.pyc,,
-cffi/vengine_gen.py,sha256=Zkq0-EdeZwn6qUvf_CI8iUEs2UxVIvDmKCH1j0-y0GI,26676
-cffi/vengine_gen.pyc,,
-cffi/verifier.py,sha256=J9Enz2rbJb9CHPqWlWQ5uQESoyr0uc7MNWugchjXBv4,11207
-cffi/verifier.pyc,,
diff --git a/lib/cffi-1.11.5.dist-info/WHEEL b/lib/cffi-1.11.5.dist-info/WHEEL
deleted file mode 100644
index d2164a8fff..0000000000
--- a/lib/cffi-1.11.5.dist-info/WHEEL
+++ /dev/null
@@ -1,5 +0,0 @@
-Wheel-Version: 1.0
-Generator: bdist_wheel (0.30.0)
-Root-Is-Purelib: false
-Tag: cp27-cp27m-macosx_10_6_intel
-
diff --git a/lib/cffi-1.11.5.dist-info/entry_points.txt b/lib/cffi-1.11.5.dist-info/entry_points.txt
deleted file mode 100644
index eee7e0fb1f..0000000000
--- a/lib/cffi-1.11.5.dist-info/entry_points.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-[distutils.setup_keywords]
-cffi_modules = cffi.setuptools_ext:cffi_modules
-
diff --git a/lib/cffi-1.11.5.dist-info/metadata.json b/lib/cffi-1.11.5.dist-info/metadata.json
deleted file mode 100644
index 28b1bb7250..0000000000
--- a/lib/cffi-1.11.5.dist-info/metadata.json
+++ /dev/null
@@ -1 +0,0 @@
-{"classifiers": ["Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy"], "description_content_type": "UNKNOWN", "extensions": {"python.details": {"contacts": [{"email": "python-cffi@googlegroups.com", "name": "Armin Rigo, Maciej Fijalkowski", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst"}, "project_urls": {"Home": "http://cffi.readthedocs.org"}}, "python.exports": {"distutils.setup_keywords": {"cffi_modules": "cffi.setuptools_ext:cffi_modules"}}}, "extras": [], "generator": "bdist_wheel (0.30.0)", "license": "MIT", "metadata_version": "2.0", "name": "cffi", "run_requires": [{"requires": ["pycparser"]}], "summary": "Foreign Function Interface for Python calling C code.", "version": "1.11.5"}
\ No newline at end of file
diff --git a/lib/cffi-1.11.5.dist-info/top_level.txt b/lib/cffi-1.11.5.dist-info/top_level.txt
deleted file mode 100644
index f64577957e..0000000000
--- a/lib/cffi-1.11.5.dist-info/top_level.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-_cffi_backend
-cffi
diff --git a/lib/cffi/__init__.py b/lib/cffi/__init__.py
deleted file mode 100644
index 9cbfe37dc3..0000000000
--- a/lib/cffi/__init__.py
+++ /dev/null
@@ -1,13 +0,0 @@
-__all__ = ['FFI', 'VerificationError', 'VerificationMissing', 'CDefError',
- 'FFIError']
-
-from .api import FFI
-from .error import CDefError, FFIError, VerificationError, VerificationMissing
-
-__version__ = "1.11.5"
-__version_info__ = (1, 11, 5)
-
-# The verifier module file names are based on the CRC32 of a string that
-# contains the following version number. It may be older than __version__
-# if nothing is clearly incompatible.
-__version_verifier_modules__ = "0.8.6"
diff --git a/lib/cffi/_cffi_errors.h b/lib/cffi/_cffi_errors.h
deleted file mode 100644
index 60dcc3b86a..0000000000
--- a/lib/cffi/_cffi_errors.h
+++ /dev/null
@@ -1,145 +0,0 @@
-#ifndef CFFI_MESSAGEBOX
-# ifdef _MSC_VER
-# define CFFI_MESSAGEBOX 1
-# else
-# define CFFI_MESSAGEBOX 0
-# endif
-#endif
-
-
-#if CFFI_MESSAGEBOX
-/* Windows only: logic to take the Python-CFFI embedding logic
- initialization errors and display them in a background thread
- with MessageBox. The idea is that if the whole program closes
- as a result of this problem, then likely it is already a console
- program and you can read the stderr output in the console too.
- If it is not a console program, then it will likely show its own
- dialog to complain, or generally not abruptly close, and for this
- case the background thread should stay alive.
-*/
-static void *volatile _cffi_bootstrap_text;
-
-static PyObject *_cffi_start_error_capture(void)
-{
- PyObject *result = NULL;
- PyObject *x, *m, *bi;
-
- if (InterlockedCompareExchangePointer(&_cffi_bootstrap_text,
- (void *)1, NULL) != NULL)
- return (PyObject *)1;
-
- m = PyImport_AddModule("_cffi_error_capture");
- if (m == NULL)
- goto error;
-
- result = PyModule_GetDict(m);
- if (result == NULL)
- goto error;
-
-#if PY_MAJOR_VERSION >= 3
- bi = PyImport_ImportModule("builtins");
-#else
- bi = PyImport_ImportModule("__builtin__");
-#endif
- if (bi == NULL)
- goto error;
- PyDict_SetItemString(result, "__builtins__", bi);
- Py_DECREF(bi);
-
- x = PyRun_String(
- "import sys\n"
- "class FileLike:\n"
- " def write(self, x):\n"
- " of.write(x)\n"
- " self.buf += x\n"
- "fl = FileLike()\n"
- "fl.buf = ''\n"
- "of = sys.stderr\n"
- "sys.stderr = fl\n"
- "def done():\n"
- " sys.stderr = of\n"
- " return fl.buf\n", /* make sure the returned value stays alive */
- Py_file_input,
- result, result);
- Py_XDECREF(x);
-
- error:
- if (PyErr_Occurred())
- {
- PyErr_WriteUnraisable(Py_None);
- PyErr_Clear();
- }
- return result;
-}
-
-#pragma comment(lib, "user32.lib")
-
-static DWORD WINAPI _cffi_bootstrap_dialog(LPVOID ignored)
-{
- Sleep(666); /* may be interrupted if the whole process is closing */
-#if PY_MAJOR_VERSION >= 3
- MessageBoxW(NULL, (wchar_t *)_cffi_bootstrap_text,
- L"Python-CFFI error",
- MB_OK | MB_ICONERROR);
-#else
- MessageBoxA(NULL, (char *)_cffi_bootstrap_text,
- "Python-CFFI error",
- MB_OK | MB_ICONERROR);
-#endif
- _cffi_bootstrap_text = NULL;
- return 0;
-}
-
-static void _cffi_stop_error_capture(PyObject *ecap)
-{
- PyObject *s;
- void *text;
-
- if (ecap == (PyObject *)1)
- return;
-
- if (ecap == NULL)
- goto error;
-
- s = PyRun_String("done()", Py_eval_input, ecap, ecap);
- if (s == NULL)
- goto error;
-
- /* Show a dialog box, but in a background thread, and
- never show multiple dialog boxes at once. */
-#if PY_MAJOR_VERSION >= 3
- text = PyUnicode_AsWideCharString(s, NULL);
-#else
- text = PyString_AsString(s);
-#endif
-
- _cffi_bootstrap_text = text;
-
- if (text != NULL)
- {
- HANDLE h;
- h = CreateThread(NULL, 0, _cffi_bootstrap_dialog,
- NULL, 0, NULL);
- if (h != NULL)
- CloseHandle(h);
- }
- /* decref the string, but it should stay alive as 'fl.buf'
- in the small module above. It will really be freed only if
- we later get another similar error. So it's a leak of at
- most one copy of the small module. That's fine for this
- situation which is usually a "fatal error" anyway. */
- Py_DECREF(s);
- PyErr_Clear();
- return;
-
- error:
- _cffi_bootstrap_text = NULL;
- PyErr_Clear();
-}
-
-#else
-
-static PyObject *_cffi_start_error_capture(void) { return NULL; }
-static void _cffi_stop_error_capture(PyObject *ecap) { }
-
-#endif
diff --git a/lib/cffi/_cffi_include.h b/lib/cffi/_cffi_include.h
deleted file mode 100644
index 37ea74feb4..0000000000
--- a/lib/cffi/_cffi_include.h
+++ /dev/null
@@ -1,308 +0,0 @@
-#define _CFFI_
-
-/* We try to define Py_LIMITED_API before including Python.h.
-
- Mess: we can only define it if Py_DEBUG, Py_TRACE_REFS and
- Py_REF_DEBUG are not defined. This is a best-effort approximation:
- we can learn about Py_DEBUG from pyconfig.h, but it is unclear if
- the same works for the other two macros. Py_DEBUG implies them,
- but not the other way around.
-
- Issue #350 is still open: on Windows, the code here causes it to link
- with PYTHON36.DLL (for example) instead of PYTHON3.DLL. A fix was
- attempted in 164e526a5515 and 14ce6985e1c3, but reverted: virtualenv
- does not make PYTHON3.DLL available, and so the "correctly" compiled
- version would not run inside a virtualenv. We will re-apply the fix
- after virtualenv has been fixed for some time. For explanation, see
- issue #355. For a workaround if you want PYTHON3.DLL and don't worry
- about virtualenv, see issue #350. See also 'py_limited_api' in
- setuptools_ext.py.
-*/
-#if !defined(_CFFI_USE_EMBEDDING) && !defined(Py_LIMITED_API)
-# include
-# if !defined(Py_DEBUG) && !defined(Py_TRACE_REFS) && !defined(Py_REF_DEBUG)
-# define Py_LIMITED_API
-# endif
-#endif
-
-#include
-#ifdef __cplusplus
-extern "C" {
-#endif
-#include
-#include "parse_c_type.h"
-
-/* this block of #ifs should be kept exactly identical between
- c/_cffi_backend.c, cffi/vengine_cpy.py, cffi/vengine_gen.py
- and cffi/_cffi_include.h */
-#if defined(_MSC_VER)
-# include /* for alloca() */
-# if _MSC_VER < 1600 /* MSVC < 2010 */
- typedef __int8 int8_t;
- typedef __int16 int16_t;
- typedef __int32 int32_t;
- typedef __int64 int64_t;
- typedef unsigned __int8 uint8_t;
- typedef unsigned __int16 uint16_t;
- typedef unsigned __int32 uint32_t;
- typedef unsigned __int64 uint64_t;
- typedef __int8 int_least8_t;
- typedef __int16 int_least16_t;
- typedef __int32 int_least32_t;
- typedef __int64 int_least64_t;
- typedef unsigned __int8 uint_least8_t;
- typedef unsigned __int16 uint_least16_t;
- typedef unsigned __int32 uint_least32_t;
- typedef unsigned __int64 uint_least64_t;
- typedef __int8 int_fast8_t;
- typedef __int16 int_fast16_t;
- typedef __int32 int_fast32_t;
- typedef __int64 int_fast64_t;
- typedef unsigned __int8 uint_fast8_t;
- typedef unsigned __int16 uint_fast16_t;
- typedef unsigned __int32 uint_fast32_t;
- typedef unsigned __int64 uint_fast64_t;
- typedef __int64 intmax_t;
- typedef unsigned __int64 uintmax_t;
-# else
-# include
-# endif
-# if _MSC_VER < 1800 /* MSVC < 2013 */
-# ifndef __cplusplus
- typedef unsigned char _Bool;
-# endif
-# endif
-#else
-# include
-# if (defined (__SVR4) && defined (__sun)) || defined(_AIX) || defined(__hpux)
-# include
-# endif
-#endif
-
-#ifdef __GNUC__
-# define _CFFI_UNUSED_FN __attribute__((unused))
-#else
-# define _CFFI_UNUSED_FN /* nothing */
-#endif
-
-#ifdef __cplusplus
-# ifndef _Bool
- typedef bool _Bool; /* semi-hackish: C++ has no _Bool; bool is builtin */
-# endif
-#endif
-
-/********** CPython-specific section **********/
-#ifndef PYPY_VERSION
-
-
-#if PY_MAJOR_VERSION >= 3
-# define PyInt_FromLong PyLong_FromLong
-#endif
-
-#define _cffi_from_c_double PyFloat_FromDouble
-#define _cffi_from_c_float PyFloat_FromDouble
-#define _cffi_from_c_long PyInt_FromLong
-#define _cffi_from_c_ulong PyLong_FromUnsignedLong
-#define _cffi_from_c_longlong PyLong_FromLongLong
-#define _cffi_from_c_ulonglong PyLong_FromUnsignedLongLong
-#define _cffi_from_c__Bool PyBool_FromLong
-
-#define _cffi_to_c_double PyFloat_AsDouble
-#define _cffi_to_c_float PyFloat_AsDouble
-
-#define _cffi_from_c_int(x, type) \
- (((type)-1) > 0 ? /* unsigned */ \
- (sizeof(type) < sizeof(long) ? \
- PyInt_FromLong((long)x) : \
- sizeof(type) == sizeof(long) ? \
- PyLong_FromUnsignedLong((unsigned long)x) : \
- PyLong_FromUnsignedLongLong((unsigned long long)x)) : \
- (sizeof(type) <= sizeof(long) ? \
- PyInt_FromLong((long)x) : \
- PyLong_FromLongLong((long long)x)))
-
-#define _cffi_to_c_int(o, type) \
- ((type)( \
- sizeof(type) == 1 ? (((type)-1) > 0 ? (type)_cffi_to_c_u8(o) \
- : (type)_cffi_to_c_i8(o)) : \
- sizeof(type) == 2 ? (((type)-1) > 0 ? (type)_cffi_to_c_u16(o) \
- : (type)_cffi_to_c_i16(o)) : \
- sizeof(type) == 4 ? (((type)-1) > 0 ? (type)_cffi_to_c_u32(o) \
- : (type)_cffi_to_c_i32(o)) : \
- sizeof(type) == 8 ? (((type)-1) > 0 ? (type)_cffi_to_c_u64(o) \
- : (type)_cffi_to_c_i64(o)) : \
- (Py_FatalError("unsupported size for type " #type), (type)0)))
-
-#define _cffi_to_c_i8 \
- ((int(*)(PyObject *))_cffi_exports[1])
-#define _cffi_to_c_u8 \
- ((int(*)(PyObject *))_cffi_exports[2])
-#define _cffi_to_c_i16 \
- ((int(*)(PyObject *))_cffi_exports[3])
-#define _cffi_to_c_u16 \
- ((int(*)(PyObject *))_cffi_exports[4])
-#define _cffi_to_c_i32 \
- ((int(*)(PyObject *))_cffi_exports[5])
-#define _cffi_to_c_u32 \
- ((unsigned int(*)(PyObject *))_cffi_exports[6])
-#define _cffi_to_c_i64 \
- ((long long(*)(PyObject *))_cffi_exports[7])
-#define _cffi_to_c_u64 \
- ((unsigned long long(*)(PyObject *))_cffi_exports[8])
-#define _cffi_to_c_char \
- ((int(*)(PyObject *))_cffi_exports[9])
-#define _cffi_from_c_pointer \
- ((PyObject *(*)(char *, struct _cffi_ctypedescr *))_cffi_exports[10])
-#define _cffi_to_c_pointer \
- ((char *(*)(PyObject *, struct _cffi_ctypedescr *))_cffi_exports[11])
-#define _cffi_get_struct_layout \
- not used any more
-#define _cffi_restore_errno \
- ((void(*)(void))_cffi_exports[13])
-#define _cffi_save_errno \
- ((void(*)(void))_cffi_exports[14])
-#define _cffi_from_c_char \
- ((PyObject *(*)(char))_cffi_exports[15])
-#define _cffi_from_c_deref \
- ((PyObject *(*)(char *, struct _cffi_ctypedescr *))_cffi_exports[16])
-#define _cffi_to_c \
- ((int(*)(char *, struct _cffi_ctypedescr *, PyObject *))_cffi_exports[17])
-#define _cffi_from_c_struct \
- ((PyObject *(*)(char *, struct _cffi_ctypedescr *))_cffi_exports[18])
-#define _cffi_to_c_wchar_t \
- ((_cffi_wchar_t(*)(PyObject *))_cffi_exports[19])
-#define _cffi_from_c_wchar_t \
- ((PyObject *(*)(_cffi_wchar_t))_cffi_exports[20])
-#define _cffi_to_c_long_double \
- ((long double(*)(PyObject *))_cffi_exports[21])
-#define _cffi_to_c__Bool \
- ((_Bool(*)(PyObject *))_cffi_exports[22])
-#define _cffi_prepare_pointer_call_argument \
- ((Py_ssize_t(*)(struct _cffi_ctypedescr *, \
- PyObject *, char **))_cffi_exports[23])
-#define _cffi_convert_array_from_object \
- ((int(*)(char *, struct _cffi_ctypedescr *, PyObject *))_cffi_exports[24])
-#define _CFFI_CPIDX 25
-#define _cffi_call_python \
- ((void(*)(struct _cffi_externpy_s *, char *))_cffi_exports[_CFFI_CPIDX])
-#define _cffi_to_c_wchar3216_t \
- ((int(*)(PyObject *))_cffi_exports[26])
-#define _cffi_from_c_wchar3216_t \
- ((PyObject *(*)(int))_cffi_exports[27])
-#define _CFFI_NUM_EXPORTS 28
-
-struct _cffi_ctypedescr;
-
-static void *_cffi_exports[_CFFI_NUM_EXPORTS];
-
-#define _cffi_type(index) ( \
- assert((((uintptr_t)_cffi_types[index]) & 1) == 0), \
- (struct _cffi_ctypedescr *)_cffi_types[index])
-
-static PyObject *_cffi_init(const char *module_name, Py_ssize_t version,
- const struct _cffi_type_context_s *ctx)
-{
- PyObject *module, *o_arg, *new_module;
- void *raw[] = {
- (void *)module_name,
- (void *)version,
- (void *)_cffi_exports,
- (void *)ctx,
- };
-
- module = PyImport_ImportModule("_cffi_backend");
- if (module == NULL)
- goto failure;
-
- o_arg = PyLong_FromVoidPtr((void *)raw);
- if (o_arg == NULL)
- goto failure;
-
- new_module = PyObject_CallMethod(
- module, (char *)"_init_cffi_1_0_external_module", (char *)"O", o_arg);
-
- Py_DECREF(o_arg);
- Py_DECREF(module);
- return new_module;
-
- failure:
- Py_XDECREF(module);
- return NULL;
-}
-
-
-#ifdef HAVE_WCHAR_H
-typedef wchar_t _cffi_wchar_t;
-#else
-typedef uint16_t _cffi_wchar_t; /* same random pick as _cffi_backend.c */
-#endif
-
-_CFFI_UNUSED_FN static uint16_t _cffi_to_c_char16_t(PyObject *o)
-{
- if (sizeof(_cffi_wchar_t) == 2)
- return (uint16_t)_cffi_to_c_wchar_t(o);
- else
- return (uint16_t)_cffi_to_c_wchar3216_t(o);
-}
-
-_CFFI_UNUSED_FN static PyObject *_cffi_from_c_char16_t(uint16_t x)
-{
- if (sizeof(_cffi_wchar_t) == 2)
- return _cffi_from_c_wchar_t((_cffi_wchar_t)x);
- else
- return _cffi_from_c_wchar3216_t((int)x);
-}
-
-_CFFI_UNUSED_FN static int _cffi_to_c_char32_t(PyObject *o)
-{
- if (sizeof(_cffi_wchar_t) == 4)
- return (int)_cffi_to_c_wchar_t(o);
- else
- return (int)_cffi_to_c_wchar3216_t(o);
-}
-
-_CFFI_UNUSED_FN static PyObject *_cffi_from_c_char32_t(int x)
-{
- if (sizeof(_cffi_wchar_t) == 4)
- return _cffi_from_c_wchar_t((_cffi_wchar_t)x);
- else
- return _cffi_from_c_wchar3216_t(x);
-}
-
-
-/********** end CPython-specific section **********/
-#else
-_CFFI_UNUSED_FN
-static void (*_cffi_call_python_org)(struct _cffi_externpy_s *, char *);
-# define _cffi_call_python _cffi_call_python_org
-#endif
-
-
-#define _cffi_array_len(array) (sizeof(array) / sizeof((array)[0]))
-
-#define _cffi_prim_int(size, sign) \
- ((size) == 1 ? ((sign) ? _CFFI_PRIM_INT8 : _CFFI_PRIM_UINT8) : \
- (size) == 2 ? ((sign) ? _CFFI_PRIM_INT16 : _CFFI_PRIM_UINT16) : \
- (size) == 4 ? ((sign) ? _CFFI_PRIM_INT32 : _CFFI_PRIM_UINT32) : \
- (size) == 8 ? ((sign) ? _CFFI_PRIM_INT64 : _CFFI_PRIM_UINT64) : \
- _CFFI__UNKNOWN_PRIM)
-
-#define _cffi_prim_float(size) \
- ((size) == sizeof(float) ? _CFFI_PRIM_FLOAT : \
- (size) == sizeof(double) ? _CFFI_PRIM_DOUBLE : \
- (size) == sizeof(long double) ? _CFFI__UNKNOWN_LONG_DOUBLE : \
- _CFFI__UNKNOWN_FLOAT_PRIM)
-
-#define _cffi_check_int(got, got_nonpos, expected) \
- ((got_nonpos) == (expected <= 0) && \
- (got) == (unsigned long long)expected)
-
-#ifdef MS_WIN32
-# define _cffi_stdcall __stdcall
-#else
-# define _cffi_stdcall /* nothing */
-#endif
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/lib/cffi/_embedding.h b/lib/cffi/_embedding.h
deleted file mode 100644
index b24652eaa8..0000000000
--- a/lib/cffi/_embedding.h
+++ /dev/null
@@ -1,484 +0,0 @@
-
-/***** Support code for embedding *****/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#if defined(_WIN32)
-# define CFFI_DLLEXPORT __declspec(dllexport)
-#elif defined(__GNUC__)
-# define CFFI_DLLEXPORT __attribute__((visibility("default")))
-#else
-# define CFFI_DLLEXPORT /* nothing */
-#endif
-
-
-/* There are two global variables of type _cffi_call_python_fnptr:
-
- * _cffi_call_python, which we declare just below, is the one called
- by ``extern "Python"`` implementations.
-
- * _cffi_call_python_org, which on CPython is actually part of the
- _cffi_exports[] array, is the function pointer copied from
- _cffi_backend.
-
- After initialization is complete, both are equal. However, the
- first one remains equal to &_cffi_start_and_call_python until the
- very end of initialization, when we are (or should be) sure that
- concurrent threads also see a completely initialized world, and
- only then is it changed.
-*/
-#undef _cffi_call_python
-typedef void (*_cffi_call_python_fnptr)(struct _cffi_externpy_s *, char *);
-static void _cffi_start_and_call_python(struct _cffi_externpy_s *, char *);
-static _cffi_call_python_fnptr _cffi_call_python = &_cffi_start_and_call_python;
-
-
-#ifndef _MSC_VER
- /* --- Assuming a GCC not infinitely old --- */
-# define cffi_compare_and_swap(l,o,n) __sync_bool_compare_and_swap(l,o,n)
-# define cffi_write_barrier() __sync_synchronize()
-# if !defined(__amd64__) && !defined(__x86_64__) && \
- !defined(__i386__) && !defined(__i386)
-# define cffi_read_barrier() __sync_synchronize()
-# else
-# define cffi_read_barrier() (void)0
-# endif
-#else
- /* --- Windows threads version --- */
-# include
-# define cffi_compare_and_swap(l,o,n) \
- (InterlockedCompareExchangePointer(l,n,o) == (o))
-# define cffi_write_barrier() InterlockedCompareExchange(&_cffi_dummy,0,0)
-# define cffi_read_barrier() (void)0
-static volatile LONG _cffi_dummy;
-#endif
-
-#ifdef WITH_THREAD
-# ifndef _MSC_VER
-# include
- static pthread_mutex_t _cffi_embed_startup_lock;
-# else
- static CRITICAL_SECTION _cffi_embed_startup_lock;
-# endif
- static char _cffi_embed_startup_lock_ready = 0;
-#endif
-
-static void _cffi_acquire_reentrant_mutex(void)
-{
- static void *volatile lock = NULL;
-
- while (!cffi_compare_and_swap(&lock, NULL, (void *)1)) {
- /* should ideally do a spin loop instruction here, but
- hard to do it portably and doesn't really matter I
- think: pthread_mutex_init() should be very fast, and
- this is only run at start-up anyway. */
- }
-
-#ifdef WITH_THREAD
- if (!_cffi_embed_startup_lock_ready) {
-# ifndef _MSC_VER
- pthread_mutexattr_t attr;
- pthread_mutexattr_init(&attr);
- pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
- pthread_mutex_init(&_cffi_embed_startup_lock, &attr);
-# else
- InitializeCriticalSection(&_cffi_embed_startup_lock);
-# endif
- _cffi_embed_startup_lock_ready = 1;
- }
-#endif
-
- while (!cffi_compare_and_swap(&lock, (void *)1, NULL))
- ;
-
-#ifndef _MSC_VER
- pthread_mutex_lock(&_cffi_embed_startup_lock);
-#else
- EnterCriticalSection(&_cffi_embed_startup_lock);
-#endif
-}
-
-static void _cffi_release_reentrant_mutex(void)
-{
-#ifndef _MSC_VER
- pthread_mutex_unlock(&_cffi_embed_startup_lock);
-#else
- LeaveCriticalSection(&_cffi_embed_startup_lock);
-#endif
-}
-
-
-/********** CPython-specific section **********/
-#ifndef PYPY_VERSION
-
-#include "_cffi_errors.h"
-
-
-#define _cffi_call_python_org _cffi_exports[_CFFI_CPIDX]
-
-PyMODINIT_FUNC _CFFI_PYTHON_STARTUP_FUNC(void); /* forward */
-
-static void _cffi_py_initialize(void)
-{
- /* XXX use initsigs=0, which "skips initialization registration of
- signal handlers, which might be useful when Python is
- embedded" according to the Python docs. But review and think
- if it should be a user-controllable setting.
-
- XXX we should also give a way to write errors to a buffer
- instead of to stderr.
-
- XXX if importing 'site' fails, CPython (any version) calls
- exit(). Should we try to work around this behavior here?
- */
- Py_InitializeEx(0);
-}
-
-static int _cffi_initialize_python(void)
-{
- /* This initializes Python, imports _cffi_backend, and then the
- present .dll/.so is set up as a CPython C extension module.
- */
- int result;
- PyGILState_STATE state;
- PyObject *pycode=NULL, *global_dict=NULL, *x;
-
- state = PyGILState_Ensure();
-
- /* Call the initxxx() function from the present module. It will
- create and initialize us as a CPython extension module, instead
- of letting the startup Python code do it---it might reimport
- the same .dll/.so and get maybe confused on some platforms.
- It might also have troubles locating the .dll/.so again for all
- I know.
- */
- (void)_CFFI_PYTHON_STARTUP_FUNC();
- if (PyErr_Occurred())
- goto error;
-
- /* Now run the Python code provided to ffi.embedding_init_code().
- */
- pycode = Py_CompileString(_CFFI_PYTHON_STARTUP_CODE,
- "",
- Py_file_input);
- if (pycode == NULL)
- goto error;
- global_dict = PyDict_New();
- if (global_dict == NULL)
- goto error;
- if (PyDict_SetItemString(global_dict, "__builtins__",
- PyThreadState_GET()->interp->builtins) < 0)
- goto error;
- x = PyEval_EvalCode(
-#if PY_MAJOR_VERSION < 3
- (PyCodeObject *)
-#endif
- pycode, global_dict, global_dict);
- if (x == NULL)
- goto error;
- Py_DECREF(x);
-
- /* Done! Now if we've been called from
- _cffi_start_and_call_python() in an ``extern "Python"``, we can
- only hope that the Python code did correctly set up the
- corresponding @ffi.def_extern() function. Otherwise, the
- general logic of ``extern "Python"`` functions (inside the
- _cffi_backend module) will find that the reference is still
- missing and print an error.
- */
- result = 0;
- done:
- Py_XDECREF(pycode);
- Py_XDECREF(global_dict);
- PyGILState_Release(state);
- return result;
-
- error:;
- {
- /* Print as much information as potentially useful.
- Debugging load-time failures with embedding is not fun
- */
- PyObject *ecap;
- PyObject *exception, *v, *tb, *f, *modules, *mod;
- PyErr_Fetch(&exception, &v, &tb);
- ecap = _cffi_start_error_capture();
- f = PySys_GetObject((char *)"stderr");
- if (f != NULL && f != Py_None) {
- PyFile_WriteString(
- "Failed to initialize the Python-CFFI embedding logic:\n\n", f);
- }
-
- if (exception != NULL) {
- PyErr_NormalizeException(&exception, &v, &tb);
- PyErr_Display(exception, v, tb);
- }
- Py_XDECREF(exception);
- Py_XDECREF(v);
- Py_XDECREF(tb);
-
- if (f != NULL && f != Py_None) {
- PyFile_WriteString("\nFrom: " _CFFI_MODULE_NAME
- "\ncompiled with cffi version: 1.11.5"
- "\n_cffi_backend module: ", f);
- modules = PyImport_GetModuleDict();
- mod = PyDict_GetItemString(modules, "_cffi_backend");
- if (mod == NULL) {
- PyFile_WriteString("not loaded", f);
- }
- else {
- v = PyObject_GetAttrString(mod, "__file__");
- PyFile_WriteObject(v, f, 0);
- Py_XDECREF(v);
- }
- PyFile_WriteString("\nsys.path: ", f);
- PyFile_WriteObject(PySys_GetObject((char *)"path"), f, 0);
- PyFile_WriteString("\n\n", f);
- }
- _cffi_stop_error_capture(ecap);
- }
- result = -1;
- goto done;
-}
-
-PyAPI_DATA(char *) _PyParser_TokenNames[]; /* from CPython */
-
-static int _cffi_carefully_make_gil(void)
-{
- /* This does the basic initialization of Python. It can be called
- completely concurrently from unrelated threads. It assumes
- that we don't hold the GIL before (if it exists), and we don't
- hold it afterwards.
-
- (What it really does used to be completely different in Python 2
- and Python 3, with the Python 2 solution avoiding the spin-lock
- around the Py_InitializeEx() call. However, after recent changes
- to CPython 2.7 (issue #358) it no longer works. So we use the
- Python 3 solution everywhere.)
-
- This initializes Python by calling Py_InitializeEx().
- Important: this must not be called concurrently at all.
- So we use a global variable as a simple spin lock. This global
- variable must be from 'libpythonX.Y.so', not from this
- cffi-based extension module, because it must be shared from
- different cffi-based extension modules. We choose
- _PyParser_TokenNames[0] as a completely arbitrary pointer value
- that is never written to. The default is to point to the
- string "ENDMARKER". We change it temporarily to point to the
- next character in that string. (Yes, I know it's REALLY
- obscure.)
- */
-
-#ifdef WITH_THREAD
- char *volatile *lock = (char *volatile *)_PyParser_TokenNames;
- char *old_value;
-
- while (1) { /* spin loop */
- old_value = *lock;
- if (old_value[0] == 'E') {
- assert(old_value[1] == 'N');
- if (cffi_compare_and_swap(lock, old_value, old_value + 1))
- break;
- }
- else {
- assert(old_value[0] == 'N');
- /* should ideally do a spin loop instruction here, but
- hard to do it portably and doesn't really matter I
- think: PyEval_InitThreads() should be very fast, and
- this is only run at start-up anyway. */
- }
- }
-#endif
-
- /* call Py_InitializeEx() */
- {
- PyGILState_STATE state = PyGILState_UNLOCKED;
- if (!Py_IsInitialized())
- _cffi_py_initialize();
- else
- state = PyGILState_Ensure();
-
- PyEval_InitThreads();
- PyGILState_Release(state);
- }
-
-#ifdef WITH_THREAD
- /* release the lock */
- while (!cffi_compare_and_swap(lock, old_value + 1, old_value))
- ;
-#endif
-
- return 0;
-}
-
-/********** end CPython-specific section **********/
-
-
-#else
-
-
-/********** PyPy-specific section **********/
-
-PyMODINIT_FUNC _CFFI_PYTHON_STARTUP_FUNC(const void *[]); /* forward */
-
-static struct _cffi_pypy_init_s {
- const char *name;
- void (*func)(const void *[]);
- const char *code;
-} _cffi_pypy_init = {
- _CFFI_MODULE_NAME,
- (void(*)(const void *[]))_CFFI_PYTHON_STARTUP_FUNC,
- _CFFI_PYTHON_STARTUP_CODE,
-};
-
-extern int pypy_carefully_make_gil(const char *);
-extern int pypy_init_embedded_cffi_module(int, struct _cffi_pypy_init_s *);
-
-static int _cffi_carefully_make_gil(void)
-{
- return pypy_carefully_make_gil(_CFFI_MODULE_NAME);
-}
-
-static int _cffi_initialize_python(void)
-{
- return pypy_init_embedded_cffi_module(0xB011, &_cffi_pypy_init);
-}
-
-/********** end PyPy-specific section **********/
-
-
-#endif
-
-
-#ifdef __GNUC__
-__attribute__((noinline))
-#endif
-static _cffi_call_python_fnptr _cffi_start_python(void)
-{
- /* Delicate logic to initialize Python. This function can be
- called multiple times concurrently, e.g. when the process calls
- its first ``extern "Python"`` functions in multiple threads at
- once. It can also be called recursively, in which case we must
- ignore it. We also have to consider what occurs if several
- different cffi-based extensions reach this code in parallel
- threads---it is a different copy of the code, then, and we
- can't have any shared global variable unless it comes from
- 'libpythonX.Y.so'.
-
- Idea:
-
- * _cffi_carefully_make_gil(): "carefully" call
- PyEval_InitThreads() (possibly with Py_InitializeEx() first).
-
- * then we use a (local) custom lock to make sure that a call to this
- cffi-based extension will wait if another call to the *same*
- extension is running the initialization in another thread.
- It is reentrant, so that a recursive call will not block, but
- only one from a different thread.
-
- * then we grab the GIL and (Python 2) we call Py_InitializeEx().
- At this point, concurrent calls to Py_InitializeEx() are not
- possible: we have the GIL.
-
- * do the rest of the specific initialization, which may
- temporarily release the GIL but not the custom lock.
- Only release the custom lock when we are done.
- */
- static char called = 0;
-
- if (_cffi_carefully_make_gil() != 0)
- return NULL;
-
- _cffi_acquire_reentrant_mutex();
-
- /* Here the GIL exists, but we don't have it. We're only protected
- from concurrency by the reentrant mutex. */
-
- /* This file only initializes the embedded module once, the first
- time this is called, even if there are subinterpreters. */
- if (!called) {
- called = 1; /* invoke _cffi_initialize_python() only once,
- but don't set '_cffi_call_python' right now,
- otherwise concurrent threads won't call
- this function at all (we need them to wait) */
- if (_cffi_initialize_python() == 0) {
- /* now initialization is finished. Switch to the fast-path. */
-
- /* We would like nobody to see the new value of
- '_cffi_call_python' without also seeing the rest of the
- data initialized. However, this is not possible. But
- the new value of '_cffi_call_python' is the function
- 'cffi_call_python()' from _cffi_backend. So: */
- cffi_write_barrier();
- /* ^^^ we put a write barrier here, and a corresponding
- read barrier at the start of cffi_call_python(). This
- ensures that after that read barrier, we see everything
- done here before the write barrier.
- */
-
- assert(_cffi_call_python_org != NULL);
- _cffi_call_python = (_cffi_call_python_fnptr)_cffi_call_python_org;
- }
- else {
- /* initialization failed. Reset this to NULL, even if it was
- already set to some other value. Future calls to
- _cffi_start_python() are still forced to occur, and will
- always return NULL from now on. */
- _cffi_call_python_org = NULL;
- }
- }
-
- _cffi_release_reentrant_mutex();
-
- return (_cffi_call_python_fnptr)_cffi_call_python_org;
-}
-
-static
-void _cffi_start_and_call_python(struct _cffi_externpy_s *externpy, char *args)
-{
- _cffi_call_python_fnptr fnptr;
- int current_err = errno;
-#ifdef _MSC_VER
- int current_lasterr = GetLastError();
-#endif
- fnptr = _cffi_start_python();
- if (fnptr == NULL) {
- fprintf(stderr, "function %s() called, but initialization code "
- "failed. Returning 0.\n", externpy->name);
- memset(args, 0, externpy->size_of_result);
- }
-#ifdef _MSC_VER
- SetLastError(current_lasterr);
-#endif
- errno = current_err;
-
- if (fnptr != NULL)
- fnptr(externpy, args);
-}
-
-
-/* The cffi_start_python() function makes sure Python is initialized
- and our cffi module is set up. It can be called manually from the
- user C code. The same effect is obtained automatically from any
- dll-exported ``extern "Python"`` function. This function returns
- -1 if initialization failed, 0 if all is OK. */
-_CFFI_UNUSED_FN
-static int cffi_start_python(void)
-{
- if (_cffi_call_python == &_cffi_start_and_call_python) {
- if (_cffi_start_python() == NULL)
- return -1;
- }
- cffi_read_barrier();
- return 0;
-}
-
-#undef cffi_compare_and_swap
-#undef cffi_write_barrier
-#undef cffi_read_barrier
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/lib/cffi/api.py b/lib/cffi/api.py
deleted file mode 100644
index 7b63ca7174..0000000000
--- a/lib/cffi/api.py
+++ /dev/null
@@ -1,935 +0,0 @@
-import sys, types
-from .lock import allocate_lock
-from .error import CDefError
-from . import model
-
-try:
- callable
-except NameError:
- # Python 3.1
- from collections import Callable
- callable = lambda x: isinstance(x, Callable)
-
-try:
- basestring
-except NameError:
- # Python 3.x
- basestring = str
-
-
-
-class FFI(object):
- r'''
- The main top-level class that you instantiate once, or once per module.
-
- Example usage:
-
- ffi = FFI()
- ffi.cdef("""
- int printf(const char *, ...);
- """)
-
- C = ffi.dlopen(None) # standard library
- -or-
- C = ffi.verify() # use a C compiler: verify the decl above is right
-
- C.printf("hello, %s!\n", ffi.new("char[]", "world"))
- '''
-
- def __init__(self, backend=None):
- """Create an FFI instance. The 'backend' argument is used to
- select a non-default backend, mostly for tests.
- """
- if backend is None:
- # You need PyPy (>= 2.0 beta), or a CPython (>= 2.6) with
- # _cffi_backend.so compiled.
- import _cffi_backend as backend
- from . import __version__
- if backend.__version__ != __version__:
- # bad version! Try to be as explicit as possible.
- if hasattr(backend, '__file__'):
- # CPython
- raise Exception("Version mismatch: this is the 'cffi' package version %s, located in %r. When we import the top-level '_cffi_backend' extension module, we get version %s, located in %r. The two versions should be equal; check your installation." % (
- __version__, __file__,
- backend.__version__, backend.__file__))
- else:
- # PyPy
- raise Exception("Version mismatch: this is the 'cffi' package version %s, located in %r. This interpreter comes with a built-in '_cffi_backend' module, which is version %s. The two versions should be equal; check your installation." % (
- __version__, __file__, backend.__version__))
- # (If you insist you can also try to pass the option
- # 'backend=backend_ctypes.CTypesBackend()', but don't
- # rely on it! It's probably not going to work well.)
-
- from . import cparser
- self._backend = backend
- self._lock = allocate_lock()
- self._parser = cparser.Parser()
- self._cached_btypes = {}
- self._parsed_types = types.ModuleType('parsed_types').__dict__
- self._new_types = types.ModuleType('new_types').__dict__
- self._function_caches = []
- self._libraries = []
- self._cdefsources = []
- self._included_ffis = []
- self._windows_unicode = None
- self._init_once_cache = {}
- self._cdef_version = None
- self._embedding = None
- self._typecache = model.get_typecache(backend)
- if hasattr(backend, 'set_ffi'):
- backend.set_ffi(self)
- for name in list(backend.__dict__):
- if name.startswith('RTLD_'):
- setattr(self, name, getattr(backend, name))
- #
- with self._lock:
- self.BVoidP = self._get_cached_btype(model.voidp_type)
- self.BCharA = self._get_cached_btype(model.char_array_type)
- if isinstance(backend, types.ModuleType):
- # _cffi_backend: attach these constants to the class
- if not hasattr(FFI, 'NULL'):
- FFI.NULL = self.cast(self.BVoidP, 0)
- FFI.CData, FFI.CType = backend._get_types()
- else:
- # ctypes backend: attach these constants to the instance
- self.NULL = self.cast(self.BVoidP, 0)
- self.CData, self.CType = backend._get_types()
- self.buffer = backend.buffer
-
- def cdef(self, csource, override=False, packed=False):
- """Parse the given C source. This registers all declared functions,
- types, and global variables. The functions and global variables can
- then be accessed via either 'ffi.dlopen()' or 'ffi.verify()'.
- The types can be used in 'ffi.new()' and other functions.
- If 'packed' is specified as True, all structs declared inside this
- cdef are packed, i.e. laid out without any field alignment at all.
- """
- self._cdef(csource, override=override, packed=packed)
-
- def embedding_api(self, csource, packed=False):
- self._cdef(csource, packed=packed, dllexport=True)
- if self._embedding is None:
- self._embedding = ''
-
- def _cdef(self, csource, override=False, **options):
- if not isinstance(csource, str): # unicode, on Python 2
- if not isinstance(csource, basestring):
- raise TypeError("cdef() argument must be a string")
- csource = csource.encode('ascii')
- with self._lock:
- self._cdef_version = object()
- self._parser.parse(csource, override=override, **options)
- self._cdefsources.append(csource)
- if override:
- for cache in self._function_caches:
- cache.clear()
- finishlist = self._parser._recomplete
- if finishlist:
- self._parser._recomplete = []
- for tp in finishlist:
- tp.finish_backend_type(self, finishlist)
-
- def dlopen(self, name, flags=0):
- """Load and return a dynamic library identified by 'name'.
- The standard C library can be loaded by passing None.
- Note that functions and types declared by 'ffi.cdef()' are not
- linked to a particular library, just like C headers; in the
- library we only look for the actual (untyped) symbols.
- """
- assert isinstance(name, basestring) or name is None
- with self._lock:
- lib, function_cache = _make_ffi_library(self, name, flags)
- self._function_caches.append(function_cache)
- self._libraries.append(lib)
- return lib
-
- def dlclose(self, lib):
- """Close a library obtained with ffi.dlopen(). After this call,
- access to functions or variables from the library will fail
- (possibly with a segmentation fault).
- """
- type(lib).__cffi_close__(lib)
-
- def _typeof_locked(self, cdecl):
- # call me with the lock!
- key = cdecl
- if key in self._parsed_types:
- return self._parsed_types[key]
- #
- if not isinstance(cdecl, str): # unicode, on Python 2
- cdecl = cdecl.encode('ascii')
- #
- type = self._parser.parse_type(cdecl)
- really_a_function_type = type.is_raw_function
- if really_a_function_type:
- type = type.as_function_pointer()
- btype = self._get_cached_btype(type)
- result = btype, really_a_function_type
- self._parsed_types[key] = result
- return result
-
- def _typeof(self, cdecl, consider_function_as_funcptr=False):
- # string -> ctype object
- try:
- result = self._parsed_types[cdecl]
- except KeyError:
- with self._lock:
- result = self._typeof_locked(cdecl)
- #
- btype, really_a_function_type = result
- if really_a_function_type and not consider_function_as_funcptr:
- raise CDefError("the type %r is a function type, not a "
- "pointer-to-function type" % (cdecl,))
- return btype
-
- def typeof(self, cdecl):
- """Parse the C type given as a string and return the
- corresponding object.
- It can also be used on 'cdata' instance to get its C type.
- """
- if isinstance(cdecl, basestring):
- return self._typeof(cdecl)
- if isinstance(cdecl, self.CData):
- return self._backend.typeof(cdecl)
- if isinstance(cdecl, types.BuiltinFunctionType):
- res = _builtin_function_type(cdecl)
- if res is not None:
- return res
- if (isinstance(cdecl, types.FunctionType)
- and hasattr(cdecl, '_cffi_base_type')):
- with self._lock:
- return self._get_cached_btype(cdecl._cffi_base_type)
- raise TypeError(type(cdecl))
-
- def sizeof(self, cdecl):
- """Return the size in bytes of the argument. It can be a
- string naming a C type, or a 'cdata' instance.
- """
- if isinstance(cdecl, basestring):
- BType = self._typeof(cdecl)
- return self._backend.sizeof(BType)
- else:
- return self._backend.sizeof(cdecl)
-
- def alignof(self, cdecl):
- """Return the natural alignment size in bytes of the C type
- given as a string.
- """
- if isinstance(cdecl, basestring):
- cdecl = self._typeof(cdecl)
- return self._backend.alignof(cdecl)
-
- def offsetof(self, cdecl, *fields_or_indexes):
- """Return the offset of the named field inside the given
- structure or array, which must be given as a C type name.
- You can give several field names in case of nested structures.
- You can also give numeric values which correspond to array
- items, in case of an array type.
- """
- if isinstance(cdecl, basestring):
- cdecl = self._typeof(cdecl)
- return self._typeoffsetof(cdecl, *fields_or_indexes)[1]
-
- def new(self, cdecl, init=None):
- """Allocate an instance according to the specified C type and
- return a pointer to it. The specified C type must be either a
- pointer or an array: ``new('X *')`` allocates an X and returns
- a pointer to it, whereas ``new('X[n]')`` allocates an array of
- n X'es and returns an array referencing it (which works
- mostly like a pointer, like in C). You can also use
- ``new('X[]', n)`` to allocate an array of a non-constant
- length n.
-
- The memory is initialized following the rules of declaring a
- global variable in C: by default it is zero-initialized, but
- an explicit initializer can be given which can be used to
- fill all or part of the memory.
-
- When the returned object goes out of scope, the memory
- is freed. In other words the returned object has
- ownership of the value of type 'cdecl' that it points to. This
- means that the raw data can be used as long as this object is
- kept alive, but must not be used for a longer time. Be careful
- about that when copying the pointer to the memory somewhere
- else, e.g. into another structure.
- """
- if isinstance(cdecl, basestring):
- cdecl = self._typeof(cdecl)
- return self._backend.newp(cdecl, init)
-
- def new_allocator(self, alloc=None, free=None,
- should_clear_after_alloc=True):
- """Return a new allocator, i.e. a function that behaves like ffi.new()
- but uses the provided low-level 'alloc' and 'free' functions.
-
- 'alloc' is called with the size as argument. If it returns NULL, a
- MemoryError is raised. 'free' is called with the result of 'alloc'
- as argument. Both can be either Python function or directly C
- functions. If 'free' is None, then no free function is called.
- If both 'alloc' and 'free' are None, the default is used.
-
- If 'should_clear_after_alloc' is set to False, then the memory
- returned by 'alloc' is assumed to be already cleared (or you are
- fine with garbage); otherwise CFFI will clear it.
- """
- compiled_ffi = self._backend.FFI()
- allocator = compiled_ffi.new_allocator(alloc, free,
- should_clear_after_alloc)
- def allocate(cdecl, init=None):
- if isinstance(cdecl, basestring):
- cdecl = self._typeof(cdecl)
- return allocator(cdecl, init)
- return allocate
-
- def cast(self, cdecl, source):
- """Similar to a C cast: returns an instance of the named C
- type initialized with the given 'source'. The source is
- casted between integers or pointers of any type.
- """
- if isinstance(cdecl, basestring):
- cdecl = self._typeof(cdecl)
- return self._backend.cast(cdecl, source)
-
- def string(self, cdata, maxlen=-1):
- """Return a Python string (or unicode string) from the 'cdata'.
- If 'cdata' is a pointer or array of characters or bytes, returns
- the null-terminated string. The returned string extends until
- the first null character, or at most 'maxlen' characters. If
- 'cdata' is an array then 'maxlen' defaults to its length.
-
- If 'cdata' is a pointer or array of wchar_t, returns a unicode
- string following the same rules.
-
- If 'cdata' is a single character or byte or a wchar_t, returns
- it as a string or unicode string.
-
- If 'cdata' is an enum, returns the value of the enumerator as a
- string, or 'NUMBER' if the value is out of range.
- """
- return self._backend.string(cdata, maxlen)
-
- def unpack(self, cdata, length):
- """Unpack an array of C data of the given length,
- returning a Python string/unicode/list.
-
- If 'cdata' is a pointer to 'char', returns a byte string.
- It does not stop at the first null. This is equivalent to:
- ffi.buffer(cdata, length)[:]
-
- If 'cdata' is a pointer to 'wchar_t', returns a unicode string.
- 'length' is measured in wchar_t's; it is not the size in bytes.
-
- If 'cdata' is a pointer to anything else, returns a list of
- 'length' items. This is a faster equivalent to:
- [cdata[i] for i in range(length)]
- """
- return self._backend.unpack(cdata, length)
-
- #def buffer(self, cdata, size=-1):
- # """Return a read-write buffer object that references the raw C data
- # pointed to by the given 'cdata'. The 'cdata' must be a pointer or
- # an array. Can be passed to functions expecting a buffer, or directly
- # manipulated with:
- #
- # buf[:] get a copy of it in a regular string, or
- # buf[idx] as a single character
- # buf[:] = ...
- # buf[idx] = ... change the content
- # """
- # note that 'buffer' is a type, set on this instance by __init__
-
- def from_buffer(self, python_buffer):
- """Return a that points to the data of the
- given Python object, which must support the buffer interface.
- Note that this is not meant to be used on the built-in types
- str or unicode (you can build 'char[]' arrays explicitly)
- but only on objects containing large quantities of raw data
- in some other format, like 'array.array' or numpy arrays.
- """
- return self._backend.from_buffer(self.BCharA, python_buffer)
-
- def memmove(self, dest, src, n):
- """ffi.memmove(dest, src, n) copies n bytes of memory from src to dest.
-
- Like the C function memmove(), the memory areas may overlap;
- apart from that it behaves like the C function memcpy().
-
- 'src' can be any cdata ptr or array, or any Python buffer object.
- 'dest' can be any cdata ptr or array, or a writable Python buffer
- object. The size to copy, 'n', is always measured in bytes.
-
- Unlike other methods, this one supports all Python buffer including
- byte strings and bytearrays---but it still does not support
- non-contiguous buffers.
- """
- return self._backend.memmove(dest, src, n)
-
- def callback(self, cdecl, python_callable=None, error=None, onerror=None):
- """Return a callback object or a decorator making such a
- callback object. 'cdecl' must name a C function pointer type.
- The callback invokes the specified 'python_callable' (which may
- be provided either directly or via a decorator). Important: the
- callback object must be manually kept alive for as long as the
- callback may be invoked from the C level.
- """
- def callback_decorator_wrap(python_callable):
- if not callable(python_callable):
- raise TypeError("the 'python_callable' argument "
- "is not callable")
- return self._backend.callback(cdecl, python_callable,
- error, onerror)
- if isinstance(cdecl, basestring):
- cdecl = self._typeof(cdecl, consider_function_as_funcptr=True)
- if python_callable is None:
- return callback_decorator_wrap # decorator mode
- else:
- return callback_decorator_wrap(python_callable) # direct mode
-
- def getctype(self, cdecl, replace_with=''):
- """Return a string giving the C type 'cdecl', which may be itself
- a string or a object. If 'replace_with' is given, it gives
- extra text to append (or insert for more complicated C types), like
- a variable name, or '*' to get actually the C type 'pointer-to-cdecl'.
- """
- if isinstance(cdecl, basestring):
- cdecl = self._typeof(cdecl)
- replace_with = replace_with.strip()
- if (replace_with.startswith('*')
- and '&[' in self._backend.getcname(cdecl, '&')):
- replace_with = '(%s)' % replace_with
- elif replace_with and not replace_with[0] in '[(':
- replace_with = ' ' + replace_with
- return self._backend.getcname(cdecl, replace_with)
-
- def gc(self, cdata, destructor, size=0):
- """Return a new cdata object that points to the same
- data. Later, when this new cdata object is garbage-collected,
- 'destructor(old_cdata_object)' will be called.
-
- The optional 'size' gives an estimate of the size, used to
- trigger the garbage collection more eagerly. So far only used
- on PyPy. It tells the GC that the returned object keeps alive
- roughly 'size' bytes of external memory.
- """
- return self._backend.gcp(cdata, destructor, size)
-
- def _get_cached_btype(self, type):
- assert self._lock.acquire(False) is False
- # call me with the lock!
- try:
- BType = self._cached_btypes[type]
- except KeyError:
- finishlist = []
- BType = type.get_cached_btype(self, finishlist)
- for type in finishlist:
- type.finish_backend_type(self, finishlist)
- return BType
-
- def verify(self, source='', tmpdir=None, **kwargs):
- """Verify that the current ffi signatures compile on this
- machine, and return a dynamic library object. The dynamic
- library can be used to call functions and access global
- variables declared in this 'ffi'. The library is compiled
- by the C compiler: it gives you C-level API compatibility
- (including calling macros). This is unlike 'ffi.dlopen()',
- which requires binary compatibility in the signatures.
- """
- from .verifier import Verifier, _caller_dir_pycache
- #
- # If set_unicode(True) was called, insert the UNICODE and
- # _UNICODE macro declarations
- if self._windows_unicode:
- self._apply_windows_unicode(kwargs)
- #
- # Set the tmpdir here, and not in Verifier.__init__: it picks
- # up the caller's directory, which we want to be the caller of
- # ffi.verify(), as opposed to the caller of Veritier().
- tmpdir = tmpdir or _caller_dir_pycache()
- #
- # Make a Verifier() and use it to load the library.
- self.verifier = Verifier(self, source, tmpdir, **kwargs)
- lib = self.verifier.load_library()
- #
- # Save the loaded library for keep-alive purposes, even
- # if the caller doesn't keep it alive itself (it should).
- self._libraries.append(lib)
- return lib
-
- def _get_errno(self):
- return self._backend.get_errno()
- def _set_errno(self, errno):
- self._backend.set_errno(errno)
- errno = property(_get_errno, _set_errno, None,
- "the value of 'errno' from/to the C calls")
-
- def getwinerror(self, code=-1):
- return self._backend.getwinerror(code)
-
- def _pointer_to(self, ctype):
- with self._lock:
- return model.pointer_cache(self, ctype)
-
- def addressof(self, cdata, *fields_or_indexes):
- """Return the address of a .
- If 'fields_or_indexes' are given, returns the address of that
- field or array item in the structure or array, recursively in
- case of nested structures.
- """
- try:
- ctype = self._backend.typeof(cdata)
- except TypeError:
- if '__addressof__' in type(cdata).__dict__:
- return type(cdata).__addressof__(cdata, *fields_or_indexes)
- raise
- if fields_or_indexes:
- ctype, offset = self._typeoffsetof(ctype, *fields_or_indexes)
- else:
- if ctype.kind == "pointer":
- raise TypeError("addressof(pointer)")
- offset = 0
- ctypeptr = self._pointer_to(ctype)
- return self._backend.rawaddressof(ctypeptr, cdata, offset)
-
- def _typeoffsetof(self, ctype, field_or_index, *fields_or_indexes):
- ctype, offset = self._backend.typeoffsetof(ctype, field_or_index)
- for field1 in fields_or_indexes:
- ctype, offset1 = self._backend.typeoffsetof(ctype, field1, 1)
- offset += offset1
- return ctype, offset
-
- def include(self, ffi_to_include):
- """Includes the typedefs, structs, unions and enums defined
- in another FFI instance. Usage is similar to a #include in C,
- where a part of the program might include types defined in
- another part for its own usage. Note that the include()
- method has no effect on functions, constants and global
- variables, which must anyway be accessed directly from the
- lib object returned by the original FFI instance.
- """
- if not isinstance(ffi_to_include, FFI):
- raise TypeError("ffi.include() expects an argument that is also of"
- " type cffi.FFI, not %r" % (
- type(ffi_to_include).__name__,))
- if ffi_to_include is self:
- raise ValueError("self.include(self)")
- with ffi_to_include._lock:
- with self._lock:
- self._parser.include(ffi_to_include._parser)
- self._cdefsources.append('[')
- self._cdefsources.extend(ffi_to_include._cdefsources)
- self._cdefsources.append(']')
- self._included_ffis.append(ffi_to_include)
-
- def new_handle(self, x):
- return self._backend.newp_handle(self.BVoidP, x)
-
- def from_handle(self, x):
- return self._backend.from_handle(x)
-
- def set_unicode(self, enabled_flag):
- """Windows: if 'enabled_flag' is True, enable the UNICODE and
- _UNICODE defines in C, and declare the types like TCHAR and LPTCSTR
- to be (pointers to) wchar_t. If 'enabled_flag' is False,
- declare these types to be (pointers to) plain 8-bit characters.
- This is mostly for backward compatibility; you usually want True.
- """
- if self._windows_unicode is not None:
- raise ValueError("set_unicode() can only be called once")
- enabled_flag = bool(enabled_flag)
- if enabled_flag:
- self.cdef("typedef wchar_t TBYTE;"
- "typedef wchar_t TCHAR;"
- "typedef const wchar_t *LPCTSTR;"
- "typedef const wchar_t *PCTSTR;"
- "typedef wchar_t *LPTSTR;"
- "typedef wchar_t *PTSTR;"
- "typedef TBYTE *PTBYTE;"
- "typedef TCHAR *PTCHAR;")
- else:
- self.cdef("typedef char TBYTE;"
- "typedef char TCHAR;"
- "typedef const char *LPCTSTR;"
- "typedef const char *PCTSTR;"
- "typedef char *LPTSTR;"
- "typedef char *PTSTR;"
- "typedef TBYTE *PTBYTE;"
- "typedef TCHAR *PTCHAR;")
- self._windows_unicode = enabled_flag
-
- def _apply_windows_unicode(self, kwds):
- defmacros = kwds.get('define_macros', ())
- if not isinstance(defmacros, (list, tuple)):
- raise TypeError("'define_macros' must be a list or tuple")
- defmacros = list(defmacros) + [('UNICODE', '1'),
- ('_UNICODE', '1')]
- kwds['define_macros'] = defmacros
-
- def _apply_embedding_fix(self, kwds):
- # must include an argument like "-lpython2.7" for the compiler
- def ensure(key, value):
- lst = kwds.setdefault(key, [])
- if value not in lst:
- lst.append(value)
- #
- if '__pypy__' in sys.builtin_module_names:
- import os
- if sys.platform == "win32":
- # we need 'libpypy-c.lib'. Current distributions of
- # pypy (>= 4.1) contain it as 'libs/python27.lib'.
- pythonlib = "python27"
- if hasattr(sys, 'prefix'):
- ensure('library_dirs', os.path.join(sys.prefix, 'libs'))
- else:
- # we need 'libpypy-c.{so,dylib}', which should be by
- # default located in 'sys.prefix/bin' for installed
- # systems.
- if sys.version_info < (3,):
- pythonlib = "pypy-c"
- else:
- pythonlib = "pypy3-c"
- if hasattr(sys, 'prefix'):
- ensure('library_dirs', os.path.join(sys.prefix, 'bin'))
- # On uninstalled pypy's, the libpypy-c is typically found in
- # .../pypy/goal/.
- if hasattr(sys, 'prefix'):
- ensure('library_dirs', os.path.join(sys.prefix, 'pypy', 'goal'))
- else:
- if sys.platform == "win32":
- template = "python%d%d"
- if hasattr(sys, 'gettotalrefcount'):
- template += '_d'
- else:
- try:
- import sysconfig
- except ImportError: # 2.6
- from distutils import sysconfig
- template = "python%d.%d"
- if sysconfig.get_config_var('DEBUG_EXT'):
- template += sysconfig.get_config_var('DEBUG_EXT')
- pythonlib = (template %
- (sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff))
- if hasattr(sys, 'abiflags'):
- pythonlib += sys.abiflags
- ensure('libraries', pythonlib)
- if sys.platform == "win32":
- ensure('extra_link_args', '/MANIFEST')
-
- def set_source(self, module_name, source, source_extension='.c', **kwds):
- import os
- if hasattr(self, '_assigned_source'):
- raise ValueError("set_source() cannot be called several times "
- "per ffi object")
- if not isinstance(module_name, basestring):
- raise TypeError("'module_name' must be a string")
- if os.sep in module_name or (os.altsep and os.altsep in module_name):
- raise ValueError("'module_name' must not contain '/': use a dotted "
- "name to make a 'package.module' location")
- self._assigned_source = (str(module_name), source,
- source_extension, kwds)
-
- def distutils_extension(self, tmpdir='build', verbose=True):
- from distutils.dir_util import mkpath
- from .recompiler import recompile
- #
- if not hasattr(self, '_assigned_source'):
- if hasattr(self, 'verifier'): # fallback, 'tmpdir' ignored
- return self.verifier.get_extension()
- raise ValueError("set_source() must be called before"
- " distutils_extension()")
- module_name, source, source_extension, kwds = self._assigned_source
- if source is None:
- raise TypeError("distutils_extension() is only for C extension "
- "modules, not for dlopen()-style pure Python "
- "modules")
- mkpath(tmpdir)
- ext, updated = recompile(self, module_name,
- source, tmpdir=tmpdir, extradir=tmpdir,
- source_extension=source_extension,
- call_c_compiler=False, **kwds)
- if verbose:
- if updated:
- sys.stderr.write("regenerated: %r\n" % (ext.sources[0],))
- else:
- sys.stderr.write("not modified: %r\n" % (ext.sources[0],))
- return ext
-
- def emit_c_code(self, filename):
- from .recompiler import recompile
- #
- if not hasattr(self, '_assigned_source'):
- raise ValueError("set_source() must be called before emit_c_code()")
- module_name, source, source_extension, kwds = self._assigned_source
- if source is None:
- raise TypeError("emit_c_code() is only for C extension modules, "
- "not for dlopen()-style pure Python modules")
- recompile(self, module_name, source,
- c_file=filename, call_c_compiler=False, **kwds)
-
- def emit_python_code(self, filename):
- from .recompiler import recompile
- #
- if not hasattr(self, '_assigned_source'):
- raise ValueError("set_source() must be called before emit_c_code()")
- module_name, source, source_extension, kwds = self._assigned_source
- if source is not None:
- raise TypeError("emit_python_code() is only for dlopen()-style "
- "pure Python modules, not for C extension modules")
- recompile(self, module_name, source,
- c_file=filename, call_c_compiler=False, **kwds)
-
- def compile(self, tmpdir='.', verbose=0, target=None, debug=None):
- """The 'target' argument gives the final file name of the
- compiled DLL. Use '*' to force distutils' choice, suitable for
- regular CPython C API modules. Use a file name ending in '.*'
- to ask for the system's default extension for dynamic libraries
- (.so/.dll/.dylib).
-
- The default is '*' when building a non-embedded C API extension,
- and (module_name + '.*') when building an embedded library.
- """
- from .recompiler import recompile
- #
- if not hasattr(self, '_assigned_source'):
- raise ValueError("set_source() must be called before compile()")
- module_name, source, source_extension, kwds = self._assigned_source
- return recompile(self, module_name, source, tmpdir=tmpdir,
- target=target, source_extension=source_extension,
- compiler_verbose=verbose, debug=debug, **kwds)
-
- def init_once(self, func, tag):
- # Read _init_once_cache[tag], which is either (False, lock) if
- # we're calling the function now in some thread, or (True, result).
- # Don't call setdefault() in most cases, to avoid allocating and
- # immediately freeing a lock; but still use setdefaut() to avoid
- # races.
- try:
- x = self._init_once_cache[tag]
- except KeyError:
- x = self._init_once_cache.setdefault(tag, (False, allocate_lock()))
- # Common case: we got (True, result), so we return the result.
- if x[0]:
- return x[1]
- # Else, it's a lock. Acquire it to serialize the following tests.
- with x[1]:
- # Read again from _init_once_cache the current status.
- x = self._init_once_cache[tag]
- if x[0]:
- return x[1]
- # Call the function and store the result back.
- result = func()
- self._init_once_cache[tag] = (True, result)
- return result
-
- def embedding_init_code(self, pysource):
- if self._embedding:
- raise ValueError("embedding_init_code() can only be called once")
- # fix 'pysource' before it gets dumped into the C file:
- # - remove empty lines at the beginning, so it starts at "line 1"
- # - dedent, if all non-empty lines are indented
- # - check for SyntaxErrors
- import re
- match = re.match(r'\s*\n', pysource)
- if match:
- pysource = pysource[match.end():]
- lines = pysource.splitlines() or ['']
- prefix = re.match(r'\s*', lines[0]).group()
- for i in range(1, len(lines)):
- line = lines[i]
- if line.rstrip():
- while not line.startswith(prefix):
- prefix = prefix[:-1]
- i = len(prefix)
- lines = [line[i:]+'\n' for line in lines]
- pysource = ''.join(lines)
- #
- compile(pysource, "cffi_init", "exec")
- #
- self._embedding = pysource
-
- def def_extern(self, *args, **kwds):
- raise ValueError("ffi.def_extern() is only available on API-mode FFI "
- "objects")
-
- def list_types(self):
- """Returns the user type names known to this FFI instance.
- This returns a tuple containing three lists of names:
- (typedef_names, names_of_structs, names_of_unions)
- """
- typedefs = []
- structs = []
- unions = []
- for key in self._parser._declarations:
- if key.startswith('typedef '):
- typedefs.append(key[8:])
- elif key.startswith('struct '):
- structs.append(key[7:])
- elif key.startswith('union '):
- unions.append(key[6:])
- typedefs.sort()
- structs.sort()
- unions.sort()
- return (typedefs, structs, unions)
-
-
-def _load_backend_lib(backend, name, flags):
- import os
- if name is None:
- if sys.platform != "win32":
- return backend.load_library(None, flags)
- name = "c" # Windows: load_library(None) fails, but this works
- # on Python 2 (backward compatibility hack only)
- first_error = None
- if '.' in name or '/' in name or os.sep in name:
- try:
- return backend.load_library(name, flags)
- except OSError as e:
- first_error = e
- import ctypes.util
- path = ctypes.util.find_library(name)
- if path is None:
- if name == "c" and sys.platform == "win32" and sys.version_info >= (3,):
- raise OSError("dlopen(None) cannot work on Windows for Python 3 "
- "(see http://bugs.python.org/issue23606)")
- msg = ("ctypes.util.find_library() did not manage "
- "to locate a library called %r" % (name,))
- if first_error is not None:
- msg = "%s. Additionally, %s" % (first_error, msg)
- raise OSError(msg)
- return backend.load_library(path, flags)
-
-def _make_ffi_library(ffi, libname, flags):
- backend = ffi._backend
- backendlib = _load_backend_lib(backend, libname, flags)
- #
- def accessor_function(name):
- key = 'function ' + name
- tp, _ = ffi._parser._declarations[key]
- BType = ffi._get_cached_btype(tp)
- value = backendlib.load_function(BType, name)
- library.__dict__[name] = value
- #
- def accessor_variable(name):
- key = 'variable ' + name
- tp, _ = ffi._parser._declarations[key]
- BType = ffi._get_cached_btype(tp)
- read_variable = backendlib.read_variable
- write_variable = backendlib.write_variable
- setattr(FFILibrary, name, property(
- lambda self: read_variable(BType, name),
- lambda self, value: write_variable(BType, name, value)))
- #
- def addressof_var(name):
- try:
- return addr_variables[name]
- except KeyError:
- with ffi._lock:
- if name not in addr_variables:
- key = 'variable ' + name
- tp, _ = ffi._parser._declarations[key]
- BType = ffi._get_cached_btype(tp)
- if BType.kind != 'array':
- BType = model.pointer_cache(ffi, BType)
- p = backendlib.load_function(BType, name)
- addr_variables[name] = p
- return addr_variables[name]
- #
- def accessor_constant(name):
- raise NotImplementedError("non-integer constant '%s' cannot be "
- "accessed from a dlopen() library" % (name,))
- #
- def accessor_int_constant(name):
- library.__dict__[name] = ffi._parser._int_constants[name]
- #
- accessors = {}
- accessors_version = [False]
- addr_variables = {}
- #
- def update_accessors():
- if accessors_version[0] is ffi._cdef_version:
- return
- #
- for key, (tp, _) in ffi._parser._declarations.items():
- if not isinstance(tp, model.EnumType):
- tag, name = key.split(' ', 1)
- if tag == 'function':
- accessors[name] = accessor_function
- elif tag == 'variable':
- accessors[name] = accessor_variable
- elif tag == 'constant':
- accessors[name] = accessor_constant
- else:
- for i, enumname in enumerate(tp.enumerators):
- def accessor_enum(name, tp=tp, i=i):
- tp.check_not_partial()
- library.__dict__[name] = tp.enumvalues[i]
- accessors[enumname] = accessor_enum
- for name in ffi._parser._int_constants:
- accessors.setdefault(name, accessor_int_constant)
- accessors_version[0] = ffi._cdef_version
- #
- def make_accessor(name):
- with ffi._lock:
- if name in library.__dict__ or name in FFILibrary.__dict__:
- return # added by another thread while waiting for the lock
- if name not in accessors:
- update_accessors()
- if name not in accessors:
- raise AttributeError(name)
- accessors[name](name)
- #
- class FFILibrary(object):
- def __getattr__(self, name):
- make_accessor(name)
- return getattr(self, name)
- def __setattr__(self, name, value):
- try:
- property = getattr(self.__class__, name)
- except AttributeError:
- make_accessor(name)
- setattr(self, name, value)
- else:
- property.__set__(self, value)
- def __dir__(self):
- with ffi._lock:
- update_accessors()
- return accessors.keys()
- def __addressof__(self, name):
- if name in library.__dict__:
- return library.__dict__[name]
- if name in FFILibrary.__dict__:
- return addressof_var(name)
- make_accessor(name)
- if name in library.__dict__:
- return library.__dict__[name]
- if name in FFILibrary.__dict__:
- return addressof_var(name)
- raise AttributeError("cffi library has no function or "
- "global variable named '%s'" % (name,))
- def __cffi_close__(self):
- backendlib.close_lib()
- self.__dict__.clear()
- #
- if libname is not None:
- try:
- if not isinstance(libname, str): # unicode, on Python 2
- libname = libname.encode('utf-8')
- FFILibrary.__name__ = 'FFILibrary_%s' % libname
- except UnicodeError:
- pass
- library = FFILibrary()
- return library, library.__dict__
-
-def _builtin_function_type(func):
- # a hack to make at least ffi.typeof(builtin_function) work,
- # if the builtin function was obtained by 'vengine_cpy'.
- import sys
- try:
- module = sys.modules[func.__module__]
- ffi = module._cffi_original_ffi
- types_of_builtin_funcs = module._cffi_types_of_builtin_funcs
- tp = types_of_builtin_funcs[func]
- except (KeyError, AttributeError, TypeError):
- return None
- else:
- with ffi._lock:
- return ffi._get_cached_btype(tp)
diff --git a/lib/cffi/backend_ctypes.py b/lib/cffi/backend_ctypes.py
deleted file mode 100644
index 5ef3c135e7..0000000000
--- a/lib/cffi/backend_ctypes.py
+++ /dev/null
@@ -1,1114 +0,0 @@
-import ctypes, ctypes.util, operator, sys
-from . import model
-
-if sys.version_info < (3,):
- bytechr = chr
-else:
- unicode = str
- long = int
- xrange = range
- bytechr = lambda num: bytes([num])
-
-class CTypesType(type):
- pass
-
-class CTypesData(object):
- __metaclass__ = CTypesType
- __slots__ = ['__weakref__']
- __name__ = ''
-
- def __init__(self, *args):
- raise TypeError("cannot instantiate %r" % (self.__class__,))
-
- @classmethod
- def _newp(cls, init):
- raise TypeError("expected a pointer or array ctype, got '%s'"
- % (cls._get_c_name(),))
-
- @staticmethod
- def _to_ctypes(value):
- raise TypeError
-
- @classmethod
- def _arg_to_ctypes(cls, *value):
- try:
- ctype = cls._ctype
- except AttributeError:
- raise TypeError("cannot create an instance of %r" % (cls,))
- if value:
- res = cls._to_ctypes(*value)
- if not isinstance(res, ctype):
- res = cls._ctype(res)
- else:
- res = cls._ctype()
- return res
-
- @classmethod
- def _create_ctype_obj(cls, init):
- if init is None:
- return cls._arg_to_ctypes()
- else:
- return cls._arg_to_ctypes(init)
-
- @staticmethod
- def _from_ctypes(ctypes_value):
- raise TypeError
-
- @classmethod
- def _get_c_name(cls, replace_with=''):
- return cls._reftypename.replace(' &', replace_with)
-
- @classmethod
- def _fix_class(cls):
- cls.__name__ = 'CData<%s>' % (cls._get_c_name(),)
- cls.__qualname__ = 'CData<%s>' % (cls._get_c_name(),)
- cls.__module__ = 'ffi'
-
- def _get_own_repr(self):
- raise NotImplementedError
-
- def _addr_repr(self, address):
- if address == 0:
- return 'NULL'
- else:
- if address < 0:
- address += 1 << (8*ctypes.sizeof(ctypes.c_void_p))
- return '0x%x' % address
-
- def __repr__(self, c_name=None):
- own = self._get_own_repr()
- return '' % (c_name or self._get_c_name(), own)
-
- def _convert_to_address(self, BClass):
- if BClass is None:
- raise TypeError("cannot convert %r to an address" % (
- self._get_c_name(),))
- else:
- raise TypeError("cannot convert %r to %r" % (
- self._get_c_name(), BClass._get_c_name()))
-
- @classmethod
- def _get_size(cls):
- return ctypes.sizeof(cls._ctype)
-
- def _get_size_of_instance(self):
- return ctypes.sizeof(self._ctype)
-
- @classmethod
- def _cast_from(cls, source):
- raise TypeError("cannot cast to %r" % (cls._get_c_name(),))
-
- def _cast_to_integer(self):
- return self._convert_to_address(None)
-
- @classmethod
- def _alignment(cls):
- return ctypes.alignment(cls._ctype)
-
- def __iter__(self):
- raise TypeError("cdata %r does not support iteration" % (
- self._get_c_name()),)
-
- def _make_cmp(name):
- cmpfunc = getattr(operator, name)
- def cmp(self, other):
- v_is_ptr = not isinstance(self, CTypesGenericPrimitive)
- w_is_ptr = (isinstance(other, CTypesData) and
- not isinstance(other, CTypesGenericPrimitive))
- if v_is_ptr and w_is_ptr:
- return cmpfunc(self._convert_to_address(None),
- other._convert_to_address(None))
- elif v_is_ptr or w_is_ptr:
- return NotImplemented
- else:
- if isinstance(self, CTypesGenericPrimitive):
- self = self._value
- if isinstance(other, CTypesGenericPrimitive):
- other = other._value
- return cmpfunc(self, other)
- cmp.func_name = name
- return cmp
-
- __eq__ = _make_cmp('__eq__')
- __ne__ = _make_cmp('__ne__')
- __lt__ = _make_cmp('__lt__')
- __le__ = _make_cmp('__le__')
- __gt__ = _make_cmp('__gt__')
- __ge__ = _make_cmp('__ge__')
-
- def __hash__(self):
- return hash(self._convert_to_address(None))
-
- def _to_string(self, maxlen):
- raise TypeError("string(): %r" % (self,))
-
-
-class CTypesGenericPrimitive(CTypesData):
- __slots__ = []
-
- def __hash__(self):
- return hash(self._value)
-
- def _get_own_repr(self):
- return repr(self._from_ctypes(self._value))
-
-
-class CTypesGenericArray(CTypesData):
- __slots__ = []
-
- @classmethod
- def _newp(cls, init):
- return cls(init)
-
- def __iter__(self):
- for i in xrange(len(self)):
- yield self[i]
-
- def _get_own_repr(self):
- return self._addr_repr(ctypes.addressof(self._blob))
-
-
-class CTypesGenericPtr(CTypesData):
- __slots__ = ['_address', '_as_ctype_ptr']
- _automatic_casts = False
- kind = "pointer"
-
- @classmethod
- def _newp(cls, init):
- return cls(init)
-
- @classmethod
- def _cast_from(cls, source):
- if source is None:
- address = 0
- elif isinstance(source, CTypesData):
- address = source._cast_to_integer()
- elif isinstance(source, (int, long)):
- address = source
- else:
- raise TypeError("bad type for cast to %r: %r" %
- (cls, type(source).__name__))
- return cls._new_pointer_at(address)
-
- @classmethod
- def _new_pointer_at(cls, address):
- self = cls.__new__(cls)
- self._address = address
- self._as_ctype_ptr = ctypes.cast(address, cls._ctype)
- return self
-
- def _get_own_repr(self):
- try:
- return self._addr_repr(self._address)
- except AttributeError:
- return '???'
-
- def _cast_to_integer(self):
- return self._address
-
- def __nonzero__(self):
- return bool(self._address)
- __bool__ = __nonzero__
-
- @classmethod
- def _to_ctypes(cls, value):
- if not isinstance(value, CTypesData):
- raise TypeError("unexpected %s object" % type(value).__name__)
- address = value._convert_to_address(cls)
- return ctypes.cast(address, cls._ctype)
-
- @classmethod
- def _from_ctypes(cls, ctypes_ptr):
- address = ctypes.cast(ctypes_ptr, ctypes.c_void_p).value or 0
- return cls._new_pointer_at(address)
-
- @classmethod
- def _initialize(cls, ctypes_ptr, value):
- if value:
- ctypes_ptr.contents = cls._to_ctypes(value).contents
-
- def _convert_to_address(self, BClass):
- if (BClass in (self.__class__, None) or BClass._automatic_casts
- or self._automatic_casts):
- return self._address
- else:
- return CTypesData._convert_to_address(self, BClass)
-
-
-class CTypesBaseStructOrUnion(CTypesData):
- __slots__ = ['_blob']
-
- @classmethod
- def _create_ctype_obj(cls, init):
- # may be overridden
- raise TypeError("cannot instantiate opaque type %s" % (cls,))
-
- def _get_own_repr(self):
- return self._addr_repr(ctypes.addressof(self._blob))
-
- @classmethod
- def _offsetof(cls, fieldname):
- return getattr(cls._ctype, fieldname).offset
-
- def _convert_to_address(self, BClass):
- if getattr(BClass, '_BItem', None) is self.__class__:
- return ctypes.addressof(self._blob)
- else:
- return CTypesData._convert_to_address(self, BClass)
-
- @classmethod
- def _from_ctypes(cls, ctypes_struct_or_union):
- self = cls.__new__(cls)
- self._blob = ctypes_struct_or_union
- return self
-
- @classmethod
- def _to_ctypes(cls, value):
- return value._blob
-
- def __repr__(self, c_name=None):
- return CTypesData.__repr__(self, c_name or self._get_c_name(' &'))
-
-
-class CTypesBackend(object):
-
- PRIMITIVE_TYPES = {
- 'char': ctypes.c_char,
- 'short': ctypes.c_short,
- 'int': ctypes.c_int,
- 'long': ctypes.c_long,
- 'long long': ctypes.c_longlong,
- 'signed char': ctypes.c_byte,
- 'unsigned char': ctypes.c_ubyte,
- 'unsigned short': ctypes.c_ushort,
- 'unsigned int': ctypes.c_uint,
- 'unsigned long': ctypes.c_ulong,
- 'unsigned long long': ctypes.c_ulonglong,
- 'float': ctypes.c_float,
- 'double': ctypes.c_double,
- '_Bool': ctypes.c_bool,
- }
-
- for _name in ['unsigned long long', 'unsigned long',
- 'unsigned int', 'unsigned short', 'unsigned char']:
- _size = ctypes.sizeof(PRIMITIVE_TYPES[_name])
- PRIMITIVE_TYPES['uint%d_t' % (8*_size)] = PRIMITIVE_TYPES[_name]
- if _size == ctypes.sizeof(ctypes.c_void_p):
- PRIMITIVE_TYPES['uintptr_t'] = PRIMITIVE_TYPES[_name]
- if _size == ctypes.sizeof(ctypes.c_size_t):
- PRIMITIVE_TYPES['size_t'] = PRIMITIVE_TYPES[_name]
-
- for _name in ['long long', 'long', 'int', 'short', 'signed char']:
- _size = ctypes.sizeof(PRIMITIVE_TYPES[_name])
- PRIMITIVE_TYPES['int%d_t' % (8*_size)] = PRIMITIVE_TYPES[_name]
- if _size == ctypes.sizeof(ctypes.c_void_p):
- PRIMITIVE_TYPES['intptr_t'] = PRIMITIVE_TYPES[_name]
- PRIMITIVE_TYPES['ptrdiff_t'] = PRIMITIVE_TYPES[_name]
- if _size == ctypes.sizeof(ctypes.c_size_t):
- PRIMITIVE_TYPES['ssize_t'] = PRIMITIVE_TYPES[_name]
-
-
- def __init__(self):
- self.RTLD_LAZY = 0 # not supported anyway by ctypes
- self.RTLD_NOW = 0
- self.RTLD_GLOBAL = ctypes.RTLD_GLOBAL
- self.RTLD_LOCAL = ctypes.RTLD_LOCAL
-
- def set_ffi(self, ffi):
- self.ffi = ffi
-
- def _get_types(self):
- return CTypesData, CTypesType
-
- def load_library(self, path, flags=0):
- cdll = ctypes.CDLL(path, flags)
- return CTypesLibrary(self, cdll)
-
- def new_void_type(self):
- class CTypesVoid(CTypesData):
- __slots__ = []
- _reftypename = 'void &'
- @staticmethod
- def _from_ctypes(novalue):
- return None
- @staticmethod
- def _to_ctypes(novalue):
- if novalue is not None:
- raise TypeError("None expected, got %s object" %
- (type(novalue).__name__,))
- return None
- CTypesVoid._fix_class()
- return CTypesVoid
-
- def new_primitive_type(self, name):
- if name == 'wchar_t':
- raise NotImplementedError(name)
- ctype = self.PRIMITIVE_TYPES[name]
- if name == 'char':
- kind = 'char'
- elif name in ('float', 'double'):
- kind = 'float'
- else:
- if name in ('signed char', 'unsigned char'):
- kind = 'byte'
- elif name == '_Bool':
- kind = 'bool'
- else:
- kind = 'int'
- is_signed = (ctype(-1).value == -1)
- #
- def _cast_source_to_int(source):
- if isinstance(source, (int, long, float)):
- source = int(source)
- elif isinstance(source, CTypesData):
- source = source._cast_to_integer()
- elif isinstance(source, bytes):
- source = ord(source)
- elif source is None:
- source = 0
- else:
- raise TypeError("bad type for cast to %r: %r" %
- (CTypesPrimitive, type(source).__name__))
- return source
- #
- kind1 = kind
- class CTypesPrimitive(CTypesGenericPrimitive):
- __slots__ = ['_value']
- _ctype = ctype
- _reftypename = '%s &' % name
- kind = kind1
-
- def __init__(self, value):
- self._value = value
-
- @staticmethod
- def _create_ctype_obj(init):
- if init is None:
- return ctype()
- return ctype(CTypesPrimitive._to_ctypes(init))
-
- if kind == 'int' or kind == 'byte':
- @classmethod
- def _cast_from(cls, source):
- source = _cast_source_to_int(source)
- source = ctype(source).value # cast within range
- return cls(source)
- def __int__(self):
- return self._value
-
- if kind == 'bool':
- @classmethod
- def _cast_from(cls, source):
- if not isinstance(source, (int, long, float)):
- source = _cast_source_to_int(source)
- return cls(bool(source))
- def __int__(self):
- return self._value
-
- if kind == 'char':
- @classmethod
- def _cast_from(cls, source):
- source = _cast_source_to_int(source)
- source = bytechr(source & 0xFF)
- return cls(source)
- def __int__(self):
- return ord(self._value)
-
- if kind == 'float':
- @classmethod
- def _cast_from(cls, source):
- if isinstance(source, float):
- pass
- elif isinstance(source, CTypesGenericPrimitive):
- if hasattr(source, '__float__'):
- source = float(source)
- else:
- source = int(source)
- else:
- source = _cast_source_to_int(source)
- source = ctype(source).value # fix precision
- return cls(source)
- def __int__(self):
- return int(self._value)
- def __float__(self):
- return self._value
-
- _cast_to_integer = __int__
-
- if kind == 'int' or kind == 'byte' or kind == 'bool':
- @staticmethod
- def _to_ctypes(x):
- if not isinstance(x, (int, long)):
- if isinstance(x, CTypesData):
- x = int(x)
- else:
- raise TypeError("integer expected, got %s" %
- type(x).__name__)
- if ctype(x).value != x:
- if not is_signed and x < 0:
- raise OverflowError("%s: negative integer" % name)
- else:
- raise OverflowError("%s: integer out of bounds"
- % name)
- return x
-
- if kind == 'char':
- @staticmethod
- def _to_ctypes(x):
- if isinstance(x, bytes) and len(x) == 1:
- return x
- if isinstance(x, CTypesPrimitive): # >
- return x._value
- raise TypeError("character expected, got %s" %
- type(x).__name__)
- def __nonzero__(self):
- return ord(self._value) != 0
- else:
- def __nonzero__(self):
- return self._value != 0
- __bool__ = __nonzero__
-
- if kind == 'float':
- @staticmethod
- def _to_ctypes(x):
- if not isinstance(x, (int, long, float, CTypesData)):
- raise TypeError("float expected, got %s" %
- type(x).__name__)
- return ctype(x).value
-
- @staticmethod
- def _from_ctypes(value):
- return getattr(value, 'value', value)
-
- @staticmethod
- def _initialize(blob, init):
- blob.value = CTypesPrimitive._to_ctypes(init)
-
- if kind == 'char':
- def _to_string(self, maxlen):
- return self._value
- if kind == 'byte':
- def _to_string(self, maxlen):
- return chr(self._value & 0xff)
- #
- CTypesPrimitive._fix_class()
- return CTypesPrimitive
-
- def new_pointer_type(self, BItem):
- getbtype = self.ffi._get_cached_btype
- if BItem is getbtype(model.PrimitiveType('char')):
- kind = 'charp'
- elif BItem in (getbtype(model.PrimitiveType('signed char')),
- getbtype(model.PrimitiveType('unsigned char'))):
- kind = 'bytep'
- elif BItem is getbtype(model.void_type):
- kind = 'voidp'
- else:
- kind = 'generic'
- #
- class CTypesPtr(CTypesGenericPtr):
- __slots__ = ['_own']
- if kind == 'charp':
- __slots__ += ['__as_strbuf']
- _BItem = BItem
- if hasattr(BItem, '_ctype'):
- _ctype = ctypes.POINTER(BItem._ctype)
- _bitem_size = ctypes.sizeof(BItem._ctype)
- else:
- _ctype = ctypes.c_void_p
- if issubclass(BItem, CTypesGenericArray):
- _reftypename = BItem._get_c_name('(* &)')
- else:
- _reftypename = BItem._get_c_name(' * &')
-
- def __init__(self, init):
- ctypeobj = BItem._create_ctype_obj(init)
- if kind == 'charp':
- self.__as_strbuf = ctypes.create_string_buffer(
- ctypeobj.value + b'\x00')
- self._as_ctype_ptr = ctypes.cast(
- self.__as_strbuf, self._ctype)
- else:
- self._as_ctype_ptr = ctypes.pointer(ctypeobj)
- self._address = ctypes.cast(self._as_ctype_ptr,
- ctypes.c_void_p).value
- self._own = True
-
- def __add__(self, other):
- if isinstance(other, (int, long)):
- return self._new_pointer_at(self._address +
- other * self._bitem_size)
- else:
- return NotImplemented
-
- def __sub__(self, other):
- if isinstance(other, (int, long)):
- return self._new_pointer_at(self._address -
- other * self._bitem_size)
- elif type(self) is type(other):
- return (self._address - other._address) // self._bitem_size
- else:
- return NotImplemented
-
- def __getitem__(self, index):
- if getattr(self, '_own', False) and index != 0:
- raise IndexError
- return BItem._from_ctypes(self._as_ctype_ptr[index])
-
- def __setitem__(self, index, value):
- self._as_ctype_ptr[index] = BItem._to_ctypes(value)
-
- if kind == 'charp' or kind == 'voidp':
- @classmethod
- def _arg_to_ctypes(cls, *value):
- if value and isinstance(value[0], bytes):
- return ctypes.c_char_p(value[0])
- else:
- return super(CTypesPtr, cls)._arg_to_ctypes(*value)
-
- if kind == 'charp' or kind == 'bytep':
- def _to_string(self, maxlen):
- if maxlen < 0:
- maxlen = sys.maxsize
- p = ctypes.cast(self._as_ctype_ptr,
- ctypes.POINTER(ctypes.c_char))
- n = 0
- while n < maxlen and p[n] != b'\x00':
- n += 1
- return b''.join([p[i] for i in range(n)])
-
- def _get_own_repr(self):
- if getattr(self, '_own', False):
- return 'owning %d bytes' % (
- ctypes.sizeof(self._as_ctype_ptr.contents),)
- return super(CTypesPtr, self)._get_own_repr()
- #
- if (BItem is self.ffi._get_cached_btype(model.void_type) or
- BItem is self.ffi._get_cached_btype(model.PrimitiveType('char'))):
- CTypesPtr._automatic_casts = True
- #
- CTypesPtr._fix_class()
- return CTypesPtr
-
- def new_array_type(self, CTypesPtr, length):
- if length is None:
- brackets = ' &[]'
- else:
- brackets = ' &[%d]' % length
- BItem = CTypesPtr._BItem
- getbtype = self.ffi._get_cached_btype
- if BItem is getbtype(model.PrimitiveType('char')):
- kind = 'char'
- elif BItem in (getbtype(model.PrimitiveType('signed char')),
- getbtype(model.PrimitiveType('unsigned char'))):
- kind = 'byte'
- else:
- kind = 'generic'
- #
- class CTypesArray(CTypesGenericArray):
- __slots__ = ['_blob', '_own']
- if length is not None:
- _ctype = BItem._ctype * length
- else:
- __slots__.append('_ctype')
- _reftypename = BItem._get_c_name(brackets)
- _declared_length = length
- _CTPtr = CTypesPtr
-
- def __init__(self, init):
- if length is None:
- if isinstance(init, (int, long)):
- len1 = init
- init = None
- elif kind == 'char' and isinstance(init, bytes):
- len1 = len(init) + 1 # extra null
- else:
- init = tuple(init)
- len1 = len(init)
- self._ctype = BItem._ctype * len1
- self._blob = self._ctype()
- self._own = True
- if init is not None:
- self._initialize(self._blob, init)
-
- @staticmethod
- def _initialize(blob, init):
- if isinstance(init, bytes):
- init = [init[i:i+1] for i in range(len(init))]
- else:
- init = tuple(init)
- if len(init) > len(blob):
- raise IndexError("too many initializers")
- addr = ctypes.cast(blob, ctypes.c_void_p).value
- PTR = ctypes.POINTER(BItem._ctype)
- itemsize = ctypes.sizeof(BItem._ctype)
- for i, value in enumerate(init):
- p = ctypes.cast(addr + i * itemsize, PTR)
- BItem._initialize(p.contents, value)
-
- def __len__(self):
- return len(self._blob)
-
- def __getitem__(self, index):
- if not (0 <= index < len(self._blob)):
- raise IndexError
- return BItem._from_ctypes(self._blob[index])
-
- def __setitem__(self, index, value):
- if not (0 <= index < len(self._blob)):
- raise IndexError
- self._blob[index] = BItem._to_ctypes(value)
-
- if kind == 'char' or kind == 'byte':
- def _to_string(self, maxlen):
- if maxlen < 0:
- maxlen = len(self._blob)
- p = ctypes.cast(self._blob,
- ctypes.POINTER(ctypes.c_char))
- n = 0
- while n < maxlen and p[n] != b'\x00':
- n += 1
- return b''.join([p[i] for i in range(n)])
-
- def _get_own_repr(self):
- if getattr(self, '_own', False):
- return 'owning %d bytes' % (ctypes.sizeof(self._blob),)
- return super(CTypesArray, self)._get_own_repr()
-
- def _convert_to_address(self, BClass):
- if BClass in (CTypesPtr, None) or BClass._automatic_casts:
- return ctypes.addressof(self._blob)
- else:
- return CTypesData._convert_to_address(self, BClass)
-
- @staticmethod
- def _from_ctypes(ctypes_array):
- self = CTypesArray.__new__(CTypesArray)
- self._blob = ctypes_array
- return self
-
- @staticmethod
- def _arg_to_ctypes(value):
- return CTypesPtr._arg_to_ctypes(value)
-
- def __add__(self, other):
- if isinstance(other, (int, long)):
- return CTypesPtr._new_pointer_at(
- ctypes.addressof(self._blob) +
- other * ctypes.sizeof(BItem._ctype))
- else:
- return NotImplemented
-
- @classmethod
- def _cast_from(cls, source):
- raise NotImplementedError("casting to %r" % (
- cls._get_c_name(),))
- #
- CTypesArray._fix_class()
- return CTypesArray
-
- def _new_struct_or_union(self, kind, name, base_ctypes_class):
- #
- class struct_or_union(base_ctypes_class):
- pass
- struct_or_union.__name__ = '%s_%s' % (kind, name)
- kind1 = kind
- #
- class CTypesStructOrUnion(CTypesBaseStructOrUnion):
- __slots__ = ['_blob']
- _ctype = struct_or_union
- _reftypename = '%s &' % (name,)
- _kind = kind = kind1
- #
- CTypesStructOrUnion._fix_class()
- return CTypesStructOrUnion
-
- def new_struct_type(self, name):
- return self._new_struct_or_union('struct', name, ctypes.Structure)
-
- def new_union_type(self, name):
- return self._new_struct_or_union('union', name, ctypes.Union)
-
- def complete_struct_or_union(self, CTypesStructOrUnion, fields, tp,
- totalsize=-1, totalalignment=-1, sflags=0):
- if totalsize >= 0 or totalalignment >= 0:
- raise NotImplementedError("the ctypes backend of CFFI does not support "
- "structures completed by verify(); please "
- "compile and install the _cffi_backend module.")
- struct_or_union = CTypesStructOrUnion._ctype
- fnames = [fname for (fname, BField, bitsize) in fields]
- btypes = [BField for (fname, BField, bitsize) in fields]
- bitfields = [bitsize for (fname, BField, bitsize) in fields]
- #
- bfield_types = {}
- cfields = []
- for (fname, BField, bitsize) in fields:
- if bitsize < 0:
- cfields.append((fname, BField._ctype))
- bfield_types[fname] = BField
- else:
- cfields.append((fname, BField._ctype, bitsize))
- bfield_types[fname] = Ellipsis
- if sflags & 8:
- struct_or_union._pack_ = 1
- struct_or_union._fields_ = cfields
- CTypesStructOrUnion._bfield_types = bfield_types
- #
- @staticmethod
- def _create_ctype_obj(init):
- result = struct_or_union()
- if init is not None:
- initialize(result, init)
- return result
- CTypesStructOrUnion._create_ctype_obj = _create_ctype_obj
- #
- def initialize(blob, init):
- if is_union:
- if len(init) > 1:
- raise ValueError("union initializer: %d items given, but "
- "only one supported (use a dict if needed)"
- % (len(init),))
- if not isinstance(init, dict):
- if isinstance(init, (bytes, unicode)):
- raise TypeError("union initializer: got a str")
- init = tuple(init)
- if len(init) > len(fnames):
- raise ValueError("too many values for %s initializer" %
- CTypesStructOrUnion._get_c_name())
- init = dict(zip(fnames, init))
- addr = ctypes.addressof(blob)
- for fname, value in init.items():
- BField, bitsize = name2fieldtype[fname]
- assert bitsize < 0, \
- "not implemented: initializer with bit fields"
- offset = CTypesStructOrUnion._offsetof(fname)
- PTR = ctypes.POINTER(BField._ctype)
- p = ctypes.cast(addr + offset, PTR)
- BField._initialize(p.contents, value)
- is_union = CTypesStructOrUnion._kind == 'union'
- name2fieldtype = dict(zip(fnames, zip(btypes, bitfields)))
- #
- for fname, BField, bitsize in fields:
- if fname == '':
- raise NotImplementedError("nested anonymous structs/unions")
- if hasattr(CTypesStructOrUnion, fname):
- raise ValueError("the field name %r conflicts in "
- "the ctypes backend" % fname)
- if bitsize < 0:
- def getter(self, fname=fname, BField=BField,
- offset=CTypesStructOrUnion._offsetof(fname),
- PTR=ctypes.POINTER(BField._ctype)):
- addr = ctypes.addressof(self._blob)
- p = ctypes.cast(addr + offset, PTR)
- return BField._from_ctypes(p.contents)
- def setter(self, value, fname=fname, BField=BField):
- setattr(self._blob, fname, BField._to_ctypes(value))
- #
- if issubclass(BField, CTypesGenericArray):
- setter = None
- if BField._declared_length == 0:
- def getter(self, fname=fname, BFieldPtr=BField._CTPtr,
- offset=CTypesStructOrUnion._offsetof(fname),
- PTR=ctypes.POINTER(BField._ctype)):
- addr = ctypes.addressof(self._blob)
- p = ctypes.cast(addr + offset, PTR)
- return BFieldPtr._from_ctypes(p)
- #
- else:
- def getter(self, fname=fname, BField=BField):
- return BField._from_ctypes(getattr(self._blob, fname))
- def setter(self, value, fname=fname, BField=BField):
- # xxx obscure workaround
- value = BField._to_ctypes(value)
- oldvalue = getattr(self._blob, fname)
- setattr(self._blob, fname, value)
- if value != getattr(self._blob, fname):
- setattr(self._blob, fname, oldvalue)
- raise OverflowError("value too large for bitfield")
- setattr(CTypesStructOrUnion, fname, property(getter, setter))
- #
- CTypesPtr = self.ffi._get_cached_btype(model.PointerType(tp))
- for fname in fnames:
- if hasattr(CTypesPtr, fname):
- raise ValueError("the field name %r conflicts in "
- "the ctypes backend" % fname)
- def getter(self, fname=fname):
- return getattr(self[0], fname)
- def setter(self, value, fname=fname):
- setattr(self[0], fname, value)
- setattr(CTypesPtr, fname, property(getter, setter))
-
- def new_function_type(self, BArgs, BResult, has_varargs):
- nameargs = [BArg._get_c_name() for BArg in BArgs]
- if has_varargs:
- nameargs.append('...')
- nameargs = ', '.join(nameargs)
- #
- class CTypesFunctionPtr(CTypesGenericPtr):
- __slots__ = ['_own_callback', '_name']
- _ctype = ctypes.CFUNCTYPE(getattr(BResult, '_ctype', None),
- *[BArg._ctype for BArg in BArgs],
- use_errno=True)
- _reftypename = BResult._get_c_name('(* &)(%s)' % (nameargs,))
-
- def __init__(self, init, error=None):
- # create a callback to the Python callable init()
- import traceback
- assert not has_varargs, "varargs not supported for callbacks"
- if getattr(BResult, '_ctype', None) is not None:
- error = BResult._from_ctypes(
- BResult._create_ctype_obj(error))
- else:
- error = None
- def callback(*args):
- args2 = []
- for arg, BArg in zip(args, BArgs):
- args2.append(BArg._from_ctypes(arg))
- try:
- res2 = init(*args2)
- res2 = BResult._to_ctypes(res2)
- except:
- traceback.print_exc()
- res2 = error
- if issubclass(BResult, CTypesGenericPtr):
- if res2:
- res2 = ctypes.cast(res2, ctypes.c_void_p).value
- # .value: http://bugs.python.org/issue1574593
- else:
- res2 = None
- #print repr(res2)
- return res2
- if issubclass(BResult, CTypesGenericPtr):
- # The only pointers callbacks can return are void*s:
- # http://bugs.python.org/issue5710
- callback_ctype = ctypes.CFUNCTYPE(
- ctypes.c_void_p,
- *[BArg._ctype for BArg in BArgs],
- use_errno=True)
- else:
- callback_ctype = CTypesFunctionPtr._ctype
- self._as_ctype_ptr = callback_ctype(callback)
- self._address = ctypes.cast(self._as_ctype_ptr,
- ctypes.c_void_p).value
- self._own_callback = init
-
- @staticmethod
- def _initialize(ctypes_ptr, value):
- if value:
- raise NotImplementedError("ctypes backend: not supported: "
- "initializers for function pointers")
-
- def __repr__(self):
- c_name = getattr(self, '_name', None)
- if c_name:
- i = self._reftypename.index('(* &)')
- if self._reftypename[i-1] not in ' )*':
- c_name = ' ' + c_name
- c_name = self._reftypename.replace('(* &)', c_name)
- return CTypesData.__repr__(self, c_name)
-
- def _get_own_repr(self):
- if getattr(self, '_own_callback', None) is not None:
- return 'calling %r' % (self._own_callback,)
- return super(CTypesFunctionPtr, self)._get_own_repr()
-
- def __call__(self, *args):
- if has_varargs:
- assert len(args) >= len(BArgs)
- extraargs = args[len(BArgs):]
- args = args[:len(BArgs)]
- else:
- assert len(args) == len(BArgs)
- ctypes_args = []
- for arg, BArg in zip(args, BArgs):
- ctypes_args.append(BArg._arg_to_ctypes(arg))
- if has_varargs:
- for i, arg in enumerate(extraargs):
- if arg is None:
- ctypes_args.append(ctypes.c_void_p(0)) # NULL
- continue
- if not isinstance(arg, CTypesData):
- raise TypeError(
- "argument %d passed in the variadic part "
- "needs to be a cdata object (got %s)" %
- (1 + len(BArgs) + i, type(arg).__name__))
- ctypes_args.append(arg._arg_to_ctypes(arg))
- result = self._as_ctype_ptr(*ctypes_args)
- return BResult._from_ctypes(result)
- #
- CTypesFunctionPtr._fix_class()
- return CTypesFunctionPtr
-
- def new_enum_type(self, name, enumerators, enumvalues, CTypesInt):
- assert isinstance(name, str)
- reverse_mapping = dict(zip(reversed(enumvalues),
- reversed(enumerators)))
- #
- class CTypesEnum(CTypesInt):
- __slots__ = []
- _reftypename = '%s &' % name
-
- def _get_own_repr(self):
- value = self._value
- try:
- return '%d: %s' % (value, reverse_mapping[value])
- except KeyError:
- return str(value)
-
- def _to_string(self, maxlen):
- value = self._value
- try:
- return reverse_mapping[value]
- except KeyError:
- return str(value)
- #
- CTypesEnum._fix_class()
- return CTypesEnum
-
- def get_errno(self):
- return ctypes.get_errno()
-
- def set_errno(self, value):
- ctypes.set_errno(value)
-
- def string(self, b, maxlen=-1):
- return b._to_string(maxlen)
-
- def buffer(self, bptr, size=-1):
- raise NotImplementedError("buffer() with ctypes backend")
-
- def sizeof(self, cdata_or_BType):
- if isinstance(cdata_or_BType, CTypesData):
- return cdata_or_BType._get_size_of_instance()
- else:
- assert issubclass(cdata_or_BType, CTypesData)
- return cdata_or_BType._get_size()
-
- def alignof(self, BType):
- assert issubclass(BType, CTypesData)
- return BType._alignment()
-
- def newp(self, BType, source):
- if not issubclass(BType, CTypesData):
- raise TypeError
- return BType._newp(source)
-
- def cast(self, BType, source):
- return BType._cast_from(source)
-
- def callback(self, BType, source, error, onerror):
- assert onerror is None # XXX not implemented
- return BType(source, error)
-
- _weakref_cache_ref = None
-
- def gcp(self, cdata, destructor, size=0):
- if self._weakref_cache_ref is None:
- import weakref
- class MyRef(weakref.ref):
- def __eq__(self, other):
- myref = self()
- return self is other or (
- myref is not None and myref is other())
- def __ne__(self, other):
- return not (self == other)
- def __hash__(self):
- try:
- return self._hash
- except AttributeError:
- self._hash = hash(self())
- return self._hash
- self._weakref_cache_ref = {}, MyRef
- weak_cache, MyRef = self._weakref_cache_ref
-
- if destructor is None:
- try:
- del weak_cache[MyRef(cdata)]
- except KeyError:
- raise TypeError("Can remove destructor only on a object "
- "previously returned by ffi.gc()")
- return None
-
- def remove(k):
- cdata, destructor = weak_cache.pop(k, (None, None))
- if destructor is not None:
- destructor(cdata)
-
- new_cdata = self.cast(self.typeof(cdata), cdata)
- assert new_cdata is not cdata
- weak_cache[MyRef(new_cdata, remove)] = (cdata, destructor)
- return new_cdata
-
- typeof = type
-
- def getcname(self, BType, replace_with):
- return BType._get_c_name(replace_with)
-
- def typeoffsetof(self, BType, fieldname, num=0):
- if isinstance(fieldname, str):
- if num == 0 and issubclass(BType, CTypesGenericPtr):
- BType = BType._BItem
- if not issubclass(BType, CTypesBaseStructOrUnion):
- raise TypeError("expected a struct or union ctype")
- BField = BType._bfield_types[fieldname]
- if BField is Ellipsis:
- raise TypeError("not supported for bitfields")
- return (BField, BType._offsetof(fieldname))
- elif isinstance(fieldname, (int, long)):
- if issubclass(BType, CTypesGenericArray):
- BType = BType._CTPtr
- if not issubclass(BType, CTypesGenericPtr):
- raise TypeError("expected an array or ptr ctype")
- BItem = BType._BItem
- offset = BItem._get_size() * fieldname
- if offset > sys.maxsize:
- raise OverflowError
- return (BItem, offset)
- else:
- raise TypeError(type(fieldname))
-
- def rawaddressof(self, BTypePtr, cdata, offset=None):
- if isinstance(cdata, CTypesBaseStructOrUnion):
- ptr = ctypes.pointer(type(cdata)._to_ctypes(cdata))
- elif isinstance(cdata, CTypesGenericPtr):
- if offset is None or not issubclass(type(cdata)._BItem,
- CTypesBaseStructOrUnion):
- raise TypeError("unexpected cdata type")
- ptr = type(cdata)._to_ctypes(cdata)
- elif isinstance(cdata, CTypesGenericArray):
- ptr = type(cdata)._to_ctypes(cdata)
- else:
- raise TypeError("expected a ")
- if offset:
- ptr = ctypes.cast(
- ctypes.c_void_p(
- ctypes.cast(ptr, ctypes.c_void_p).value + offset),
- type(ptr))
- return BTypePtr._from_ctypes(ptr)
-
-
-class CTypesLibrary(object):
-
- def __init__(self, backend, cdll):
- self.backend = backend
- self.cdll = cdll
-
- def load_function(self, BType, name):
- c_func = getattr(self.cdll, name)
- funcobj = BType._from_ctypes(c_func)
- funcobj._name = name
- return funcobj
-
- def read_variable(self, BType, name):
- try:
- ctypes_obj = BType._ctype.in_dll(self.cdll, name)
- except AttributeError as e:
- raise NotImplementedError(e)
- return BType._from_ctypes(ctypes_obj)
-
- def write_variable(self, BType, name, value):
- new_ctypes_obj = BType._to_ctypes(value)
- ctypes_obj = BType._ctype.in_dll(self.cdll, name)
- ctypes.memmove(ctypes.addressof(ctypes_obj),
- ctypes.addressof(new_ctypes_obj),
- ctypes.sizeof(BType._ctype))
diff --git a/lib/cffi/cffi_opcode.py b/lib/cffi/cffi_opcode.py
deleted file mode 100644
index a0df98d1c7..0000000000
--- a/lib/cffi/cffi_opcode.py
+++ /dev/null
@@ -1,187 +0,0 @@
-from .error import VerificationError
-
-class CffiOp(object):
- def __init__(self, op, arg):
- self.op = op
- self.arg = arg
-
- def as_c_expr(self):
- if self.op is None:
- assert isinstance(self.arg, str)
- return '(_cffi_opcode_t)(%s)' % (self.arg,)
- classname = CLASS_NAME[self.op]
- return '_CFFI_OP(_CFFI_OP_%s, %s)' % (classname, self.arg)
-
- def as_python_bytes(self):
- if self.op is None and self.arg.isdigit():
- value = int(self.arg) # non-negative: '-' not in self.arg
- if value >= 2**31:
- raise OverflowError("cannot emit %r: limited to 2**31-1"
- % (self.arg,))
- return format_four_bytes(value)
- if isinstance(self.arg, str):
- raise VerificationError("cannot emit to Python: %r" % (self.arg,))
- return format_four_bytes((self.arg << 8) | self.op)
-
- def __str__(self):
- classname = CLASS_NAME.get(self.op, self.op)
- return '(%s %s)' % (classname, self.arg)
-
-def format_four_bytes(num):
- return '\\x%02X\\x%02X\\x%02X\\x%02X' % (
- (num >> 24) & 0xFF,
- (num >> 16) & 0xFF,
- (num >> 8) & 0xFF,
- (num ) & 0xFF)
-
-OP_PRIMITIVE = 1
-OP_POINTER = 3
-OP_ARRAY = 5
-OP_OPEN_ARRAY = 7
-OP_STRUCT_UNION = 9
-OP_ENUM = 11
-OP_FUNCTION = 13
-OP_FUNCTION_END = 15
-OP_NOOP = 17
-OP_BITFIELD = 19
-OP_TYPENAME = 21
-OP_CPYTHON_BLTN_V = 23 # varargs
-OP_CPYTHON_BLTN_N = 25 # noargs
-OP_CPYTHON_BLTN_O = 27 # O (i.e. a single arg)
-OP_CONSTANT = 29
-OP_CONSTANT_INT = 31
-OP_GLOBAL_VAR = 33
-OP_DLOPEN_FUNC = 35
-OP_DLOPEN_CONST = 37
-OP_GLOBAL_VAR_F = 39
-OP_EXTERN_PYTHON = 41
-
-PRIM_VOID = 0
-PRIM_BOOL = 1
-PRIM_CHAR = 2
-PRIM_SCHAR = 3
-PRIM_UCHAR = 4
-PRIM_SHORT = 5
-PRIM_USHORT = 6
-PRIM_INT = 7
-PRIM_UINT = 8
-PRIM_LONG = 9
-PRIM_ULONG = 10
-PRIM_LONGLONG = 11
-PRIM_ULONGLONG = 12
-PRIM_FLOAT = 13
-PRIM_DOUBLE = 14
-PRIM_LONGDOUBLE = 15
-
-PRIM_WCHAR = 16
-PRIM_INT8 = 17
-PRIM_UINT8 = 18
-PRIM_INT16 = 19
-PRIM_UINT16 = 20
-PRIM_INT32 = 21
-PRIM_UINT32 = 22
-PRIM_INT64 = 23
-PRIM_UINT64 = 24
-PRIM_INTPTR = 25
-PRIM_UINTPTR = 26
-PRIM_PTRDIFF = 27
-PRIM_SIZE = 28
-PRIM_SSIZE = 29
-PRIM_INT_LEAST8 = 30
-PRIM_UINT_LEAST8 = 31
-PRIM_INT_LEAST16 = 32
-PRIM_UINT_LEAST16 = 33
-PRIM_INT_LEAST32 = 34
-PRIM_UINT_LEAST32 = 35
-PRIM_INT_LEAST64 = 36
-PRIM_UINT_LEAST64 = 37
-PRIM_INT_FAST8 = 38
-PRIM_UINT_FAST8 = 39
-PRIM_INT_FAST16 = 40
-PRIM_UINT_FAST16 = 41
-PRIM_INT_FAST32 = 42
-PRIM_UINT_FAST32 = 43
-PRIM_INT_FAST64 = 44
-PRIM_UINT_FAST64 = 45
-PRIM_INTMAX = 46
-PRIM_UINTMAX = 47
-PRIM_FLOATCOMPLEX = 48
-PRIM_DOUBLECOMPLEX = 49
-PRIM_CHAR16 = 50
-PRIM_CHAR32 = 51
-
-_NUM_PRIM = 52
-_UNKNOWN_PRIM = -1
-_UNKNOWN_FLOAT_PRIM = -2
-_UNKNOWN_LONG_DOUBLE = -3
-
-_IO_FILE_STRUCT = -1
-
-PRIMITIVE_TO_INDEX = {
- 'char': PRIM_CHAR,
- 'short': PRIM_SHORT,
- 'int': PRIM_INT,
- 'long': PRIM_LONG,
- 'long long': PRIM_LONGLONG,
- 'signed char': PRIM_SCHAR,
- 'unsigned char': PRIM_UCHAR,
- 'unsigned short': PRIM_USHORT,
- 'unsigned int': PRIM_UINT,
- 'unsigned long': PRIM_ULONG,
- 'unsigned long long': PRIM_ULONGLONG,
- 'float': PRIM_FLOAT,
- 'double': PRIM_DOUBLE,
- 'long double': PRIM_LONGDOUBLE,
- 'float _Complex': PRIM_FLOATCOMPLEX,
- 'double _Complex': PRIM_DOUBLECOMPLEX,
- '_Bool': PRIM_BOOL,
- 'wchar_t': PRIM_WCHAR,
- 'char16_t': PRIM_CHAR16,
- 'char32_t': PRIM_CHAR32,
- 'int8_t': PRIM_INT8,
- 'uint8_t': PRIM_UINT8,
- 'int16_t': PRIM_INT16,
- 'uint16_t': PRIM_UINT16,
- 'int32_t': PRIM_INT32,
- 'uint32_t': PRIM_UINT32,
- 'int64_t': PRIM_INT64,
- 'uint64_t': PRIM_UINT64,
- 'intptr_t': PRIM_INTPTR,
- 'uintptr_t': PRIM_UINTPTR,
- 'ptrdiff_t': PRIM_PTRDIFF,
- 'size_t': PRIM_SIZE,
- 'ssize_t': PRIM_SSIZE,
- 'int_least8_t': PRIM_INT_LEAST8,
- 'uint_least8_t': PRIM_UINT_LEAST8,
- 'int_least16_t': PRIM_INT_LEAST16,
- 'uint_least16_t': PRIM_UINT_LEAST16,
- 'int_least32_t': PRIM_INT_LEAST32,
- 'uint_least32_t': PRIM_UINT_LEAST32,
- 'int_least64_t': PRIM_INT_LEAST64,
- 'uint_least64_t': PRIM_UINT_LEAST64,
- 'int_fast8_t': PRIM_INT_FAST8,
- 'uint_fast8_t': PRIM_UINT_FAST8,
- 'int_fast16_t': PRIM_INT_FAST16,
- 'uint_fast16_t': PRIM_UINT_FAST16,
- 'int_fast32_t': PRIM_INT_FAST32,
- 'uint_fast32_t': PRIM_UINT_FAST32,
- 'int_fast64_t': PRIM_INT_FAST64,
- 'uint_fast64_t': PRIM_UINT_FAST64,
- 'intmax_t': PRIM_INTMAX,
- 'uintmax_t': PRIM_UINTMAX,
- }
-
-F_UNION = 0x01
-F_CHECK_FIELDS = 0x02
-F_PACKED = 0x04
-F_EXTERNAL = 0x08
-F_OPAQUE = 0x10
-
-G_FLAGS = dict([('_CFFI_' + _key, globals()[_key])
- for _key in ['F_UNION', 'F_CHECK_FIELDS', 'F_PACKED',
- 'F_EXTERNAL', 'F_OPAQUE']])
-
-CLASS_NAME = {}
-for _name, _value in list(globals().items()):
- if _name.startswith('OP_') and isinstance(_value, int):
- CLASS_NAME[_value] = _name[3:]
diff --git a/lib/cffi/commontypes.py b/lib/cffi/commontypes.py
deleted file mode 100644
index 8ec97c756a..0000000000
--- a/lib/cffi/commontypes.py
+++ /dev/null
@@ -1,80 +0,0 @@
-import sys
-from . import model
-from .error import FFIError
-
-
-COMMON_TYPES = {}
-
-try:
- # fetch "bool" and all simple Windows types
- from _cffi_backend import _get_common_types
- _get_common_types(COMMON_TYPES)
-except ImportError:
- pass
-
-COMMON_TYPES['FILE'] = model.unknown_type('FILE', '_IO_FILE')
-COMMON_TYPES['bool'] = '_Bool' # in case we got ImportError above
-
-for _type in model.PrimitiveType.ALL_PRIMITIVE_TYPES:
- if _type.endswith('_t'):
- COMMON_TYPES[_type] = _type
-del _type
-
-_CACHE = {}
-
-def resolve_common_type(parser, commontype):
- try:
- return _CACHE[commontype]
- except KeyError:
- cdecl = COMMON_TYPES.get(commontype, commontype)
- if not isinstance(cdecl, str):
- result, quals = cdecl, 0 # cdecl is already a BaseType
- elif cdecl in model.PrimitiveType.ALL_PRIMITIVE_TYPES:
- result, quals = model.PrimitiveType(cdecl), 0
- elif cdecl == 'set-unicode-needed':
- raise FFIError("The Windows type %r is only available after "
- "you call ffi.set_unicode()" % (commontype,))
- else:
- if commontype == cdecl:
- raise FFIError(
- "Unsupported type: %r. Please look at "
- "http://cffi.readthedocs.io/en/latest/cdef.html#ffi-cdef-limitations "
- "and file an issue if you think this type should really "
- "be supported." % (commontype,))
- result, quals = parser.parse_type_and_quals(cdecl) # recursive
-
- assert isinstance(result, model.BaseTypeByIdentity)
- _CACHE[commontype] = result, quals
- return result, quals
-
-
-# ____________________________________________________________
-# extra types for Windows (most of them are in commontypes.c)
-
-
-def win_common_types():
- return {
- "UNICODE_STRING": model.StructType(
- "_UNICODE_STRING",
- ["Length",
- "MaximumLength",
- "Buffer"],
- [model.PrimitiveType("unsigned short"),
- model.PrimitiveType("unsigned short"),
- model.PointerType(model.PrimitiveType("wchar_t"))],
- [-1, -1, -1]),
- "PUNICODE_STRING": "UNICODE_STRING *",
- "PCUNICODE_STRING": "const UNICODE_STRING *",
-
- "TBYTE": "set-unicode-needed",
- "TCHAR": "set-unicode-needed",
- "LPCTSTR": "set-unicode-needed",
- "PCTSTR": "set-unicode-needed",
- "LPTSTR": "set-unicode-needed",
- "PTSTR": "set-unicode-needed",
- "PTBYTE": "set-unicode-needed",
- "PTCHAR": "set-unicode-needed",
- }
-
-if sys.platform == 'win32':
- COMMON_TYPES.update(win_common_types())
diff --git a/lib/cffi/cparser.py b/lib/cffi/cparser.py
deleted file mode 100644
index f7e2e35634..0000000000
--- a/lib/cffi/cparser.py
+++ /dev/null
@@ -1,891 +0,0 @@
-from . import model
-from .commontypes import COMMON_TYPES, resolve_common_type
-from .error import FFIError, CDefError
-try:
- from . import _pycparser as pycparser
-except ImportError:
- import pycparser
-import weakref, re, sys
-
-try:
- if sys.version_info < (3,):
- import thread as _thread
- else:
- import _thread
- lock = _thread.allocate_lock()
-except ImportError:
- lock = None
-
-CDEF_SOURCE_STRING = ""
-_r_comment = re.compile(r"/\*.*?\*/|//([^\n\\]|\\.)*?$",
- re.DOTALL | re.MULTILINE)
-_r_define = re.compile(r"^\s*#\s*define\s+([A-Za-z_][A-Za-z_0-9]*)"
- r"\b((?:[^\n\\]|\\.)*?)$",
- re.DOTALL | re.MULTILINE)
-_r_partial_enum = re.compile(r"=\s*\.\.\.\s*[,}]|\.\.\.\s*\}")
-_r_enum_dotdotdot = re.compile(r"__dotdotdot\d+__$")
-_r_partial_array = re.compile(r"\[\s*\.\.\.\s*\]")
-_r_words = re.compile(r"\w+|\S")
-_parser_cache = None
-_r_int_literal = re.compile(r"-?0?x?[0-9a-f]+[lu]*$", re.IGNORECASE)
-_r_stdcall1 = re.compile(r"\b(__stdcall|WINAPI)\b")
-_r_stdcall2 = re.compile(r"[(]\s*(__stdcall|WINAPI)\b")
-_r_cdecl = re.compile(r"\b__cdecl\b")
-_r_extern_python = re.compile(r'\bextern\s*"'
- r'(Python|Python\s*\+\s*C|C\s*\+\s*Python)"\s*.')
-_r_star_const_space = re.compile( # matches "* const "
- r"[*]\s*((const|volatile|restrict)\b\s*)+")
-_r_int_dotdotdot = re.compile(r"(\b(int|long|short|signed|unsigned|char)\s*)+"
- r"\.\.\.")
-_r_float_dotdotdot = re.compile(r"\b(double|float)\s*\.\.\.")
-
-def _get_parser():
- global _parser_cache
- if _parser_cache is None:
- _parser_cache = pycparser.CParser()
- return _parser_cache
-
-def _workaround_for_old_pycparser(csource):
- # Workaround for a pycparser issue (fixed between pycparser 2.10 and
- # 2.14): "char*const***" gives us a wrong syntax tree, the same as
- # for "char***(*const)". This means we can't tell the difference
- # afterwards. But "char(*const(***))" gives us the right syntax
- # tree. The issue only occurs if there are several stars in
- # sequence with no parenthesis inbetween, just possibly qualifiers.
- # Attempt to fix it by adding some parentheses in the source: each
- # time we see "* const" or "* const *", we add an opening
- # parenthesis before each star---the hard part is figuring out where
- # to close them.
- parts = []
- while True:
- match = _r_star_const_space.search(csource)
- if not match:
- break
- #print repr(''.join(parts)+csource), '=>',
- parts.append(csource[:match.start()])
- parts.append('('); closing = ')'
- parts.append(match.group()) # e.g. "* const "
- endpos = match.end()
- if csource.startswith('*', endpos):
- parts.append('('); closing += ')'
- level = 0
- i = endpos
- while i < len(csource):
- c = csource[i]
- if c == '(':
- level += 1
- elif c == ')':
- if level == 0:
- break
- level -= 1
- elif c in ',;=':
- if level == 0:
- break
- i += 1
- csource = csource[endpos:i] + closing + csource[i:]
- #print repr(''.join(parts)+csource)
- parts.append(csource)
- return ''.join(parts)
-
-def _preprocess_extern_python(csource):
- # input: `extern "Python" int foo(int);` or
- # `extern "Python" { int foo(int); }`
- # output:
- # void __cffi_extern_python_start;
- # int foo(int);
- # void __cffi_extern_python_stop;
- #
- # input: `extern "Python+C" int foo(int);`
- # output:
- # void __cffi_extern_python_plus_c_start;
- # int foo(int);
- # void __cffi_extern_python_stop;
- parts = []
- while True:
- match = _r_extern_python.search(csource)
- if not match:
- break
- endpos = match.end() - 1
- #print
- #print ''.join(parts)+csource
- #print '=>'
- parts.append(csource[:match.start()])
- if 'C' in match.group(1):
- parts.append('void __cffi_extern_python_plus_c_start; ')
- else:
- parts.append('void __cffi_extern_python_start; ')
- if csource[endpos] == '{':
- # grouping variant
- closing = csource.find('}', endpos)
- if closing < 0:
- raise CDefError("'extern \"Python\" {': no '}' found")
- if csource.find('{', endpos + 1, closing) >= 0:
- raise NotImplementedError("cannot use { } inside a block "
- "'extern \"Python\" { ... }'")
- parts.append(csource[endpos+1:closing])
- csource = csource[closing+1:]
- else:
- # non-grouping variant
- semicolon = csource.find(';', endpos)
- if semicolon < 0:
- raise CDefError("'extern \"Python\": no ';' found")
- parts.append(csource[endpos:semicolon+1])
- csource = csource[semicolon+1:]
- parts.append(' void __cffi_extern_python_stop;')
- #print ''.join(parts)+csource
- #print
- parts.append(csource)
- return ''.join(parts)
-
-def _preprocess(csource):
- # Remove comments. NOTE: this only work because the cdef() section
- # should not contain any string literal!
- csource = _r_comment.sub(' ', csource)
- # Remove the "#define FOO x" lines
- macros = {}
- for match in _r_define.finditer(csource):
- macroname, macrovalue = match.groups()
- macrovalue = macrovalue.replace('\\\n', '').strip()
- macros[macroname] = macrovalue
- csource = _r_define.sub('', csource)
- #
- if pycparser.__version__ < '2.14':
- csource = _workaround_for_old_pycparser(csource)
- #
- # BIG HACK: replace WINAPI or __stdcall with "volatile const".
- # It doesn't make sense for the return type of a function to be
- # "volatile volatile const", so we abuse it to detect __stdcall...
- # Hack number 2 is that "int(volatile *fptr)();" is not valid C
- # syntax, so we place the "volatile" before the opening parenthesis.
- csource = _r_stdcall2.sub(' volatile volatile const(', csource)
- csource = _r_stdcall1.sub(' volatile volatile const ', csource)
- csource = _r_cdecl.sub(' ', csource)
- #
- # Replace `extern "Python"` with start/end markers
- csource = _preprocess_extern_python(csource)
- #
- # Replace "[...]" with "[__dotdotdotarray__]"
- csource = _r_partial_array.sub('[__dotdotdotarray__]', csource)
- #
- # Replace "...}" with "__dotdotdotNUM__}". This construction should
- # occur only at the end of enums; at the end of structs we have "...;}"
- # and at the end of vararg functions "...);". Also replace "=...[,}]"
- # with ",__dotdotdotNUM__[,}]": this occurs in the enums too, when
- # giving an unknown value.
- matches = list(_r_partial_enum.finditer(csource))
- for number, match in enumerate(reversed(matches)):
- p = match.start()
- if csource[p] == '=':
- p2 = csource.find('...', p, match.end())
- assert p2 > p
- csource = '%s,__dotdotdot%d__ %s' % (csource[:p], number,
- csource[p2+3:])
- else:
- assert csource[p:p+3] == '...'
- csource = '%s __dotdotdot%d__ %s' % (csource[:p], number,
- csource[p+3:])
- # Replace "int ..." or "unsigned long int..." with "__dotdotdotint__"
- csource = _r_int_dotdotdot.sub(' __dotdotdotint__ ', csource)
- # Replace "float ..." or "double..." with "__dotdotdotfloat__"
- csource = _r_float_dotdotdot.sub(' __dotdotdotfloat__ ', csource)
- # Replace all remaining "..." with the same name, "__dotdotdot__",
- # which is declared with a typedef for the purpose of C parsing.
- return csource.replace('...', ' __dotdotdot__ '), macros
-
-def _common_type_names(csource):
- # Look in the source for what looks like usages of types from the
- # list of common types. A "usage" is approximated here as the
- # appearance of the word, minus a "definition" of the type, which
- # is the last word in a "typedef" statement. Approximative only
- # but should be fine for all the common types.
- look_for_words = set(COMMON_TYPES)
- look_for_words.add(';')
- look_for_words.add(',')
- look_for_words.add('(')
- look_for_words.add(')')
- look_for_words.add('typedef')
- words_used = set()
- is_typedef = False
- paren = 0
- previous_word = ''
- for word in _r_words.findall(csource):
- if word in look_for_words:
- if word == ';':
- if is_typedef:
- words_used.discard(previous_word)
- look_for_words.discard(previous_word)
- is_typedef = False
- elif word == 'typedef':
- is_typedef = True
- paren = 0
- elif word == '(':
- paren += 1
- elif word == ')':
- paren -= 1
- elif word == ',':
- if is_typedef and paren == 0:
- words_used.discard(previous_word)
- look_for_words.discard(previous_word)
- else: # word in COMMON_TYPES
- words_used.add(word)
- previous_word = word
- return words_used
-
-
-class Parser(object):
-
- def __init__(self):
- self._declarations = {}
- self._included_declarations = set()
- self._anonymous_counter = 0
- self._structnode2type = weakref.WeakKeyDictionary()
- self._options = {}
- self._int_constants = {}
- self._recomplete = []
- self._uses_new_feature = None
-
- def _parse(self, csource):
- csource, macros = _preprocess(csource)
- # XXX: for more efficiency we would need to poke into the
- # internals of CParser... the following registers the
- # typedefs, because their presence or absence influences the
- # parsing itself (but what they are typedef'ed to plays no role)
- ctn = _common_type_names(csource)
- typenames = []
- for name in sorted(self._declarations):
- if name.startswith('typedef '):
- name = name[8:]
- typenames.append(name)
- ctn.discard(name)
- typenames += sorted(ctn)
- #
- csourcelines = []
- csourcelines.append('# 1 ""')
- for typename in typenames:
- csourcelines.append('typedef int %s;' % typename)
- csourcelines.append('typedef int __dotdotdotint__, __dotdotdotfloat__,'
- ' __dotdotdot__;')
- # this forces pycparser to consider the following in the file
- # called from line 1
- csourcelines.append('# 1 "%s"' % (CDEF_SOURCE_STRING,))
- csourcelines.append(csource)
- fullcsource = '\n'.join(csourcelines)
- if lock is not None:
- lock.acquire() # pycparser is not thread-safe...
- try:
- ast = _get_parser().parse(fullcsource)
- except pycparser.c_parser.ParseError as e:
- self.convert_pycparser_error(e, csource)
- finally:
- if lock is not None:
- lock.release()
- # csource will be used to find buggy source text
- return ast, macros, csource
-
- def _convert_pycparser_error(self, e, csource):
- # xxx look for ":NUM:" at the start of str(e)
- # and interpret that as a line number. This will not work if
- # the user gives explicit ``# NUM "FILE"`` directives.
- line = None
- msg = str(e)
- match = re.match(r"%s:(\d+):" % (CDEF_SOURCE_STRING,), msg)
- if match:
- linenum = int(match.group(1), 10)
- csourcelines = csource.splitlines()
- if 1 <= linenum <= len(csourcelines):
- line = csourcelines[linenum-1]
- return line
-
- def convert_pycparser_error(self, e, csource):
- line = self._convert_pycparser_error(e, csource)
-
- msg = str(e)
- if line:
- msg = 'cannot parse "%s"\n%s' % (line.strip(), msg)
- else:
- msg = 'parse error\n%s' % (msg,)
- raise CDefError(msg)
-
- def parse(self, csource, override=False, packed=False, dllexport=False):
- prev_options = self._options
- try:
- self._options = {'override': override,
- 'packed': packed,
- 'dllexport': dllexport}
- self._internal_parse(csource)
- finally:
- self._options = prev_options
-
- def _internal_parse(self, csource):
- ast, macros, csource = self._parse(csource)
- # add the macros
- self._process_macros(macros)
- # find the first "__dotdotdot__" and use that as a separator
- # between the repeated typedefs and the real csource
- iterator = iter(ast.ext)
- for decl in iterator:
- if decl.name == '__dotdotdot__':
- break
- else:
- assert 0
- current_decl = None
- #
- try:
- self._inside_extern_python = '__cffi_extern_python_stop'
- for decl in iterator:
- current_decl = decl
- if isinstance(decl, pycparser.c_ast.Decl):
- self._parse_decl(decl)
- elif isinstance(decl, pycparser.c_ast.Typedef):
- if not decl.name:
- raise CDefError("typedef does not declare any name",
- decl)
- quals = 0
- if (isinstance(decl.type.type, pycparser.c_ast.IdentifierType) and
- decl.type.type.names[-1].startswith('__dotdotdot')):
- realtype = self._get_unknown_type(decl)
- elif (isinstance(decl.type, pycparser.c_ast.PtrDecl) and
- isinstance(decl.type.type, pycparser.c_ast.TypeDecl) and
- isinstance(decl.type.type.type,
- pycparser.c_ast.IdentifierType) and
- decl.type.type.type.names[-1].startswith('__dotdotdot')):
- realtype = self._get_unknown_ptr_type(decl)
- else:
- realtype, quals = self._get_type_and_quals(
- decl.type, name=decl.name, partial_length_ok=True)
- self._declare('typedef ' + decl.name, realtype, quals=quals)
- elif decl.__class__.__name__ == 'Pragma':
- pass # skip pragma, only in pycparser 2.15
- else:
- raise CDefError("unexpected <%s>: this construct is valid "
- "C but not valid in cdef()" %
- decl.__class__.__name__, decl)
- except CDefError as e:
- if len(e.args) == 1:
- e.args = e.args + (current_decl,)
- raise
- except FFIError as e:
- msg = self._convert_pycparser_error(e, csource)
- if msg:
- e.args = (e.args[0] + "\n *** Err: %s" % msg,)
- raise
-
- def _add_constants(self, key, val):
- if key in self._int_constants:
- if self._int_constants[key] == val:
- return # ignore identical double declarations
- raise FFIError(
- "multiple declarations of constant: %s" % (key,))
- self._int_constants[key] = val
-
- def _add_integer_constant(self, name, int_str):
- int_str = int_str.lower().rstrip("ul")
- neg = int_str.startswith('-')
- if neg:
- int_str = int_str[1:]
- # "010" is not valid oct in py3
- if (int_str.startswith("0") and int_str != '0'
- and not int_str.startswith("0x")):
- int_str = "0o" + int_str[1:]
- pyvalue = int(int_str, 0)
- if neg:
- pyvalue = -pyvalue
- self._add_constants(name, pyvalue)
- self._declare('macro ' + name, pyvalue)
-
- def _process_macros(self, macros):
- for key, value in macros.items():
- value = value.strip()
- if _r_int_literal.match(value):
- self._add_integer_constant(key, value)
- elif value == '...':
- self._declare('macro ' + key, value)
- else:
- raise CDefError(
- 'only supports one of the following syntax:\n'
- ' #define %s ... (literally dot-dot-dot)\n'
- ' #define %s NUMBER (with NUMBER an integer'
- ' constant, decimal/hex/octal)\n'
- 'got:\n'
- ' #define %s %s'
- % (key, key, key, value))
-
- def _declare_function(self, tp, quals, decl):
- tp = self._get_type_pointer(tp, quals)
- if self._options.get('dllexport'):
- tag = 'dllexport_python '
- elif self._inside_extern_python == '__cffi_extern_python_start':
- tag = 'extern_python '
- elif self._inside_extern_python == '__cffi_extern_python_plus_c_start':
- tag = 'extern_python_plus_c '
- else:
- tag = 'function '
- self._declare(tag + decl.name, tp)
-
- def _parse_decl(self, decl):
- node = decl.type
- if isinstance(node, pycparser.c_ast.FuncDecl):
- tp, quals = self._get_type_and_quals(node, name=decl.name)
- assert isinstance(tp, model.RawFunctionType)
- self._declare_function(tp, quals, decl)
- else:
- if isinstance(node, pycparser.c_ast.Struct):
- self._get_struct_union_enum_type('struct', node)
- elif isinstance(node, pycparser.c_ast.Union):
- self._get_struct_union_enum_type('union', node)
- elif isinstance(node, pycparser.c_ast.Enum):
- self._get_struct_union_enum_type('enum', node)
- elif not decl.name:
- raise CDefError("construct does not declare any variable",
- decl)
- #
- if decl.name:
- tp, quals = self._get_type_and_quals(node,
- partial_length_ok=True)
- if tp.is_raw_function:
- self._declare_function(tp, quals, decl)
- elif (tp.is_integer_type() and
- hasattr(decl, 'init') and
- hasattr(decl.init, 'value') and
- _r_int_literal.match(decl.init.value)):
- self._add_integer_constant(decl.name, decl.init.value)
- elif (tp.is_integer_type() and
- isinstance(decl.init, pycparser.c_ast.UnaryOp) and
- decl.init.op == '-' and
- hasattr(decl.init.expr, 'value') and
- _r_int_literal.match(decl.init.expr.value)):
- self._add_integer_constant(decl.name,
- '-' + decl.init.expr.value)
- elif (tp is model.void_type and
- decl.name.startswith('__cffi_extern_python_')):
- # hack: `extern "Python"` in the C source is replaced
- # with "void __cffi_extern_python_start;" and
- # "void __cffi_extern_python_stop;"
- self._inside_extern_python = decl.name
- else:
- if self._inside_extern_python !='__cffi_extern_python_stop':
- raise CDefError(
- "cannot declare constants or "
- "variables with 'extern \"Python\"'")
- if (quals & model.Q_CONST) and not tp.is_array_type:
- self._declare('constant ' + decl.name, tp, quals=quals)
- else:
- self._declare('variable ' + decl.name, tp, quals=quals)
-
- def parse_type(self, cdecl):
- return self.parse_type_and_quals(cdecl)[0]
-
- def parse_type_and_quals(self, cdecl):
- ast, macros = self._parse('void __dummy(\n%s\n);' % cdecl)[:2]
- assert not macros
- exprnode = ast.ext[-1].type.args.params[0]
- if isinstance(exprnode, pycparser.c_ast.ID):
- raise CDefError("unknown identifier '%s'" % (exprnode.name,))
- return self._get_type_and_quals(exprnode.type)
-
- def _declare(self, name, obj, included=False, quals=0):
- if name in self._declarations:
- prevobj, prevquals = self._declarations[name]
- if prevobj is obj and prevquals == quals:
- return
- if not self._options.get('override'):
- raise FFIError(
- "multiple declarations of %s (for interactive usage, "
- "try cdef(xx, override=True))" % (name,))
- assert '__dotdotdot__' not in name.split()
- self._declarations[name] = (obj, quals)
- if included:
- self._included_declarations.add(obj)
-
- def _extract_quals(self, type):
- quals = 0
- if isinstance(type, (pycparser.c_ast.TypeDecl,
- pycparser.c_ast.PtrDecl)):
- if 'const' in type.quals:
- quals |= model.Q_CONST
- if 'volatile' in type.quals:
- quals |= model.Q_VOLATILE
- if 'restrict' in type.quals:
- quals |= model.Q_RESTRICT
- return quals
-
- def _get_type_pointer(self, type, quals, declname=None):
- if isinstance(type, model.RawFunctionType):
- return type.as_function_pointer()
- if (isinstance(type, model.StructOrUnionOrEnum) and
- type.name.startswith('$') and type.name[1:].isdigit() and
- type.forcename is None and declname is not None):
- return model.NamedPointerType(type, declname, quals)
- return model.PointerType(type, quals)
-
- def _get_type_and_quals(self, typenode, name=None, partial_length_ok=False):
- # first, dereference typedefs, if we have it already parsed, we're good
- if (isinstance(typenode, pycparser.c_ast.TypeDecl) and
- isinstance(typenode.type, pycparser.c_ast.IdentifierType) and
- len(typenode.type.names) == 1 and
- ('typedef ' + typenode.type.names[0]) in self._declarations):
- tp, quals = self._declarations['typedef ' + typenode.type.names[0]]
- quals |= self._extract_quals(typenode)
- return tp, quals
- #
- if isinstance(typenode, pycparser.c_ast.ArrayDecl):
- # array type
- if typenode.dim is None:
- length = None
- else:
- length = self._parse_constant(
- typenode.dim, partial_length_ok=partial_length_ok)
- tp, quals = self._get_type_and_quals(typenode.type,
- partial_length_ok=partial_length_ok)
- return model.ArrayType(tp, length), quals
- #
- if isinstance(typenode, pycparser.c_ast.PtrDecl):
- # pointer type
- itemtype, itemquals = self._get_type_and_quals(typenode.type)
- tp = self._get_type_pointer(itemtype, itemquals, declname=name)
- quals = self._extract_quals(typenode)
- return tp, quals
- #
- if isinstance(typenode, pycparser.c_ast.TypeDecl):
- quals = self._extract_quals(typenode)
- type = typenode.type
- if isinstance(type, pycparser.c_ast.IdentifierType):
- # assume a primitive type. get it from .names, but reduce
- # synonyms to a single chosen combination
- names = list(type.names)
- if names != ['signed', 'char']: # keep this unmodified
- prefixes = {}
- while names:
- name = names[0]
- if name in ('short', 'long', 'signed', 'unsigned'):
- prefixes[name] = prefixes.get(name, 0) + 1
- del names[0]
- else:
- break
- # ignore the 'signed' prefix below, and reorder the others
- newnames = []
- for prefix in ('unsigned', 'short', 'long'):
- for i in range(prefixes.get(prefix, 0)):
- newnames.append(prefix)
- if not names:
- names = ['int'] # implicitly
- if names == ['int']: # but kill it if 'short' or 'long'
- if 'short' in prefixes or 'long' in prefixes:
- names = []
- names = newnames + names
- ident = ' '.join(names)
- if ident == 'void':
- return model.void_type, quals
- if ident == '__dotdotdot__':
- raise FFIError(':%d: bad usage of "..."' %
- typenode.coord.line)
- tp0, quals0 = resolve_common_type(self, ident)
- return tp0, (quals | quals0)
- #
- if isinstance(type, pycparser.c_ast.Struct):
- # 'struct foobar'
- tp = self._get_struct_union_enum_type('struct', type, name)
- return tp, quals
- #
- if isinstance(type, pycparser.c_ast.Union):
- # 'union foobar'
- tp = self._get_struct_union_enum_type('union', type, name)
- return tp, quals
- #
- if isinstance(type, pycparser.c_ast.Enum):
- # 'enum foobar'
- tp = self._get_struct_union_enum_type('enum', type, name)
- return tp, quals
- #
- if isinstance(typenode, pycparser.c_ast.FuncDecl):
- # a function type
- return self._parse_function_type(typenode, name), 0
- #
- # nested anonymous structs or unions end up here
- if isinstance(typenode, pycparser.c_ast.Struct):
- return self._get_struct_union_enum_type('struct', typenode, name,
- nested=True), 0
- if isinstance(typenode, pycparser.c_ast.Union):
- return self._get_struct_union_enum_type('union', typenode, name,
- nested=True), 0
- #
- raise FFIError(":%d: bad or unsupported type declaration" %
- typenode.coord.line)
-
- def _parse_function_type(self, typenode, funcname=None):
- params = list(getattr(typenode.args, 'params', []))
- for i, arg in enumerate(params):
- if not hasattr(arg, 'type'):
- raise CDefError("%s arg %d: unknown type '%s'"
- " (if you meant to use the old C syntax of giving"
- " untyped arguments, it is not supported)"
- % (funcname or 'in expression', i + 1,
- getattr(arg, 'name', '?')))
- ellipsis = (
- len(params) > 0 and
- isinstance(params[-1].type, pycparser.c_ast.TypeDecl) and
- isinstance(params[-1].type.type,
- pycparser.c_ast.IdentifierType) and
- params[-1].type.type.names == ['__dotdotdot__'])
- if ellipsis:
- params.pop()
- if not params:
- raise CDefError(
- "%s: a function with only '(...)' as argument"
- " is not correct C" % (funcname or 'in expression'))
- args = [self._as_func_arg(*self._get_type_and_quals(argdeclnode.type))
- for argdeclnode in params]
- if not ellipsis and args == [model.void_type]:
- args = []
- result, quals = self._get_type_and_quals(typenode.type)
- # the 'quals' on the result type are ignored. HACK: we absure them
- # to detect __stdcall functions: we textually replace "__stdcall"
- # with "volatile volatile const" above.
- abi = None
- if hasattr(typenode.type, 'quals'): # else, probable syntax error anyway
- if typenode.type.quals[-3:] == ['volatile', 'volatile', 'const']:
- abi = '__stdcall'
- return model.RawFunctionType(tuple(args), result, ellipsis, abi)
-
- def _as_func_arg(self, type, quals):
- if isinstance(type, model.ArrayType):
- return model.PointerType(type.item, quals)
- elif isinstance(type, model.RawFunctionType):
- return type.as_function_pointer()
- else:
- return type
-
- def _get_struct_union_enum_type(self, kind, type, name=None, nested=False):
- # First, a level of caching on the exact 'type' node of the AST.
- # This is obscure, but needed because pycparser "unrolls" declarations
- # such as "typedef struct { } foo_t, *foo_p" and we end up with
- # an AST that is not a tree, but a DAG, with the "type" node of the
- # two branches foo_t and foo_p of the trees being the same node.
- # It's a bit silly but detecting "DAG-ness" in the AST tree seems
- # to be the only way to distinguish this case from two independent
- # structs. See test_struct_with_two_usages.
- try:
- return self._structnode2type[type]
- except KeyError:
- pass
- #
- # Note that this must handle parsing "struct foo" any number of
- # times and always return the same StructType object. Additionally,
- # one of these times (not necessarily the first), the fields of
- # the struct can be specified with "struct foo { ...fields... }".
- # If no name is given, then we have to create a new anonymous struct
- # with no caching; in this case, the fields are either specified
- # right now or never.
- #
- force_name = name
- name = type.name
- #
- # get the type or create it if needed
- if name is None:
- # 'force_name' is used to guess a more readable name for
- # anonymous structs, for the common case "typedef struct { } foo".
- if force_name is not None:
- explicit_name = '$%s' % force_name
- else:
- self._anonymous_counter += 1
- explicit_name = '$%d' % self._anonymous_counter
- tp = None
- else:
- explicit_name = name
- key = '%s %s' % (kind, name)
- tp, _ = self._declarations.get(key, (None, None))
- #
- if tp is None:
- if kind == 'struct':
- tp = model.StructType(explicit_name, None, None, None)
- elif kind == 'union':
- tp = model.UnionType(explicit_name, None, None, None)
- elif kind == 'enum':
- if explicit_name == '__dotdotdot__':
- raise CDefError("Enums cannot be declared with ...")
- tp = self._build_enum_type(explicit_name, type.values)
- else:
- raise AssertionError("kind = %r" % (kind,))
- if name is not None:
- self._declare(key, tp)
- else:
- if kind == 'enum' and type.values is not None:
- raise NotImplementedError(
- "enum %s: the '{}' declaration should appear on the first "
- "time the enum is mentioned, not later" % explicit_name)
- if not tp.forcename:
- tp.force_the_name(force_name)
- if tp.forcename and '$' in tp.name:
- self._declare('anonymous %s' % tp.forcename, tp)
- #
- self._structnode2type[type] = tp
- #
- # enums: done here
- if kind == 'enum':
- return tp
- #
- # is there a 'type.decls'? If yes, then this is the place in the
- # C sources that declare the fields. If no, then just return the
- # existing type, possibly still incomplete.
- if type.decls is None:
- return tp
- #
- if tp.fldnames is not None:
- raise CDefError("duplicate declaration of struct %s" % name)
- fldnames = []
- fldtypes = []
- fldbitsize = []
- fldquals = []
- for decl in type.decls:
- if (isinstance(decl.type, pycparser.c_ast.IdentifierType) and
- ''.join(decl.type.names) == '__dotdotdot__'):
- # XXX pycparser is inconsistent: 'names' should be a list
- # of strings, but is sometimes just one string. Use
- # str.join() as a way to cope with both.
- self._make_partial(tp, nested)
- continue
- if decl.bitsize is None:
- bitsize = -1
- else:
- bitsize = self._parse_constant(decl.bitsize)
- self._partial_length = False
- type, fqual = self._get_type_and_quals(decl.type,
- partial_length_ok=True)
- if self._partial_length:
- self._make_partial(tp, nested)
- if isinstance(type, model.StructType) and type.partial:
- self._make_partial(tp, nested)
- fldnames.append(decl.name or '')
- fldtypes.append(type)
- fldbitsize.append(bitsize)
- fldquals.append(fqual)
- tp.fldnames = tuple(fldnames)
- tp.fldtypes = tuple(fldtypes)
- tp.fldbitsize = tuple(fldbitsize)
- tp.fldquals = tuple(fldquals)
- if fldbitsize != [-1] * len(fldbitsize):
- if isinstance(tp, model.StructType) and tp.partial:
- raise NotImplementedError("%s: using both bitfields and '...;'"
- % (tp,))
- tp.packed = self._options.get('packed')
- if tp.completed: # must be re-completed: it is not opaque any more
- tp.completed = 0
- self._recomplete.append(tp)
- return tp
-
- def _make_partial(self, tp, nested):
- if not isinstance(tp, model.StructOrUnion):
- raise CDefError("%s cannot be partial" % (tp,))
- if not tp.has_c_name() and not nested:
- raise NotImplementedError("%s is partial but has no C name" %(tp,))
- tp.partial = True
-
- def _parse_constant(self, exprnode, partial_length_ok=False):
- # for now, limited to expressions that are an immediate number
- # or positive/negative number
- if isinstance(exprnode, pycparser.c_ast.Constant):
- s = exprnode.value
- if s.startswith('0'):
- if s.startswith('0x') or s.startswith('0X'):
- return int(s, 16)
- return int(s, 8)
- elif '1' <= s[0] <= '9':
- return int(s, 10)
- elif s[0] == "'" and s[-1] == "'" and (
- len(s) == 3 or (len(s) == 4 and s[1] == "\\")):
- return ord(s[-2])
- else:
- raise CDefError("invalid constant %r" % (s,))
- #
- if (isinstance(exprnode, pycparser.c_ast.UnaryOp) and
- exprnode.op == '+'):
- return self._parse_constant(exprnode.expr)
- #
- if (isinstance(exprnode, pycparser.c_ast.UnaryOp) and
- exprnode.op == '-'):
- return -self._parse_constant(exprnode.expr)
- # load previously defined int constant
- if (isinstance(exprnode, pycparser.c_ast.ID) and
- exprnode.name in self._int_constants):
- return self._int_constants[exprnode.name]
- #
- if (isinstance(exprnode, pycparser.c_ast.ID) and
- exprnode.name == '__dotdotdotarray__'):
- if partial_length_ok:
- self._partial_length = True
- return '...'
- raise FFIError(":%d: unsupported '[...]' here, cannot derive "
- "the actual array length in this context"
- % exprnode.coord.line)
- #
- if (isinstance(exprnode, pycparser.c_ast.BinaryOp) and
- exprnode.op == '+'):
- return (self._parse_constant(exprnode.left) +
- self._parse_constant(exprnode.right))
- #
- if (isinstance(exprnode, pycparser.c_ast.BinaryOp) and
- exprnode.op == '-'):
- return (self._parse_constant(exprnode.left) -
- self._parse_constant(exprnode.right))
- #
- raise FFIError(":%d: unsupported expression: expected a "
- "simple numeric constant" % exprnode.coord.line)
-
- def _build_enum_type(self, explicit_name, decls):
- if decls is not None:
- partial = False
- enumerators = []
- enumvalues = []
- nextenumvalue = 0
- for enum in decls.enumerators:
- if _r_enum_dotdotdot.match(enum.name):
- partial = True
- continue
- if enum.value is not None:
- nextenumvalue = self._parse_constant(enum.value)
- enumerators.append(enum.name)
- enumvalues.append(nextenumvalue)
- self._add_constants(enum.name, nextenumvalue)
- nextenumvalue += 1
- enumerators = tuple(enumerators)
- enumvalues = tuple(enumvalues)
- tp = model.EnumType(explicit_name, enumerators, enumvalues)
- tp.partial = partial
- else: # opaque enum
- tp = model.EnumType(explicit_name, (), ())
- return tp
-
- def include(self, other):
- for name, (tp, quals) in other._declarations.items():
- if name.startswith('anonymous $enum_$'):
- continue # fix for test_anonymous_enum_include
- kind = name.split(' ', 1)[0]
- if kind in ('struct', 'union', 'enum', 'anonymous', 'typedef'):
- self._declare(name, tp, included=True, quals=quals)
- for k, v in other._int_constants.items():
- self._add_constants(k, v)
-
- def _get_unknown_type(self, decl):
- typenames = decl.type.type.names
- if typenames == ['__dotdotdot__']:
- return model.unknown_type(decl.name)
-
- if typenames == ['__dotdotdotint__']:
- if self._uses_new_feature is None:
- self._uses_new_feature = "'typedef int... %s'" % decl.name
- return model.UnknownIntegerType(decl.name)
-
- if typenames == ['__dotdotdotfloat__']:
- # note: not for 'long double' so far
- if self._uses_new_feature is None:
- self._uses_new_feature = "'typedef float... %s'" % decl.name
- return model.UnknownFloatType(decl.name)
-
- raise FFIError(':%d: unsupported usage of "..." in typedef'
- % decl.coord.line)
-
- def _get_unknown_ptr_type(self, decl):
- if decl.type.type.type.names == ['__dotdotdot__']:
- return model.unknown_ptr_type(decl.name)
- raise FFIError(':%d: unsupported usage of "..." in typedef'
- % decl.coord.line)
diff --git a/lib/cffi/error.py b/lib/cffi/error.py
deleted file mode 100644
index ec19964843..0000000000
--- a/lib/cffi/error.py
+++ /dev/null
@@ -1,23 +0,0 @@
-
-class FFIError(Exception):
- pass
-
-class CDefError(Exception):
- def __str__(self):
- try:
- current_decl = self.args[1]
- filename = current_decl.coord.file
- linenum = current_decl.coord.line
- prefix = '%s:%d: ' % (filename, linenum)
- except (AttributeError, TypeError, IndexError):
- prefix = ''
- return '%s%s' % (prefix, self.args[0])
-
-class VerificationError(Exception):
- """ An error raised when verification fails
- """
-
-class VerificationMissing(Exception):
- """ An error raised when incomplete structures are passed into
- cdef, but no verification has been done
- """
diff --git a/lib/cffi/ffiplatform.py b/lib/cffi/ffiplatform.py
deleted file mode 100644
index 85313460a6..0000000000
--- a/lib/cffi/ffiplatform.py
+++ /dev/null
@@ -1,127 +0,0 @@
-import sys, os
-from .error import VerificationError
-
-
-LIST_OF_FILE_NAMES = ['sources', 'include_dirs', 'library_dirs',
- 'extra_objects', 'depends']
-
-def get_extension(srcfilename, modname, sources=(), **kwds):
- _hack_at_distutils()
- from distutils.core import Extension
- allsources = [srcfilename]
- for src in sources:
- allsources.append(os.path.normpath(src))
- return Extension(name=modname, sources=allsources, **kwds)
-
-def compile(tmpdir, ext, compiler_verbose=0, debug=None):
- """Compile a C extension module using distutils."""
-
- _hack_at_distutils()
- saved_environ = os.environ.copy()
- try:
- outputfilename = _build(tmpdir, ext, compiler_verbose, debug)
- outputfilename = os.path.abspath(outputfilename)
- finally:
- # workaround for a distutils bugs where some env vars can
- # become longer and longer every time it is used
- for key, value in saved_environ.items():
- if os.environ.get(key) != value:
- os.environ[key] = value
- return outputfilename
-
-def _build(tmpdir, ext, compiler_verbose=0, debug=None):
- # XXX compact but horrible :-(
- from distutils.core import Distribution
- import distutils.errors, distutils.log
- #
- dist = Distribution({'ext_modules': [ext]})
- dist.parse_config_files()
- options = dist.get_option_dict('build_ext')
- if debug is None:
- debug = sys.flags.debug
- options['debug'] = ('ffiplatform', debug)
- options['force'] = ('ffiplatform', True)
- options['build_lib'] = ('ffiplatform', tmpdir)
- options['build_temp'] = ('ffiplatform', tmpdir)
- #
- try:
- old_level = distutils.log.set_threshold(0) or 0
- try:
- distutils.log.set_verbosity(compiler_verbose)
- dist.run_command('build_ext')
- cmd_obj = dist.get_command_obj('build_ext')
- [soname] = cmd_obj.get_outputs()
- finally:
- distutils.log.set_threshold(old_level)
- except (distutils.errors.CompileError,
- distutils.errors.LinkError) as e:
- raise VerificationError('%s: %s' % (e.__class__.__name__, e))
- #
- return soname
-
-try:
- from os.path import samefile
-except ImportError:
- def samefile(f1, f2):
- return os.path.abspath(f1) == os.path.abspath(f2)
-
-def maybe_relative_path(path):
- if not os.path.isabs(path):
- return path # already relative
- dir = path
- names = []
- while True:
- prevdir = dir
- dir, name = os.path.split(prevdir)
- if dir == prevdir or not dir:
- return path # failed to make it relative
- names.append(name)
- try:
- if samefile(dir, os.curdir):
- names.reverse()
- return os.path.join(*names)
- except OSError:
- pass
-
-# ____________________________________________________________
-
-try:
- int_or_long = (int, long)
- import cStringIO
-except NameError:
- int_or_long = int # Python 3
- import io as cStringIO
-
-def _flatten(x, f):
- if isinstance(x, str):
- f.write('%ds%s' % (len(x), x))
- elif isinstance(x, dict):
- keys = sorted(x.keys())
- f.write('%dd' % len(keys))
- for key in keys:
- _flatten(key, f)
- _flatten(x[key], f)
- elif isinstance(x, (list, tuple)):
- f.write('%dl' % len(x))
- for value in x:
- _flatten(value, f)
- elif isinstance(x, int_or_long):
- f.write('%di' % (x,))
- else:
- raise TypeError(
- "the keywords to verify() contains unsupported object %r" % (x,))
-
-def flatten(x):
- f = cStringIO.StringIO()
- _flatten(x, f)
- return f.getvalue()
-
-def _hack_at_distutils():
- # Windows-only workaround for some configurations: see
- # https://bugs.python.org/issue23246 (Python 2.7 with
- # a specific MS compiler suite download)
- if sys.platform == "win32":
- try:
- import setuptools # for side-effects, patches distutils
- except ImportError:
- pass
diff --git a/lib/cffi/lock.py b/lib/cffi/lock.py
deleted file mode 100644
index db91b7158c..0000000000
--- a/lib/cffi/lock.py
+++ /dev/null
@@ -1,30 +0,0 @@
-import sys
-
-if sys.version_info < (3,):
- try:
- from thread import allocate_lock
- except ImportError:
- from dummy_thread import allocate_lock
-else:
- try:
- from _thread import allocate_lock
- except ImportError:
- from _dummy_thread import allocate_lock
-
-
-##import sys
-##l1 = allocate_lock
-
-##class allocate_lock(object):
-## def __init__(self):
-## self._real = l1()
-## def __enter__(self):
-## for i in range(4, 0, -1):
-## print sys._getframe(i).f_code
-## print
-## return self._real.__enter__()
-## def __exit__(self, *args):
-## return self._real.__exit__(*args)
-## def acquire(self, f):
-## assert f is False
-## return self._real.acquire(f)
diff --git a/lib/cffi/model.py b/lib/cffi/model.py
deleted file mode 100644
index 5d1139d370..0000000000
--- a/lib/cffi/model.py
+++ /dev/null
@@ -1,611 +0,0 @@
-import types
-import weakref
-
-from .lock import allocate_lock
-from .error import CDefError, VerificationError, VerificationMissing
-
-# type qualifiers
-Q_CONST = 0x01
-Q_RESTRICT = 0x02
-Q_VOLATILE = 0x04
-
-def qualify(quals, replace_with):
- if quals & Q_CONST:
- replace_with = ' const ' + replace_with.lstrip()
- if quals & Q_VOLATILE:
- replace_with = ' volatile ' + replace_with.lstrip()
- if quals & Q_RESTRICT:
- # It seems that __restrict is supported by gcc and msvc.
- # If you hit some different compiler, add a #define in
- # _cffi_include.h for it (and in its copies, documented there)
- replace_with = ' __restrict ' + replace_with.lstrip()
- return replace_with
-
-
-class BaseTypeByIdentity(object):
- is_array_type = False
- is_raw_function = False
-
- def get_c_name(self, replace_with='', context='a C file', quals=0):
- result = self.c_name_with_marker
- assert result.count('&') == 1
- # some logic duplication with ffi.getctype()... :-(
- replace_with = replace_with.strip()
- if replace_with:
- if replace_with.startswith('*') and '&[' in result:
- replace_with = '(%s)' % replace_with
- elif not replace_with[0] in '[(':
- replace_with = ' ' + replace_with
- replace_with = qualify(quals, replace_with)
- result = result.replace('&', replace_with)
- if '$' in result:
- raise VerificationError(
- "cannot generate '%s' in %s: unknown type name"
- % (self._get_c_name(), context))
- return result
-
- def _get_c_name(self):
- return self.c_name_with_marker.replace('&', '')
-
- def has_c_name(self):
- return '$' not in self._get_c_name()
-
- def is_integer_type(self):
- return False
-
- def get_cached_btype(self, ffi, finishlist, can_delay=False):
- try:
- BType = ffi._cached_btypes[self]
- except KeyError:
- BType = self.build_backend_type(ffi, finishlist)
- BType2 = ffi._cached_btypes.setdefault(self, BType)
- assert BType2 is BType
- return BType
-
- def __repr__(self):
- return '<%s>' % (self._get_c_name(),)
-
- def _get_items(self):
- return [(name, getattr(self, name)) for name in self._attrs_]
-
-
-class BaseType(BaseTypeByIdentity):
-
- def __eq__(self, other):
- return (self.__class__ == other.__class__ and
- self._get_items() == other._get_items())
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- return hash((self.__class__, tuple(self._get_items())))
-
-
-class VoidType(BaseType):
- _attrs_ = ()
-
- def __init__(self):
- self.c_name_with_marker = 'void&'
-
- def build_backend_type(self, ffi, finishlist):
- return global_cache(self, ffi, 'new_void_type')
-
-void_type = VoidType()
-
-
-class BasePrimitiveType(BaseType):
- def is_complex_type(self):
- return False
-
-
-class PrimitiveType(BasePrimitiveType):
- _attrs_ = ('name',)
-
- ALL_PRIMITIVE_TYPES = {
- 'char': 'c',
- 'short': 'i',
- 'int': 'i',
- 'long': 'i',
- 'long long': 'i',
- 'signed char': 'i',
- 'unsigned char': 'i',
- 'unsigned short': 'i',
- 'unsigned int': 'i',
- 'unsigned long': 'i',
- 'unsigned long long': 'i',
- 'float': 'f',
- 'double': 'f',
- 'long double': 'f',
- 'float _Complex': 'j',
- 'double _Complex': 'j',
- '_Bool': 'i',
- # the following types are not primitive in the C sense
- 'wchar_t': 'c',
- 'char16_t': 'c',
- 'char32_t': 'c',
- 'int8_t': 'i',
- 'uint8_t': 'i',
- 'int16_t': 'i',
- 'uint16_t': 'i',
- 'int32_t': 'i',
- 'uint32_t': 'i',
- 'int64_t': 'i',
- 'uint64_t': 'i',
- 'int_least8_t': 'i',
- 'uint_least8_t': 'i',
- 'int_least16_t': 'i',
- 'uint_least16_t': 'i',
- 'int_least32_t': 'i',
- 'uint_least32_t': 'i',
- 'int_least64_t': 'i',
- 'uint_least64_t': 'i',
- 'int_fast8_t': 'i',
- 'uint_fast8_t': 'i',
- 'int_fast16_t': 'i',
- 'uint_fast16_t': 'i',
- 'int_fast32_t': 'i',
- 'uint_fast32_t': 'i',
- 'int_fast64_t': 'i',
- 'uint_fast64_t': 'i',
- 'intptr_t': 'i',
- 'uintptr_t': 'i',
- 'intmax_t': 'i',
- 'uintmax_t': 'i',
- 'ptrdiff_t': 'i',
- 'size_t': 'i',
- 'ssize_t': 'i',
- }
-
- def __init__(self, name):
- assert name in self.ALL_PRIMITIVE_TYPES
- self.name = name
- self.c_name_with_marker = name + '&'
-
- def is_char_type(self):
- return self.ALL_PRIMITIVE_TYPES[self.name] == 'c'
- def is_integer_type(self):
- return self.ALL_PRIMITIVE_TYPES[self.name] == 'i'
- def is_float_type(self):
- return self.ALL_PRIMITIVE_TYPES[self.name] == 'f'
- def is_complex_type(self):
- return self.ALL_PRIMITIVE_TYPES[self.name] == 'j'
-
- def build_backend_type(self, ffi, finishlist):
- return global_cache(self, ffi, 'new_primitive_type', self.name)
-
-
-class UnknownIntegerType(BasePrimitiveType):
- _attrs_ = ('name',)
-
- def __init__(self, name):
- self.name = name
- self.c_name_with_marker = name + '&'
-
- def is_integer_type(self):
- return True
-
- def build_backend_type(self, ffi, finishlist):
- raise NotImplementedError("integer type '%s' can only be used after "
- "compilation" % self.name)
-
-class UnknownFloatType(BasePrimitiveType):
- _attrs_ = ('name', )
-
- def __init__(self, name):
- self.name = name
- self.c_name_with_marker = name + '&'
-
- def build_backend_type(self, ffi, finishlist):
- raise NotImplementedError("float type '%s' can only be used after "
- "compilation" % self.name)
-
-
-class BaseFunctionType(BaseType):
- _attrs_ = ('args', 'result', 'ellipsis', 'abi')
-
- def __init__(self, args, result, ellipsis, abi=None):
- self.args = args
- self.result = result
- self.ellipsis = ellipsis
- self.abi = abi
- #
- reprargs = [arg._get_c_name() for arg in self.args]
- if self.ellipsis:
- reprargs.append('...')
- reprargs = reprargs or ['void']
- replace_with = self._base_pattern % (', '.join(reprargs),)
- if abi is not None:
- replace_with = replace_with[:1] + abi + ' ' + replace_with[1:]
- self.c_name_with_marker = (
- self.result.c_name_with_marker.replace('&', replace_with))
-
-
-class RawFunctionType(BaseFunctionType):
- # Corresponds to a C type like 'int(int)', which is the C type of
- # a function, but not a pointer-to-function. The backend has no
- # notion of such a type; it's used temporarily by parsing.
- _base_pattern = '(&)(%s)'
- is_raw_function = True
-
- def build_backend_type(self, ffi, finishlist):
- raise CDefError("cannot render the type %r: it is a function "
- "type, not a pointer-to-function type" % (self,))
-
- def as_function_pointer(self):
- return FunctionPtrType(self.args, self.result, self.ellipsis, self.abi)
-
-
-class FunctionPtrType(BaseFunctionType):
- _base_pattern = '(*&)(%s)'
-
- def build_backend_type(self, ffi, finishlist):
- result = self.result.get_cached_btype(ffi, finishlist)
- args = []
- for tp in self.args:
- args.append(tp.get_cached_btype(ffi, finishlist))
- abi_args = ()
- if self.abi == "__stdcall":
- if not self.ellipsis: # __stdcall ignored for variadic funcs
- try:
- abi_args = (ffi._backend.FFI_STDCALL,)
- except AttributeError:
- pass
- return global_cache(self, ffi, 'new_function_type',
- tuple(args), result, self.ellipsis, *abi_args)
-
- def as_raw_function(self):
- return RawFunctionType(self.args, self.result, self.ellipsis, self.abi)
-
-
-class PointerType(BaseType):
- _attrs_ = ('totype', 'quals')
-
- def __init__(self, totype, quals=0):
- self.totype = totype
- self.quals = quals
- extra = qualify(quals, " *&")
- if totype.is_array_type:
- extra = "(%s)" % (extra.lstrip(),)
- self.c_name_with_marker = totype.c_name_with_marker.replace('&', extra)
-
- def build_backend_type(self, ffi, finishlist):
- BItem = self.totype.get_cached_btype(ffi, finishlist, can_delay=True)
- return global_cache(self, ffi, 'new_pointer_type', BItem)
-
-voidp_type = PointerType(void_type)
-
-def ConstPointerType(totype):
- return PointerType(totype, Q_CONST)
-
-const_voidp_type = ConstPointerType(void_type)
-
-
-class NamedPointerType(PointerType):
- _attrs_ = ('totype', 'name')
-
- def __init__(self, totype, name, quals=0):
- PointerType.__init__(self, totype, quals)
- self.name = name
- self.c_name_with_marker = name + '&'
-
-
-class ArrayType(BaseType):
- _attrs_ = ('item', 'length')
- is_array_type = True
-
- def __init__(self, item, length):
- self.item = item
- self.length = length
- #
- if length is None:
- brackets = '&[]'
- elif length == '...':
- brackets = '&[/*...*/]'
- else:
- brackets = '&[%s]' % length
- self.c_name_with_marker = (
- self.item.c_name_with_marker.replace('&', brackets))
-
- def resolve_length(self, newlength):
- return ArrayType(self.item, newlength)
-
- def build_backend_type(self, ffi, finishlist):
- if self.length == '...':
- raise CDefError("cannot render the type %r: unknown length" %
- (self,))
- self.item.get_cached_btype(ffi, finishlist) # force the item BType
- BPtrItem = PointerType(self.item).get_cached_btype(ffi, finishlist)
- return global_cache(self, ffi, 'new_array_type', BPtrItem, self.length)
-
-char_array_type = ArrayType(PrimitiveType('char'), None)
-
-
-class StructOrUnionOrEnum(BaseTypeByIdentity):
- _attrs_ = ('name',)
- forcename = None
-
- def build_c_name_with_marker(self):
- name = self.forcename or '%s %s' % (self.kind, self.name)
- self.c_name_with_marker = name + '&'
-
- def force_the_name(self, forcename):
- self.forcename = forcename
- self.build_c_name_with_marker()
-
- def get_official_name(self):
- assert self.c_name_with_marker.endswith('&')
- return self.c_name_with_marker[:-1]
-
-
-class StructOrUnion(StructOrUnionOrEnum):
- fixedlayout = None
- completed = 0
- partial = False
- packed = False
-
- def __init__(self, name, fldnames, fldtypes, fldbitsize, fldquals=None):
- self.name = name
- self.fldnames = fldnames
- self.fldtypes = fldtypes
- self.fldbitsize = fldbitsize
- self.fldquals = fldquals
- self.build_c_name_with_marker()
-
- def anonymous_struct_fields(self):
- if self.fldtypes is not None:
- for name, type in zip(self.fldnames, self.fldtypes):
- if name == '' and isinstance(type, StructOrUnion):
- yield type
-
- def enumfields(self, expand_anonymous_struct_union=True):
- fldquals = self.fldquals
- if fldquals is None:
- fldquals = (0,) * len(self.fldnames)
- for name, type, bitsize, quals in zip(self.fldnames, self.fldtypes,
- self.fldbitsize, fldquals):
- if (name == '' and isinstance(type, StructOrUnion)
- and expand_anonymous_struct_union):
- # nested anonymous struct/union
- for result in type.enumfields():
- yield result
- else:
- yield (name, type, bitsize, quals)
-
- def force_flatten(self):
- # force the struct or union to have a declaration that lists
- # directly all fields returned by enumfields(), flattening
- # nested anonymous structs/unions.
- names = []
- types = []
- bitsizes = []
- fldquals = []
- for name, type, bitsize, quals in self.enumfields():
- names.append(name)
- types.append(type)
- bitsizes.append(bitsize)
- fldquals.append(quals)
- self.fldnames = tuple(names)
- self.fldtypes = tuple(types)
- self.fldbitsize = tuple(bitsizes)
- self.fldquals = tuple(fldquals)
-
- def get_cached_btype(self, ffi, finishlist, can_delay=False):
- BType = StructOrUnionOrEnum.get_cached_btype(self, ffi, finishlist,
- can_delay)
- if not can_delay:
- self.finish_backend_type(ffi, finishlist)
- return BType
-
- def finish_backend_type(self, ffi, finishlist):
- if self.completed:
- if self.completed != 2:
- raise NotImplementedError("recursive structure declaration "
- "for '%s'" % (self.name,))
- return
- BType = ffi._cached_btypes[self]
- #
- self.completed = 1
- #
- if self.fldtypes is None:
- pass # not completing it: it's an opaque struct
- #
- elif self.fixedlayout is None:
- fldtypes = [tp.get_cached_btype(ffi, finishlist)
- for tp in self.fldtypes]
- lst = list(zip(self.fldnames, fldtypes, self.fldbitsize))
- sflags = 0
- if self.packed:
- sflags = 8 # SF_PACKED
- ffi._backend.complete_struct_or_union(BType, lst, self,
- -1, -1, sflags)
- #
- else:
- fldtypes = []
- fieldofs, fieldsize, totalsize, totalalignment = self.fixedlayout
- for i in range(len(self.fldnames)):
- fsize = fieldsize[i]
- ftype = self.fldtypes[i]
- #
- if isinstance(ftype, ArrayType) and ftype.length == '...':
- # fix the length to match the total size
- BItemType = ftype.item.get_cached_btype(ffi, finishlist)
- nlen, nrest = divmod(fsize, ffi.sizeof(BItemType))
- if nrest != 0:
- self._verification_error(
- "field '%s.%s' has a bogus size?" % (
- self.name, self.fldnames[i] or '{}'))
- ftype = ftype.resolve_length(nlen)
- self.fldtypes = (self.fldtypes[:i] + (ftype,) +
- self.fldtypes[i+1:])
- #
- BFieldType = ftype.get_cached_btype(ffi, finishlist)
- if isinstance(ftype, ArrayType) and ftype.length is None:
- assert fsize == 0
- else:
- bitemsize = ffi.sizeof(BFieldType)
- if bitemsize != fsize:
- self._verification_error(
- "field '%s.%s' is declared as %d bytes, but is "
- "really %d bytes" % (self.name,
- self.fldnames[i] or '{}',
- bitemsize, fsize))
- fldtypes.append(BFieldType)
- #
- lst = list(zip(self.fldnames, fldtypes, self.fldbitsize, fieldofs))
- ffi._backend.complete_struct_or_union(BType, lst, self,
- totalsize, totalalignment)
- self.completed = 2
-
- def _verification_error(self, msg):
- raise VerificationError(msg)
-
- def check_not_partial(self):
- if self.partial and self.fixedlayout is None:
- raise VerificationMissing(self._get_c_name())
-
- def build_backend_type(self, ffi, finishlist):
- self.check_not_partial()
- finishlist.append(self)
- #
- return global_cache(self, ffi, 'new_%s_type' % self.kind,
- self.get_official_name(), key=self)
-
-
-class StructType(StructOrUnion):
- kind = 'struct'
-
-
-class UnionType(StructOrUnion):
- kind = 'union'
-
-
-class EnumType(StructOrUnionOrEnum):
- kind = 'enum'
- partial = False
- partial_resolved = False
-
- def __init__(self, name, enumerators, enumvalues, baseinttype=None):
- self.name = name
- self.enumerators = enumerators
- self.enumvalues = enumvalues
- self.baseinttype = baseinttype
- self.build_c_name_with_marker()
-
- def force_the_name(self, forcename):
- StructOrUnionOrEnum.force_the_name(self, forcename)
- if self.forcename is None:
- name = self.get_official_name()
- self.forcename = '$' + name.replace(' ', '_')
-
- def check_not_partial(self):
- if self.partial and not self.partial_resolved:
- raise VerificationMissing(self._get_c_name())
-
- def build_backend_type(self, ffi, finishlist):
- self.check_not_partial()
- base_btype = self.build_baseinttype(ffi, finishlist)
- return global_cache(self, ffi, 'new_enum_type',
- self.get_official_name(),
- self.enumerators, self.enumvalues,
- base_btype, key=self)
-
- def build_baseinttype(self, ffi, finishlist):
- if self.baseinttype is not None:
- return self.baseinttype.get_cached_btype(ffi, finishlist)
- #
- if self.enumvalues:
- smallest_value = min(self.enumvalues)
- largest_value = max(self.enumvalues)
- else:
- import warnings
- try:
- # XXX! The goal is to ensure that the warnings.warn()
- # will not suppress the warning. We want to get it
- # several times if we reach this point several times.
- __warningregistry__.clear()
- except NameError:
- pass
- warnings.warn("%r has no values explicitly defined; "
- "guessing that it is equivalent to 'unsigned int'"
- % self._get_c_name())
- smallest_value = largest_value = 0
- if smallest_value < 0: # needs a signed type
- sign = 1
- candidate1 = PrimitiveType("int")
- candidate2 = PrimitiveType("long")
- else:
- sign = 0
- candidate1 = PrimitiveType("unsigned int")
- candidate2 = PrimitiveType("unsigned long")
- btype1 = candidate1.get_cached_btype(ffi, finishlist)
- btype2 = candidate2.get_cached_btype(ffi, finishlist)
- size1 = ffi.sizeof(btype1)
- size2 = ffi.sizeof(btype2)
- if (smallest_value >= ((-1) << (8*size1-1)) and
- largest_value < (1 << (8*size1-sign))):
- return btype1
- if (smallest_value >= ((-1) << (8*size2-1)) and
- largest_value < (1 << (8*size2-sign))):
- return btype2
- raise CDefError("%s values don't all fit into either 'long' "
- "or 'unsigned long'" % self._get_c_name())
-
-def unknown_type(name, structname=None):
- if structname is None:
- structname = '$%s' % name
- tp = StructType(structname, None, None, None)
- tp.force_the_name(name)
- tp.origin = "unknown_type"
- return tp
-
-def unknown_ptr_type(name, structname=None):
- if structname is None:
- structname = '$$%s' % name
- tp = StructType(structname, None, None, None)
- return NamedPointerType(tp, name)
-
-
-global_lock = allocate_lock()
-_typecache_cffi_backend = weakref.WeakValueDictionary()
-
-def get_typecache(backend):
- # returns _typecache_cffi_backend if backend is the _cffi_backend
- # module, or type(backend).__typecache if backend is an instance of
- # CTypesBackend (or some FakeBackend class during tests)
- if isinstance(backend, types.ModuleType):
- return _typecache_cffi_backend
- with global_lock:
- if not hasattr(type(backend), '__typecache'):
- type(backend).__typecache = weakref.WeakValueDictionary()
- return type(backend).__typecache
-
-def global_cache(srctype, ffi, funcname, *args, **kwds):
- key = kwds.pop('key', (funcname, args))
- assert not kwds
- try:
- return ffi._typecache[key]
- except KeyError:
- pass
- try:
- res = getattr(ffi._backend, funcname)(*args)
- except NotImplementedError as e:
- raise NotImplementedError("%s: %r: %s" % (funcname, srctype, e))
- # note that setdefault() on WeakValueDictionary is not atomic
- # and contains a rare bug (http://bugs.python.org/issue19542);
- # we have to use a lock and do it ourselves
- cache = ffi._typecache
- with global_lock:
- res1 = cache.get(key)
- if res1 is None:
- cache[key] = res
- return res
- else:
- return res1
-
-def pointer_cache(ffi, BType):
- return global_cache('?', ffi, 'new_pointer_type', BType)
-
-def attach_exception_info(e, name):
- if e.args and type(e.args[0]) is str:
- e.args = ('%s: %s' % (name, e.args[0]),) + e.args[1:]
diff --git a/lib/cffi/parse_c_type.h b/lib/cffi/parse_c_type.h
deleted file mode 100644
index 84e4ef8565..0000000000
--- a/lib/cffi/parse_c_type.h
+++ /dev/null
@@ -1,181 +0,0 @@
-
-/* This part is from file 'cffi/parse_c_type.h'. It is copied at the
- beginning of C sources generated by CFFI's ffi.set_source(). */
-
-typedef void *_cffi_opcode_t;
-
-#define _CFFI_OP(opcode, arg) (_cffi_opcode_t)(opcode | (((uintptr_t)(arg)) << 8))
-#define _CFFI_GETOP(cffi_opcode) ((unsigned char)(uintptr_t)cffi_opcode)
-#define _CFFI_GETARG(cffi_opcode) (((intptr_t)cffi_opcode) >> 8)
-
-#define _CFFI_OP_PRIMITIVE 1
-#define _CFFI_OP_POINTER 3
-#define _CFFI_OP_ARRAY 5
-#define _CFFI_OP_OPEN_ARRAY 7
-#define _CFFI_OP_STRUCT_UNION 9
-#define _CFFI_OP_ENUM 11
-#define _CFFI_OP_FUNCTION 13
-#define _CFFI_OP_FUNCTION_END 15
-#define _CFFI_OP_NOOP 17
-#define _CFFI_OP_BITFIELD 19
-#define _CFFI_OP_TYPENAME 21
-#define _CFFI_OP_CPYTHON_BLTN_V 23 // varargs
-#define _CFFI_OP_CPYTHON_BLTN_N 25 // noargs
-#define _CFFI_OP_CPYTHON_BLTN_O 27 // O (i.e. a single arg)
-#define _CFFI_OP_CONSTANT 29
-#define _CFFI_OP_CONSTANT_INT 31
-#define _CFFI_OP_GLOBAL_VAR 33
-#define _CFFI_OP_DLOPEN_FUNC 35
-#define _CFFI_OP_DLOPEN_CONST 37
-#define _CFFI_OP_GLOBAL_VAR_F 39
-#define _CFFI_OP_EXTERN_PYTHON 41
-
-#define _CFFI_PRIM_VOID 0
-#define _CFFI_PRIM_BOOL 1
-#define _CFFI_PRIM_CHAR 2
-#define _CFFI_PRIM_SCHAR 3
-#define _CFFI_PRIM_UCHAR 4
-#define _CFFI_PRIM_SHORT 5
-#define _CFFI_PRIM_USHORT 6
-#define _CFFI_PRIM_INT 7
-#define _CFFI_PRIM_UINT 8
-#define _CFFI_PRIM_LONG 9
-#define _CFFI_PRIM_ULONG 10
-#define _CFFI_PRIM_LONGLONG 11
-#define _CFFI_PRIM_ULONGLONG 12
-#define _CFFI_PRIM_FLOAT 13
-#define _CFFI_PRIM_DOUBLE 14
-#define _CFFI_PRIM_LONGDOUBLE 15
-
-#define _CFFI_PRIM_WCHAR 16
-#define _CFFI_PRIM_INT8 17
-#define _CFFI_PRIM_UINT8 18
-#define _CFFI_PRIM_INT16 19
-#define _CFFI_PRIM_UINT16 20
-#define _CFFI_PRIM_INT32 21
-#define _CFFI_PRIM_UINT32 22
-#define _CFFI_PRIM_INT64 23
-#define _CFFI_PRIM_UINT64 24
-#define _CFFI_PRIM_INTPTR 25
-#define _CFFI_PRIM_UINTPTR 26
-#define _CFFI_PRIM_PTRDIFF 27
-#define _CFFI_PRIM_SIZE 28
-#define _CFFI_PRIM_SSIZE 29
-#define _CFFI_PRIM_INT_LEAST8 30
-#define _CFFI_PRIM_UINT_LEAST8 31
-#define _CFFI_PRIM_INT_LEAST16 32
-#define _CFFI_PRIM_UINT_LEAST16 33
-#define _CFFI_PRIM_INT_LEAST32 34
-#define _CFFI_PRIM_UINT_LEAST32 35
-#define _CFFI_PRIM_INT_LEAST64 36
-#define _CFFI_PRIM_UINT_LEAST64 37
-#define _CFFI_PRIM_INT_FAST8 38
-#define _CFFI_PRIM_UINT_FAST8 39
-#define _CFFI_PRIM_INT_FAST16 40
-#define _CFFI_PRIM_UINT_FAST16 41
-#define _CFFI_PRIM_INT_FAST32 42
-#define _CFFI_PRIM_UINT_FAST32 43
-#define _CFFI_PRIM_INT_FAST64 44
-#define _CFFI_PRIM_UINT_FAST64 45
-#define _CFFI_PRIM_INTMAX 46
-#define _CFFI_PRIM_UINTMAX 47
-#define _CFFI_PRIM_FLOATCOMPLEX 48
-#define _CFFI_PRIM_DOUBLECOMPLEX 49
-#define _CFFI_PRIM_CHAR16 50
-#define _CFFI_PRIM_CHAR32 51
-
-#define _CFFI__NUM_PRIM 52
-#define _CFFI__UNKNOWN_PRIM (-1)
-#define _CFFI__UNKNOWN_FLOAT_PRIM (-2)
-#define _CFFI__UNKNOWN_LONG_DOUBLE (-3)
-
-#define _CFFI__IO_FILE_STRUCT (-1)
-
-
-struct _cffi_global_s {
- const char *name;
- void *address;
- _cffi_opcode_t type_op;
- void *size_or_direct_fn; // OP_GLOBAL_VAR: size, or 0 if unknown
- // OP_CPYTHON_BLTN_*: addr of direct function
-};
-
-struct _cffi_getconst_s {
- unsigned long long value;
- const struct _cffi_type_context_s *ctx;
- int gindex;
-};
-
-struct _cffi_struct_union_s {
- const char *name;
- int type_index; // -> _cffi_types, on a OP_STRUCT_UNION
- int flags; // _CFFI_F_* flags below
- size_t size;
- int alignment;
- int first_field_index; // -> _cffi_fields array
- int num_fields;
-};
-#define _CFFI_F_UNION 0x01 // is a union, not a struct
-#define _CFFI_F_CHECK_FIELDS 0x02 // complain if fields are not in the
- // "standard layout" or if some are missing
-#define _CFFI_F_PACKED 0x04 // for CHECK_FIELDS, assume a packed struct
-#define _CFFI_F_EXTERNAL 0x08 // in some other ffi.include()
-#define _CFFI_F_OPAQUE 0x10 // opaque
-
-struct _cffi_field_s {
- const char *name;
- size_t field_offset;
- size_t field_size;
- _cffi_opcode_t field_type_op;
-};
-
-struct _cffi_enum_s {
- const char *name;
- int type_index; // -> _cffi_types, on a OP_ENUM
- int type_prim; // _CFFI_PRIM_xxx
- const char *enumerators; // comma-delimited string
-};
-
-struct _cffi_typename_s {
- const char *name;
- int type_index; /* if opaque, points to a possibly artificial
- OP_STRUCT which is itself opaque */
-};
-
-struct _cffi_type_context_s {
- _cffi_opcode_t *types;
- const struct _cffi_global_s *globals;
- const struct _cffi_field_s *fields;
- const struct _cffi_struct_union_s *struct_unions;
- const struct _cffi_enum_s *enums;
- const struct _cffi_typename_s *typenames;
- int num_globals;
- int num_struct_unions;
- int num_enums;
- int num_typenames;
- const char *const *includes;
- int num_types;
- int flags; /* future extension */
-};
-
-struct _cffi_parse_info_s {
- const struct _cffi_type_context_s *ctx;
- _cffi_opcode_t *output;
- unsigned int output_size;
- size_t error_location;
- const char *error_message;
-};
-
-struct _cffi_externpy_s {
- const char *name;
- size_t size_of_result;
- void *reserved1, *reserved2;
-};
-
-#ifdef _CFFI_INTERNAL
-static int parse_c_type(struct _cffi_parse_info_s *info, const char *input);
-static int search_in_globals(const struct _cffi_type_context_s *ctx,
- const char *search, size_t search_len);
-static int search_in_struct_unions(const struct _cffi_type_context_s *ctx,
- const char *search, size_t search_len);
-#endif
diff --git a/lib/cffi/recompiler.py b/lib/cffi/recompiler.py
deleted file mode 100644
index f48b773452..0000000000
--- a/lib/cffi/recompiler.py
+++ /dev/null
@@ -1,1560 +0,0 @@
-import os, sys, io
-from . import ffiplatform, model
-from .error import VerificationError
-from .cffi_opcode import *
-
-VERSION_BASE = 0x2601
-VERSION_EMBEDDED = 0x2701
-VERSION_CHAR16CHAR32 = 0x2801
-
-
-class GlobalExpr:
- def __init__(self, name, address, type_op, size=0, check_value=0):
- self.name = name
- self.address = address
- self.type_op = type_op
- self.size = size
- self.check_value = check_value
-
- def as_c_expr(self):
- return ' { "%s", (void *)%s, %s, (void *)%s },' % (
- self.name, self.address, self.type_op.as_c_expr(), self.size)
-
- def as_python_expr(self):
- return "b'%s%s',%d" % (self.type_op.as_python_bytes(), self.name,
- self.check_value)
-
-class FieldExpr:
- def __init__(self, name, field_offset, field_size, fbitsize, field_type_op):
- self.name = name
- self.field_offset = field_offset
- self.field_size = field_size
- self.fbitsize = fbitsize
- self.field_type_op = field_type_op
-
- def as_c_expr(self):
- spaces = " " * len(self.name)
- return (' { "%s", %s,\n' % (self.name, self.field_offset) +
- ' %s %s,\n' % (spaces, self.field_size) +
- ' %s %s },' % (spaces, self.field_type_op.as_c_expr()))
-
- def as_python_expr(self):
- raise NotImplementedError
-
- def as_field_python_expr(self):
- if self.field_type_op.op == OP_NOOP:
- size_expr = ''
- elif self.field_type_op.op == OP_BITFIELD:
- size_expr = format_four_bytes(self.fbitsize)
- else:
- raise NotImplementedError
- return "b'%s%s%s'" % (self.field_type_op.as_python_bytes(),
- size_expr,
- self.name)
-
-class StructUnionExpr:
- def __init__(self, name, type_index, flags, size, alignment, comment,
- first_field_index, c_fields):
- self.name = name
- self.type_index = type_index
- self.flags = flags
- self.size = size
- self.alignment = alignment
- self.comment = comment
- self.first_field_index = first_field_index
- self.c_fields = c_fields
-
- def as_c_expr(self):
- return (' { "%s", %d, %s,' % (self.name, self.type_index, self.flags)
- + '\n %s, %s, ' % (self.size, self.alignment)
- + '%d, %d ' % (self.first_field_index, len(self.c_fields))
- + ('/* %s */ ' % self.comment if self.comment else '')
- + '},')
-
- def as_python_expr(self):
- flags = eval(self.flags, G_FLAGS)
- fields_expr = [c_field.as_field_python_expr()
- for c_field in self.c_fields]
- return "(b'%s%s%s',%s)" % (
- format_four_bytes(self.type_index),
- format_four_bytes(flags),
- self.name,
- ','.join(fields_expr))
-
-class EnumExpr:
- def __init__(self, name, type_index, size, signed, allenums):
- self.name = name
- self.type_index = type_index
- self.size = size
- self.signed = signed
- self.allenums = allenums
-
- def as_c_expr(self):
- return (' { "%s", %d, _cffi_prim_int(%s, %s),\n'
- ' "%s" },' % (self.name, self.type_index,
- self.size, self.signed, self.allenums))
-
- def as_python_expr(self):
- prim_index = {
- (1, 0): PRIM_UINT8, (1, 1): PRIM_INT8,
- (2, 0): PRIM_UINT16, (2, 1): PRIM_INT16,
- (4, 0): PRIM_UINT32, (4, 1): PRIM_INT32,
- (8, 0): PRIM_UINT64, (8, 1): PRIM_INT64,
- }[self.size, self.signed]
- return "b'%s%s%s\\x00%s'" % (format_four_bytes(self.type_index),
- format_four_bytes(prim_index),
- self.name, self.allenums)
-
-class TypenameExpr:
- def __init__(self, name, type_index):
- self.name = name
- self.type_index = type_index
-
- def as_c_expr(self):
- return ' { "%s", %d },' % (self.name, self.type_index)
-
- def as_python_expr(self):
- return "b'%s%s'" % (format_four_bytes(self.type_index), self.name)
-
-
-# ____________________________________________________________
-
-
-class Recompiler:
- _num_externpy = 0
-
- def __init__(self, ffi, module_name, target_is_python=False):
- self.ffi = ffi
- self.module_name = module_name
- self.target_is_python = target_is_python
- self._version = VERSION_BASE
-
- def needs_version(self, ver):
- self._version = max(self._version, ver)
-
- def collect_type_table(self):
- self._typesdict = {}
- self._generate("collecttype")
- #
- all_decls = sorted(self._typesdict, key=str)
- #
- # prepare all FUNCTION bytecode sequences first
- self.cffi_types = []
- for tp in all_decls:
- if tp.is_raw_function:
- assert self._typesdict[tp] is None
- self._typesdict[tp] = len(self.cffi_types)
- self.cffi_types.append(tp) # placeholder
- for tp1 in tp.args:
- assert isinstance(tp1, (model.VoidType,
- model.BasePrimitiveType,
- model.PointerType,
- model.StructOrUnionOrEnum,
- model.FunctionPtrType))
- if self._typesdict[tp1] is None:
- self._typesdict[tp1] = len(self.cffi_types)
- self.cffi_types.append(tp1) # placeholder
- self.cffi_types.append('END') # placeholder
- #
- # prepare all OTHER bytecode sequences
- for tp in all_decls:
- if not tp.is_raw_function and self._typesdict[tp] is None:
- self._typesdict[tp] = len(self.cffi_types)
- self.cffi_types.append(tp) # placeholder
- if tp.is_array_type and tp.length is not None:
- self.cffi_types.append('LEN') # placeholder
- assert None not in self._typesdict.values()
- #
- # collect all structs and unions and enums
- self._struct_unions = {}
- self._enums = {}
- for tp in all_decls:
- if isinstance(tp, model.StructOrUnion):
- self._struct_unions[tp] = None
- elif isinstance(tp, model.EnumType):
- self._enums[tp] = None
- for i, tp in enumerate(sorted(self._struct_unions,
- key=lambda tp: tp.name)):
- self._struct_unions[tp] = i
- for i, tp in enumerate(sorted(self._enums,
- key=lambda tp: tp.name)):
- self._enums[tp] = i
- #
- # emit all bytecode sequences now
- for tp in all_decls:
- method = getattr(self, '_emit_bytecode_' + tp.__class__.__name__)
- method(tp, self._typesdict[tp])
- #
- # consistency check
- for op in self.cffi_types:
- assert isinstance(op, CffiOp)
- self.cffi_types = tuple(self.cffi_types) # don't change any more
-
- def _do_collect_type(self, tp):
- if not isinstance(tp, model.BaseTypeByIdentity):
- if isinstance(tp, tuple):
- for x in tp:
- self._do_collect_type(x)
- return
- if tp not in self._typesdict:
- self._typesdict[tp] = None
- if isinstance(tp, model.FunctionPtrType):
- self._do_collect_type(tp.as_raw_function())
- elif isinstance(tp, model.StructOrUnion):
- if tp.fldtypes is not None and (
- tp not in self.ffi._parser._included_declarations):
- for name1, tp1, _, _ in tp.enumfields():
- self._do_collect_type(self._field_type(tp, name1, tp1))
- else:
- for _, x in tp._get_items():
- self._do_collect_type(x)
-
- def _generate(self, step_name):
- lst = self.ffi._parser._declarations.items()
- for name, (tp, quals) in sorted(lst):
- kind, realname = name.split(' ', 1)
- try:
- method = getattr(self, '_generate_cpy_%s_%s' % (kind,
- step_name))
- except AttributeError:
- raise VerificationError(
- "not implemented in recompile(): %r" % name)
- try:
- self._current_quals = quals
- method(tp, realname)
- except Exception as e:
- model.attach_exception_info(e, name)
- raise
-
- # ----------
-
- ALL_STEPS = ["global", "field", "struct_union", "enum", "typename"]
-
- def collect_step_tables(self):
- # collect the declarations for '_cffi_globals', '_cffi_typenames', etc.
- self._lsts = {}
- for step_name in self.ALL_STEPS:
- self._lsts[step_name] = []
- self._seen_struct_unions = set()
- self._generate("ctx")
- self._add_missing_struct_unions()
- #
- for step_name in self.ALL_STEPS:
- lst = self._lsts[step_name]
- if step_name != "field":
- lst.sort(key=lambda entry: entry.name)
- self._lsts[step_name] = tuple(lst) # don't change any more
- #
- # check for a possible internal inconsistency: _cffi_struct_unions
- # should have been generated with exactly self._struct_unions
- lst = self._lsts["struct_union"]
- for tp, i in self._struct_unions.items():
- assert i < len(lst)
- assert lst[i].name == tp.name
- assert len(lst) == len(self._struct_unions)
- # same with enums
- lst = self._lsts["enum"]
- for tp, i in self._enums.items():
- assert i < len(lst)
- assert lst[i].name == tp.name
- assert len(lst) == len(self._enums)
-
- # ----------
-
- def _prnt(self, what=''):
- self._f.write(what + '\n')
-
- def write_source_to_f(self, f, preamble):
- if self.target_is_python:
- assert preamble is None
- self.write_py_source_to_f(f)
- else:
- assert preamble is not None
- self.write_c_source_to_f(f, preamble)
-
- def _rel_readlines(self, filename):
- g = open(os.path.join(os.path.dirname(__file__), filename), 'r')
- lines = g.readlines()
- g.close()
- return lines
-
- def write_c_source_to_f(self, f, preamble):
- self._f = f
- prnt = self._prnt
- if self.ffi._embedding is not None:
- prnt('#define _CFFI_USE_EMBEDDING')
- #
- # first the '#include' (actually done by inlining the file's content)
- lines = self._rel_readlines('_cffi_include.h')
- i = lines.index('#include "parse_c_type.h"\n')
- lines[i:i+1] = self._rel_readlines('parse_c_type.h')
- prnt(''.join(lines))
- #
- # if we have ffi._embedding != None, we give it here as a macro
- # and include an extra file
- base_module_name = self.module_name.split('.')[-1]
- if self.ffi._embedding is not None:
- prnt('#define _CFFI_MODULE_NAME "%s"' % (self.module_name,))
- prnt('static const char _CFFI_PYTHON_STARTUP_CODE[] = {')
- self._print_string_literal_in_array(self.ffi._embedding)
- prnt('0 };')
- prnt('#ifdef PYPY_VERSION')
- prnt('# define _CFFI_PYTHON_STARTUP_FUNC _cffi_pypyinit_%s' % (
- base_module_name,))
- prnt('#elif PY_MAJOR_VERSION >= 3')
- prnt('# define _CFFI_PYTHON_STARTUP_FUNC PyInit_%s' % (
- base_module_name,))
- prnt('#else')
- prnt('# define _CFFI_PYTHON_STARTUP_FUNC init%s' % (
- base_module_name,))
- prnt('#endif')
- lines = self._rel_readlines('_embedding.h')
- i = lines.index('#include "_cffi_errors.h"\n')
- lines[i:i+1] = self._rel_readlines('_cffi_errors.h')
- prnt(''.join(lines))
- self.needs_version(VERSION_EMBEDDED)
- #
- # then paste the C source given by the user, verbatim.
- prnt('/************************************************************/')
- prnt()
- prnt(preamble)
- prnt()
- prnt('/************************************************************/')
- prnt()
- #
- # the declaration of '_cffi_types'
- prnt('static void *_cffi_types[] = {')
- typeindex2type = dict([(i, tp) for (tp, i) in self._typesdict.items()])
- for i, op in enumerate(self.cffi_types):
- comment = ''
- if i in typeindex2type:
- comment = ' // ' + typeindex2type[i]._get_c_name()
- prnt('/* %2d */ %s,%s' % (i, op.as_c_expr(), comment))
- if not self.cffi_types:
- prnt(' 0')
- prnt('};')
- prnt()
- #
- # call generate_cpy_xxx_decl(), for every xxx found from
- # ffi._parser._declarations. This generates all the functions.
- self._seen_constants = set()
- self._generate("decl")
- #
- # the declaration of '_cffi_globals' and '_cffi_typenames'
- nums = {}
- for step_name in self.ALL_STEPS:
- lst = self._lsts[step_name]
- nums[step_name] = len(lst)
- if nums[step_name] > 0:
- prnt('static const struct _cffi_%s_s _cffi_%ss[] = {' % (
- step_name, step_name))
- for entry in lst:
- prnt(entry.as_c_expr())
- prnt('};')
- prnt()
- #
- # the declaration of '_cffi_includes'
- if self.ffi._included_ffis:
- prnt('static const char * const _cffi_includes[] = {')
- for ffi_to_include in self.ffi._included_ffis:
- try:
- included_module_name, included_source = (
- ffi_to_include._assigned_source[:2])
- except AttributeError:
- raise VerificationError(
- "ffi object %r includes %r, but the latter has not "
- "been prepared with set_source()" % (
- self.ffi, ffi_to_include,))
- if included_source is None:
- raise VerificationError(
- "not implemented yet: ffi.include() of a Python-based "
- "ffi inside a C-based ffi")
- prnt(' "%s",' % (included_module_name,))
- prnt(' NULL')
- prnt('};')
- prnt()
- #
- # the declaration of '_cffi_type_context'
- prnt('static const struct _cffi_type_context_s _cffi_type_context = {')
- prnt(' _cffi_types,')
- for step_name in self.ALL_STEPS:
- if nums[step_name] > 0:
- prnt(' _cffi_%ss,' % step_name)
- else:
- prnt(' NULL, /* no %ss */' % step_name)
- for step_name in self.ALL_STEPS:
- if step_name != "field":
- prnt(' %d, /* num_%ss */' % (nums[step_name], step_name))
- if self.ffi._included_ffis:
- prnt(' _cffi_includes,')
- else:
- prnt(' NULL, /* no includes */')
- prnt(' %d, /* num_types */' % (len(self.cffi_types),))
- flags = 0
- if self._num_externpy:
- flags |= 1 # set to mean that we use extern "Python"
- prnt(' %d, /* flags */' % flags)
- prnt('};')
- prnt()
- #
- # the init function
- prnt('#ifdef __GNUC__')
- prnt('# pragma GCC visibility push(default) /* for -fvisibility= */')
- prnt('#endif')
- prnt()
- prnt('#ifdef PYPY_VERSION')
- prnt('PyMODINIT_FUNC')
- prnt('_cffi_pypyinit_%s(const void *p[])' % (base_module_name,))
- prnt('{')
- if self._num_externpy:
- prnt(' if (((intptr_t)p[0]) >= 0x0A03) {')
- prnt(' _cffi_call_python_org = '
- '(void(*)(struct _cffi_externpy_s *, char *))p[1];')
- prnt(' }')
- prnt(' p[0] = (const void *)0x%x;' % self._version)
- prnt(' p[1] = &_cffi_type_context;')
- prnt('#if PY_MAJOR_VERSION >= 3')
- prnt(' return NULL;')
- prnt('#endif')
- prnt('}')
- # on Windows, distutils insists on putting init_cffi_xyz in
- # 'export_symbols', so instead of fighting it, just give up and
- # give it one
- prnt('# ifdef _MSC_VER')
- prnt(' PyMODINIT_FUNC')
- prnt('# if PY_MAJOR_VERSION >= 3')
- prnt(' PyInit_%s(void) { return NULL; }' % (base_module_name,))
- prnt('# else')
- prnt(' init%s(void) { }' % (base_module_name,))
- prnt('# endif')
- prnt('# endif')
- prnt('#elif PY_MAJOR_VERSION >= 3')
- prnt('PyMODINIT_FUNC')
- prnt('PyInit_%s(void)' % (base_module_name,))
- prnt('{')
- prnt(' return _cffi_init("%s", 0x%x, &_cffi_type_context);' % (
- self.module_name, self._version))
- prnt('}')
- prnt('#else')
- prnt('PyMODINIT_FUNC')
- prnt('init%s(void)' % (base_module_name,))
- prnt('{')
- prnt(' _cffi_init("%s", 0x%x, &_cffi_type_context);' % (
- self.module_name, self._version))
- prnt('}')
- prnt('#endif')
- prnt()
- prnt('#ifdef __GNUC__')
- prnt('# pragma GCC visibility pop')
- prnt('#endif')
- self._version = None
-
- def _to_py(self, x):
- if isinstance(x, str):
- return "b'%s'" % (x,)
- if isinstance(x, (list, tuple)):
- rep = [self._to_py(item) for item in x]
- if len(rep) == 1:
- rep.append('')
- return "(%s)" % (','.join(rep),)
- return x.as_python_expr() # Py2: unicode unexpected; Py3: bytes unexp.
-
- def write_py_source_to_f(self, f):
- self._f = f
- prnt = self._prnt
- #
- # header
- prnt("# auto-generated file")
- prnt("import _cffi_backend")
- #
- # the 'import' of the included ffis
- num_includes = len(self.ffi._included_ffis or ())
- for i in range(num_includes):
- ffi_to_include = self.ffi._included_ffis[i]
- try:
- included_module_name, included_source = (
- ffi_to_include._assigned_source[:2])
- except AttributeError:
- raise VerificationError(
- "ffi object %r includes %r, but the latter has not "
- "been prepared with set_source()" % (
- self.ffi, ffi_to_include,))
- if included_source is not None:
- raise VerificationError(
- "not implemented yet: ffi.include() of a C-based "
- "ffi inside a Python-based ffi")
- prnt('from %s import ffi as _ffi%d' % (included_module_name, i))
- prnt()
- prnt("ffi = _cffi_backend.FFI('%s'," % (self.module_name,))
- prnt(" _version = 0x%x," % (self._version,))
- self._version = None
- #
- # the '_types' keyword argument
- self.cffi_types = tuple(self.cffi_types) # don't change any more
- types_lst = [op.as_python_bytes() for op in self.cffi_types]
- prnt(' _types = %s,' % (self._to_py(''.join(types_lst)),))
- typeindex2type = dict([(i, tp) for (tp, i) in self._typesdict.items()])
- #
- # the keyword arguments from ALL_STEPS
- for step_name in self.ALL_STEPS:
- lst = self._lsts[step_name]
- if len(lst) > 0 and step_name != "field":
- prnt(' _%ss = %s,' % (step_name, self._to_py(lst)))
- #
- # the '_includes' keyword argument
- if num_includes > 0:
- prnt(' _includes = (%s,),' % (
- ', '.join(['_ffi%d' % i for i in range(num_includes)]),))
- #
- # the footer
- prnt(')')
-
- # ----------
-
- def _gettypenum(self, type):
- # a KeyError here is a bug. please report it! :-)
- return self._typesdict[type]
-
- def _convert_funcarg_to_c(self, tp, fromvar, tovar, errcode):
- extraarg = ''
- if isinstance(tp, model.BasePrimitiveType) and not tp.is_complex_type():
- if tp.is_integer_type() and tp.name != '_Bool':
- converter = '_cffi_to_c_int'
- extraarg = ', %s' % tp.name
- elif isinstance(tp, model.UnknownFloatType):
- # don't check with is_float_type(): it may be a 'long
- # double' here, and _cffi_to_c_double would loose precision
- converter = '(%s)_cffi_to_c_double' % (tp.get_c_name(''),)
- else:
- cname = tp.get_c_name('')
- converter = '(%s)_cffi_to_c_%s' % (cname,
- tp.name.replace(' ', '_'))
- if cname in ('char16_t', 'char32_t'):
- self.needs_version(VERSION_CHAR16CHAR32)
- errvalue = '-1'
- #
- elif isinstance(tp, model.PointerType):
- self._convert_funcarg_to_c_ptr_or_array(tp, fromvar,
- tovar, errcode)
- return
- #
- elif (isinstance(tp, model.StructOrUnionOrEnum) or
- isinstance(tp, model.BasePrimitiveType)):
- # a struct (not a struct pointer) as a function argument;
- # or, a complex (the same code works)
- self._prnt(' if (_cffi_to_c((char *)&%s, _cffi_type(%d), %s) < 0)'
- % (tovar, self._gettypenum(tp), fromvar))
- self._prnt(' %s;' % errcode)
- return
- #
- elif isinstance(tp, model.FunctionPtrType):
- converter = '(%s)_cffi_to_c_pointer' % tp.get_c_name('')
- extraarg = ', _cffi_type(%d)' % self._gettypenum(tp)
- errvalue = 'NULL'
- #
- else:
- raise NotImplementedError(tp)
- #
- self._prnt(' %s = %s(%s%s);' % (tovar, converter, fromvar, extraarg))
- self._prnt(' if (%s == (%s)%s && PyErr_Occurred())' % (
- tovar, tp.get_c_name(''), errvalue))
- self._prnt(' %s;' % errcode)
-
- def _extra_local_variables(self, tp, localvars):
- if isinstance(tp, model.PointerType):
- localvars.add('Py_ssize_t datasize')
-
- def _convert_funcarg_to_c_ptr_or_array(self, tp, fromvar, tovar, errcode):
- self._prnt(' datasize = _cffi_prepare_pointer_call_argument(')
- self._prnt(' _cffi_type(%d), %s, (char **)&%s);' % (
- self._gettypenum(tp), fromvar, tovar))
- self._prnt(' if (datasize != 0) {')
- self._prnt(' if (datasize < 0)')
- self._prnt(' %s;' % errcode)
- self._prnt(' %s = (%s)alloca((size_t)datasize);' % (
- tovar, tp.get_c_name('')))
- self._prnt(' memset((void *)%s, 0, (size_t)datasize);' % (tovar,))
- self._prnt(' if (_cffi_convert_array_from_object('
- '(char *)%s, _cffi_type(%d), %s) < 0)' % (
- tovar, self._gettypenum(tp), fromvar))
- self._prnt(' %s;' % errcode)
- self._prnt(' }')
-
- def _convert_expr_from_c(self, tp, var, context):
- if isinstance(tp, model.BasePrimitiveType):
- if tp.is_integer_type() and tp.name != '_Bool':
- return '_cffi_from_c_int(%s, %s)' % (var, tp.name)
- elif isinstance(tp, model.UnknownFloatType):
- return '_cffi_from_c_double(%s)' % (var,)
- elif tp.name != 'long double' and not tp.is_complex_type():
- cname = tp.name.replace(' ', '_')
- if cname in ('char16_t', 'char32_t'):
- self.needs_version(VERSION_CHAR16CHAR32)
- return '_cffi_from_c_%s(%s)' % (cname, var)
- else:
- return '_cffi_from_c_deref((char *)&%s, _cffi_type(%d))' % (
- var, self._gettypenum(tp))
- elif isinstance(tp, (model.PointerType, model.FunctionPtrType)):
- return '_cffi_from_c_pointer((char *)%s, _cffi_type(%d))' % (
- var, self._gettypenum(tp))
- elif isinstance(tp, model.ArrayType):
- return '_cffi_from_c_pointer((char *)%s, _cffi_type(%d))' % (
- var, self._gettypenum(model.PointerType(tp.item)))
- elif isinstance(tp, model.StructOrUnion):
- if tp.fldnames is None:
- raise TypeError("'%s' is used as %s, but is opaque" % (
- tp._get_c_name(), context))
- return '_cffi_from_c_struct((char *)&%s, _cffi_type(%d))' % (
- var, self._gettypenum(tp))
- elif isinstance(tp, model.EnumType):
- return '_cffi_from_c_deref((char *)&%s, _cffi_type(%d))' % (
- var, self._gettypenum(tp))
- else:
- raise NotImplementedError(tp)
-
- # ----------
- # typedefs
-
- def _typedef_type(self, tp, name):
- return self._global_type(tp, "(*(%s *)0)" % (name,))
-
- def _generate_cpy_typedef_collecttype(self, tp, name):
- self._do_collect_type(self._typedef_type(tp, name))
-
- def _generate_cpy_typedef_decl(self, tp, name):
- pass
-
- def _typedef_ctx(self, tp, name):
- type_index = self._typesdict[tp]
- self._lsts["typename"].append(TypenameExpr(name, type_index))
-
- def _generate_cpy_typedef_ctx(self, tp, name):
- tp = self._typedef_type(tp, name)
- self._typedef_ctx(tp, name)
- if getattr(tp, "origin", None) == "unknown_type":
- self._struct_ctx(tp, tp.name, approxname=None)
- elif isinstance(tp, model.NamedPointerType):
- self._struct_ctx(tp.totype, tp.totype.name, approxname=tp.name,
- named_ptr=tp)
-
- # ----------
- # function declarations
-
- def _generate_cpy_function_collecttype(self, tp, name):
- self._do_collect_type(tp.as_raw_function())
- if tp.ellipsis and not self.target_is_python:
- self._do_collect_type(tp)
-
- def _generate_cpy_function_decl(self, tp, name):
- assert not self.target_is_python
- assert isinstance(tp, model.FunctionPtrType)
- if tp.ellipsis:
- # cannot support vararg functions better than this: check for its
- # exact type (including the fixed arguments), and build it as a
- # constant function pointer (no CPython wrapper)
- self._generate_cpy_constant_decl(tp, name)
- return
- prnt = self._prnt
- numargs = len(tp.args)
- if numargs == 0:
- argname = 'noarg'
- elif numargs == 1:
- argname = 'arg0'
- else:
- argname = 'args'
- #
- # ------------------------------
- # the 'd' version of the function, only for addressof(lib, 'func')
- arguments = []
- call_arguments = []
- context = 'argument of %s' % name
- for i, type in enumerate(tp.args):
- arguments.append(type.get_c_name(' x%d' % i, context))
- call_arguments.append('x%d' % i)
- repr_arguments = ', '.join(arguments)
- repr_arguments = repr_arguments or 'void'
- if tp.abi:
- abi = tp.abi + ' '
- else:
- abi = ''
- name_and_arguments = '%s_cffi_d_%s(%s)' % (abi, name, repr_arguments)
- prnt('static %s' % (tp.result.get_c_name(name_and_arguments),))
- prnt('{')
- call_arguments = ', '.join(call_arguments)
- result_code = 'return '
- if isinstance(tp.result, model.VoidType):
- result_code = ''
- prnt(' %s%s(%s);' % (result_code, name, call_arguments))
- prnt('}')
- #
- prnt('#ifndef PYPY_VERSION') # ------------------------------
- #
- prnt('static PyObject *')
- prnt('_cffi_f_%s(PyObject *self, PyObject *%s)' % (name, argname))
- prnt('{')
- #
- context = 'argument of %s' % name
- for i, type in enumerate(tp.args):
- arg = type.get_c_name(' x%d' % i, context)
- prnt(' %s;' % arg)
- #
- localvars = set()
- for type in tp.args:
- self._extra_local_variables(type, localvars)
- for decl in localvars:
- prnt(' %s;' % (decl,))
- #
- if not isinstance(tp.result, model.VoidType):
- result_code = 'result = '
- context = 'result of %s' % name
- result_decl = ' %s;' % tp.result.get_c_name(' result', context)
- prnt(result_decl)
- else:
- result_decl = None
- result_code = ''
- #
- if len(tp.args) > 1:
- rng = range(len(tp.args))
- for i in rng:
- prnt(' PyObject *arg%d;' % i)
- prnt()
- prnt(' if (!PyArg_UnpackTuple(args, "%s", %d, %d, %s))' % (
- name, len(rng), len(rng),
- ', '.join(['&arg%d' % i for i in rng])))
- prnt(' return NULL;')
- prnt()
- #
- for i, type in enumerate(tp.args):
- self._convert_funcarg_to_c(type, 'arg%d' % i, 'x%d' % i,
- 'return NULL')
- prnt()
- #
- prnt(' Py_BEGIN_ALLOW_THREADS')
- prnt(' _cffi_restore_errno();')
- call_arguments = ['x%d' % i for i in range(len(tp.args))]
- call_arguments = ', '.join(call_arguments)
- prnt(' { %s%s(%s); }' % (result_code, name, call_arguments))
- prnt(' _cffi_save_errno();')
- prnt(' Py_END_ALLOW_THREADS')
- prnt()
- #
- prnt(' (void)self; /* unused */')
- if numargs == 0:
- prnt(' (void)noarg; /* unused */')
- if result_code:
- prnt(' return %s;' %
- self._convert_expr_from_c(tp.result, 'result', 'result type'))
- else:
- prnt(' Py_INCREF(Py_None);')
- prnt(' return Py_None;')
- prnt('}')
- #
- prnt('#else') # ------------------------------
- #
- # the PyPy version: need to replace struct/union arguments with
- # pointers, and if the result is a struct/union, insert a first
- # arg that is a pointer to the result. We also do that for
- # complex args and return type.
- def need_indirection(type):
- return (isinstance(type, model.StructOrUnion) or
- (isinstance(type, model.PrimitiveType) and
- type.is_complex_type()))
- difference = False
- arguments = []
- call_arguments = []
- context = 'argument of %s' % name
- for i, type in enumerate(tp.args):
- indirection = ''
- if need_indirection(type):
- indirection = '*'
- difference = True
- arg = type.get_c_name(' %sx%d' % (indirection, i), context)
- arguments.append(arg)
- call_arguments.append('%sx%d' % (indirection, i))
- tp_result = tp.result
- if need_indirection(tp_result):
- context = 'result of %s' % name
- arg = tp_result.get_c_name(' *result', context)
- arguments.insert(0, arg)
- tp_result = model.void_type
- result_decl = None
- result_code = '*result = '
- difference = True
- if difference:
- repr_arguments = ', '.join(arguments)
- repr_arguments = repr_arguments or 'void'
- name_and_arguments = '%s_cffi_f_%s(%s)' % (abi, name,
- repr_arguments)
- prnt('static %s' % (tp_result.get_c_name(name_and_arguments),))
- prnt('{')
- if result_decl:
- prnt(result_decl)
- call_arguments = ', '.join(call_arguments)
- prnt(' { %s%s(%s); }' % (result_code, name, call_arguments))
- if result_decl:
- prnt(' return result;')
- prnt('}')
- else:
- prnt('# define _cffi_f_%s _cffi_d_%s' % (name, name))
- #
- prnt('#endif') # ------------------------------
- prnt()
-
- def _generate_cpy_function_ctx(self, tp, name):
- if tp.ellipsis and not self.target_is_python:
- self._generate_cpy_constant_ctx(tp, name)
- return
- type_index = self._typesdict[tp.as_raw_function()]
- numargs = len(tp.args)
- if self.target_is_python:
- meth_kind = OP_DLOPEN_FUNC
- elif numargs == 0:
- meth_kind = OP_CPYTHON_BLTN_N # 'METH_NOARGS'
- elif numargs == 1:
- meth_kind = OP_CPYTHON_BLTN_O # 'METH_O'
- else:
- meth_kind = OP_CPYTHON_BLTN_V # 'METH_VARARGS'
- self._lsts["global"].append(
- GlobalExpr(name, '_cffi_f_%s' % name,
- CffiOp(meth_kind, type_index),
- size='_cffi_d_%s' % name))
-
- # ----------
- # named structs or unions
-
- def _field_type(self, tp_struct, field_name, tp_field):
- if isinstance(tp_field, model.ArrayType):
- actual_length = tp_field.length
- if actual_length == '...':
- ptr_struct_name = tp_struct.get_c_name('*')
- actual_length = '_cffi_array_len(((%s)0)->%s)' % (
- ptr_struct_name, field_name)
- tp_item = self._field_type(tp_struct, '%s[0]' % field_name,
- tp_field.item)
- tp_field = model.ArrayType(tp_item, actual_length)
- return tp_field
-
- def _struct_collecttype(self, tp):
- self._do_collect_type(tp)
- if self.target_is_python:
- # also requires nested anon struct/unions in ABI mode, recursively
- for fldtype in tp.anonymous_struct_fields():
- self._struct_collecttype(fldtype)
-
- def _struct_decl(self, tp, cname, approxname):
- if tp.fldtypes is None:
- return
- prnt = self._prnt
- checkfuncname = '_cffi_checkfld_%s' % (approxname,)
- prnt('_CFFI_UNUSED_FN')
- prnt('static void %s(%s *p)' % (checkfuncname, cname))
- prnt('{')
- prnt(' /* only to generate compile-time warnings or errors */')
- prnt(' (void)p;')
- for fname, ftype, fbitsize, fqual in tp.enumfields():
- try:
- if ftype.is_integer_type() or fbitsize >= 0:
- # accept all integers, but complain on float or double
- prnt(" (void)((p->%s) | 0); /* check that '%s.%s' is "
- "an integer */" % (fname, cname, fname))
- continue
- # only accept exactly the type declared, except that '[]'
- # is interpreted as a '*' and so will match any array length.
- # (It would also match '*', but that's harder to detect...)
- while (isinstance(ftype, model.ArrayType)
- and (ftype.length is None or ftype.length == '...')):
- ftype = ftype.item
- fname = fname + '[0]'
- prnt(' { %s = &p->%s; (void)tmp; }' % (
- ftype.get_c_name('*tmp', 'field %r'%fname, quals=fqual),
- fname))
- except VerificationError as e:
- prnt(' /* %s */' % str(e)) # cannot verify it, ignore
- prnt('}')
- prnt('struct _cffi_align_%s { char x; %s y; };' % (approxname, cname))
- prnt()
-
- def _struct_ctx(self, tp, cname, approxname, named_ptr=None):
- type_index = self._typesdict[tp]
- reason_for_not_expanding = None
- flags = []
- if isinstance(tp, model.UnionType):
- flags.append("_CFFI_F_UNION")
- if tp.fldtypes is None:
- flags.append("_CFFI_F_OPAQUE")
- reason_for_not_expanding = "opaque"
- if (tp not in self.ffi._parser._included_declarations and
- (named_ptr is None or
- named_ptr not in self.ffi._parser._included_declarations)):
- if tp.fldtypes is None:
- pass # opaque
- elif tp.partial or any(tp.anonymous_struct_fields()):
- pass # field layout obtained silently from the C compiler
- else:
- flags.append("_CFFI_F_CHECK_FIELDS")
- if tp.packed:
- flags.append("_CFFI_F_PACKED")
- else:
- flags.append("_CFFI_F_EXTERNAL")
- reason_for_not_expanding = "external"
- flags = '|'.join(flags) or '0'
- c_fields = []
- if reason_for_not_expanding is None:
- expand_anonymous_struct_union = not self.target_is_python
- enumfields = list(tp.enumfields(expand_anonymous_struct_union))
- for fldname, fldtype, fbitsize, fqual in enumfields:
- fldtype = self._field_type(tp, fldname, fldtype)
- self._check_not_opaque(fldtype,
- "field '%s.%s'" % (tp.name, fldname))
- # cname is None for _add_missing_struct_unions() only
- op = OP_NOOP
- if fbitsize >= 0:
- op = OP_BITFIELD
- size = '%d /* bits */' % fbitsize
- elif cname is None or (
- isinstance(fldtype, model.ArrayType) and
- fldtype.length is None):
- size = '(size_t)-1'
- else:
- size = 'sizeof(((%s)0)->%s)' % (
- tp.get_c_name('*') if named_ptr is None
- else named_ptr.name,
- fldname)
- if cname is None or fbitsize >= 0:
- offset = '(size_t)-1'
- elif named_ptr is not None:
- offset = '((char *)&((%s)0)->%s) - (char *)0' % (
- named_ptr.name, fldname)
- else:
- offset = 'offsetof(%s, %s)' % (tp.get_c_name(''), fldname)
- c_fields.append(
- FieldExpr(fldname, offset, size, fbitsize,
- CffiOp(op, self._typesdict[fldtype])))
- first_field_index = len(self._lsts["field"])
- self._lsts["field"].extend(c_fields)
- #
- if cname is None: # unknown name, for _add_missing_struct_unions
- size = '(size_t)-2'
- align = -2
- comment = "unnamed"
- else:
- if named_ptr is not None:
- size = 'sizeof(*(%s)0)' % (named_ptr.name,)
- align = '-1 /* unknown alignment */'
- else:
- size = 'sizeof(%s)' % (cname,)
- align = 'offsetof(struct _cffi_align_%s, y)' % (approxname,)
- comment = None
- else:
- size = '(size_t)-1'
- align = -1
- first_field_index = -1
- comment = reason_for_not_expanding
- self._lsts["struct_union"].append(
- StructUnionExpr(tp.name, type_index, flags, size, align, comment,
- first_field_index, c_fields))
- self._seen_struct_unions.add(tp)
-
- def _check_not_opaque(self, tp, location):
- while isinstance(tp, model.ArrayType):
- tp = tp.item
- if isinstance(tp, model.StructOrUnion) and tp.fldtypes is None:
- raise TypeError(
- "%s is of an opaque type (not declared in cdef())" % location)
-
- def _add_missing_struct_unions(self):
- # not very nice, but some struct declarations might be missing
- # because they don't have any known C name. Check that they are
- # not partial (we can't complete or verify them!) and emit them
- # anonymously.
- lst = list(self._struct_unions.items())
- lst.sort(key=lambda tp_order: tp_order[1])
- for tp, order in lst:
- if tp not in self._seen_struct_unions:
- if tp.partial:
- raise NotImplementedError("internal inconsistency: %r is "
- "partial but was not seen at "
- "this point" % (tp,))
- if tp.name.startswith('$') and tp.name[1:].isdigit():
- approxname = tp.name[1:]
- elif tp.name == '_IO_FILE' and tp.forcename == 'FILE':
- approxname = 'FILE'
- self._typedef_ctx(tp, 'FILE')
- else:
- raise NotImplementedError("internal inconsistency: %r" %
- (tp,))
- self._struct_ctx(tp, None, approxname)
-
- def _generate_cpy_struct_collecttype(self, tp, name):
- self._struct_collecttype(tp)
- _generate_cpy_union_collecttype = _generate_cpy_struct_collecttype
-
- def _struct_names(self, tp):
- cname = tp.get_c_name('')
- if ' ' in cname:
- return cname, cname.replace(' ', '_')
- else:
- return cname, '_' + cname
-
- def _generate_cpy_struct_decl(self, tp, name):
- self._struct_decl(tp, *self._struct_names(tp))
- _generate_cpy_union_decl = _generate_cpy_struct_decl
-
- def _generate_cpy_struct_ctx(self, tp, name):
- self._struct_ctx(tp, *self._struct_names(tp))
- _generate_cpy_union_ctx = _generate_cpy_struct_ctx
-
- # ----------
- # 'anonymous' declarations. These are produced for anonymous structs
- # or unions; the 'name' is obtained by a typedef.
-
- def _generate_cpy_anonymous_collecttype(self, tp, name):
- if isinstance(tp, model.EnumType):
- self._generate_cpy_enum_collecttype(tp, name)
- else:
- self._struct_collecttype(tp)
-
- def _generate_cpy_anonymous_decl(self, tp, name):
- if isinstance(tp, model.EnumType):
- self._generate_cpy_enum_decl(tp)
- else:
- self._struct_decl(tp, name, 'typedef_' + name)
-
- def _generate_cpy_anonymous_ctx(self, tp, name):
- if isinstance(tp, model.EnumType):
- self._enum_ctx(tp, name)
- else:
- self._struct_ctx(tp, name, 'typedef_' + name)
-
- # ----------
- # constants, declared with "static const ..."
-
- def _generate_cpy_const(self, is_int, name, tp=None, category='const',
- check_value=None):
- if (category, name) in self._seen_constants:
- raise VerificationError(
- "duplicate declaration of %s '%s'" % (category, name))
- self._seen_constants.add((category, name))
- #
- prnt = self._prnt
- funcname = '_cffi_%s_%s' % (category, name)
- if is_int:
- prnt('static int %s(unsigned long long *o)' % funcname)
- prnt('{')
- prnt(' int n = (%s) <= 0;' % (name,))
- prnt(' *o = (unsigned long long)((%s) | 0);'
- ' /* check that %s is an integer */' % (name, name))
- if check_value is not None:
- if check_value > 0:
- check_value = '%dU' % (check_value,)
- prnt(' if (!_cffi_check_int(*o, n, %s))' % (check_value,))
- prnt(' n |= 2;')
- prnt(' return n;')
- prnt('}')
- else:
- assert check_value is None
- prnt('static void %s(char *o)' % funcname)
- prnt('{')
- prnt(' *(%s)o = %s;' % (tp.get_c_name('*'), name))
- prnt('}')
- prnt()
-
- def _generate_cpy_constant_collecttype(self, tp, name):
- is_int = tp.is_integer_type()
- if not is_int or self.target_is_python:
- self._do_collect_type(tp)
-
- def _generate_cpy_constant_decl(self, tp, name):
- is_int = tp.is_integer_type()
- self._generate_cpy_const(is_int, name, tp)
-
- def _generate_cpy_constant_ctx(self, tp, name):
- if not self.target_is_python and tp.is_integer_type():
- type_op = CffiOp(OP_CONSTANT_INT, -1)
- else:
- if self.target_is_python:
- const_kind = OP_DLOPEN_CONST
- else:
- const_kind = OP_CONSTANT
- type_index = self._typesdict[tp]
- type_op = CffiOp(const_kind, type_index)
- self._lsts["global"].append(
- GlobalExpr(name, '_cffi_const_%s' % name, type_op))
-
- # ----------
- # enums
-
- def _generate_cpy_enum_collecttype(self, tp, name):
- self._do_collect_type(tp)
-
- def _generate_cpy_enum_decl(self, tp, name=None):
- for enumerator in tp.enumerators:
- self._generate_cpy_const(True, enumerator)
-
- def _enum_ctx(self, tp, cname):
- type_index = self._typesdict[tp]
- type_op = CffiOp(OP_ENUM, -1)
- if self.target_is_python:
- tp.check_not_partial()
- for enumerator, enumvalue in zip(tp.enumerators, tp.enumvalues):
- self._lsts["global"].append(
- GlobalExpr(enumerator, '_cffi_const_%s' % enumerator, type_op,
- check_value=enumvalue))
- #
- if cname is not None and '$' not in cname and not self.target_is_python:
- size = "sizeof(%s)" % cname
- signed = "((%s)-1) <= 0" % cname
- else:
- basetp = tp.build_baseinttype(self.ffi, [])
- size = self.ffi.sizeof(basetp)
- signed = int(int(self.ffi.cast(basetp, -1)) < 0)
- allenums = ",".join(tp.enumerators)
- self._lsts["enum"].append(
- EnumExpr(tp.name, type_index, size, signed, allenums))
-
- def _generate_cpy_enum_ctx(self, tp, name):
- self._enum_ctx(tp, tp._get_c_name())
-
- # ----------
- # macros: for now only for integers
-
- def _generate_cpy_macro_collecttype(self, tp, name):
- pass
-
- def _generate_cpy_macro_decl(self, tp, name):
- if tp == '...':
- check_value = None
- else:
- check_value = tp # an integer
- self._generate_cpy_const(True, name, check_value=check_value)
-
- def _generate_cpy_macro_ctx(self, tp, name):
- if tp == '...':
- if self.target_is_python:
- raise VerificationError(
- "cannot use the syntax '...' in '#define %s ...' when "
- "using the ABI mode" % (name,))
- check_value = None
- else:
- check_value = tp # an integer
- type_op = CffiOp(OP_CONSTANT_INT, -1)
- self._lsts["global"].append(
- GlobalExpr(name, '_cffi_const_%s' % name, type_op,
- check_value=check_value))
-
- # ----------
- # global variables
-
- def _global_type(self, tp, global_name):
- if isinstance(tp, model.ArrayType):
- actual_length = tp.length
- if actual_length == '...':
- actual_length = '_cffi_array_len(%s)' % (global_name,)
- tp_item = self._global_type(tp.item, '%s[0]' % global_name)
- tp = model.ArrayType(tp_item, actual_length)
- return tp
-
- def _generate_cpy_variable_collecttype(self, tp, name):
- self._do_collect_type(self._global_type(tp, name))
-
- def _generate_cpy_variable_decl(self, tp, name):
- prnt = self._prnt
- tp = self._global_type(tp, name)
- if isinstance(tp, model.ArrayType) and tp.length is None:
- tp = tp.item
- ampersand = ''
- else:
- ampersand = '&'
- # This code assumes that casts from "tp *" to "void *" is a
- # no-op, i.e. a function that returns a "tp *" can be called
- # as if it returned a "void *". This should be generally true
- # on any modern machine. The only exception to that rule (on
- # uncommon architectures, and as far as I can tell) might be
- # if 'tp' were a function type, but that is not possible here.
- # (If 'tp' is a function _pointer_ type, then casts from "fn_t
- # **" to "void *" are again no-ops, as far as I can tell.)
- decl = '*_cffi_var_%s(void)' % (name,)
- prnt('static ' + tp.get_c_name(decl, quals=self._current_quals))
- prnt('{')
- prnt(' return %s(%s);' % (ampersand, name))
- prnt('}')
- prnt()
-
- def _generate_cpy_variable_ctx(self, tp, name):
- tp = self._global_type(tp, name)
- type_index = self._typesdict[tp]
- if self.target_is_python:
- op = OP_GLOBAL_VAR
- else:
- op = OP_GLOBAL_VAR_F
- self._lsts["global"].append(
- GlobalExpr(name, '_cffi_var_%s' % name, CffiOp(op, type_index)))
-
- # ----------
- # extern "Python"
-
- def _generate_cpy_extern_python_collecttype(self, tp, name):
- assert isinstance(tp, model.FunctionPtrType)
- self._do_collect_type(tp)
- _generate_cpy_dllexport_python_collecttype = \
- _generate_cpy_extern_python_plus_c_collecttype = \
- _generate_cpy_extern_python_collecttype
-
- def _extern_python_decl(self, tp, name, tag_and_space):
- prnt = self._prnt
- if isinstance(tp.result, model.VoidType):
- size_of_result = '0'
- else:
- context = 'result of %s' % name
- size_of_result = '(int)sizeof(%s)' % (
- tp.result.get_c_name('', context),)
- prnt('static struct _cffi_externpy_s _cffi_externpy__%s =' % name)
- prnt(' { "%s.%s", %s };' % (self.module_name, name, size_of_result))
- prnt()
- #
- arguments = []
- context = 'argument of %s' % name
- for i, type in enumerate(tp.args):
- arg = type.get_c_name(' a%d' % i, context)
- arguments.append(arg)
- #
- repr_arguments = ', '.join(arguments)
- repr_arguments = repr_arguments or 'void'
- name_and_arguments = '%s(%s)' % (name, repr_arguments)
- if tp.abi == "__stdcall":
- name_and_arguments = '_cffi_stdcall ' + name_and_arguments
- #
- def may_need_128_bits(tp):
- return (isinstance(tp, model.PrimitiveType) and
- tp.name == 'long double')
- #
- size_of_a = max(len(tp.args)*8, 8)
- if may_need_128_bits(tp.result):
- size_of_a = max(size_of_a, 16)
- if isinstance(tp.result, model.StructOrUnion):
- size_of_a = 'sizeof(%s) > %d ? sizeof(%s) : %d' % (
- tp.result.get_c_name(''), size_of_a,
- tp.result.get_c_name(''), size_of_a)
- prnt('%s%s' % (tag_and_space, tp.result.get_c_name(name_and_arguments)))
- prnt('{')
- prnt(' char a[%s];' % size_of_a)
- prnt(' char *p = a;')
- for i, type in enumerate(tp.args):
- arg = 'a%d' % i
- if (isinstance(type, model.StructOrUnion) or
- may_need_128_bits(type)):
- arg = '&' + arg
- type = model.PointerType(type)
- prnt(' *(%s)(p + %d) = %s;' % (type.get_c_name('*'), i*8, arg))
- prnt(' _cffi_call_python(&_cffi_externpy__%s, p);' % name)
- if not isinstance(tp.result, model.VoidType):
- prnt(' return *(%s)p;' % (tp.result.get_c_name('*'),))
- prnt('}')
- prnt()
- self._num_externpy += 1
-
- def _generate_cpy_extern_python_decl(self, tp, name):
- self._extern_python_decl(tp, name, 'static ')
-
- def _generate_cpy_dllexport_python_decl(self, tp, name):
- self._extern_python_decl(tp, name, 'CFFI_DLLEXPORT ')
-
- def _generate_cpy_extern_python_plus_c_decl(self, tp, name):
- self._extern_python_decl(tp, name, '')
-
- def _generate_cpy_extern_python_ctx(self, tp, name):
- if self.target_is_python:
- raise VerificationError(
- "cannot use 'extern \"Python\"' in the ABI mode")
- if tp.ellipsis:
- raise NotImplementedError("a vararg function is extern \"Python\"")
- type_index = self._typesdict[tp]
- type_op = CffiOp(OP_EXTERN_PYTHON, type_index)
- self._lsts["global"].append(
- GlobalExpr(name, '&_cffi_externpy__%s' % name, type_op, name))
-
- _generate_cpy_dllexport_python_ctx = \
- _generate_cpy_extern_python_plus_c_ctx = \
- _generate_cpy_extern_python_ctx
-
- def _print_string_literal_in_array(self, s):
- prnt = self._prnt
- prnt('// # NB. this is not a string because of a size limit in MSVC')
- for line in s.splitlines(True):
- prnt(('// ' + line).rstrip())
- printed_line = ''
- for c in line:
- if len(printed_line) >= 76:
- prnt(printed_line)
- printed_line = ''
- printed_line += '%d,' % (ord(c),)
- prnt(printed_line)
-
- # ----------
- # emitting the opcodes for individual types
-
- def _emit_bytecode_VoidType(self, tp, index):
- self.cffi_types[index] = CffiOp(OP_PRIMITIVE, PRIM_VOID)
-
- def _emit_bytecode_PrimitiveType(self, tp, index):
- prim_index = PRIMITIVE_TO_INDEX[tp.name]
- self.cffi_types[index] = CffiOp(OP_PRIMITIVE, prim_index)
-
- def _emit_bytecode_UnknownIntegerType(self, tp, index):
- s = ('_cffi_prim_int(sizeof(%s), (\n'
- ' ((%s)-1) | 0 /* check that %s is an integer type */\n'
- ' ) <= 0)' % (tp.name, tp.name, tp.name))
- self.cffi_types[index] = CffiOp(OP_PRIMITIVE, s)
-
- def _emit_bytecode_UnknownFloatType(self, tp, index):
- s = ('_cffi_prim_float(sizeof(%s) *\n'
- ' (((%s)1) / 2) * 2 /* integer => 0, float => 1 */\n'
- ' )' % (tp.name, tp.name))
- self.cffi_types[index] = CffiOp(OP_PRIMITIVE, s)
-
- def _emit_bytecode_RawFunctionType(self, tp, index):
- self.cffi_types[index] = CffiOp(OP_FUNCTION, self._typesdict[tp.result])
- index += 1
- for tp1 in tp.args:
- realindex = self._typesdict[tp1]
- if index != realindex:
- if isinstance(tp1, model.PrimitiveType):
- self._emit_bytecode_PrimitiveType(tp1, index)
- else:
- self.cffi_types[index] = CffiOp(OP_NOOP, realindex)
- index += 1
- flags = int(tp.ellipsis)
- if tp.abi is not None:
- if tp.abi == '__stdcall':
- flags |= 2
- else:
- raise NotImplementedError("abi=%r" % (tp.abi,))
- self.cffi_types[index] = CffiOp(OP_FUNCTION_END, flags)
-
- def _emit_bytecode_PointerType(self, tp, index):
- self.cffi_types[index] = CffiOp(OP_POINTER, self._typesdict[tp.totype])
-
- _emit_bytecode_ConstPointerType = _emit_bytecode_PointerType
- _emit_bytecode_NamedPointerType = _emit_bytecode_PointerType
-
- def _emit_bytecode_FunctionPtrType(self, tp, index):
- raw = tp.as_raw_function()
- self.cffi_types[index] = CffiOp(OP_POINTER, self._typesdict[raw])
-
- def _emit_bytecode_ArrayType(self, tp, index):
- item_index = self._typesdict[tp.item]
- if tp.length is None:
- self.cffi_types[index] = CffiOp(OP_OPEN_ARRAY, item_index)
- elif tp.length == '...':
- raise VerificationError(
- "type %s badly placed: the '...' array length can only be "
- "used on global arrays or on fields of structures" % (
- str(tp).replace('/*...*/', '...'),))
- else:
- assert self.cffi_types[index + 1] == 'LEN'
- self.cffi_types[index] = CffiOp(OP_ARRAY, item_index)
- self.cffi_types[index + 1] = CffiOp(None, str(tp.length))
-
- def _emit_bytecode_StructType(self, tp, index):
- struct_index = self._struct_unions[tp]
- self.cffi_types[index] = CffiOp(OP_STRUCT_UNION, struct_index)
- _emit_bytecode_UnionType = _emit_bytecode_StructType
-
- def _emit_bytecode_EnumType(self, tp, index):
- enum_index = self._enums[tp]
- self.cffi_types[index] = CffiOp(OP_ENUM, enum_index)
-
-
-if sys.version_info >= (3,):
- NativeIO = io.StringIO
-else:
- class NativeIO(io.BytesIO):
- def write(self, s):
- if isinstance(s, unicode):
- s = s.encode('ascii')
- super(NativeIO, self).write(s)
-
-def _make_c_or_py_source(ffi, module_name, preamble, target_file, verbose):
- if verbose:
- print("generating %s" % (target_file,))
- recompiler = Recompiler(ffi, module_name,
- target_is_python=(preamble is None))
- recompiler.collect_type_table()
- recompiler.collect_step_tables()
- f = NativeIO()
- recompiler.write_source_to_f(f, preamble)
- output = f.getvalue()
- try:
- with open(target_file, 'r') as f1:
- if f1.read(len(output) + 1) != output:
- raise IOError
- if verbose:
- print("(already up-to-date)")
- return False # already up-to-date
- except IOError:
- tmp_file = '%s.~%d' % (target_file, os.getpid())
- with open(tmp_file, 'w') as f1:
- f1.write(output)
- try:
- os.rename(tmp_file, target_file)
- except OSError:
- os.unlink(target_file)
- os.rename(tmp_file, target_file)
- return True
-
-def make_c_source(ffi, module_name, preamble, target_c_file, verbose=False):
- assert preamble is not None
- return _make_c_or_py_source(ffi, module_name, preamble, target_c_file,
- verbose)
-
-def make_py_source(ffi, module_name, target_py_file, verbose=False):
- return _make_c_or_py_source(ffi, module_name, None, target_py_file,
- verbose)
-
-def _modname_to_file(outputdir, modname, extension):
- parts = modname.split('.')
- try:
- os.makedirs(os.path.join(outputdir, *parts[:-1]))
- except OSError:
- pass
- parts[-1] += extension
- return os.path.join(outputdir, *parts), parts
-
-
-# Aaargh. Distutils is not tested at all for the purpose of compiling
-# DLLs that are not extension modules. Here are some hacks to work
-# around that, in the _patch_for_*() functions...
-
-def _patch_meth(patchlist, cls, name, new_meth):
- old = getattr(cls, name)
- patchlist.append((cls, name, old))
- setattr(cls, name, new_meth)
- return old
-
-def _unpatch_meths(patchlist):
- for cls, name, old_meth in reversed(patchlist):
- setattr(cls, name, old_meth)
-
-def _patch_for_embedding(patchlist):
- if sys.platform == 'win32':
- # we must not remove the manifest when building for embedding!
- from distutils.msvc9compiler import MSVCCompiler
- _patch_meth(patchlist, MSVCCompiler, '_remove_visual_c_ref',
- lambda self, manifest_file: manifest_file)
-
- if sys.platform == 'darwin':
- # we must not make a '-bundle', but a '-dynamiclib' instead
- from distutils.ccompiler import CCompiler
- def my_link_shared_object(self, *args, **kwds):
- if '-bundle' in self.linker_so:
- self.linker_so = list(self.linker_so)
- i = self.linker_so.index('-bundle')
- self.linker_so[i] = '-dynamiclib'
- return old_link_shared_object(self, *args, **kwds)
- old_link_shared_object = _patch_meth(patchlist, CCompiler,
- 'link_shared_object',
- my_link_shared_object)
-
-def _patch_for_target(patchlist, target):
- from distutils.command.build_ext import build_ext
- # if 'target' is different from '*', we need to patch some internal
- # method to just return this 'target' value, instead of having it
- # built from module_name
- if target.endswith('.*'):
- target = target[:-2]
- if sys.platform == 'win32':
- target += '.dll'
- elif sys.platform == 'darwin':
- target += '.dylib'
- else:
- target += '.so'
- _patch_meth(patchlist, build_ext, 'get_ext_filename',
- lambda self, ext_name: target)
-
-
-def recompile(ffi, module_name, preamble, tmpdir='.', call_c_compiler=True,
- c_file=None, source_extension='.c', extradir=None,
- compiler_verbose=1, target=None, debug=None, **kwds):
- if not isinstance(module_name, str):
- module_name = module_name.encode('ascii')
- if ffi._windows_unicode:
- ffi._apply_windows_unicode(kwds)
- if preamble is not None:
- embedding = (ffi._embedding is not None)
- if embedding:
- ffi._apply_embedding_fix(kwds)
- if c_file is None:
- c_file, parts = _modname_to_file(tmpdir, module_name,
- source_extension)
- if extradir:
- parts = [extradir] + parts
- ext_c_file = os.path.join(*parts)
- else:
- ext_c_file = c_file
- #
- if target is None:
- if embedding:
- target = '%s.*' % module_name
- else:
- target = '*'
- #
- ext = ffiplatform.get_extension(ext_c_file, module_name, **kwds)
- updated = make_c_source(ffi, module_name, preamble, c_file,
- verbose=compiler_verbose)
- if call_c_compiler:
- patchlist = []
- cwd = os.getcwd()
- try:
- if embedding:
- _patch_for_embedding(patchlist)
- if target != '*':
- _patch_for_target(patchlist, target)
- if compiler_verbose:
- if tmpdir == '.':
- msg = 'the current directory is'
- else:
- msg = 'setting the current directory to'
- print('%s %r' % (msg, os.path.abspath(tmpdir)))
- os.chdir(tmpdir)
- outputfilename = ffiplatform.compile('.', ext,
- compiler_verbose, debug)
- finally:
- os.chdir(cwd)
- _unpatch_meths(patchlist)
- return outputfilename
- else:
- return ext, updated
- else:
- if c_file is None:
- c_file, _ = _modname_to_file(tmpdir, module_name, '.py')
- updated = make_py_source(ffi, module_name, c_file,
- verbose=compiler_verbose)
- if call_c_compiler:
- return c_file
- else:
- return None, updated
-
-def _verify(ffi, module_name, preamble, *args, **kwds):
- # FOR TESTS ONLY
- from testing.udir import udir
- import imp
- assert module_name not in sys.modules, "module name conflict: %r" % (
- module_name,)
- kwds.setdefault('tmpdir', str(udir))
- outputfilename = recompile(ffi, module_name, preamble, *args, **kwds)
- module = imp.load_dynamic(module_name, outputfilename)
- #
- # hack hack hack: copy all *bound methods* from module.ffi back to the
- # ffi instance. Then calls like ffi.new() will invoke module.ffi.new().
- for name in dir(module.ffi):
- if not name.startswith('_'):
- attr = getattr(module.ffi, name)
- if attr is not getattr(ffi, name, object()):
- setattr(ffi, name, attr)
- def typeof_disabled(*args, **kwds):
- raise NotImplementedError
- ffi._typeof = typeof_disabled
- for name in dir(ffi):
- if not name.startswith('_') and not hasattr(module.ffi, name):
- setattr(ffi, name, NotImplemented)
- return module.lib
diff --git a/lib/cffi/setuptools_ext.py b/lib/cffi/setuptools_ext.py
deleted file mode 100644
index 58fb8a3d73..0000000000
--- a/lib/cffi/setuptools_ext.py
+++ /dev/null
@@ -1,204 +0,0 @@
-import os
-import sys
-
-try:
- basestring
-except NameError:
- # Python 3.x
- basestring = str
-
-def error(msg):
- from distutils.errors import DistutilsSetupError
- raise DistutilsSetupError(msg)
-
-
-def execfile(filename, glob):
- # We use execfile() (here rewritten for Python 3) instead of
- # __import__() to load the build script. The problem with
- # a normal import is that in some packages, the intermediate
- # __init__.py files may already try to import the file that
- # we are generating.
- with open(filename) as f:
- src = f.read()
- src += '\n' # Python 2.6 compatibility
- code = compile(src, filename, 'exec')
- exec(code, glob, glob)
-
-
-def add_cffi_module(dist, mod_spec):
- from cffi.api import FFI
-
- if not isinstance(mod_spec, basestring):
- error("argument to 'cffi_modules=...' must be a str or a list of str,"
- " not %r" % (type(mod_spec).__name__,))
- mod_spec = str(mod_spec)
- try:
- build_file_name, ffi_var_name = mod_spec.split(':')
- except ValueError:
- error("%r must be of the form 'path/build.py:ffi_variable'" %
- (mod_spec,))
- if not os.path.exists(build_file_name):
- ext = ''
- rewritten = build_file_name.replace('.', '/') + '.py'
- if os.path.exists(rewritten):
- ext = ' (rewrite cffi_modules to [%r])' % (
- rewritten + ':' + ffi_var_name,)
- error("%r does not name an existing file%s" % (build_file_name, ext))
-
- mod_vars = {'__name__': '__cffi__', '__file__': build_file_name}
- execfile(build_file_name, mod_vars)
-
- try:
- ffi = mod_vars[ffi_var_name]
- except KeyError:
- error("%r: object %r not found in module" % (mod_spec,
- ffi_var_name))
- if not isinstance(ffi, FFI):
- ffi = ffi() # maybe it's a function instead of directly an ffi
- if not isinstance(ffi, FFI):
- error("%r is not an FFI instance (got %r)" % (mod_spec,
- type(ffi).__name__))
- if not hasattr(ffi, '_assigned_source'):
- error("%r: the set_source() method was not called" % (mod_spec,))
- module_name, source, source_extension, kwds = ffi._assigned_source
- if ffi._windows_unicode:
- kwds = kwds.copy()
- ffi._apply_windows_unicode(kwds)
-
- if source is None:
- _add_py_module(dist, ffi, module_name)
- else:
- _add_c_module(dist, ffi, module_name, source, source_extension, kwds)
-
-def _set_py_limited_api(Extension, kwds):
- """
- Add py_limited_api to kwds if setuptools >= 26 is in use.
- Do not alter the setting if it already exists.
- Setuptools takes care of ignoring the flag on Python 2 and PyPy.
-
- CPython itself should ignore the flag in a debugging version
- (by not listing .abi3.so in the extensions it supports), but
- it doesn't so far, creating troubles. That's why we check
- for "not hasattr(sys, 'gettotalrefcount')" (the 2.7 compatible equivalent
- of 'd' not in sys.abiflags). (http://bugs.python.org/issue28401)
-
- On Windows, it's better not to use py_limited_api until issue #355
- can be resolved (by having virtualenv copy PYTHON3.DLL). See also
- the start of _cffi_include.h.
- """
- if ('py_limited_api' not in kwds and not hasattr(sys, 'gettotalrefcount')
- and sys.platform != 'win32'):
- import setuptools
- try:
- setuptools_major_version = int(setuptools.__version__.partition('.')[0])
- if setuptools_major_version >= 26:
- kwds['py_limited_api'] = True
- except ValueError: # certain development versions of setuptools
- # If we don't know the version number of setuptools, we
- # try to set 'py_limited_api' anyway. At worst, we get a
- # warning.
- kwds['py_limited_api'] = True
- return kwds
-
-def _add_c_module(dist, ffi, module_name, source, source_extension, kwds):
- from distutils.core import Extension
- # We are a setuptools extension. Need this build_ext for py_limited_api.
- from setuptools.command.build_ext import build_ext
- from distutils.dir_util import mkpath
- from distutils import log
- from cffi import recompiler
-
- allsources = ['$PLACEHOLDER']
- allsources.extend(kwds.pop('sources', []))
- kwds = _set_py_limited_api(Extension, kwds)
- ext = Extension(name=module_name, sources=allsources, **kwds)
-
- def make_mod(tmpdir, pre_run=None):
- c_file = os.path.join(tmpdir, module_name + source_extension)
- log.info("generating cffi module %r" % c_file)
- mkpath(tmpdir)
- # a setuptools-only, API-only hook: called with the "ext" and "ffi"
- # arguments just before we turn the ffi into C code. To use it,
- # subclass the 'distutils.command.build_ext.build_ext' class and
- # add a method 'def pre_run(self, ext, ffi)'.
- if pre_run is not None:
- pre_run(ext, ffi)
- updated = recompiler.make_c_source(ffi, module_name, source, c_file)
- if not updated:
- log.info("already up-to-date")
- return c_file
-
- if dist.ext_modules is None:
- dist.ext_modules = []
- dist.ext_modules.append(ext)
-
- base_class = dist.cmdclass.get('build_ext', build_ext)
- class build_ext_make_mod(base_class):
- def run(self):
- if ext.sources[0] == '$PLACEHOLDER':
- pre_run = getattr(self, 'pre_run', None)
- ext.sources[0] = make_mod(self.build_temp, pre_run)
- base_class.run(self)
- dist.cmdclass['build_ext'] = build_ext_make_mod
- # NB. multiple runs here will create multiple 'build_ext_make_mod'
- # classes. Even in this case the 'build_ext' command should be
- # run once; but just in case, the logic above does nothing if
- # called again.
-
-
-def _add_py_module(dist, ffi, module_name):
- from distutils.dir_util import mkpath
- from setuptools.command.build_py import build_py
- from setuptools.command.build_ext import build_ext
- from distutils import log
- from cffi import recompiler
-
- def generate_mod(py_file):
- log.info("generating cffi module %r" % py_file)
- mkpath(os.path.dirname(py_file))
- updated = recompiler.make_py_source(ffi, module_name, py_file)
- if not updated:
- log.info("already up-to-date")
-
- base_class = dist.cmdclass.get('build_py', build_py)
- class build_py_make_mod(base_class):
- def run(self):
- base_class.run(self)
- module_path = module_name.split('.')
- module_path[-1] += '.py'
- generate_mod(os.path.join(self.build_lib, *module_path))
- dist.cmdclass['build_py'] = build_py_make_mod
-
- # distutils and setuptools have no notion I could find of a
- # generated python module. If we don't add module_name to
- # dist.py_modules, then things mostly work but there are some
- # combination of options (--root and --record) that will miss
- # the module. So we add it here, which gives a few apparently
- # harmless warnings about not finding the file outside the
- # build directory.
- if dist.py_modules is None:
- dist.py_modules = []
- dist.py_modules.append(module_name)
-
- # the following is only for "build_ext -i"
- base_class_2 = dist.cmdclass.get('build_ext', build_ext)
- class build_ext_make_mod(base_class_2):
- def run(self):
- base_class_2.run(self)
- if self.inplace:
- # from get_ext_fullpath() in distutils/command/build_ext.py
- module_path = module_name.split('.')
- package = '.'.join(module_path[:-1])
- build_py = self.get_finalized_command('build_py')
- package_dir = build_py.get_package_dir(package)
- file_name = module_path[-1] + '.py'
- generate_mod(os.path.join(package_dir, file_name))
- dist.cmdclass['build_ext'] = build_ext_make_mod
-
-def cffi_modules(dist, attr, value):
- assert attr == 'cffi_modules'
- if isinstance(value, basestring):
- value = [value]
-
- for cffi_module in value:
- add_cffi_module(dist, cffi_module)
diff --git a/lib/cffi/vengine_cpy.py b/lib/cffi/vengine_cpy.py
deleted file mode 100644
index 536f11f80e..0000000000
--- a/lib/cffi/vengine_cpy.py
+++ /dev/null
@@ -1,1015 +0,0 @@
-#
-# DEPRECATED: implementation for ffi.verify()
-#
-import sys, imp
-from . import model
-from .error import VerificationError
-
-
-class VCPythonEngine(object):
- _class_key = 'x'
- _gen_python_module = True
-
- def __init__(self, verifier):
- self.verifier = verifier
- self.ffi = verifier.ffi
- self._struct_pending_verification = {}
- self._types_of_builtin_functions = {}
-
- def patch_extension_kwds(self, kwds):
- pass
-
- def find_module(self, module_name, path, so_suffixes):
- try:
- f, filename, descr = imp.find_module(module_name, path)
- except ImportError:
- return None
- if f is not None:
- f.close()
- # Note that after a setuptools installation, there are both .py
- # and .so files with the same basename. The code here relies on
- # imp.find_module() locating the .so in priority.
- if descr[0] not in so_suffixes:
- return None
- return filename
-
- def collect_types(self):
- self._typesdict = {}
- self._generate("collecttype")
-
- def _prnt(self, what=''):
- self._f.write(what + '\n')
-
- def _gettypenum(self, type):
- # a KeyError here is a bug. please report it! :-)
- return self._typesdict[type]
-
- def _do_collect_type(self, tp):
- if ((not isinstance(tp, model.PrimitiveType)
- or tp.name == 'long double')
- and tp not in self._typesdict):
- num = len(self._typesdict)
- self._typesdict[tp] = num
-
- def write_source_to_f(self):
- self.collect_types()
- #
- # The new module will have a _cffi_setup() function that receives
- # objects from the ffi world, and that calls some setup code in
- # the module. This setup code is split in several independent
- # functions, e.g. one per constant. The functions are "chained"
- # by ending in a tail call to each other.
- #
- # This is further split in two chained lists, depending on if we
- # can do it at import-time or if we must wait for _cffi_setup() to
- # provide us with the objects. This is needed because we
- # need the values of the enum constants in order to build the
- # that we may have to pass to _cffi_setup().
- #
- # The following two 'chained_list_constants' items contains
- # the head of these two chained lists, as a string that gives the
- # call to do, if any.
- self._chained_list_constants = ['((void)lib,0)', '((void)lib,0)']
- #
- prnt = self._prnt
- # first paste some standard set of lines that are mostly '#define'
- prnt(cffimod_header)
- prnt()
- # then paste the C source given by the user, verbatim.
- prnt(self.verifier.preamble)
- prnt()
- #
- # call generate_cpy_xxx_decl(), for every xxx found from
- # ffi._parser._declarations. This generates all the functions.
- self._generate("decl")
- #
- # implement the function _cffi_setup_custom() as calling the
- # head of the chained list.
- self._generate_setup_custom()
- prnt()
- #
- # produce the method table, including the entries for the
- # generated Python->C function wrappers, which are done
- # by generate_cpy_function_method().
- prnt('static PyMethodDef _cffi_methods[] = {')
- self._generate("method")
- prnt(' {"_cffi_setup", _cffi_setup, METH_VARARGS, NULL},')
- prnt(' {NULL, NULL, 0, NULL} /* Sentinel */')
- prnt('};')
- prnt()
- #
- # standard init.
- modname = self.verifier.get_module_name()
- constants = self._chained_list_constants[False]
- prnt('#if PY_MAJOR_VERSION >= 3')
- prnt()
- prnt('static struct PyModuleDef _cffi_module_def = {')
- prnt(' PyModuleDef_HEAD_INIT,')
- prnt(' "%s",' % modname)
- prnt(' NULL,')
- prnt(' -1,')
- prnt(' _cffi_methods,')
- prnt(' NULL, NULL, NULL, NULL')
- prnt('};')
- prnt()
- prnt('PyMODINIT_FUNC')
- prnt('PyInit_%s(void)' % modname)
- prnt('{')
- prnt(' PyObject *lib;')
- prnt(' lib = PyModule_Create(&_cffi_module_def);')
- prnt(' if (lib == NULL)')
- prnt(' return NULL;')
- prnt(' if (%s < 0 || _cffi_init() < 0) {' % (constants,))
- prnt(' Py_DECREF(lib);')
- prnt(' return NULL;')
- prnt(' }')
- prnt(' return lib;')
- prnt('}')
- prnt()
- prnt('#else')
- prnt()
- prnt('PyMODINIT_FUNC')
- prnt('init%s(void)' % modname)
- prnt('{')
- prnt(' PyObject *lib;')
- prnt(' lib = Py_InitModule("%s", _cffi_methods);' % modname)
- prnt(' if (lib == NULL)')
- prnt(' return;')
- prnt(' if (%s < 0 || _cffi_init() < 0)' % (constants,))
- prnt(' return;')
- prnt(' return;')
- prnt('}')
- prnt()
- prnt('#endif')
-
- def load_library(self, flags=None):
- # XXX review all usages of 'self' here!
- # import it as a new extension module
- imp.acquire_lock()
- try:
- if hasattr(sys, "getdlopenflags"):
- previous_flags = sys.getdlopenflags()
- try:
- if hasattr(sys, "setdlopenflags") and flags is not None:
- sys.setdlopenflags(flags)
- module = imp.load_dynamic(self.verifier.get_module_name(),
- self.verifier.modulefilename)
- except ImportError as e:
- error = "importing %r: %s" % (self.verifier.modulefilename, e)
- raise VerificationError(error)
- finally:
- if hasattr(sys, "setdlopenflags"):
- sys.setdlopenflags(previous_flags)
- finally:
- imp.release_lock()
- #
- # call loading_cpy_struct() to get the struct layout inferred by
- # the C compiler
- self._load(module, 'loading')
- #
- # the C code will need the objects. Collect them in
- # order in a list.
- revmapping = dict([(value, key)
- for (key, value) in self._typesdict.items()])
- lst = [revmapping[i] for i in range(len(revmapping))]
- lst = list(map(self.ffi._get_cached_btype, lst))
- #
- # build the FFILibrary class and instance and call _cffi_setup().
- # this will set up some fields like '_cffi_types', and only then
- # it will invoke the chained list of functions that will really
- # build (notably) the constant objects, as if they are
- # pointers, and store them as attributes on the 'library' object.
- class FFILibrary(object):
- _cffi_python_module = module
- _cffi_ffi = self.ffi
- _cffi_dir = []
- def __dir__(self):
- return FFILibrary._cffi_dir + list(self.__dict__)
- library = FFILibrary()
- if module._cffi_setup(lst, VerificationError, library):
- import warnings
- warnings.warn("reimporting %r might overwrite older definitions"
- % (self.verifier.get_module_name()))
- #
- # finally, call the loaded_cpy_xxx() functions. This will perform
- # the final adjustments, like copying the Python->C wrapper
- # functions from the module to the 'library' object, and setting
- # up the FFILibrary class with properties for the global C variables.
- self._load(module, 'loaded', library=library)
- module._cffi_original_ffi = self.ffi
- module._cffi_types_of_builtin_funcs = self._types_of_builtin_functions
- return library
-
- def _get_declarations(self):
- lst = [(key, tp) for (key, (tp, qual)) in
- self.ffi._parser._declarations.items()]
- lst.sort()
- return lst
-
- def _generate(self, step_name):
- for name, tp in self._get_declarations():
- kind, realname = name.split(' ', 1)
- try:
- method = getattr(self, '_generate_cpy_%s_%s' % (kind,
- step_name))
- except AttributeError:
- raise VerificationError(
- "not implemented in verify(): %r" % name)
- try:
- method(tp, realname)
- except Exception as e:
- model.attach_exception_info(e, name)
- raise
-
- def _load(self, module, step_name, **kwds):
- for name, tp in self._get_declarations():
- kind, realname = name.split(' ', 1)
- method = getattr(self, '_%s_cpy_%s' % (step_name, kind))
- try:
- method(tp, realname, module, **kwds)
- except Exception as e:
- model.attach_exception_info(e, name)
- raise
-
- def _generate_nothing(self, tp, name):
- pass
-
- def _loaded_noop(self, tp, name, module, **kwds):
- pass
-
- # ----------
-
- def _convert_funcarg_to_c(self, tp, fromvar, tovar, errcode):
- extraarg = ''
- if isinstance(tp, model.PrimitiveType):
- if tp.is_integer_type() and tp.name != '_Bool':
- converter = '_cffi_to_c_int'
- extraarg = ', %s' % tp.name
- else:
- converter = '(%s)_cffi_to_c_%s' % (tp.get_c_name(''),
- tp.name.replace(' ', '_'))
- errvalue = '-1'
- #
- elif isinstance(tp, model.PointerType):
- self._convert_funcarg_to_c_ptr_or_array(tp, fromvar,
- tovar, errcode)
- return
- #
- elif isinstance(tp, (model.StructOrUnion, model.EnumType)):
- # a struct (not a struct pointer) as a function argument
- self._prnt(' if (_cffi_to_c((char *)&%s, _cffi_type(%d), %s) < 0)'
- % (tovar, self._gettypenum(tp), fromvar))
- self._prnt(' %s;' % errcode)
- return
- #
- elif isinstance(tp, model.FunctionPtrType):
- converter = '(%s)_cffi_to_c_pointer' % tp.get_c_name('')
- extraarg = ', _cffi_type(%d)' % self._gettypenum(tp)
- errvalue = 'NULL'
- #
- else:
- raise NotImplementedError(tp)
- #
- self._prnt(' %s = %s(%s%s);' % (tovar, converter, fromvar, extraarg))
- self._prnt(' if (%s == (%s)%s && PyErr_Occurred())' % (
- tovar, tp.get_c_name(''), errvalue))
- self._prnt(' %s;' % errcode)
-
- def _extra_local_variables(self, tp, localvars):
- if isinstance(tp, model.PointerType):
- localvars.add('Py_ssize_t datasize')
-
- def _convert_funcarg_to_c_ptr_or_array(self, tp, fromvar, tovar, errcode):
- self._prnt(' datasize = _cffi_prepare_pointer_call_argument(')
- self._prnt(' _cffi_type(%d), %s, (char **)&%s);' % (
- self._gettypenum(tp), fromvar, tovar))
- self._prnt(' if (datasize != 0) {')
- self._prnt(' if (datasize < 0)')
- self._prnt(' %s;' % errcode)
- self._prnt(' %s = alloca((size_t)datasize);' % (tovar,))
- self._prnt(' memset((void *)%s, 0, (size_t)datasize);' % (tovar,))
- self._prnt(' if (_cffi_convert_array_from_object('
- '(char *)%s, _cffi_type(%d), %s) < 0)' % (
- tovar, self._gettypenum(tp), fromvar))
- self._prnt(' %s;' % errcode)
- self._prnt(' }')
-
- def _convert_expr_from_c(self, tp, var, context):
- if isinstance(tp, model.PrimitiveType):
- if tp.is_integer_type() and tp.name != '_Bool':
- return '_cffi_from_c_int(%s, %s)' % (var, tp.name)
- elif tp.name != 'long double':
- return '_cffi_from_c_%s(%s)' % (tp.name.replace(' ', '_'), var)
- else:
- return '_cffi_from_c_deref((char *)&%s, _cffi_type(%d))' % (
- var, self._gettypenum(tp))
- elif isinstance(tp, (model.PointerType, model.FunctionPtrType)):
- return '_cffi_from_c_pointer((char *)%s, _cffi_type(%d))' % (
- var, self._gettypenum(tp))
- elif isinstance(tp, model.ArrayType):
- return '_cffi_from_c_pointer((char *)%s, _cffi_type(%d))' % (
- var, self._gettypenum(model.PointerType(tp.item)))
- elif isinstance(tp, model.StructOrUnion):
- if tp.fldnames is None:
- raise TypeError("'%s' is used as %s, but is opaque" % (
- tp._get_c_name(), context))
- return '_cffi_from_c_struct((char *)&%s, _cffi_type(%d))' % (
- var, self._gettypenum(tp))
- elif isinstance(tp, model.EnumType):
- return '_cffi_from_c_deref((char *)&%s, _cffi_type(%d))' % (
- var, self._gettypenum(tp))
- else:
- raise NotImplementedError(tp)
-
- # ----------
- # typedefs: generates no code so far
-
- _generate_cpy_typedef_collecttype = _generate_nothing
- _generate_cpy_typedef_decl = _generate_nothing
- _generate_cpy_typedef_method = _generate_nothing
- _loading_cpy_typedef = _loaded_noop
- _loaded_cpy_typedef = _loaded_noop
-
- # ----------
- # function declarations
-
- def _generate_cpy_function_collecttype(self, tp, name):
- assert isinstance(tp, model.FunctionPtrType)
- if tp.ellipsis:
- self._do_collect_type(tp)
- else:
- # don't call _do_collect_type(tp) in this common case,
- # otherwise test_autofilled_struct_as_argument fails
- for type in tp.args:
- self._do_collect_type(type)
- self._do_collect_type(tp.result)
-
- def _generate_cpy_function_decl(self, tp, name):
- assert isinstance(tp, model.FunctionPtrType)
- if tp.ellipsis:
- # cannot support vararg functions better than this: check for its
- # exact type (including the fixed arguments), and build it as a
- # constant function pointer (no CPython wrapper)
- self._generate_cpy_const(False, name, tp)
- return
- prnt = self._prnt
- numargs = len(tp.args)
- if numargs == 0:
- argname = 'noarg'
- elif numargs == 1:
- argname = 'arg0'
- else:
- argname = 'args'
- prnt('static PyObject *')
- prnt('_cffi_f_%s(PyObject *self, PyObject *%s)' % (name, argname))
- prnt('{')
- #
- context = 'argument of %s' % name
- for i, type in enumerate(tp.args):
- prnt(' %s;' % type.get_c_name(' x%d' % i, context))
- #
- localvars = set()
- for type in tp.args:
- self._extra_local_variables(type, localvars)
- for decl in localvars:
- prnt(' %s;' % (decl,))
- #
- if not isinstance(tp.result, model.VoidType):
- result_code = 'result = '
- context = 'result of %s' % name
- prnt(' %s;' % tp.result.get_c_name(' result', context))
- else:
- result_code = ''
- #
- if len(tp.args) > 1:
- rng = range(len(tp.args))
- for i in rng:
- prnt(' PyObject *arg%d;' % i)
- prnt()
- prnt(' if (!PyArg_ParseTuple(args, "%s:%s", %s))' % (
- 'O' * numargs, name, ', '.join(['&arg%d' % i for i in rng])))
- prnt(' return NULL;')
- prnt()
- #
- for i, type in enumerate(tp.args):
- self._convert_funcarg_to_c(type, 'arg%d' % i, 'x%d' % i,
- 'return NULL')
- prnt()
- #
- prnt(' Py_BEGIN_ALLOW_THREADS')
- prnt(' _cffi_restore_errno();')
- prnt(' { %s%s(%s); }' % (
- result_code, name,
- ', '.join(['x%d' % i for i in range(len(tp.args))])))
- prnt(' _cffi_save_errno();')
- prnt(' Py_END_ALLOW_THREADS')
- prnt()
- #
- prnt(' (void)self; /* unused */')
- if numargs == 0:
- prnt(' (void)noarg; /* unused */')
- if result_code:
- prnt(' return %s;' %
- self._convert_expr_from_c(tp.result, 'result', 'result type'))
- else:
- prnt(' Py_INCREF(Py_None);')
- prnt(' return Py_None;')
- prnt('}')
- prnt()
-
- def _generate_cpy_function_method(self, tp, name):
- if tp.ellipsis:
- return
- numargs = len(tp.args)
- if numargs == 0:
- meth = 'METH_NOARGS'
- elif numargs == 1:
- meth = 'METH_O'
- else:
- meth = 'METH_VARARGS'
- self._prnt(' {"%s", _cffi_f_%s, %s, NULL},' % (name, name, meth))
-
- _loading_cpy_function = _loaded_noop
-
- def _loaded_cpy_function(self, tp, name, module, library):
- if tp.ellipsis:
- return
- func = getattr(module, name)
- setattr(library, name, func)
- self._types_of_builtin_functions[func] = tp
-
- # ----------
- # named structs
-
- _generate_cpy_struct_collecttype = _generate_nothing
- def _generate_cpy_struct_decl(self, tp, name):
- assert name == tp.name
- self._generate_struct_or_union_decl(tp, 'struct', name)
- def _generate_cpy_struct_method(self, tp, name):
- self._generate_struct_or_union_method(tp, 'struct', name)
- def _loading_cpy_struct(self, tp, name, module):
- self._loading_struct_or_union(tp, 'struct', name, module)
- def _loaded_cpy_struct(self, tp, name, module, **kwds):
- self._loaded_struct_or_union(tp)
-
- _generate_cpy_union_collecttype = _generate_nothing
- def _generate_cpy_union_decl(self, tp, name):
- assert name == tp.name
- self._generate_struct_or_union_decl(tp, 'union', name)
- def _generate_cpy_union_method(self, tp, name):
- self._generate_struct_or_union_method(tp, 'union', name)
- def _loading_cpy_union(self, tp, name, module):
- self._loading_struct_or_union(tp, 'union', name, module)
- def _loaded_cpy_union(self, tp, name, module, **kwds):
- self._loaded_struct_or_union(tp)
-
- def _generate_struct_or_union_decl(self, tp, prefix, name):
- if tp.fldnames is None:
- return # nothing to do with opaque structs
- checkfuncname = '_cffi_check_%s_%s' % (prefix, name)
- layoutfuncname = '_cffi_layout_%s_%s' % (prefix, name)
- cname = ('%s %s' % (prefix, name)).strip()
- #
- prnt = self._prnt
- prnt('static void %s(%s *p)' % (checkfuncname, cname))
- prnt('{')
- prnt(' /* only to generate compile-time warnings or errors */')
- prnt(' (void)p;')
- for fname, ftype, fbitsize, fqual in tp.enumfields():
- if (isinstance(ftype, model.PrimitiveType)
- and ftype.is_integer_type()) or fbitsize >= 0:
- # accept all integers, but complain on float or double
- prnt(' (void)((p->%s) << 1);' % fname)
- else:
- # only accept exactly the type declared.
- try:
- prnt(' { %s = &p->%s; (void)tmp; }' % (
- ftype.get_c_name('*tmp', 'field %r'%fname, quals=fqual),
- fname))
- except VerificationError as e:
- prnt(' /* %s */' % str(e)) # cannot verify it, ignore
- prnt('}')
- prnt('static PyObject *')
- prnt('%s(PyObject *self, PyObject *noarg)' % (layoutfuncname,))
- prnt('{')
- prnt(' struct _cffi_aligncheck { char x; %s y; };' % cname)
- prnt(' static Py_ssize_t nums[] = {')
- prnt(' sizeof(%s),' % cname)
- prnt(' offsetof(struct _cffi_aligncheck, y),')
- for fname, ftype, fbitsize, fqual in tp.enumfields():
- if fbitsize >= 0:
- continue # xxx ignore fbitsize for now
- prnt(' offsetof(%s, %s),' % (cname, fname))
- if isinstance(ftype, model.ArrayType) and ftype.length is None:
- prnt(' 0, /* %s */' % ftype._get_c_name())
- else:
- prnt(' sizeof(((%s *)0)->%s),' % (cname, fname))
- prnt(' -1')
- prnt(' };')
- prnt(' (void)self; /* unused */')
- prnt(' (void)noarg; /* unused */')
- prnt(' return _cffi_get_struct_layout(nums);')
- prnt(' /* the next line is not executed, but compiled */')
- prnt(' %s(0);' % (checkfuncname,))
- prnt('}')
- prnt()
-
- def _generate_struct_or_union_method(self, tp, prefix, name):
- if tp.fldnames is None:
- return # nothing to do with opaque structs
- layoutfuncname = '_cffi_layout_%s_%s' % (prefix, name)
- self._prnt(' {"%s", %s, METH_NOARGS, NULL},' % (layoutfuncname,
- layoutfuncname))
-
- def _loading_struct_or_union(self, tp, prefix, name, module):
- if tp.fldnames is None:
- return # nothing to do with opaque structs
- layoutfuncname = '_cffi_layout_%s_%s' % (prefix, name)
- #
- function = getattr(module, layoutfuncname)
- layout = function()
- if isinstance(tp, model.StructOrUnion) and tp.partial:
- # use the function()'s sizes and offsets to guide the
- # layout of the struct
- totalsize = layout[0]
- totalalignment = layout[1]
- fieldofs = layout[2::2]
- fieldsize = layout[3::2]
- tp.force_flatten()
- assert len(fieldofs) == len(fieldsize) == len(tp.fldnames)
- tp.fixedlayout = fieldofs, fieldsize, totalsize, totalalignment
- else:
- cname = ('%s %s' % (prefix, name)).strip()
- self._struct_pending_verification[tp] = layout, cname
-
- def _loaded_struct_or_union(self, tp):
- if tp.fldnames is None:
- return # nothing to do with opaque structs
- self.ffi._get_cached_btype(tp) # force 'fixedlayout' to be considered
-
- if tp in self._struct_pending_verification:
- # check that the layout sizes and offsets match the real ones
- def check(realvalue, expectedvalue, msg):
- if realvalue != expectedvalue:
- raise VerificationError(
- "%s (we have %d, but C compiler says %d)"
- % (msg, expectedvalue, realvalue))
- ffi = self.ffi
- BStruct = ffi._get_cached_btype(tp)
- layout, cname = self._struct_pending_verification.pop(tp)
- check(layout[0], ffi.sizeof(BStruct), "wrong total size")
- check(layout[1], ffi.alignof(BStruct), "wrong total alignment")
- i = 2
- for fname, ftype, fbitsize, fqual in tp.enumfields():
- if fbitsize >= 0:
- continue # xxx ignore fbitsize for now
- check(layout[i], ffi.offsetof(BStruct, fname),
- "wrong offset for field %r" % (fname,))
- if layout[i+1] != 0:
- BField = ffi._get_cached_btype(ftype)
- check(layout[i+1], ffi.sizeof(BField),
- "wrong size for field %r" % (fname,))
- i += 2
- assert i == len(layout)
-
- # ----------
- # 'anonymous' declarations. These are produced for anonymous structs
- # or unions; the 'name' is obtained by a typedef.
-
- _generate_cpy_anonymous_collecttype = _generate_nothing
-
- def _generate_cpy_anonymous_decl(self, tp, name):
- if isinstance(tp, model.EnumType):
- self._generate_cpy_enum_decl(tp, name, '')
- else:
- self._generate_struct_or_union_decl(tp, '', name)
-
- def _generate_cpy_anonymous_method(self, tp, name):
- if not isinstance(tp, model.EnumType):
- self._generate_struct_or_union_method(tp, '', name)
-
- def _loading_cpy_anonymous(self, tp, name, module):
- if isinstance(tp, model.EnumType):
- self._loading_cpy_enum(tp, name, module)
- else:
- self._loading_struct_or_union(tp, '', name, module)
-
- def _loaded_cpy_anonymous(self, tp, name, module, **kwds):
- if isinstance(tp, model.EnumType):
- self._loaded_cpy_enum(tp, name, module, **kwds)
- else:
- self._loaded_struct_or_union(tp)
-
- # ----------
- # constants, likely declared with '#define'
-
- def _generate_cpy_const(self, is_int, name, tp=None, category='const',
- vartp=None, delayed=True, size_too=False,
- check_value=None):
- prnt = self._prnt
- funcname = '_cffi_%s_%s' % (category, name)
- prnt('static int %s(PyObject *lib)' % funcname)
- prnt('{')
- prnt(' PyObject *o;')
- prnt(' int res;')
- if not is_int:
- prnt(' %s;' % (vartp or tp).get_c_name(' i', name))
- else:
- assert category == 'const'
- #
- if check_value is not None:
- self._check_int_constant_value(name, check_value)
- #
- if not is_int:
- if category == 'var':
- realexpr = '&' + name
- else:
- realexpr = name
- prnt(' i = (%s);' % (realexpr,))
- prnt(' o = %s;' % (self._convert_expr_from_c(tp, 'i',
- 'variable type'),))
- assert delayed
- else:
- prnt(' o = _cffi_from_c_int_const(%s);' % name)
- prnt(' if (o == NULL)')
- prnt(' return -1;')
- if size_too:
- prnt(' {')
- prnt(' PyObject *o1 = o;')
- prnt(' o = Py_BuildValue("On", o1, (Py_ssize_t)sizeof(%s));'
- % (name,))
- prnt(' Py_DECREF(o1);')
- prnt(' if (o == NULL)')
- prnt(' return -1;')
- prnt(' }')
- prnt(' res = PyObject_SetAttrString(lib, "%s", o);' % name)
- prnt(' Py_DECREF(o);')
- prnt(' if (res < 0)')
- prnt(' return -1;')
- prnt(' return %s;' % self._chained_list_constants[delayed])
- self._chained_list_constants[delayed] = funcname + '(lib)'
- prnt('}')
- prnt()
-
- def _generate_cpy_constant_collecttype(self, tp, name):
- is_int = isinstance(tp, model.PrimitiveType) and tp.is_integer_type()
- if not is_int:
- self._do_collect_type(tp)
-
- def _generate_cpy_constant_decl(self, tp, name):
- is_int = isinstance(tp, model.PrimitiveType) and tp.is_integer_type()
- self._generate_cpy_const(is_int, name, tp)
-
- _generate_cpy_constant_method = _generate_nothing
- _loading_cpy_constant = _loaded_noop
- _loaded_cpy_constant = _loaded_noop
-
- # ----------
- # enums
-
- def _check_int_constant_value(self, name, value, err_prefix=''):
- prnt = self._prnt
- if value <= 0:
- prnt(' if ((%s) > 0 || (long)(%s) != %dL) {' % (
- name, name, value))
- else:
- prnt(' if ((%s) <= 0 || (unsigned long)(%s) != %dUL) {' % (
- name, name, value))
- prnt(' char buf[64];')
- prnt(' if ((%s) <= 0)' % name)
- prnt(' snprintf(buf, 63, "%%ld", (long)(%s));' % name)
- prnt(' else')
- prnt(' snprintf(buf, 63, "%%lu", (unsigned long)(%s));' %
- name)
- prnt(' PyErr_Format(_cffi_VerificationError,')
- prnt(' "%s%s has the real value %s, not %s",')
- prnt(' "%s", "%s", buf, "%d");' % (
- err_prefix, name, value))
- prnt(' return -1;')
- prnt(' }')
-
- def _enum_funcname(self, prefix, name):
- # "$enum_$1" => "___D_enum____D_1"
- name = name.replace('$', '___D_')
- return '_cffi_e_%s_%s' % (prefix, name)
-
- def _generate_cpy_enum_decl(self, tp, name, prefix='enum'):
- if tp.partial:
- for enumerator in tp.enumerators:
- self._generate_cpy_const(True, enumerator, delayed=False)
- return
- #
- funcname = self._enum_funcname(prefix, name)
- prnt = self._prnt
- prnt('static int %s(PyObject *lib)' % funcname)
- prnt('{')
- for enumerator, enumvalue in zip(tp.enumerators, tp.enumvalues):
- self._check_int_constant_value(enumerator, enumvalue,
- "enum %s: " % name)
- prnt(' return %s;' % self._chained_list_constants[True])
- self._chained_list_constants[True] = funcname + '(lib)'
- prnt('}')
- prnt()
-
- _generate_cpy_enum_collecttype = _generate_nothing
- _generate_cpy_enum_method = _generate_nothing
-
- def _loading_cpy_enum(self, tp, name, module):
- if tp.partial:
- enumvalues = [getattr(module, enumerator)
- for enumerator in tp.enumerators]
- tp.enumvalues = tuple(enumvalues)
- tp.partial_resolved = True
-
- def _loaded_cpy_enum(self, tp, name, module, library):
- for enumerator, enumvalue in zip(tp.enumerators, tp.enumvalues):
- setattr(library, enumerator, enumvalue)
-
- # ----------
- # macros: for now only for integers
-
- def _generate_cpy_macro_decl(self, tp, name):
- if tp == '...':
- check_value = None
- else:
- check_value = tp # an integer
- self._generate_cpy_const(True, name, check_value=check_value)
-
- _generate_cpy_macro_collecttype = _generate_nothing
- _generate_cpy_macro_method = _generate_nothing
- _loading_cpy_macro = _loaded_noop
- _loaded_cpy_macro = _loaded_noop
-
- # ----------
- # global variables
-
- def _generate_cpy_variable_collecttype(self, tp, name):
- if isinstance(tp, model.ArrayType):
- tp_ptr = model.PointerType(tp.item)
- else:
- tp_ptr = model.PointerType(tp)
- self._do_collect_type(tp_ptr)
-
- def _generate_cpy_variable_decl(self, tp, name):
- if isinstance(tp, model.ArrayType):
- tp_ptr = model.PointerType(tp.item)
- self._generate_cpy_const(False, name, tp, vartp=tp_ptr,
- size_too = (tp.length == '...'))
- else:
- tp_ptr = model.PointerType(tp)
- self._generate_cpy_const(False, name, tp_ptr, category='var')
-
- _generate_cpy_variable_method = _generate_nothing
- _loading_cpy_variable = _loaded_noop
-
- def _loaded_cpy_variable(self, tp, name, module, library):
- value = getattr(library, name)
- if isinstance(tp, model.ArrayType): # int a[5] is "constant" in the
- # sense that "a=..." is forbidden
- if tp.length == '...':
- assert isinstance(value, tuple)
- (value, size) = value
- BItemType = self.ffi._get_cached_btype(tp.item)
- length, rest = divmod(size, self.ffi.sizeof(BItemType))
- if rest != 0:
- raise VerificationError(
- "bad size: %r does not seem to be an array of %s" %
- (name, tp.item))
- tp = tp.resolve_length(length)
- # 'value' is a which we have to replace with
- # a if the N is actually known
- if tp.length is not None:
- BArray = self.ffi._get_cached_btype(tp)
- value = self.ffi.cast(BArray, value)
- setattr(library, name, value)
- return
- # remove ptr= from the library instance, and replace
- # it by a property on the class, which reads/writes into ptr[0].
- ptr = value
- delattr(library, name)
- def getter(library):
- return ptr[0]
- def setter(library, value):
- ptr[0] = value
- setattr(type(library), name, property(getter, setter))
- type(library)._cffi_dir.append(name)
-
- # ----------
-
- def _generate_setup_custom(self):
- prnt = self._prnt
- prnt('static int _cffi_setup_custom(PyObject *lib)')
- prnt('{')
- prnt(' return %s;' % self._chained_list_constants[True])
- prnt('}')
-
-cffimod_header = r'''
-#include
-#include
-
-/* this block of #ifs should be kept exactly identical between
- c/_cffi_backend.c, cffi/vengine_cpy.py, cffi/vengine_gen.py
- and cffi/_cffi_include.h */
-#if defined(_MSC_VER)
-# include /* for alloca() */
-# if _MSC_VER < 1600 /* MSVC < 2010 */
- typedef __int8 int8_t;
- typedef __int16 int16_t;
- typedef __int32 int32_t;
- typedef __int64 int64_t;
- typedef unsigned __int8 uint8_t;
- typedef unsigned __int16 uint16_t;
- typedef unsigned __int32 uint32_t;
- typedef unsigned __int64 uint64_t;
- typedef __int8 int_least8_t;
- typedef __int16 int_least16_t;
- typedef __int32 int_least32_t;
- typedef __int64 int_least64_t;
- typedef unsigned __int8 uint_least8_t;
- typedef unsigned __int16 uint_least16_t;
- typedef unsigned __int32 uint_least32_t;
- typedef unsigned __int64 uint_least64_t;
- typedef __int8 int_fast8_t;
- typedef __int16 int_fast16_t;
- typedef __int32 int_fast32_t;
- typedef __int64 int_fast64_t;
- typedef unsigned __int8 uint_fast8_t;
- typedef unsigned __int16 uint_fast16_t;
- typedef unsigned __int32 uint_fast32_t;
- typedef unsigned __int64 uint_fast64_t;
- typedef __int64 intmax_t;
- typedef unsigned __int64 uintmax_t;
-# else
-# include
-# endif
-# if _MSC_VER < 1800 /* MSVC < 2013 */
-# ifndef __cplusplus
- typedef unsigned char _Bool;
-# endif
-# endif
-#else
-# include
-# if (defined (__SVR4) && defined (__sun)) || defined(_AIX) || defined(__hpux)
-# include
-# endif
-#endif
-
-#if PY_MAJOR_VERSION < 3
-# undef PyCapsule_CheckExact
-# undef PyCapsule_GetPointer
-# define PyCapsule_CheckExact(capsule) (PyCObject_Check(capsule))
-# define PyCapsule_GetPointer(capsule, name) \
- (PyCObject_AsVoidPtr(capsule))
-#endif
-
-#if PY_MAJOR_VERSION >= 3
-# define PyInt_FromLong PyLong_FromLong
-#endif
-
-#define _cffi_from_c_double PyFloat_FromDouble
-#define _cffi_from_c_float PyFloat_FromDouble
-#define _cffi_from_c_long PyInt_FromLong
-#define _cffi_from_c_ulong PyLong_FromUnsignedLong
-#define _cffi_from_c_longlong PyLong_FromLongLong
-#define _cffi_from_c_ulonglong PyLong_FromUnsignedLongLong
-#define _cffi_from_c__Bool PyBool_FromLong
-
-#define _cffi_to_c_double PyFloat_AsDouble
-#define _cffi_to_c_float PyFloat_AsDouble
-
-#define _cffi_from_c_int_const(x) \
- (((x) > 0) ? \
- ((unsigned long long)(x) <= (unsigned long long)LONG_MAX) ? \
- PyInt_FromLong((long)(x)) : \
- PyLong_FromUnsignedLongLong((unsigned long long)(x)) : \
- ((long long)(x) >= (long long)LONG_MIN) ? \
- PyInt_FromLong((long)(x)) : \
- PyLong_FromLongLong((long long)(x)))
-
-#define _cffi_from_c_int(x, type) \
- (((type)-1) > 0 ? /* unsigned */ \
- (sizeof(type) < sizeof(long) ? \
- PyInt_FromLong((long)x) : \
- sizeof(type) == sizeof(long) ? \
- PyLong_FromUnsignedLong((unsigned long)x) : \
- PyLong_FromUnsignedLongLong((unsigned long long)x)) : \
- (sizeof(type) <= sizeof(long) ? \
- PyInt_FromLong((long)x) : \
- PyLong_FromLongLong((long long)x)))
-
-#define _cffi_to_c_int(o, type) \
- ((type)( \
- sizeof(type) == 1 ? (((type)-1) > 0 ? (type)_cffi_to_c_u8(o) \
- : (type)_cffi_to_c_i8(o)) : \
- sizeof(type) == 2 ? (((type)-1) > 0 ? (type)_cffi_to_c_u16(o) \
- : (type)_cffi_to_c_i16(o)) : \
- sizeof(type) == 4 ? (((type)-1) > 0 ? (type)_cffi_to_c_u32(o) \
- : (type)_cffi_to_c_i32(o)) : \
- sizeof(type) == 8 ? (((type)-1) > 0 ? (type)_cffi_to_c_u64(o) \
- : (type)_cffi_to_c_i64(o)) : \
- (Py_FatalError("unsupported size for type " #type), (type)0)))
-
-#define _cffi_to_c_i8 \
- ((int(*)(PyObject *))_cffi_exports[1])
-#define _cffi_to_c_u8 \
- ((int(*)(PyObject *))_cffi_exports[2])
-#define _cffi_to_c_i16 \
- ((int(*)(PyObject *))_cffi_exports[3])
-#define _cffi_to_c_u16 \
- ((int(*)(PyObject *))_cffi_exports[4])
-#define _cffi_to_c_i32 \
- ((int(*)(PyObject *))_cffi_exports[5])
-#define _cffi_to_c_u32 \
- ((unsigned int(*)(PyObject *))_cffi_exports[6])
-#define _cffi_to_c_i64 \
- ((long long(*)(PyObject *))_cffi_exports[7])
-#define _cffi_to_c_u64 \
- ((unsigned long long(*)(PyObject *))_cffi_exports[8])
-#define _cffi_to_c_char \
- ((int(*)(PyObject *))_cffi_exports[9])
-#define _cffi_from_c_pointer \
- ((PyObject *(*)(char *, CTypeDescrObject *))_cffi_exports[10])
-#define _cffi_to_c_pointer \
- ((char *(*)(PyObject *, CTypeDescrObject *))_cffi_exports[11])
-#define _cffi_get_struct_layout \
- ((PyObject *(*)(Py_ssize_t[]))_cffi_exports[12])
-#define _cffi_restore_errno \
- ((void(*)(void))_cffi_exports[13])
-#define _cffi_save_errno \
- ((void(*)(void))_cffi_exports[14])
-#define _cffi_from_c_char \
- ((PyObject *(*)(char))_cffi_exports[15])
-#define _cffi_from_c_deref \
- ((PyObject *(*)(char *, CTypeDescrObject *))_cffi_exports[16])
-#define _cffi_to_c \
- ((int(*)(char *, CTypeDescrObject *, PyObject *))_cffi_exports[17])
-#define _cffi_from_c_struct \
- ((PyObject *(*)(char *, CTypeDescrObject *))_cffi_exports[18])
-#define _cffi_to_c_wchar_t \
- ((wchar_t(*)(PyObject *))_cffi_exports[19])
-#define _cffi_from_c_wchar_t \
- ((PyObject *(*)(wchar_t))_cffi_exports[20])
-#define _cffi_to_c_long_double \
- ((long double(*)(PyObject *))_cffi_exports[21])
-#define _cffi_to_c__Bool \
- ((_Bool(*)(PyObject *))_cffi_exports[22])
-#define _cffi_prepare_pointer_call_argument \
- ((Py_ssize_t(*)(CTypeDescrObject *, PyObject *, char **))_cffi_exports[23])
-#define _cffi_convert_array_from_object \
- ((int(*)(char *, CTypeDescrObject *, PyObject *))_cffi_exports[24])
-#define _CFFI_NUM_EXPORTS 25
-
-typedef struct _ctypedescr CTypeDescrObject;
-
-static void *_cffi_exports[_CFFI_NUM_EXPORTS];
-static PyObject *_cffi_types, *_cffi_VerificationError;
-
-static int _cffi_setup_custom(PyObject *lib); /* forward */
-
-static PyObject *_cffi_setup(PyObject *self, PyObject *args)
-{
- PyObject *library;
- int was_alive = (_cffi_types != NULL);
- (void)self; /* unused */
- if (!PyArg_ParseTuple(args, "OOO", &_cffi_types, &_cffi_VerificationError,
- &library))
- return NULL;
- Py_INCREF(_cffi_types);
- Py_INCREF(_cffi_VerificationError);
- if (_cffi_setup_custom(library) < 0)
- return NULL;
- return PyBool_FromLong(was_alive);
-}
-
-static int _cffi_init(void)
-{
- PyObject *module, *c_api_object = NULL;
-
- module = PyImport_ImportModule("_cffi_backend");
- if (module == NULL)
- goto failure;
-
- c_api_object = PyObject_GetAttrString(module, "_C_API");
- if (c_api_object == NULL)
- goto failure;
- if (!PyCapsule_CheckExact(c_api_object)) {
- PyErr_SetNone(PyExc_ImportError);
- goto failure;
- }
- memcpy(_cffi_exports, PyCapsule_GetPointer(c_api_object, "cffi"),
- _CFFI_NUM_EXPORTS * sizeof(void *));
-
- Py_DECREF(module);
- Py_DECREF(c_api_object);
- return 0;
-
- failure:
- Py_XDECREF(module);
- Py_XDECREF(c_api_object);
- return -1;
-}
-
-#define _cffi_type(num) ((CTypeDescrObject *)PyList_GET_ITEM(_cffi_types, num))
-
-/**********/
-'''
diff --git a/lib/cffi/vengine_gen.py b/lib/cffi/vengine_gen.py
deleted file mode 100644
index a64ff644fa..0000000000
--- a/lib/cffi/vengine_gen.py
+++ /dev/null
@@ -1,675 +0,0 @@
-#
-# DEPRECATED: implementation for ffi.verify()
-#
-import sys, os
-import types
-
-from . import model
-from .error import VerificationError
-
-
-class VGenericEngine(object):
- _class_key = 'g'
- _gen_python_module = False
-
- def __init__(self, verifier):
- self.verifier = verifier
- self.ffi = verifier.ffi
- self.export_symbols = []
- self._struct_pending_verification = {}
-
- def patch_extension_kwds(self, kwds):
- # add 'export_symbols' to the dictionary. Note that we add the
- # list before filling it. When we fill it, it will thus also show
- # up in kwds['export_symbols'].
- kwds.setdefault('export_symbols', self.export_symbols)
-
- def find_module(self, module_name, path, so_suffixes):
- for so_suffix in so_suffixes:
- basename = module_name + so_suffix
- if path is None:
- path = sys.path
- for dirname in path:
- filename = os.path.join(dirname, basename)
- if os.path.isfile(filename):
- return filename
-
- def collect_types(self):
- pass # not needed in the generic engine
-
- def _prnt(self, what=''):
- self._f.write(what + '\n')
-
- def write_source_to_f(self):
- prnt = self._prnt
- # first paste some standard set of lines that are mostly '#include'
- prnt(cffimod_header)
- # then paste the C source given by the user, verbatim.
- prnt(self.verifier.preamble)
- #
- # call generate_gen_xxx_decl(), for every xxx found from
- # ffi._parser._declarations. This generates all the functions.
- self._generate('decl')
- #
- # on Windows, distutils insists on putting init_cffi_xyz in
- # 'export_symbols', so instead of fighting it, just give up and
- # give it one
- if sys.platform == 'win32':
- if sys.version_info >= (3,):
- prefix = 'PyInit_'
- else:
- prefix = 'init'
- modname = self.verifier.get_module_name()
- prnt("void %s%s(void) { }\n" % (prefix, modname))
-
- def load_library(self, flags=0):
- # import it with the CFFI backend
- backend = self.ffi._backend
- # needs to make a path that contains '/', on Posix
- filename = os.path.join(os.curdir, self.verifier.modulefilename)
- module = backend.load_library(filename, flags)
- #
- # call loading_gen_struct() to get the struct layout inferred by
- # the C compiler
- self._load(module, 'loading')
-
- # build the FFILibrary class and instance, this is a module subclass
- # because modules are expected to have usually-constant-attributes and
- # in PyPy this means the JIT is able to treat attributes as constant,
- # which we want.
- class FFILibrary(types.ModuleType):
- _cffi_generic_module = module
- _cffi_ffi = self.ffi
- _cffi_dir = []
- def __dir__(self):
- return FFILibrary._cffi_dir
- library = FFILibrary("")
- #
- # finally, call the loaded_gen_xxx() functions. This will set
- # up the 'library' object.
- self._load(module, 'loaded', library=library)
- return library
-
- def _get_declarations(self):
- lst = [(key, tp) for (key, (tp, qual)) in
- self.ffi._parser._declarations.items()]
- lst.sort()
- return lst
-
- def _generate(self, step_name):
- for name, tp in self._get_declarations():
- kind, realname = name.split(' ', 1)
- try:
- method = getattr(self, '_generate_gen_%s_%s' % (kind,
- step_name))
- except AttributeError:
- raise VerificationError(
- "not implemented in verify(): %r" % name)
- try:
- method(tp, realname)
- except Exception as e:
- model.attach_exception_info(e, name)
- raise
-
- def _load(self, module, step_name, **kwds):
- for name, tp in self._get_declarations():
- kind, realname = name.split(' ', 1)
- method = getattr(self, '_%s_gen_%s' % (step_name, kind))
- try:
- method(tp, realname, module, **kwds)
- except Exception as e:
- model.attach_exception_info(e, name)
- raise
-
- def _generate_nothing(self, tp, name):
- pass
-
- def _loaded_noop(self, tp, name, module, **kwds):
- pass
-
- # ----------
- # typedefs: generates no code so far
-
- _generate_gen_typedef_decl = _generate_nothing
- _loading_gen_typedef = _loaded_noop
- _loaded_gen_typedef = _loaded_noop
-
- # ----------
- # function declarations
-
- def _generate_gen_function_decl(self, tp, name):
- assert isinstance(tp, model.FunctionPtrType)
- if tp.ellipsis:
- # cannot support vararg functions better than this: check for its
- # exact type (including the fixed arguments), and build it as a
- # constant function pointer (no _cffi_f_%s wrapper)
- self._generate_gen_const(False, name, tp)
- return
- prnt = self._prnt
- numargs = len(tp.args)
- argnames = []
- for i, type in enumerate(tp.args):
- indirection = ''
- if isinstance(type, model.StructOrUnion):
- indirection = '*'
- argnames.append('%sx%d' % (indirection, i))
- context = 'argument of %s' % name
- arglist = [type.get_c_name(' %s' % arg, context)
- for type, arg in zip(tp.args, argnames)]
- tpresult = tp.result
- if isinstance(tpresult, model.StructOrUnion):
- arglist.insert(0, tpresult.get_c_name(' *r', context))
- tpresult = model.void_type
- arglist = ', '.join(arglist) or 'void'
- wrappername = '_cffi_f_%s' % name
- self.export_symbols.append(wrappername)
- if tp.abi:
- abi = tp.abi + ' '
- else:
- abi = ''
- funcdecl = ' %s%s(%s)' % (abi, wrappername, arglist)
- context = 'result of %s' % name
- prnt(tpresult.get_c_name(funcdecl, context))
- prnt('{')
- #
- if isinstance(tp.result, model.StructOrUnion):
- result_code = '*r = '
- elif not isinstance(tp.result, model.VoidType):
- result_code = 'return '
- else:
- result_code = ''
- prnt(' %s%s(%s);' % (result_code, name, ', '.join(argnames)))
- prnt('}')
- prnt()
-
- _loading_gen_function = _loaded_noop
-
- def _loaded_gen_function(self, tp, name, module, library):
- assert isinstance(tp, model.FunctionPtrType)
- if tp.ellipsis:
- newfunction = self._load_constant(False, tp, name, module)
- else:
- indirections = []
- base_tp = tp
- if (any(isinstance(typ, model.StructOrUnion) for typ in tp.args)
- or isinstance(tp.result, model.StructOrUnion)):
- indirect_args = []
- for i, typ in enumerate(tp.args):
- if isinstance(typ, model.StructOrUnion):
- typ = model.PointerType(typ)
- indirections.append((i, typ))
- indirect_args.append(typ)
- indirect_result = tp.result
- if isinstance(indirect_result, model.StructOrUnion):
- if indirect_result.fldtypes is None:
- raise TypeError("'%s' is used as result type, "
- "but is opaque" % (
- indirect_result._get_c_name(),))
- indirect_result = model.PointerType(indirect_result)
- indirect_args.insert(0, indirect_result)
- indirections.insert(0, ("result", indirect_result))
- indirect_result = model.void_type
- tp = model.FunctionPtrType(tuple(indirect_args),
- indirect_result, tp.ellipsis)
- BFunc = self.ffi._get_cached_btype(tp)
- wrappername = '_cffi_f_%s' % name
- newfunction = module.load_function(BFunc, wrappername)
- for i, typ in indirections:
- newfunction = self._make_struct_wrapper(newfunction, i, typ,
- base_tp)
- setattr(library, name, newfunction)
- type(library)._cffi_dir.append(name)
-
- def _make_struct_wrapper(self, oldfunc, i, tp, base_tp):
- backend = self.ffi._backend
- BType = self.ffi._get_cached_btype(tp)
- if i == "result":
- ffi = self.ffi
- def newfunc(*args):
- res = ffi.new(BType)
- oldfunc(res, *args)
- return res[0]
- else:
- def newfunc(*args):
- args = args[:i] + (backend.newp(BType, args[i]),) + args[i+1:]
- return oldfunc(*args)
- newfunc._cffi_base_type = base_tp
- return newfunc
-
- # ----------
- # named structs
-
- def _generate_gen_struct_decl(self, tp, name):
- assert name == tp.name
- self._generate_struct_or_union_decl(tp, 'struct', name)
-
- def _loading_gen_struct(self, tp, name, module):
- self._loading_struct_or_union(tp, 'struct', name, module)
-
- def _loaded_gen_struct(self, tp, name, module, **kwds):
- self._loaded_struct_or_union(tp)
-
- def _generate_gen_union_decl(self, tp, name):
- assert name == tp.name
- self._generate_struct_or_union_decl(tp, 'union', name)
-
- def _loading_gen_union(self, tp, name, module):
- self._loading_struct_or_union(tp, 'union', name, module)
-
- def _loaded_gen_union(self, tp, name, module, **kwds):
- self._loaded_struct_or_union(tp)
-
- def _generate_struct_or_union_decl(self, tp, prefix, name):
- if tp.fldnames is None:
- return # nothing to do with opaque structs
- checkfuncname = '_cffi_check_%s_%s' % (prefix, name)
- layoutfuncname = '_cffi_layout_%s_%s' % (prefix, name)
- cname = ('%s %s' % (prefix, name)).strip()
- #
- prnt = self._prnt
- prnt('static void %s(%s *p)' % (checkfuncname, cname))
- prnt('{')
- prnt(' /* only to generate compile-time warnings or errors */')
- prnt(' (void)p;')
- for fname, ftype, fbitsize, fqual in tp.enumfields():
- if (isinstance(ftype, model.PrimitiveType)
- and ftype.is_integer_type()) or fbitsize >= 0:
- # accept all integers, but complain on float or double
- prnt(' (void)((p->%s) << 1);' % fname)
- else:
- # only accept exactly the type declared.
- try:
- prnt(' { %s = &p->%s; (void)tmp; }' % (
- ftype.get_c_name('*tmp', 'field %r'%fname, quals=fqual),
- fname))
- except VerificationError as e:
- prnt(' /* %s */' % str(e)) # cannot verify it, ignore
- prnt('}')
- self.export_symbols.append(layoutfuncname)
- prnt('intptr_t %s(intptr_t i)' % (layoutfuncname,))
- prnt('{')
- prnt(' struct _cffi_aligncheck { char x; %s y; };' % cname)
- prnt(' static intptr_t nums[] = {')
- prnt(' sizeof(%s),' % cname)
- prnt(' offsetof(struct _cffi_aligncheck, y),')
- for fname, ftype, fbitsize, fqual in tp.enumfields():
- if fbitsize >= 0:
- continue # xxx ignore fbitsize for now
- prnt(' offsetof(%s, %s),' % (cname, fname))
- if isinstance(ftype, model.ArrayType) and ftype.length is None:
- prnt(' 0, /* %s */' % ftype._get_c_name())
- else:
- prnt(' sizeof(((%s *)0)->%s),' % (cname, fname))
- prnt(' -1')
- prnt(' };')
- prnt(' return nums[i];')
- prnt(' /* the next line is not executed, but compiled */')
- prnt(' %s(0);' % (checkfuncname,))
- prnt('}')
- prnt()
-
- def _loading_struct_or_union(self, tp, prefix, name, module):
- if tp.fldnames is None:
- return # nothing to do with opaque structs
- layoutfuncname = '_cffi_layout_%s_%s' % (prefix, name)
- #
- BFunc = self.ffi._typeof_locked("intptr_t(*)(intptr_t)")[0]
- function = module.load_function(BFunc, layoutfuncname)
- layout = []
- num = 0
- while True:
- x = function(num)
- if x < 0: break
- layout.append(x)
- num += 1
- if isinstance(tp, model.StructOrUnion) and tp.partial:
- # use the function()'s sizes and offsets to guide the
- # layout of the struct
- totalsize = layout[0]
- totalalignment = layout[1]
- fieldofs = layout[2::2]
- fieldsize = layout[3::2]
- tp.force_flatten()
- assert len(fieldofs) == len(fieldsize) == len(tp.fldnames)
- tp.fixedlayout = fieldofs, fieldsize, totalsize, totalalignment
- else:
- cname = ('%s %s' % (prefix, name)).strip()
- self._struct_pending_verification[tp] = layout, cname
-
- def _loaded_struct_or_union(self, tp):
- if tp.fldnames is None:
- return # nothing to do with opaque structs
- self.ffi._get_cached_btype(tp) # force 'fixedlayout' to be considered
-
- if tp in self._struct_pending_verification:
- # check that the layout sizes and offsets match the real ones
- def check(realvalue, expectedvalue, msg):
- if realvalue != expectedvalue:
- raise VerificationError(
- "%s (we have %d, but C compiler says %d)"
- % (msg, expectedvalue, realvalue))
- ffi = self.ffi
- BStruct = ffi._get_cached_btype(tp)
- layout, cname = self._struct_pending_verification.pop(tp)
- check(layout[0], ffi.sizeof(BStruct), "wrong total size")
- check(layout[1], ffi.alignof(BStruct), "wrong total alignment")
- i = 2
- for fname, ftype, fbitsize, fqual in tp.enumfields():
- if fbitsize >= 0:
- continue # xxx ignore fbitsize for now
- check(layout[i], ffi.offsetof(BStruct, fname),
- "wrong offset for field %r" % (fname,))
- if layout[i+1] != 0:
- BField = ffi._get_cached_btype(ftype)
- check(layout[i+1], ffi.sizeof(BField),
- "wrong size for field %r" % (fname,))
- i += 2
- assert i == len(layout)
-
- # ----------
- # 'anonymous' declarations. These are produced for anonymous structs
- # or unions; the 'name' is obtained by a typedef.
-
- def _generate_gen_anonymous_decl(self, tp, name):
- if isinstance(tp, model.EnumType):
- self._generate_gen_enum_decl(tp, name, '')
- else:
- self._generate_struct_or_union_decl(tp, '', name)
-
- def _loading_gen_anonymous(self, tp, name, module):
- if isinstance(tp, model.EnumType):
- self._loading_gen_enum(tp, name, module, '')
- else:
- self._loading_struct_or_union(tp, '', name, module)
-
- def _loaded_gen_anonymous(self, tp, name, module, **kwds):
- if isinstance(tp, model.EnumType):
- self._loaded_gen_enum(tp, name, module, **kwds)
- else:
- self._loaded_struct_or_union(tp)
-
- # ----------
- # constants, likely declared with '#define'
-
- def _generate_gen_const(self, is_int, name, tp=None, category='const',
- check_value=None):
- prnt = self._prnt
- funcname = '_cffi_%s_%s' % (category, name)
- self.export_symbols.append(funcname)
- if check_value is not None:
- assert is_int
- assert category == 'const'
- prnt('int %s(char *out_error)' % funcname)
- prnt('{')
- self._check_int_constant_value(name, check_value)
- prnt(' return 0;')
- prnt('}')
- elif is_int:
- assert category == 'const'
- prnt('int %s(long long *out_value)' % funcname)
- prnt('{')
- prnt(' *out_value = (long long)(%s);' % (name,))
- prnt(' return (%s) <= 0;' % (name,))
- prnt('}')
- else:
- assert tp is not None
- assert check_value is None
- if category == 'var':
- ampersand = '&'
- else:
- ampersand = ''
- extra = ''
- if category == 'const' and isinstance(tp, model.StructOrUnion):
- extra = 'const *'
- ampersand = '&'
- prnt(tp.get_c_name(' %s%s(void)' % (extra, funcname), name))
- prnt('{')
- prnt(' return (%s%s);' % (ampersand, name))
- prnt('}')
- prnt()
-
- def _generate_gen_constant_decl(self, tp, name):
- is_int = isinstance(tp, model.PrimitiveType) and tp.is_integer_type()
- self._generate_gen_const(is_int, name, tp)
-
- _loading_gen_constant = _loaded_noop
-
- def _load_constant(self, is_int, tp, name, module, check_value=None):
- funcname = '_cffi_const_%s' % name
- if check_value is not None:
- assert is_int
- self._load_known_int_constant(module, funcname)
- value = check_value
- elif is_int:
- BType = self.ffi._typeof_locked("long long*")[0]
- BFunc = self.ffi._typeof_locked("int(*)(long long*)")[0]
- function = module.load_function(BFunc, funcname)
- p = self.ffi.new(BType)
- negative = function(p)
- value = int(p[0])
- if value < 0 and not negative:
- BLongLong = self.ffi._typeof_locked("long long")[0]
- value += (1 << (8*self.ffi.sizeof(BLongLong)))
- else:
- assert check_value is None
- fntypeextra = '(*)(void)'
- if isinstance(tp, model.StructOrUnion):
- fntypeextra = '*' + fntypeextra
- BFunc = self.ffi._typeof_locked(tp.get_c_name(fntypeextra, name))[0]
- function = module.load_function(BFunc, funcname)
- value = function()
- if isinstance(tp, model.StructOrUnion):
- value = value[0]
- return value
-
- def _loaded_gen_constant(self, tp, name, module, library):
- is_int = isinstance(tp, model.PrimitiveType) and tp.is_integer_type()
- value = self._load_constant(is_int, tp, name, module)
- setattr(library, name, value)
- type(library)._cffi_dir.append(name)
-
- # ----------
- # enums
-
- def _check_int_constant_value(self, name, value):
- prnt = self._prnt
- if value <= 0:
- prnt(' if ((%s) > 0 || (long)(%s) != %dL) {' % (
- name, name, value))
- else:
- prnt(' if ((%s) <= 0 || (unsigned long)(%s) != %dUL) {' % (
- name, name, value))
- prnt(' char buf[64];')
- prnt(' if ((%s) <= 0)' % name)
- prnt(' sprintf(buf, "%%ld", (long)(%s));' % name)
- prnt(' else')
- prnt(' sprintf(buf, "%%lu", (unsigned long)(%s));' %
- name)
- prnt(' sprintf(out_error, "%s has the real value %s, not %s",')
- prnt(' "%s", buf, "%d");' % (name[:100], value))
- prnt(' return -1;')
- prnt(' }')
-
- def _load_known_int_constant(self, module, funcname):
- BType = self.ffi._typeof_locked("char[]")[0]
- BFunc = self.ffi._typeof_locked("int(*)(char*)")[0]
- function = module.load_function(BFunc, funcname)
- p = self.ffi.new(BType, 256)
- if function(p) < 0:
- error = self.ffi.string(p)
- if sys.version_info >= (3,):
- error = str(error, 'utf-8')
- raise VerificationError(error)
-
- def _enum_funcname(self, prefix, name):
- # "$enum_$1" => "___D_enum____D_1"
- name = name.replace('$', '___D_')
- return '_cffi_e_%s_%s' % (prefix, name)
-
- def _generate_gen_enum_decl(self, tp, name, prefix='enum'):
- if tp.partial:
- for enumerator in tp.enumerators:
- self._generate_gen_const(True, enumerator)
- return
- #
- funcname = self._enum_funcname(prefix, name)
- self.export_symbols.append(funcname)
- prnt = self._prnt
- prnt('int %s(char *out_error)' % funcname)
- prnt('{')
- for enumerator, enumvalue in zip(tp.enumerators, tp.enumvalues):
- self._check_int_constant_value(enumerator, enumvalue)
- prnt(' return 0;')
- prnt('}')
- prnt()
-
- def _loading_gen_enum(self, tp, name, module, prefix='enum'):
- if tp.partial:
- enumvalues = [self._load_constant(True, tp, enumerator, module)
- for enumerator in tp.enumerators]
- tp.enumvalues = tuple(enumvalues)
- tp.partial_resolved = True
- else:
- funcname = self._enum_funcname(prefix, name)
- self._load_known_int_constant(module, funcname)
-
- def _loaded_gen_enum(self, tp, name, module, library):
- for enumerator, enumvalue in zip(tp.enumerators, tp.enumvalues):
- setattr(library, enumerator, enumvalue)
- type(library)._cffi_dir.append(enumerator)
-
- # ----------
- # macros: for now only for integers
-
- def _generate_gen_macro_decl(self, tp, name):
- if tp == '...':
- check_value = None
- else:
- check_value = tp # an integer
- self._generate_gen_const(True, name, check_value=check_value)
-
- _loading_gen_macro = _loaded_noop
-
- def _loaded_gen_macro(self, tp, name, module, library):
- if tp == '...':
- check_value = None
- else:
- check_value = tp # an integer
- value = self._load_constant(True, tp, name, module,
- check_value=check_value)
- setattr(library, name, value)
- type(library)._cffi_dir.append(name)
-
- # ----------
- # global variables
-
- def _generate_gen_variable_decl(self, tp, name):
- if isinstance(tp, model.ArrayType):
- if tp.length == '...':
- prnt = self._prnt
- funcname = '_cffi_sizeof_%s' % (name,)
- self.export_symbols.append(funcname)
- prnt("size_t %s(void)" % funcname)
- prnt("{")
- prnt(" return sizeof(%s);" % (name,))
- prnt("}")
- tp_ptr = model.PointerType(tp.item)
- self._generate_gen_const(False, name, tp_ptr)
- else:
- tp_ptr = model.PointerType(tp)
- self._generate_gen_const(False, name, tp_ptr, category='var')
-
- _loading_gen_variable = _loaded_noop
-
- def _loaded_gen_variable(self, tp, name, module, library):
- if isinstance(tp, model.ArrayType): # int a[5] is "constant" in the
- # sense that "a=..." is forbidden
- if tp.length == '...':
- funcname = '_cffi_sizeof_%s' % (name,)
- BFunc = self.ffi._typeof_locked('size_t(*)(void)')[0]
- function = module.load_function(BFunc, funcname)
- size = function()
- BItemType = self.ffi._get_cached_btype(tp.item)
- length, rest = divmod(size, self.ffi.sizeof(BItemType))
- if rest != 0:
- raise VerificationError(
- "bad size: %r does not seem to be an array of %s" %
- (name, tp.item))
- tp = tp.resolve_length(length)
- tp_ptr = model.PointerType(tp.item)
- value = self._load_constant(False, tp_ptr, name, module)
- # 'value' is a which we have to replace with
- # a if the N is actually known
- if tp.length is not None:
- BArray = self.ffi._get_cached_btype(tp)
- value = self.ffi.cast(BArray, value)
- setattr(library, name, value)
- type(library)._cffi_dir.append(name)
- return
- # remove ptr= from the library instance, and replace
- # it by a property on the class, which reads/writes into ptr[0].
- funcname = '_cffi_var_%s' % name
- BFunc = self.ffi._typeof_locked(tp.get_c_name('*(*)(void)', name))[0]
- function = module.load_function(BFunc, funcname)
- ptr = function()
- def getter(library):
- return ptr[0]
- def setter(library, value):
- ptr[0] = value
- setattr(type(library), name, property(getter, setter))
- type(library)._cffi_dir.append(name)
-
-cffimod_header = r'''
-#include
-#include
-#include
-#include
-#include /* XXX for ssize_t on some platforms */
-
-/* this block of #ifs should be kept exactly identical between
- c/_cffi_backend.c, cffi/vengine_cpy.py, cffi/vengine_gen.py
- and cffi/_cffi_include.h */
-#if defined(_MSC_VER)
-# include /* for alloca() */
-# if _MSC_VER < 1600 /* MSVC < 2010 */
- typedef __int8 int8_t;
- typedef __int16 int16_t;
- typedef __int32 int32_t;
- typedef __int64 int64_t;
- typedef unsigned __int8 uint8_t;
- typedef unsigned __int16 uint16_t;
- typedef unsigned __int32 uint32_t;
- typedef unsigned __int64 uint64_t;
- typedef __int8 int_least8_t;
- typedef __int16 int_least16_t;
- typedef __int32 int_least32_t;
- typedef __int64 int_least64_t;
- typedef unsigned __int8 uint_least8_t;
- typedef unsigned __int16 uint_least16_t;
- typedef unsigned __int32 uint_least32_t;
- typedef unsigned __int64 uint_least64_t;
- typedef __int8 int_fast8_t;
- typedef __int16 int_fast16_t;
- typedef __int32 int_fast32_t;
- typedef __int64 int_fast64_t;
- typedef unsigned __int8 uint_fast8_t;
- typedef unsigned __int16 uint_fast16_t;
- typedef unsigned __int32 uint_fast32_t;
- typedef unsigned __int64 uint_fast64_t;
- typedef __int64 intmax_t;
- typedef unsigned __int64 uintmax_t;
-# else
-# include
-# endif
-# if _MSC_VER < 1800 /* MSVC < 2013 */
-# ifndef __cplusplus
- typedef unsigned char _Bool;
-# endif
-# endif
-#else
-# include
-# if (defined (__SVR4) && defined (__sun)) || defined(_AIX) || defined(__hpux)
-# include
-# endif
-#endif
-'''
diff --git a/lib/cffi/verifier.py b/lib/cffi/verifier.py
deleted file mode 100644
index 59b78c216f..0000000000
--- a/lib/cffi/verifier.py
+++ /dev/null
@@ -1,306 +0,0 @@
-#
-# DEPRECATED: implementation for ffi.verify()
-#
-import sys, os, binascii, shutil, io
-from . import __version_verifier_modules__
-from . import ffiplatform
-from .error import VerificationError
-
-if sys.version_info >= (3, 3):
- import importlib.machinery
- def _extension_suffixes():
- return importlib.machinery.EXTENSION_SUFFIXES[:]
-else:
- import imp
- def _extension_suffixes():
- return [suffix for suffix, _, type in imp.get_suffixes()
- if type == imp.C_EXTENSION]
-
-
-if sys.version_info >= (3,):
- NativeIO = io.StringIO
-else:
- class NativeIO(io.BytesIO):
- def write(self, s):
- if isinstance(s, unicode):
- s = s.encode('ascii')
- super(NativeIO, self).write(s)
-
-
-class Verifier(object):
-
- def __init__(self, ffi, preamble, tmpdir=None, modulename=None,
- ext_package=None, tag='', force_generic_engine=False,
- source_extension='.c', flags=None, relative_to=None, **kwds):
- if ffi._parser._uses_new_feature:
- raise VerificationError(
- "feature not supported with ffi.verify(), but only "
- "with ffi.set_source(): %s" % (ffi._parser._uses_new_feature,))
- self.ffi = ffi
- self.preamble = preamble
- if not modulename:
- flattened_kwds = ffiplatform.flatten(kwds)
- vengine_class = _locate_engine_class(ffi, force_generic_engine)
- self._vengine = vengine_class(self)
- self._vengine.patch_extension_kwds(kwds)
- self.flags = flags
- self.kwds = self.make_relative_to(kwds, relative_to)
- #
- if modulename:
- if tag:
- raise TypeError("can't specify both 'modulename' and 'tag'")
- else:
- key = '\x00'.join([sys.version[:3], __version_verifier_modules__,
- preamble, flattened_kwds] +
- ffi._cdefsources)
- if sys.version_info >= (3,):
- key = key.encode('utf-8')
- k1 = hex(binascii.crc32(key[0::2]) & 0xffffffff)
- k1 = k1.lstrip('0x').rstrip('L')
- k2 = hex(binascii.crc32(key[1::2]) & 0xffffffff)
- k2 = k2.lstrip('0').rstrip('L')
- modulename = '_cffi_%s_%s%s%s' % (tag, self._vengine._class_key,
- k1, k2)
- suffix = _get_so_suffixes()[0]
- self.tmpdir = tmpdir or _caller_dir_pycache()
- self.sourcefilename = os.path.join(self.tmpdir, modulename + source_extension)
- self.modulefilename = os.path.join(self.tmpdir, modulename + suffix)
- self.ext_package = ext_package
- self._has_source = False
- self._has_module = False
-
- def write_source(self, file=None):
- """Write the C source code. It is produced in 'self.sourcefilename',
- which can be tweaked beforehand."""
- with self.ffi._lock:
- if self._has_source and file is None:
- raise VerificationError(
- "source code already written")
- self._write_source(file)
-
- def compile_module(self):
- """Write the C source code (if not done already) and compile it.
- This produces a dynamic link library in 'self.modulefilename'."""
- with self.ffi._lock:
- if self._has_module:
- raise VerificationError("module already compiled")
- if not self._has_source:
- self._write_source()
- self._compile_module()
-
- def load_library(self):
- """Get a C module from this Verifier instance.
- Returns an instance of a FFILibrary class that behaves like the
- objects returned by ffi.dlopen(), but that delegates all
- operations to the C module. If necessary, the C code is written
- and compiled first.
- """
- with self.ffi._lock:
- if not self._has_module:
- self._locate_module()
- if not self._has_module:
- if not self._has_source:
- self._write_source()
- self._compile_module()
- return self._load_library()
-
- def get_module_name(self):
- basename = os.path.basename(self.modulefilename)
- # kill both the .so extension and the other .'s, as introduced
- # by Python 3: 'basename.cpython-33m.so'
- basename = basename.split('.', 1)[0]
- # and the _d added in Python 2 debug builds --- but try to be
- # conservative and not kill a legitimate _d
- if basename.endswith('_d') and hasattr(sys, 'gettotalrefcount'):
- basename = basename[:-2]
- return basename
-
- def get_extension(self):
- ffiplatform._hack_at_distutils() # backward compatibility hack
- if not self._has_source:
- with self.ffi._lock:
- if not self._has_source:
- self._write_source()
- sourcename = ffiplatform.maybe_relative_path(self.sourcefilename)
- modname = self.get_module_name()
- return ffiplatform.get_extension(sourcename, modname, **self.kwds)
-
- def generates_python_module(self):
- return self._vengine._gen_python_module
-
- def make_relative_to(self, kwds, relative_to):
- if relative_to and os.path.dirname(relative_to):
- dirname = os.path.dirname(relative_to)
- kwds = kwds.copy()
- for key in ffiplatform.LIST_OF_FILE_NAMES:
- if key in kwds:
- lst = kwds[key]
- if not isinstance(lst, (list, tuple)):
- raise TypeError("keyword '%s' should be a list or tuple"
- % (key,))
- lst = [os.path.join(dirname, fn) for fn in lst]
- kwds[key] = lst
- return kwds
-
- # ----------
-
- def _locate_module(self):
- if not os.path.isfile(self.modulefilename):
- if self.ext_package:
- try:
- pkg = __import__(self.ext_package, None, None, ['__doc__'])
- except ImportError:
- return # cannot import the package itself, give up
- # (e.g. it might be called differently before installation)
- path = pkg.__path__
- else:
- path = None
- filename = self._vengine.find_module(self.get_module_name(), path,
- _get_so_suffixes())
- if filename is None:
- return
- self.modulefilename = filename
- self._vengine.collect_types()
- self._has_module = True
-
- def _write_source_to(self, file):
- self._vengine._f = file
- try:
- self._vengine.write_source_to_f()
- finally:
- del self._vengine._f
-
- def _write_source(self, file=None):
- if file is not None:
- self._write_source_to(file)
- else:
- # Write our source file to an in memory file.
- f = NativeIO()
- self._write_source_to(f)
- source_data = f.getvalue()
-
- # Determine if this matches the current file
- if os.path.exists(self.sourcefilename):
- with open(self.sourcefilename, "r") as fp:
- needs_written = not (fp.read() == source_data)
- else:
- needs_written = True
-
- # Actually write the file out if it doesn't match
- if needs_written:
- _ensure_dir(self.sourcefilename)
- with open(self.sourcefilename, "w") as fp:
- fp.write(source_data)
-
- # Set this flag
- self._has_source = True
-
- def _compile_module(self):
- # compile this C source
- tmpdir = os.path.dirname(self.sourcefilename)
- outputfilename = ffiplatform.compile(tmpdir, self.get_extension())
- try:
- same = ffiplatform.samefile(outputfilename, self.modulefilename)
- except OSError:
- same = False
- if not same:
- _ensure_dir(self.modulefilename)
- shutil.move(outputfilename, self.modulefilename)
- self._has_module = True
-
- def _load_library(self):
- assert self._has_module
- if self.flags is not None:
- return self._vengine.load_library(self.flags)
- else:
- return self._vengine.load_library()
-
-# ____________________________________________________________
-
-_FORCE_GENERIC_ENGINE = False # for tests
-
-def _locate_engine_class(ffi, force_generic_engine):
- if _FORCE_GENERIC_ENGINE:
- force_generic_engine = True
- if not force_generic_engine:
- if '__pypy__' in sys.builtin_module_names:
- force_generic_engine = True
- else:
- try:
- import _cffi_backend
- except ImportError:
- _cffi_backend = '?'
- if ffi._backend is not _cffi_backend:
- force_generic_engine = True
- if force_generic_engine:
- from . import vengine_gen
- return vengine_gen.VGenericEngine
- else:
- from . import vengine_cpy
- return vengine_cpy.VCPythonEngine
-
-# ____________________________________________________________
-
-_TMPDIR = None
-
-def _caller_dir_pycache():
- if _TMPDIR:
- return _TMPDIR
- result = os.environ.get('CFFI_TMPDIR')
- if result:
- return result
- filename = sys._getframe(2).f_code.co_filename
- return os.path.abspath(os.path.join(os.path.dirname(filename),
- '__pycache__'))
-
-def set_tmpdir(dirname):
- """Set the temporary directory to use instead of __pycache__."""
- global _TMPDIR
- _TMPDIR = dirname
-
-def cleanup_tmpdir(tmpdir=None, keep_so=False):
- """Clean up the temporary directory by removing all files in it
- called `_cffi_*.{c,so}` as well as the `build` subdirectory."""
- tmpdir = tmpdir or _caller_dir_pycache()
- try:
- filelist = os.listdir(tmpdir)
- except OSError:
- return
- if keep_so:
- suffix = '.c' # only remove .c files
- else:
- suffix = _get_so_suffixes()[0].lower()
- for fn in filelist:
- if fn.lower().startswith('_cffi_') and (
- fn.lower().endswith(suffix) or fn.lower().endswith('.c')):
- try:
- os.unlink(os.path.join(tmpdir, fn))
- except OSError:
- pass
- clean_dir = [os.path.join(tmpdir, 'build')]
- for dir in clean_dir:
- try:
- for fn in os.listdir(dir):
- fn = os.path.join(dir, fn)
- if os.path.isdir(fn):
- clean_dir.append(fn)
- else:
- os.unlink(fn)
- except OSError:
- pass
-
-def _get_so_suffixes():
- suffixes = _extension_suffixes()
- if not suffixes:
- # bah, no C_EXTENSION available. Occurs on pypy without cpyext
- if sys.platform == 'win32':
- suffixes = [".pyd"]
- else:
- suffixes = [".so"]
-
- return suffixes
-
-def _ensure_dir(filename):
- dirname = os.path.dirname(filename)
- if dirname and not os.path.isdir(dirname):
- os.makedirs(dirname)
diff --git a/lib/chardet-3.0.4.dist-info/DESCRIPTION.rst b/lib/chardet-3.0.4.dist-info/DESCRIPTION.rst
deleted file mode 100644
index c0f044d84a..0000000000
--- a/lib/chardet-3.0.4.dist-info/DESCRIPTION.rst
+++ /dev/null
@@ -1,70 +0,0 @@
-Chardet: The Universal Character Encoding Detector
---------------------------------------------------
-
-.. image:: https://img.shields.io/travis/chardet/chardet/stable.svg
- :alt: Build status
- :target: https://travis-ci.org/chardet/chardet
-
-.. image:: https://img.shields.io/coveralls/chardet/chardet/stable.svg
- :target: https://coveralls.io/r/chardet/chardet
-
-.. image:: https://img.shields.io/pypi/v/chardet.svg
- :target: https://warehouse.python.org/project/chardet/
- :alt: Latest version on PyPI
-
-.. image:: https://img.shields.io/pypi/l/chardet.svg
- :alt: License
-
-
-Detects
- - ASCII, UTF-8, UTF-16 (2 variants), UTF-32 (4 variants)
- - Big5, GB2312, EUC-TW, HZ-GB-2312, ISO-2022-CN (Traditional and Simplified Chinese)
- - EUC-JP, SHIFT_JIS, CP932, ISO-2022-JP (Japanese)
- - EUC-KR, ISO-2022-KR (Korean)
- - KOI8-R, MacCyrillic, IBM855, IBM866, ISO-8859-5, windows-1251 (Cyrillic)
- - ISO-8859-5, windows-1251 (Bulgarian)
- - ISO-8859-1, windows-1252 (Western European languages)
- - ISO-8859-7, windows-1253 (Greek)
- - ISO-8859-8, windows-1255 (Visual and Logical Hebrew)
- - TIS-620 (Thai)
-
-.. note::
- Our ISO-8859-2 and windows-1250 (Hungarian) probers have been temporarily
- disabled until we can retrain the models.
-
-Requires Python 2.6, 2.7, or 3.3+.
-
-Installation
-------------
-
-Install from `PyPI `_::
-
- pip install chardet
-
-Documentation
--------------
-
-For users, docs are now available at https://chardet.readthedocs.io/.
-
-Command-line Tool
------------------
-
-chardet comes with a command-line script which reports on the encodings of one
-or more files::
-
- % chardetect somefile someotherfile
- somefile: windows-1252 with confidence 0.5
- someotherfile: ascii with confidence 1.0
-
-About
------
-
-This is a continuation of Mark Pilgrim's excellent chardet. Previously, two
-versions needed to be maintained: one that supported python 2.x and one that
-supported python 3.x. We've recently merged with `Ian Cordasco `_'s
-`charade `_ fork, so now we have one
-coherent version that works for Python 2.6+.
-
-:maintainer: Dan Blanchard
-
-
diff --git a/lib/chardet-3.0.4.dist-info/INSTALLER b/lib/chardet-3.0.4.dist-info/INSTALLER
deleted file mode 100644
index a1b589e38a..0000000000
--- a/lib/chardet-3.0.4.dist-info/INSTALLER
+++ /dev/null
@@ -1 +0,0 @@
-pip
diff --git a/lib/chardet-3.0.4.dist-info/METADATA b/lib/chardet-3.0.4.dist-info/METADATA
deleted file mode 100644
index 1427867ab8..0000000000
--- a/lib/chardet-3.0.4.dist-info/METADATA
+++ /dev/null
@@ -1,96 +0,0 @@
-Metadata-Version: 2.0
-Name: chardet
-Version: 3.0.4
-Summary: Universal encoding detector for Python 2 and 3
-Home-page: https://github.com/chardet/chardet
-Author: Daniel Blanchard
-Author-email: dan.blanchard@gmail.com
-License: LGPL
-Keywords: encoding,i18n,xml
-Platform: UNKNOWN
-Classifier: Development Status :: 4 - Beta
-Classifier: Intended Audience :: Developers
-Classifier: License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)
-Classifier: Operating System :: OS Independent
-Classifier: Programming Language :: Python
-Classifier: Programming Language :: Python :: 2
-Classifier: Programming Language :: Python :: 2.6
-Classifier: Programming Language :: Python :: 2.7
-Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.3
-Classifier: Programming Language :: Python :: 3.4
-Classifier: Programming Language :: Python :: 3.5
-Classifier: Programming Language :: Python :: 3.6
-Classifier: Topic :: Software Development :: Libraries :: Python Modules
-Classifier: Topic :: Text Processing :: Linguistic
-
-Chardet: The Universal Character Encoding Detector
---------------------------------------------------
-
-.. image:: https://img.shields.io/travis/chardet/chardet/stable.svg
- :alt: Build status
- :target: https://travis-ci.org/chardet/chardet
-
-.. image:: https://img.shields.io/coveralls/chardet/chardet/stable.svg
- :target: https://coveralls.io/r/chardet/chardet
-
-.. image:: https://img.shields.io/pypi/v/chardet.svg
- :target: https://warehouse.python.org/project/chardet/
- :alt: Latest version on PyPI
-
-.. image:: https://img.shields.io/pypi/l/chardet.svg
- :alt: License
-
-
-Detects
- - ASCII, UTF-8, UTF-16 (2 variants), UTF-32 (4 variants)
- - Big5, GB2312, EUC-TW, HZ-GB-2312, ISO-2022-CN (Traditional and Simplified Chinese)
- - EUC-JP, SHIFT_JIS, CP932, ISO-2022-JP (Japanese)
- - EUC-KR, ISO-2022-KR (Korean)
- - KOI8-R, MacCyrillic, IBM855, IBM866, ISO-8859-5, windows-1251 (Cyrillic)
- - ISO-8859-5, windows-1251 (Bulgarian)
- - ISO-8859-1, windows-1252 (Western European languages)
- - ISO-8859-7, windows-1253 (Greek)
- - ISO-8859-8, windows-1255 (Visual and Logical Hebrew)
- - TIS-620 (Thai)
-
-.. note::
- Our ISO-8859-2 and windows-1250 (Hungarian) probers have been temporarily
- disabled until we can retrain the models.
-
-Requires Python 2.6, 2.7, or 3.3+.
-
-Installation
-------------
-
-Install from `PyPI `_::
-
- pip install chardet
-
-Documentation
--------------
-
-For users, docs are now available at https://chardet.readthedocs.io/.
-
-Command-line Tool
------------------
-
-chardet comes with a command-line script which reports on the encodings of one
-or more files::
-
- % chardetect somefile someotherfile
- somefile: windows-1252 with confidence 0.5
- someotherfile: ascii with confidence 1.0
-
-About
------
-
-This is a continuation of Mark Pilgrim's excellent chardet. Previously, two
-versions needed to be maintained: one that supported python 2.x and one that
-supported python 3.x. We've recently merged with `Ian Cordasco `_'s
-`charade `_ fork, so now we have one
-coherent version that works for Python 2.6+.
-
-:maintainer: Dan Blanchard
-
-
diff --git a/lib/chardet-3.0.4.dist-info/RECORD b/lib/chardet-3.0.4.dist-info/RECORD
deleted file mode 100644
index 9805341e33..0000000000
--- a/lib/chardet-3.0.4.dist-info/RECORD
+++ /dev/null
@@ -1,91 +0,0 @@
-chardet/__init__.py,sha256=YsP5wQlsHJ2auF1RZJfypiSrCA7_bQiRm3ES_NI76-Y,1559
-chardet/big5freq.py,sha256=D_zK5GyzoVsRes0HkLJziltFQX0bKCLOrFe9_xDvO_8,31254
-chardet/big5prober.py,sha256=kBxHbdetBpPe7xrlb-e990iot64g_eGSLd32lB7_h3M,1757
-chardet/chardistribution.py,sha256=3woWS62KrGooKyqz4zQSnjFbJpa6V7g02daAibTwcl8,9411
-chardet/charsetgroupprober.py,sha256=6bDu8YIiRuScX4ca9Igb0U69TA2PGXXDej6Cc4_9kO4,3787
-chardet/charsetprober.py,sha256=KSmwJErjypyj0bRZmC5F5eM7c8YQgLYIjZXintZNstg,5110
-chardet/codingstatemachine.py,sha256=VYp_6cyyki5sHgXDSZnXW4q1oelHc3cu9AyQTX7uug8,3590
-chardet/compat.py,sha256=PKTzHkSbtbHDqS9PyujMbX74q1a8mMpeQTDVsQhZMRw,1134
-chardet/cp949prober.py,sha256=TZ434QX8zzBsnUvL_8wm4AQVTZ2ZkqEEQL_lNw9f9ow,1855
-chardet/enums.py,sha256=Aimwdb9as1dJKZaFNUH2OhWIVBVd6ZkJJ_WK5sNY8cU,1661
-chardet/escprober.py,sha256=kkyqVg1Yw3DIOAMJ2bdlyQgUFQhuHAW8dUGskToNWSc,3950
-chardet/escsm.py,sha256=RuXlgNvTIDarndvllNCk5WZBIpdCxQ0kcd9EAuxUh84,10510
-chardet/eucjpprober.py,sha256=iD8Jdp0ISRjgjiVN7f0e8xGeQJ5GM2oeZ1dA8nbSeUw,3749
-chardet/euckrfreq.py,sha256=-7GdmvgWez4-eO4SuXpa7tBiDi5vRXQ8WvdFAzVaSfo,13546
-chardet/euckrprober.py,sha256=MqFMTQXxW4HbzIpZ9lKDHB3GN8SP4yiHenTmf8g_PxY,1748
-chardet/euctwfreq.py,sha256=No1WyduFOgB5VITUA7PLyC5oJRNzRyMbBxaKI1l16MA,31621
-chardet/euctwprober.py,sha256=13p6EP4yRaxqnP4iHtxHOJ6R2zxHq1_m8hTRjzVZ95c,1747
-chardet/gb2312freq.py,sha256=JX8lsweKLmnCwmk8UHEQsLgkr_rP_kEbvivC4qPOrlc,20715
-chardet/gb2312prober.py,sha256=gGvIWi9WhDjE-xQXHvNIyrnLvEbMAYgyUSZ65HUfylw,1754
-chardet/hebrewprober.py,sha256=c3SZ-K7hvyzGY6JRAZxJgwJ_sUS9k0WYkvMY00YBYFo,13838
-chardet/jisfreq.py,sha256=vpmJv2Bu0J8gnMVRPHMFefTRvo_ha1mryLig8CBwgOg,25777
-chardet/jpcntx.py,sha256=PYlNqRUQT8LM3cT5FmHGP0iiscFlTWED92MALvBungo,19643
-chardet/langbulgarianmodel.py,sha256=1HqQS9Pbtnj1xQgxitJMvw8X6kKr5OockNCZWfEQrPE,12839
-chardet/langcyrillicmodel.py,sha256=LODajvsetH87yYDDQKA2CULXUH87tI223dhfjh9Zx9c,17948
-chardet/langgreekmodel.py,sha256=8YAW7bU8YwSJap0kIJSbPMw1BEqzGjWzqcqf0WgUKAA,12688
-chardet/langhebrewmodel.py,sha256=JSnqmE5E62tDLTPTvLpQsg5gOMO4PbdWRvV7Avkc0HA,11345
-chardet/langhungarianmodel.py,sha256=RhapYSG5l0ZaO-VV4Fan5sW0WRGQqhwBM61yx3yxyOA,12592
-chardet/langthaimodel.py,sha256=8l0173Gu_W6G8mxmQOTEF4ls2YdE7FxWf3QkSxEGXJQ,11290
-chardet/langturkishmodel.py,sha256=W22eRNJsqI6uWAfwXSKVWWnCerYqrI8dZQTm_M0lRFk,11102
-chardet/latin1prober.py,sha256=S2IoORhFk39FEFOlSFWtgVybRiP6h7BlLldHVclNkU8,5370
-chardet/mbcharsetprober.py,sha256=AR95eFH9vuqSfvLQZN-L5ijea25NOBCoXqw8s5O9xLQ,3413
-chardet/mbcsgroupprober.py,sha256=h6TRnnYq2OxG1WdD5JOyxcdVpn7dG0q-vB8nWr5mbh4,2012
-chardet/mbcssm.py,sha256=SY32wVIF3HzcjY3BaEspy9metbNSKxIIB0RKPn7tjpI,25481
-chardet/sbcharsetprober.py,sha256=LDSpCldDCFlYwUkGkwD2oFxLlPWIWXT09akH_2PiY74,5657
-chardet/sbcsgroupprober.py,sha256=1IprcCB_k1qfmnxGC6MBbxELlKqD3scW6S8YIwdeyXA,3546
-chardet/sjisprober.py,sha256=IIt-lZj0WJqK4rmUZzKZP4GJlE8KUEtFYVuY96ek5MQ,3774
-chardet/universaldetector.py,sha256=qL0174lSZE442eB21nnktT9_VcAye07laFWUeUrjttY,12485
-chardet/utf8prober.py,sha256=IdD8v3zWOsB8OLiyPi-y_fqwipRFxV9Nc1eKBLSuIEw,2766
-chardet/version.py,sha256=sp3B08mrDXB-pf3K9fqJ_zeDHOCLC8RrngQyDFap_7g,242
-chardet/cli/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
-chardet/cli/chardetect.py,sha256=YBO8L4mXo0WR6_-Fjh_8QxPBoEBNqB9oNxNrdc54AQs,2738
-chardet-3.0.4.dist-info/DESCRIPTION.rst,sha256=PQ4sBsMyKFZkjC6QpmbpLn0UtCNyeb-ZqvCGEgyZMGk,2174
-chardet-3.0.4.dist-info/METADATA,sha256=RV_2I4B1Z586DL8oVO5Kp7X5bUdQ5EuKAvNoAEF8wSw,3239
-chardet-3.0.4.dist-info/RECORD,,
-chardet-3.0.4.dist-info/WHEEL,sha256=o2k-Qa-RMNIJmUdIc7KU6VWR_ErNRbWNlxDIpl7lm34,110
-chardet-3.0.4.dist-info/entry_points.txt,sha256=fAMmhu5eJ-zAJ-smfqQwRClQ3-nozOCmvJ6-E8lgGJo,60
-chardet-3.0.4.dist-info/metadata.json,sha256=0htbRM18ujyGZDdfowgAqj6Hq2eQtwzwyhaEveKntgo,1375
-chardet-3.0.4.dist-info/top_level.txt,sha256=AowzBbZy4x8EirABDdJSLJZMkJ_53iIag8xfKR6D7kI,8
-../../bin/chardetect,sha256=bDMb5ji6ZORA_jpp2AqGu75TL13BVleY8LRLY0ED9Vg,224
-chardet-3.0.4.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
-chardet/euctwprober.pyc,,
-chardet/big5freq.pyc,,
-chardet/langthaimodel.pyc,,
-chardet/chardistribution.pyc,,
-chardet/big5prober.pyc,,
-chardet/cp949prober.pyc,,
-chardet/langgreekmodel.pyc,,
-chardet/gb2312prober.pyc,,
-chardet/compat.pyc,,
-chardet/sbcharsetprober.pyc,,
-chardet/langturkishmodel.pyc,,
-chardet/latin1prober.pyc,,
-chardet/version.pyc,,
-chardet/cli/__init__.pyc,,
-chardet/utf8prober.pyc,,
-chardet/universaldetector.pyc,,
-chardet/mbcharsetprober.pyc,,
-chardet/sjisprober.pyc,,
-chardet/enums.pyc,,
-chardet/langcyrillicmodel.pyc,,
-chardet/jpcntx.pyc,,
-chardet/cli/chardetect.pyc,,
-chardet/euctwfreq.pyc,,
-chardet/charsetprober.pyc,,
-chardet/langbulgarianmodel.pyc,,
-chardet/mbcssm.pyc,,
-chardet/mbcsgroupprober.pyc,,
-chardet/euckrprober.pyc,,
-chardet/sbcsgroupprober.pyc,,
-chardet/eucjpprober.pyc,,
-chardet/escprober.pyc,,
-chardet/jisfreq.pyc,,
-chardet/langhungarianmodel.pyc,,
-chardet/langhebrewmodel.pyc,,
-chardet/escsm.pyc,,
-chardet/charsetgroupprober.pyc,,
-chardet/hebrewprober.pyc,,
-chardet/codingstatemachine.pyc,,
-chardet/gb2312freq.pyc,,
-chardet/__init__.pyc,,
-chardet/euckrfreq.pyc,,
diff --git a/lib/chardet-3.0.4.dist-info/WHEEL b/lib/chardet-3.0.4.dist-info/WHEEL
deleted file mode 100644
index 8b6dd1b5a8..0000000000
--- a/lib/chardet-3.0.4.dist-info/WHEEL
+++ /dev/null
@@ -1,6 +0,0 @@
-Wheel-Version: 1.0
-Generator: bdist_wheel (0.29.0)
-Root-Is-Purelib: true
-Tag: py2-none-any
-Tag: py3-none-any
-
diff --git a/lib/chardet-3.0.4.dist-info/entry_points.txt b/lib/chardet-3.0.4.dist-info/entry_points.txt
deleted file mode 100644
index a884269e7f..0000000000
--- a/lib/chardet-3.0.4.dist-info/entry_points.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-[console_scripts]
-chardetect = chardet.cli.chardetect:main
-
diff --git a/lib/chardet-3.0.4.dist-info/metadata.json b/lib/chardet-3.0.4.dist-info/metadata.json
deleted file mode 100644
index 8cdf025601..0000000000
--- a/lib/chardet-3.0.4.dist-info/metadata.json
+++ /dev/null
@@ -1 +0,0 @@
-{"classifiers": ["Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Text Processing :: Linguistic"], "extensions": {"python.commands": {"wrap_console": {"chardetect": "chardet.cli.chardetect:main"}}, "python.details": {"contacts": [{"email": "dan.blanchard@gmail.com", "name": "Daniel Blanchard", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst"}, "project_urls": {"Home": "https://github.com/chardet/chardet"}}, "python.exports": {"console_scripts": {"chardetect": "chardet.cli.chardetect:main"}}}, "generator": "bdist_wheel (0.29.0)", "keywords": ["encoding", "i18n", "xml"], "license": "LGPL", "metadata_version": "2.0", "name": "chardet", "summary": "Universal encoding detector for Python 2 and 3", "test_requires": [{"requires": ["hypothesis", "pytest"]}], "version": "3.0.4"}
\ No newline at end of file
diff --git a/lib/chardet-3.0.4.dist-info/top_level.txt b/lib/chardet-3.0.4.dist-info/top_level.txt
deleted file mode 100644
index 79236f25cd..0000000000
--- a/lib/chardet-3.0.4.dist-info/top_level.txt
+++ /dev/null
@@ -1 +0,0 @@
-chardet
diff --git a/lib/chardet/__init__.py b/lib/chardet/__init__.py
deleted file mode 100644
index 0f9f820ef6..0000000000
--- a/lib/chardet/__init__.py
+++ /dev/null
@@ -1,39 +0,0 @@
-######################## BEGIN LICENSE BLOCK ########################
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301 USA
-######################### END LICENSE BLOCK #########################
-
-
-from .compat import PY2, PY3
-from .universaldetector import UniversalDetector
-from .version import __version__, VERSION
-
-
-def detect(byte_str):
- """
- Detect the encoding of the given byte string.
-
- :param byte_str: The byte sequence to examine.
- :type byte_str: ``bytes`` or ``bytearray``
- """
- if not isinstance(byte_str, bytearray):
- if not isinstance(byte_str, bytes):
- raise TypeError('Expected object of type bytes or bytearray, got: '
- '{0}'.format(type(byte_str)))
- else:
- byte_str = bytearray(byte_str)
- detector = UniversalDetector()
- detector.feed(byte_str)
- return detector.close()
diff --git a/lib/chardet/big5freq.py b/lib/chardet/big5freq.py
deleted file mode 100644
index 38f32517aa..0000000000
--- a/lib/chardet/big5freq.py
+++ /dev/null
@@ -1,386 +0,0 @@
-######################## BEGIN LICENSE BLOCK ########################
-# The Original Code is Mozilla Communicator client code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Mark Pilgrim - port to Python
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301 USA
-######################### END LICENSE BLOCK #########################
-
-# Big5 frequency table
-# by Taiwan's Mandarin Promotion Council
-#
-#
-# 128 --> 0.42261
-# 256 --> 0.57851
-# 512 --> 0.74851
-# 1024 --> 0.89384
-# 2048 --> 0.97583
-#
-# Ideal Distribution Ratio = 0.74851/(1-0.74851) =2.98
-# Random Distribution Ration = 512/(5401-512)=0.105
-#
-# Typical Distribution Ratio about 25% of Ideal one, still much higher than RDR
-
-BIG5_TYPICAL_DISTRIBUTION_RATIO = 0.75
-
-#Char to FreqOrder table
-BIG5_TABLE_SIZE = 5376
-
-BIG5_CHAR_TO_FREQ_ORDER = (
- 1,1801,1506, 255,1431, 198, 9, 82, 6,5008, 177, 202,3681,1256,2821, 110, # 16
-3814, 33,3274, 261, 76, 44,2114, 16,2946,2187,1176, 659,3971, 26,3451,2653, # 32
-1198,3972,3350,4202, 410,2215, 302, 590, 361,1964, 8, 204, 58,4510,5009,1932, # 48
- 63,5010,5011, 317,1614, 75, 222, 159,4203,2417,1480,5012,3555,3091, 224,2822, # 64
-3682, 3, 10,3973,1471, 29,2787,1135,2866,1940, 873, 130,3275,1123, 312,5013, # 80
-4511,2052, 507, 252, 682,5014, 142,1915, 124, 206,2947, 34,3556,3204, 64, 604, # 96
-5015,2501,1977,1978, 155,1991, 645, 641,1606,5016,3452, 337, 72, 406,5017, 80, # 112
- 630, 238,3205,1509, 263, 939,1092,2654, 756,1440,1094,3453, 449, 69,2987, 591, # 128
- 179,2096, 471, 115,2035,1844, 60, 50,2988, 134, 806,1869, 734,2036,3454, 180, # 144
- 995,1607, 156, 537,2907, 688,5018, 319,1305, 779,2145, 514,2379, 298,4512, 359, # 160
-2502, 90,2716,1338, 663, 11, 906,1099,2553, 20,2441, 182, 532,1716,5019, 732, # 176
-1376,4204,1311,1420,3206, 25,2317,1056, 113, 399, 382,1950, 242,3455,2474, 529, # 192
-3276, 475,1447,3683,5020, 117, 21, 656, 810,1297,2300,2334,3557,5021, 126,4205, # 208
- 706, 456, 150, 613,4513, 71,1118,2037,4206, 145,3092, 85, 835, 486,2115,1246, # 224
-1426, 428, 727,1285,1015, 800, 106, 623, 303,1281,5022,2128,2359, 347,3815, 221, # 240
-3558,3135,5023,1956,1153,4207, 83, 296,1199,3093, 192, 624, 93,5024, 822,1898, # 256
-2823,3136, 795,2065, 991,1554,1542,1592, 27, 43,2867, 859, 139,1456, 860,4514, # 272
- 437, 712,3974, 164,2397,3137, 695, 211,3037,2097, 195,3975,1608,3559,3560,3684, # 288
-3976, 234, 811,2989,2098,3977,2233,1441,3561,1615,2380, 668,2077,1638, 305, 228, # 304
-1664,4515, 467, 415,5025, 262,2099,1593, 239, 108, 300, 200,1033, 512,1247,2078, # 320
-5026,5027,2176,3207,3685,2682, 593, 845,1062,3277, 88,1723,2038,3978,1951, 212, # 336
- 266, 152, 149, 468,1899,4208,4516, 77, 187,5028,3038, 37, 5,2990,5029,3979, # 352
-5030,5031, 39,2524,4517,2908,3208,2079, 55, 148, 74,4518, 545, 483,1474,1029, # 368
-1665, 217,1870,1531,3138,1104,2655,4209, 24, 172,3562, 900,3980,3563,3564,4519, # 384
- 32,1408,2824,1312, 329, 487,2360,2251,2717, 784,2683, 4,3039,3351,1427,1789, # 400
- 188, 109, 499,5032,3686,1717,1790, 888,1217,3040,4520,5033,3565,5034,3352,1520, # 416
-3687,3981, 196,1034, 775,5035,5036, 929,1816, 249, 439, 38,5037,1063,5038, 794, # 432
-3982,1435,2301, 46, 178,3278,2066,5039,2381,5040, 214,1709,4521, 804, 35, 707, # 448
- 324,3688,1601,2554, 140, 459,4210,5041,5042,1365, 839, 272, 978,2262,2580,3456, # 464
-2129,1363,3689,1423, 697, 100,3094, 48, 70,1231, 495,3139,2196,5043,1294,5044, # 480
-2080, 462, 586,1042,3279, 853, 256, 988, 185,2382,3457,1698, 434,1084,5045,3458, # 496
- 314,2625,2788,4522,2335,2336, 569,2285, 637,1817,2525, 757,1162,1879,1616,3459, # 512
- 287,1577,2116, 768,4523,1671,2868,3566,2526,1321,3816, 909,2418,5046,4211, 933, # 528
-3817,4212,2053,2361,1222,4524, 765,2419,1322, 786,4525,5047,1920,1462,1677,2909, # 544
-1699,5048,4526,1424,2442,3140,3690,2600,3353,1775,1941,3460,3983,4213, 309,1369, # 560
-1130,2825, 364,2234,1653,1299,3984,3567,3985,3986,2656, 525,1085,3041, 902,2001, # 576
-1475, 964,4527, 421,1845,1415,1057,2286, 940,1364,3141, 376,4528,4529,1381, 7, # 592
-2527, 983,2383, 336,1710,2684,1846, 321,3461, 559,1131,3042,2752,1809,1132,1313, # 608
- 265,1481,1858,5049, 352,1203,2826,3280, 167,1089, 420,2827, 776, 792,1724,3568, # 624
-4214,2443,3281,5050,4215,5051, 446, 229, 333,2753, 901,3818,1200,1557,4530,2657, # 640
-1921, 395,2754,2685,3819,4216,1836, 125, 916,3209,2626,4531,5052,5053,3820,5054, # 656
-5055,5056,4532,3142,3691,1133,2555,1757,3462,1510,2318,1409,3569,5057,2146, 438, # 672
-2601,2910,2384,3354,1068, 958,3043, 461, 311,2869,2686,4217,1916,3210,4218,1979, # 688
- 383, 750,2755,2627,4219, 274, 539, 385,1278,1442,5058,1154,1965, 384, 561, 210, # 704
- 98,1295,2556,3570,5059,1711,2420,1482,3463,3987,2911,1257, 129,5060,3821, 642, # 720
- 523,2789,2790,2658,5061, 141,2235,1333, 68, 176, 441, 876, 907,4220, 603,2602, # 736
- 710, 171,3464, 404, 549, 18,3143,2398,1410,3692,1666,5062,3571,4533,2912,4534, # 752
-5063,2991, 368,5064, 146, 366, 99, 871,3693,1543, 748, 807,1586,1185, 22,2263, # 768
- 379,3822,3211,5065,3212, 505,1942,2628,1992,1382,2319,5066, 380,2362, 218, 702, # 784
-1818,1248,3465,3044,3572,3355,3282,5067,2992,3694, 930,3283,3823,5068, 59,5069, # 800
- 585, 601,4221, 497,3466,1112,1314,4535,1802,5070,1223,1472,2177,5071, 749,1837, # 816
- 690,1900,3824,1773,3988,1476, 429,1043,1791,2236,2117, 917,4222, 447,1086,1629, # 832
-5072, 556,5073,5074,2021,1654, 844,1090, 105, 550, 966,1758,2828,1008,1783, 686, # 848
-1095,5075,2287, 793,1602,5076,3573,2603,4536,4223,2948,2302,4537,3825, 980,2503, # 864
- 544, 353, 527,4538, 908,2687,2913,5077, 381,2629,1943,1348,5078,1341,1252, 560, # 880
-3095,5079,3467,2870,5080,2054, 973, 886,2081, 143,4539,5081,5082, 157,3989, 496, # 896
-4224, 57, 840, 540,2039,4540,4541,3468,2118,1445, 970,2264,1748,1966,2082,4225, # 912
-3144,1234,1776,3284,2829,3695, 773,1206,2130,1066,2040,1326,3990,1738,1725,4226, # 928
- 279,3145, 51,1544,2604, 423,1578,2131,2067, 173,4542,1880,5083,5084,1583, 264, # 944
- 610,3696,4543,2444, 280, 154,5085,5086,5087,1739, 338,1282,3096, 693,2871,1411, # 960
-1074,3826,2445,5088,4544,5089,5090,1240, 952,2399,5091,2914,1538,2688, 685,1483, # 976
-4227,2475,1436, 953,4228,2055,4545, 671,2400, 79,4229,2446,3285, 608, 567,2689, # 992
-3469,4230,4231,1691, 393,1261,1792,2401,5092,4546,5093,5094,5095,5096,1383,1672, # 1008
-3827,3213,1464, 522,1119, 661,1150, 216, 675,4547,3991,1432,3574, 609,4548,2690, # 1024
-2402,5097,5098,5099,4232,3045, 0,5100,2476, 315, 231,2447, 301,3356,4549,2385, # 1040
-5101, 233,4233,3697,1819,4550,4551,5102, 96,1777,1315,2083,5103, 257,5104,1810, # 1056
-3698,2718,1139,1820,4234,2022,1124,2164,2791,1778,2659,5105,3097, 363,1655,3214, # 1072
-5106,2993,5107,5108,5109,3992,1567,3993, 718, 103,3215, 849,1443, 341,3357,2949, # 1088
-1484,5110,1712, 127, 67, 339,4235,2403, 679,1412, 821,5111,5112, 834, 738, 351, # 1104
-2994,2147, 846, 235,1497,1881, 418,1993,3828,2719, 186,1100,2148,2756,3575,1545, # 1120
-1355,2950,2872,1377, 583,3994,4236,2581,2995,5113,1298,3699,1078,2557,3700,2363, # 1136
- 78,3829,3830, 267,1289,2100,2002,1594,4237, 348, 369,1274,2197,2178,1838,4552, # 1152
-1821,2830,3701,2757,2288,2003,4553,2951,2758, 144,3358, 882,4554,3995,2759,3470, # 1168
-4555,2915,5114,4238,1726, 320,5115,3996,3046, 788,2996,5116,2831,1774,1327,2873, # 1184
-3997,2832,5117,1306,4556,2004,1700,3831,3576,2364,2660, 787,2023, 506, 824,3702, # 1200
- 534, 323,4557,1044,3359,2024,1901, 946,3471,5118,1779,1500,1678,5119,1882,4558, # 1216
- 165, 243,4559,3703,2528, 123, 683,4239, 764,4560, 36,3998,1793, 589,2916, 816, # 1232
- 626,1667,3047,2237,1639,1555,1622,3832,3999,5120,4000,2874,1370,1228,1933, 891, # 1248
-2084,2917, 304,4240,5121, 292,2997,2720,3577, 691,2101,4241,1115,4561, 118, 662, # 1264
-5122, 611,1156, 854,2386,1316,2875, 2, 386, 515,2918,5123,5124,3286, 868,2238, # 1280
-1486, 855,2661, 785,2216,3048,5125,1040,3216,3578,5126,3146, 448,5127,1525,5128, # 1296
-2165,4562,5129,3833,5130,4242,2833,3579,3147, 503, 818,4001,3148,1568, 814, 676, # 1312
-1444, 306,1749,5131,3834,1416,1030, 197,1428, 805,2834,1501,4563,5132,5133,5134, # 1328
-1994,5135,4564,5136,5137,2198, 13,2792,3704,2998,3149,1229,1917,5138,3835,2132, # 1344
-5139,4243,4565,2404,3580,5140,2217,1511,1727,1120,5141,5142, 646,3836,2448, 307, # 1360
-5143,5144,1595,3217,5145,5146,5147,3705,1113,1356,4002,1465,2529,2530,5148, 519, # 1376
-5149, 128,2133, 92,2289,1980,5150,4003,1512, 342,3150,2199,5151,2793,2218,1981, # 1392
-3360,4244, 290,1656,1317, 789, 827,2365,5152,3837,4566, 562, 581,4004,5153, 401, # 1408
-4567,2252, 94,4568,5154,1399,2794,5155,1463,2025,4569,3218,1944,5156, 828,1105, # 1424
-4245,1262,1394,5157,4246, 605,4570,5158,1784,2876,5159,2835, 819,2102, 578,2200, # 1440
-2952,5160,1502, 436,3287,4247,3288,2836,4005,2919,3472,3473,5161,2721,2320,5162, # 1456
-5163,2337,2068, 23,4571, 193, 826,3838,2103, 699,1630,4248,3098, 390,1794,1064, # 1472
-3581,5164,1579,3099,3100,1400,5165,4249,1839,1640,2877,5166,4572,4573, 137,4250, # 1488
- 598,3101,1967, 780, 104, 974,2953,5167, 278, 899, 253, 402, 572, 504, 493,1339, # 1504
-5168,4006,1275,4574,2582,2558,5169,3706,3049,3102,2253, 565,1334,2722, 863, 41, # 1520
-5170,5171,4575,5172,1657,2338, 19, 463,2760,4251, 606,5173,2999,3289,1087,2085, # 1536
-1323,2662,3000,5174,1631,1623,1750,4252,2691,5175,2878, 791,2723,2663,2339, 232, # 1552
-2421,5176,3001,1498,5177,2664,2630, 755,1366,3707,3290,3151,2026,1609, 119,1918, # 1568
-3474, 862,1026,4253,5178,4007,3839,4576,4008,4577,2265,1952,2477,5179,1125, 817, # 1584
-4254,4255,4009,1513,1766,2041,1487,4256,3050,3291,2837,3840,3152,5180,5181,1507, # 1600
-5182,2692, 733, 40,1632,1106,2879, 345,4257, 841,2531, 230,4578,3002,1847,3292, # 1616
-3475,5183,1263, 986,3476,5184, 735, 879, 254,1137, 857, 622,1300,1180,1388,1562, # 1632
-4010,4011,2954, 967,2761,2665,1349, 592,2134,1692,3361,3003,1995,4258,1679,4012, # 1648
-1902,2188,5185, 739,3708,2724,1296,1290,5186,4259,2201,2202,1922,1563,2605,2559, # 1664
-1871,2762,3004,5187, 435,5188, 343,1108, 596, 17,1751,4579,2239,3477,3709,5189, # 1680
-4580, 294,3582,2955,1693, 477, 979, 281,2042,3583, 643,2043,3710,2631,2795,2266, # 1696
-1031,2340,2135,2303,3584,4581, 367,1249,2560,5190,3585,5191,4582,1283,3362,2005, # 1712
- 240,1762,3363,4583,4584, 836,1069,3153, 474,5192,2149,2532, 268,3586,5193,3219, # 1728
-1521,1284,5194,1658,1546,4260,5195,3587,3588,5196,4261,3364,2693,1685,4262, 961, # 1744
-1673,2632, 190,2006,2203,3841,4585,4586,5197, 570,2504,3711,1490,5198,4587,2633, # 1760
-3293,1957,4588, 584,1514, 396,1045,1945,5199,4589,1968,2449,5200,5201,4590,4013, # 1776
- 619,5202,3154,3294, 215,2007,2796,2561,3220,4591,3221,4592, 763,4263,3842,4593, # 1792
-5203,5204,1958,1767,2956,3365,3712,1174, 452,1477,4594,3366,3155,5205,2838,1253, # 1808
-2387,2189,1091,2290,4264, 492,5206, 638,1169,1825,2136,1752,4014, 648, 926,1021, # 1824
-1324,4595, 520,4596, 997, 847,1007, 892,4597,3843,2267,1872,3713,2405,1785,4598, # 1840
-1953,2957,3103,3222,1728,4265,2044,3714,4599,2008,1701,3156,1551, 30,2268,4266, # 1856
-5207,2027,4600,3589,5208, 501,5209,4267, 594,3478,2166,1822,3590,3479,3591,3223, # 1872
- 829,2839,4268,5210,1680,3157,1225,4269,5211,3295,4601,4270,3158,2341,5212,4602, # 1888
-4271,5213,4015,4016,5214,1848,2388,2606,3367,5215,4603, 374,4017, 652,4272,4273, # 1904
- 375,1140, 798,5216,5217,5218,2366,4604,2269, 546,1659, 138,3051,2450,4605,5219, # 1920
-2254, 612,1849, 910, 796,3844,1740,1371, 825,3845,3846,5220,2920,2562,5221, 692, # 1936
- 444,3052,2634, 801,4606,4274,5222,1491, 244,1053,3053,4275,4276, 340,5223,4018, # 1952
-1041,3005, 293,1168, 87,1357,5224,1539, 959,5225,2240, 721, 694,4277,3847, 219, # 1968
-1478, 644,1417,3368,2666,1413,1401,1335,1389,4019,5226,5227,3006,2367,3159,1826, # 1984
- 730,1515, 184,2840, 66,4607,5228,1660,2958, 246,3369, 378,1457, 226,3480, 975, # 2000
-4020,2959,1264,3592, 674, 696,5229, 163,5230,1141,2422,2167, 713,3593,3370,4608, # 2016
-4021,5231,5232,1186, 15,5233,1079,1070,5234,1522,3224,3594, 276,1050,2725, 758, # 2032
-1126, 653,2960,3296,5235,2342, 889,3595,4022,3104,3007, 903,1250,4609,4023,3481, # 2048
-3596,1342,1681,1718, 766,3297, 286, 89,2961,3715,5236,1713,5237,2607,3371,3008, # 2064
-5238,2962,2219,3225,2880,5239,4610,2505,2533, 181, 387,1075,4024, 731,2190,3372, # 2080
-5240,3298, 310, 313,3482,2304, 770,4278, 54,3054, 189,4611,3105,3848,4025,5241, # 2096
-1230,1617,1850, 355,3597,4279,4612,3373, 111,4280,3716,1350,3160,3483,3055,4281, # 2112
-2150,3299,3598,5242,2797,4026,4027,3009, 722,2009,5243,1071, 247,1207,2343,2478, # 2128
-1378,4613,2010, 864,1437,1214,4614, 373,3849,1142,2220, 667,4615, 442,2763,2563, # 2144
-3850,4028,1969,4282,3300,1840, 837, 170,1107, 934,1336,1883,5244,5245,2119,4283, # 2160
-2841, 743,1569,5246,4616,4284, 582,2389,1418,3484,5247,1803,5248, 357,1395,1729, # 2176
-3717,3301,2423,1564,2241,5249,3106,3851,1633,4617,1114,2086,4285,1532,5250, 482, # 2192
-2451,4618,5251,5252,1492, 833,1466,5253,2726,3599,1641,2842,5254,1526,1272,3718, # 2208
-4286,1686,1795, 416,2564,1903,1954,1804,5255,3852,2798,3853,1159,2321,5256,2881, # 2224
-4619,1610,1584,3056,2424,2764, 443,3302,1163,3161,5257,5258,4029,5259,4287,2506, # 2240
-3057,4620,4030,3162,2104,1647,3600,2011,1873,4288,5260,4289, 431,3485,5261, 250, # 2256
- 97, 81,4290,5262,1648,1851,1558, 160, 848,5263, 866, 740,1694,5264,2204,2843, # 2272
-3226,4291,4621,3719,1687, 950,2479, 426, 469,3227,3720,3721,4031,5265,5266,1188, # 2288
- 424,1996, 861,3601,4292,3854,2205,2694, 168,1235,3602,4293,5267,2087,1674,4622, # 2304
-3374,3303, 220,2565,1009,5268,3855, 670,3010, 332,1208, 717,5269,5270,3603,2452, # 2320
-4032,3375,5271, 513,5272,1209,2882,3376,3163,4623,1080,5273,5274,5275,5276,2534, # 2336
-3722,3604, 815,1587,4033,4034,5277,3605,3486,3856,1254,4624,1328,3058,1390,4035, # 2352
-1741,4036,3857,4037,5278, 236,3858,2453,3304,5279,5280,3723,3859,1273,3860,4625, # 2368
-5281, 308,5282,4626, 245,4627,1852,2480,1307,2583, 430, 715,2137,2454,5283, 270, # 2384
- 199,2883,4038,5284,3606,2727,1753, 761,1754, 725,1661,1841,4628,3487,3724,5285, # 2400
-5286, 587, 14,3305, 227,2608, 326, 480,2270, 943,2765,3607, 291, 650,1884,5287, # 2416
-1702,1226, 102,1547, 62,3488, 904,4629,3489,1164,4294,5288,5289,1224,1548,2766, # 2432
- 391, 498,1493,5290,1386,1419,5291,2056,1177,4630, 813, 880,1081,2368, 566,1145, # 2448
-4631,2291,1001,1035,2566,2609,2242, 394,1286,5292,5293,2069,5294, 86,1494,1730, # 2464
-4039, 491,1588, 745, 897,2963, 843,3377,4040,2767,2884,3306,1768, 998,2221,2070, # 2480
- 397,1827,1195,1970,3725,3011,3378, 284,5295,3861,2507,2138,2120,1904,5296,4041, # 2496
-2151,4042,4295,1036,3490,1905, 114,2567,4296, 209,1527,5297,5298,2964,2844,2635, # 2512
-2390,2728,3164, 812,2568,5299,3307,5300,1559, 737,1885,3726,1210, 885, 28,2695, # 2528
-3608,3862,5301,4297,1004,1780,4632,5302, 346,1982,2222,2696,4633,3863,1742, 797, # 2544
-1642,4043,1934,1072,1384,2152, 896,4044,3308,3727,3228,2885,3609,5303,2569,1959, # 2560
-4634,2455,1786,5304,5305,5306,4045,4298,1005,1308,3728,4299,2729,4635,4636,1528, # 2576
-2610, 161,1178,4300,1983, 987,4637,1101,4301, 631,4046,1157,3229,2425,1343,1241, # 2592
-1016,2243,2570, 372, 877,2344,2508,1160, 555,1935, 911,4047,5307, 466,1170, 169, # 2608
-1051,2921,2697,3729,2481,3012,1182,2012,2571,1251,2636,5308, 992,2345,3491,1540, # 2624
-2730,1201,2071,2406,1997,2482,5309,4638, 528,1923,2191,1503,1874,1570,2369,3379, # 2640
-3309,5310, 557,1073,5311,1828,3492,2088,2271,3165,3059,3107, 767,3108,2799,4639, # 2656
-1006,4302,4640,2346,1267,2179,3730,3230, 778,4048,3231,2731,1597,2667,5312,4641, # 2672
-5313,3493,5314,5315,5316,3310,2698,1433,3311, 131, 95,1504,4049, 723,4303,3166, # 2688
-1842,3610,2768,2192,4050,2028,2105,3731,5317,3013,4051,1218,5318,3380,3232,4052, # 2704
-4304,2584, 248,1634,3864, 912,5319,2845,3732,3060,3865, 654, 53,5320,3014,5321, # 2720
-1688,4642, 777,3494,1032,4053,1425,5322, 191, 820,2121,2846, 971,4643, 931,3233, # 2736
- 135, 664, 783,3866,1998, 772,2922,1936,4054,3867,4644,2923,3234, 282,2732, 640, # 2752
-1372,3495,1127, 922, 325,3381,5323,5324, 711,2045,5325,5326,4055,2223,2800,1937, # 2768
-4056,3382,2224,2255,3868,2305,5327,4645,3869,1258,3312,4057,3235,2139,2965,4058, # 2784
-4059,5328,2225, 258,3236,4646, 101,1227,5329,3313,1755,5330,1391,3314,5331,2924, # 2800
-2057, 893,5332,5333,5334,1402,4305,2347,5335,5336,3237,3611,5337,5338, 878,1325, # 2816
-1781,2801,4647, 259,1385,2585, 744,1183,2272,4648,5339,4060,2509,5340, 684,1024, # 2832
-4306,5341, 472,3612,3496,1165,3315,4061,4062, 322,2153, 881, 455,1695,1152,1340, # 2848
- 660, 554,2154,4649,1058,4650,4307, 830,1065,3383,4063,4651,1924,5342,1703,1919, # 2864
-5343, 932,2273, 122,5344,4652, 947, 677,5345,3870,2637, 297,1906,1925,2274,4653, # 2880
-2322,3316,5346,5347,4308,5348,4309, 84,4310, 112, 989,5349, 547,1059,4064, 701, # 2896
-3613,1019,5350,4311,5351,3497, 942, 639, 457,2306,2456, 993,2966, 407, 851, 494, # 2912
-4654,3384, 927,5352,1237,5353,2426,3385, 573,4312, 680, 921,2925,1279,1875, 285, # 2928
- 790,1448,1984, 719,2168,5354,5355,4655,4065,4066,1649,5356,1541, 563,5357,1077, # 2944
-5358,3386,3061,3498, 511,3015,4067,4068,3733,4069,1268,2572,3387,3238,4656,4657, # 2960
-5359, 535,1048,1276,1189,2926,2029,3167,1438,1373,2847,2967,1134,2013,5360,4313, # 2976
-1238,2586,3109,1259,5361, 700,5362,2968,3168,3734,4314,5363,4315,1146,1876,1907, # 2992
-4658,2611,4070, 781,2427, 132,1589, 203, 147, 273,2802,2407, 898,1787,2155,4071, # 3008
-4072,5364,3871,2803,5365,5366,4659,4660,5367,3239,5368,1635,3872, 965,5369,1805, # 3024
-2699,1516,3614,1121,1082,1329,3317,4073,1449,3873, 65,1128,2848,2927,2769,1590, # 3040
-3874,5370,5371, 12,2668, 45, 976,2587,3169,4661, 517,2535,1013,1037,3240,5372, # 3056
-3875,2849,5373,3876,5374,3499,5375,2612, 614,1999,2323,3877,3110,2733,2638,5376, # 3072
-2588,4316, 599,1269,5377,1811,3735,5378,2700,3111, 759,1060, 489,1806,3388,3318, # 3088
-1358,5379,5380,2391,1387,1215,2639,2256, 490,5381,5382,4317,1759,2392,2348,5383, # 3104
-4662,3878,1908,4074,2640,1807,3241,4663,3500,3319,2770,2349, 874,5384,5385,3501, # 3120
-3736,1859, 91,2928,3737,3062,3879,4664,5386,3170,4075,2669,5387,3502,1202,1403, # 3136
-3880,2969,2536,1517,2510,4665,3503,2511,5388,4666,5389,2701,1886,1495,1731,4076, # 3152
-2370,4667,5390,2030,5391,5392,4077,2702,1216, 237,2589,4318,2324,4078,3881,4668, # 3168
-4669,2703,3615,3504, 445,4670,5393,5394,5395,5396,2771, 61,4079,3738,1823,4080, # 3184
-5397, 687,2046, 935, 925, 405,2670, 703,1096,1860,2734,4671,4081,1877,1367,2704, # 3200
-3389, 918,2106,1782,2483, 334,3320,1611,1093,4672, 564,3171,3505,3739,3390, 945, # 3216
-2641,2058,4673,5398,1926, 872,4319,5399,3506,2705,3112, 349,4320,3740,4082,4674, # 3232
-3882,4321,3741,2156,4083,4675,4676,4322,4677,2408,2047, 782,4084, 400, 251,4323, # 3248
-1624,5400,5401, 277,3742, 299,1265, 476,1191,3883,2122,4324,4325,1109, 205,5402, # 3264
-2590,1000,2157,3616,1861,5403,5404,5405,4678,5406,4679,2573, 107,2484,2158,4085, # 3280
-3507,3172,5407,1533, 541,1301, 158, 753,4326,2886,3617,5408,1696, 370,1088,4327, # 3296
-4680,3618, 579, 327, 440, 162,2244, 269,1938,1374,3508, 968,3063, 56,1396,3113, # 3312
-2107,3321,3391,5409,1927,2159,4681,3016,5410,3619,5411,5412,3743,4682,2485,5413, # 3328
-2804,5414,1650,4683,5415,2613,5416,5417,4086,2671,3392,1149,3393,4087,3884,4088, # 3344
-5418,1076, 49,5419, 951,3242,3322,3323, 450,2850, 920,5420,1812,2805,2371,4328, # 3360
-1909,1138,2372,3885,3509,5421,3243,4684,1910,1147,1518,2428,4685,3886,5422,4686, # 3376
-2393,2614, 260,1796,3244,5423,5424,3887,3324, 708,5425,3620,1704,5426,3621,1351, # 3392
-1618,3394,3017,1887, 944,4329,3395,4330,3064,3396,4331,5427,3744, 422, 413,1714, # 3408
-3325, 500,2059,2350,4332,2486,5428,1344,1911, 954,5429,1668,5430,5431,4089,2409, # 3424
-4333,3622,3888,4334,5432,2307,1318,2512,3114, 133,3115,2887,4687, 629, 31,2851, # 3440
-2706,3889,4688, 850, 949,4689,4090,2970,1732,2089,4335,1496,1853,5433,4091, 620, # 3456
-3245, 981,1242,3745,3397,1619,3746,1643,3326,2140,2457,1971,1719,3510,2169,5434, # 3472
-3246,5435,5436,3398,1829,5437,1277,4690,1565,2048,5438,1636,3623,3116,5439, 869, # 3488
-2852, 655,3890,3891,3117,4092,3018,3892,1310,3624,4691,5440,5441,5442,1733, 558, # 3504
-4692,3747, 335,1549,3065,1756,4336,3748,1946,3511,1830,1291,1192, 470,2735,2108, # 3520
-2806, 913,1054,4093,5443,1027,5444,3066,4094,4693, 982,2672,3399,3173,3512,3247, # 3536
-3248,1947,2807,5445, 571,4694,5446,1831,5447,3625,2591,1523,2429,5448,2090, 984, # 3552
-4695,3749,1960,5449,3750, 852, 923,2808,3513,3751, 969,1519, 999,2049,2325,1705, # 3568
-5450,3118, 615,1662, 151, 597,4095,2410,2326,1049, 275,4696,3752,4337, 568,3753, # 3584
-3626,2487,4338,3754,5451,2430,2275, 409,3249,5452,1566,2888,3514,1002, 769,2853, # 3600
- 194,2091,3174,3755,2226,3327,4339, 628,1505,5453,5454,1763,2180,3019,4096, 521, # 3616
-1161,2592,1788,2206,2411,4697,4097,1625,4340,4341, 412, 42,3119, 464,5455,2642, # 3632
-4698,3400,1760,1571,2889,3515,2537,1219,2207,3893,2643,2141,2373,4699,4700,3328, # 3648
-1651,3401,3627,5456,5457,3628,2488,3516,5458,3756,5459,5460,2276,2092, 460,5461, # 3664
-4701,5462,3020, 962, 588,3629, 289,3250,2644,1116, 52,5463,3067,1797,5464,5465, # 3680
-5466,1467,5467,1598,1143,3757,4342,1985,1734,1067,4702,1280,3402, 465,4703,1572, # 3696
- 510,5468,1928,2245,1813,1644,3630,5469,4704,3758,5470,5471,2673,1573,1534,5472, # 3712
-5473, 536,1808,1761,3517,3894,3175,2645,5474,5475,5476,4705,3518,2929,1912,2809, # 3728
-5477,3329,1122, 377,3251,5478, 360,5479,5480,4343,1529, 551,5481,2060,3759,1769, # 3744
-2431,5482,2930,4344,3330,3120,2327,2109,2031,4706,1404, 136,1468,1479, 672,1171, # 3760
-3252,2308, 271,3176,5483,2772,5484,2050, 678,2736, 865,1948,4707,5485,2014,4098, # 3776
-2971,5486,2737,2227,1397,3068,3760,4708,4709,1735,2931,3403,3631,5487,3895, 509, # 3792
-2854,2458,2890,3896,5488,5489,3177,3178,4710,4345,2538,4711,2309,1166,1010, 552, # 3808
- 681,1888,5490,5491,2972,2973,4099,1287,1596,1862,3179, 358, 453, 736, 175, 478, # 3824
-1117, 905,1167,1097,5492,1854,1530,5493,1706,5494,2181,3519,2292,3761,3520,3632, # 3840
-4346,2093,4347,5495,3404,1193,2489,4348,1458,2193,2208,1863,1889,1421,3331,2932, # 3856
-3069,2182,3521, 595,2123,5496,4100,5497,5498,4349,1707,2646, 223,3762,1359, 751, # 3872
-3121, 183,3522,5499,2810,3021, 419,2374, 633, 704,3897,2394, 241,5500,5501,5502, # 3888
- 838,3022,3763,2277,2773,2459,3898,1939,2051,4101,1309,3122,2246,1181,5503,1136, # 3904
-2209,3899,2375,1446,4350,2310,4712,5504,5505,4351,1055,2615, 484,3764,5506,4102, # 3920
- 625,4352,2278,3405,1499,4353,4103,5507,4104,4354,3253,2279,2280,3523,5508,5509, # 3936
-2774, 808,2616,3765,3406,4105,4355,3123,2539, 526,3407,3900,4356, 955,5510,1620, # 3952
-4357,2647,2432,5511,1429,3766,1669,1832, 994, 928,5512,3633,1260,5513,5514,5515, # 3968
-1949,2293, 741,2933,1626,4358,2738,2460, 867,1184, 362,3408,1392,5516,5517,4106, # 3984
-4359,1770,1736,3254,2934,4713,4714,1929,2707,1459,1158,5518,3070,3409,2891,1292, # 4000
-1930,2513,2855,3767,1986,1187,2072,2015,2617,4360,5519,2574,2514,2170,3768,2490, # 4016
-3332,5520,3769,4715,5521,5522, 666,1003,3023,1022,3634,4361,5523,4716,1814,2257, # 4032
- 574,3901,1603, 295,1535, 705,3902,4362, 283, 858, 417,5524,5525,3255,4717,4718, # 4048
-3071,1220,1890,1046,2281,2461,4107,1393,1599, 689,2575, 388,4363,5526,2491, 802, # 4064
-5527,2811,3903,2061,1405,2258,5528,4719,3904,2110,1052,1345,3256,1585,5529, 809, # 4080
-5530,5531,5532, 575,2739,3524, 956,1552,1469,1144,2328,5533,2329,1560,2462,3635, # 4096
-3257,4108, 616,2210,4364,3180,2183,2294,5534,1833,5535,3525,4720,5536,1319,3770, # 4112
-3771,1211,3636,1023,3258,1293,2812,5537,5538,5539,3905, 607,2311,3906, 762,2892, # 4128
-1439,4365,1360,4721,1485,3072,5540,4722,1038,4366,1450,2062,2648,4367,1379,4723, # 4144
-2593,5541,5542,4368,1352,1414,2330,2935,1172,5543,5544,3907,3908,4724,1798,1451, # 4160
-5545,5546,5547,5548,2936,4109,4110,2492,2351, 411,4111,4112,3637,3333,3124,4725, # 4176
-1561,2674,1452,4113,1375,5549,5550, 47,2974, 316,5551,1406,1591,2937,3181,5552, # 4192
-1025,2142,3125,3182, 354,2740, 884,2228,4369,2412, 508,3772, 726,3638, 996,2433, # 4208
-3639, 729,5553, 392,2194,1453,4114,4726,3773,5554,5555,2463,3640,2618,1675,2813, # 4224
- 919,2352,2975,2353,1270,4727,4115, 73,5556,5557, 647,5558,3259,2856,2259,1550, # 4240
-1346,3024,5559,1332, 883,3526,5560,5561,5562,5563,3334,2775,5564,1212, 831,1347, # 4256
-4370,4728,2331,3909,1864,3073, 720,3910,4729,4730,3911,5565,4371,5566,5567,4731, # 4272
-5568,5569,1799,4732,3774,2619,4733,3641,1645,2376,4734,5570,2938, 669,2211,2675, # 4288
-2434,5571,2893,5572,5573,1028,3260,5574,4372,2413,5575,2260,1353,5576,5577,4735, # 4304
-3183, 518,5578,4116,5579,4373,1961,5580,2143,4374,5581,5582,3025,2354,2355,3912, # 4320
- 516,1834,1454,4117,2708,4375,4736,2229,2620,1972,1129,3642,5583,2776,5584,2976, # 4336
-1422, 577,1470,3026,1524,3410,5585,5586, 432,4376,3074,3527,5587,2594,1455,2515, # 4352
-2230,1973,1175,5588,1020,2741,4118,3528,4737,5589,2742,5590,1743,1361,3075,3529, # 4368
-2649,4119,4377,4738,2295, 895, 924,4378,2171, 331,2247,3076, 166,1627,3077,1098, # 4384
-5591,1232,2894,2231,3411,4739, 657, 403,1196,2377, 542,3775,3412,1600,4379,3530, # 4400
-5592,4740,2777,3261, 576, 530,1362,4741,4742,2540,2676,3776,4120,5593, 842,3913, # 4416
-5594,2814,2032,1014,4121, 213,2709,3413, 665, 621,4380,5595,3777,2939,2435,5596, # 4432
-2436,3335,3643,3414,4743,4381,2541,4382,4744,3644,1682,4383,3531,1380,5597, 724, # 4448
-2282, 600,1670,5598,1337,1233,4745,3126,2248,5599,1621,4746,5600, 651,4384,5601, # 4464
-1612,4385,2621,5602,2857,5603,2743,2312,3078,5604, 716,2464,3079, 174,1255,2710, # 4480
-4122,3645, 548,1320,1398, 728,4123,1574,5605,1891,1197,3080,4124,5606,3081,3082, # 4496
-3778,3646,3779, 747,5607, 635,4386,4747,5608,5609,5610,4387,5611,5612,4748,5613, # 4512
-3415,4749,2437, 451,5614,3780,2542,2073,4388,2744,4389,4125,5615,1764,4750,5616, # 4528
-4390, 350,4751,2283,2395,2493,5617,4391,4126,2249,1434,4127, 488,4752, 458,4392, # 4544
-4128,3781, 771,1330,2396,3914,2576,3184,2160,2414,1553,2677,3185,4393,5618,2494, # 4560
-2895,2622,1720,2711,4394,3416,4753,5619,2543,4395,5620,3262,4396,2778,5621,2016, # 4576
-2745,5622,1155,1017,3782,3915,5623,3336,2313, 201,1865,4397,1430,5624,4129,5625, # 4592
-5626,5627,5628,5629,4398,1604,5630, 414,1866, 371,2595,4754,4755,3532,2017,3127, # 4608
-4756,1708, 960,4399, 887, 389,2172,1536,1663,1721,5631,2232,4130,2356,2940,1580, # 4624
-5632,5633,1744,4757,2544,4758,4759,5634,4760,5635,2074,5636,4761,3647,3417,2896, # 4640
-4400,5637,4401,2650,3418,2815, 673,2712,2465, 709,3533,4131,3648,4402,5638,1148, # 4656
- 502, 634,5639,5640,1204,4762,3649,1575,4763,2623,3783,5641,3784,3128, 948,3263, # 4672
- 121,1745,3916,1110,5642,4403,3083,2516,3027,4132,3785,1151,1771,3917,1488,4133, # 4688
-1987,5643,2438,3534,5644,5645,2094,5646,4404,3918,1213,1407,2816, 531,2746,2545, # 4704
-3264,1011,1537,4764,2779,4405,3129,1061,5647,3786,3787,1867,2897,5648,2018, 120, # 4720
-4406,4407,2063,3650,3265,2314,3919,2678,3419,1955,4765,4134,5649,3535,1047,2713, # 4736
-1266,5650,1368,4766,2858, 649,3420,3920,2546,2747,1102,2859,2679,5651,5652,2000, # 4752
-5653,1111,3651,2977,5654,2495,3921,3652,2817,1855,3421,3788,5655,5656,3422,2415, # 4768
-2898,3337,3266,3653,5657,2577,5658,3654,2818,4135,1460, 856,5659,3655,5660,2899, # 4784
-2978,5661,2900,3922,5662,4408, 632,2517, 875,3923,1697,3924,2296,5663,5664,4767, # 4800
-3028,1239, 580,4768,4409,5665, 914, 936,2075,1190,4136,1039,2124,5666,5667,5668, # 4816
-5669,3423,1473,5670,1354,4410,3925,4769,2173,3084,4137, 915,3338,4411,4412,3339, # 4832
-1605,1835,5671,2748, 398,3656,4413,3926,4138, 328,1913,2860,4139,3927,1331,4414, # 4848
-3029, 937,4415,5672,3657,4140,4141,3424,2161,4770,3425, 524, 742, 538,3085,1012, # 4864
-5673,5674,3928,2466,5675, 658,1103, 225,3929,5676,5677,4771,5678,4772,5679,3267, # 4880
-1243,5680,4142, 963,2250,4773,5681,2714,3658,3186,5682,5683,2596,2332,5684,4774, # 4896
-5685,5686,5687,3536, 957,3426,2547,2033,1931,2941,2467, 870,2019,3659,1746,2780, # 4912
-2781,2439,2468,5688,3930,5689,3789,3130,3790,3537,3427,3791,5690,1179,3086,5691, # 4928
-3187,2378,4416,3792,2548,3188,3131,2749,4143,5692,3428,1556,2549,2297, 977,2901, # 4944
-2034,4144,1205,3429,5693,1765,3430,3189,2125,1271, 714,1689,4775,3538,5694,2333, # 4960
-3931, 533,4417,3660,2184, 617,5695,2469,3340,3539,2315,5696,5697,3190,5698,5699, # 4976
-3932,1988, 618, 427,2651,3540,3431,5700,5701,1244,1690,5702,2819,4418,4776,5703, # 4992
-3541,4777,5704,2284,1576, 473,3661,4419,3432, 972,5705,3662,5706,3087,5707,5708, # 5008
-4778,4779,5709,3793,4145,4146,5710, 153,4780, 356,5711,1892,2902,4420,2144, 408, # 5024
- 803,2357,5712,3933,5713,4421,1646,2578,2518,4781,4782,3934,5714,3935,4422,5715, # 5040
-2416,3433, 752,5716,5717,1962,3341,2979,5718, 746,3030,2470,4783,4423,3794, 698, # 5056
-4784,1893,4424,3663,2550,4785,3664,3936,5719,3191,3434,5720,1824,1302,4147,2715, # 5072
-3937,1974,4425,5721,4426,3192, 823,1303,1288,1236,2861,3542,4148,3435, 774,3938, # 5088
-5722,1581,4786,1304,2862,3939,4787,5723,2440,2162,1083,3268,4427,4149,4428, 344, # 5104
-1173, 288,2316, 454,1683,5724,5725,1461,4788,4150,2597,5726,5727,4789, 985, 894, # 5120
-5728,3436,3193,5729,1914,2942,3795,1989,5730,2111,1975,5731,4151,5732,2579,1194, # 5136
- 425,5733,4790,3194,1245,3796,4429,5734,5735,2863,5736, 636,4791,1856,3940, 760, # 5152
-1800,5737,4430,2212,1508,4792,4152,1894,1684,2298,5738,5739,4793,4431,4432,2213, # 5168
- 479,5740,5741, 832,5742,4153,2496,5743,2980,2497,3797, 990,3132, 627,1815,2652, # 5184
-4433,1582,4434,2126,2112,3543,4794,5744, 799,4435,3195,5745,4795,2113,1737,3031, # 5200
-1018, 543, 754,4436,3342,1676,4796,4797,4154,4798,1489,5746,3544,5747,2624,2903, # 5216
-4155,5748,5749,2981,5750,5751,5752,5753,3196,4799,4800,2185,1722,5754,3269,3270, # 5232
-1843,3665,1715, 481, 365,1976,1857,5755,5756,1963,2498,4801,5757,2127,3666,3271, # 5248
- 433,1895,2064,2076,5758, 602,2750,5759,5760,5761,5762,5763,3032,1628,3437,5764, # 5264
-3197,4802,4156,2904,4803,2519,5765,2551,2782,5766,5767,5768,3343,4804,2905,5769, # 5280
-4805,5770,2864,4806,4807,1221,2982,4157,2520,5771,5772,5773,1868,1990,5774,5775, # 5296
-5776,1896,5777,5778,4808,1897,4158, 318,5779,2095,4159,4437,5780,5781, 485,5782, # 5312
- 938,3941, 553,2680, 116,5783,3942,3667,5784,3545,2681,2783,3438,3344,2820,5785, # 5328
-3668,2943,4160,1747,2944,2983,5786,5787, 207,5788,4809,5789,4810,2521,5790,3033, # 5344
- 890,3669,3943,5791,1878,3798,3439,5792,2186,2358,3440,1652,5793,5794,5795, 941, # 5360
-2299, 208,3546,4161,2020, 330,4438,3944,2906,2499,3799,4439,4811,5796,5797,5798, # 5376
-)
-
diff --git a/lib/chardet/big5prober.py b/lib/chardet/big5prober.py
deleted file mode 100644
index 98f9970122..0000000000
--- a/lib/chardet/big5prober.py
+++ /dev/null
@@ -1,47 +0,0 @@
-######################## BEGIN LICENSE BLOCK ########################
-# The Original Code is Mozilla Communicator client code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Mark Pilgrim - port to Python
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301 USA
-######################### END LICENSE BLOCK #########################
-
-from .mbcharsetprober import MultiByteCharSetProber
-from .codingstatemachine import CodingStateMachine
-from .chardistribution import Big5DistributionAnalysis
-from .mbcssm import BIG5_SM_MODEL
-
-
-class Big5Prober(MultiByteCharSetProber):
- def __init__(self):
- super(Big5Prober, self).__init__()
- self.coding_sm = CodingStateMachine(BIG5_SM_MODEL)
- self.distribution_analyzer = Big5DistributionAnalysis()
- self.reset()
-
- @property
- def charset_name(self):
- return "Big5"
-
- @property
- def language(self):
- return "Chinese"
diff --git a/lib/chardet/chardistribution.py b/lib/chardet/chardistribution.py
deleted file mode 100644
index c0395f4a45..0000000000
--- a/lib/chardet/chardistribution.py
+++ /dev/null
@@ -1,233 +0,0 @@
-######################## BEGIN LICENSE BLOCK ########################
-# The Original Code is Mozilla Communicator client code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Mark Pilgrim - port to Python
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301 USA
-######################### END LICENSE BLOCK #########################
-
-from .euctwfreq import (EUCTW_CHAR_TO_FREQ_ORDER, EUCTW_TABLE_SIZE,
- EUCTW_TYPICAL_DISTRIBUTION_RATIO)
-from .euckrfreq import (EUCKR_CHAR_TO_FREQ_ORDER, EUCKR_TABLE_SIZE,
- EUCKR_TYPICAL_DISTRIBUTION_RATIO)
-from .gb2312freq import (GB2312_CHAR_TO_FREQ_ORDER, GB2312_TABLE_SIZE,
- GB2312_TYPICAL_DISTRIBUTION_RATIO)
-from .big5freq import (BIG5_CHAR_TO_FREQ_ORDER, BIG5_TABLE_SIZE,
- BIG5_TYPICAL_DISTRIBUTION_RATIO)
-from .jisfreq import (JIS_CHAR_TO_FREQ_ORDER, JIS_TABLE_SIZE,
- JIS_TYPICAL_DISTRIBUTION_RATIO)
-
-
-class CharDistributionAnalysis(object):
- ENOUGH_DATA_THRESHOLD = 1024
- SURE_YES = 0.99
- SURE_NO = 0.01
- MINIMUM_DATA_THRESHOLD = 3
-
- def __init__(self):
- # Mapping table to get frequency order from char order (get from
- # GetOrder())
- self._char_to_freq_order = None
- self._table_size = None # Size of above table
- # This is a constant value which varies from language to language,
- # used in calculating confidence. See
- # http://www.mozilla.org/projects/intl/UniversalCharsetDetection.html
- # for further detail.
- self.typical_distribution_ratio = None
- self._done = None
- self._total_chars = None
- self._freq_chars = None
- self.reset()
-
- def reset(self):
- """reset analyser, clear any state"""
- # If this flag is set to True, detection is done and conclusion has
- # been made
- self._done = False
- self._total_chars = 0 # Total characters encountered
- # The number of characters whose frequency order is less than 512
- self._freq_chars = 0
-
- def feed(self, char, char_len):
- """feed a character with known length"""
- if char_len == 2:
- # we only care about 2-bytes character in our distribution analysis
- order = self.get_order(char)
- else:
- order = -1
- if order >= 0:
- self._total_chars += 1
- # order is valid
- if order < self._table_size:
- if 512 > self._char_to_freq_order[order]:
- self._freq_chars += 1
-
- def get_confidence(self):
- """return confidence based on existing data"""
- # if we didn't receive any character in our consideration range,
- # return negative answer
- if self._total_chars <= 0 or self._freq_chars <= self.MINIMUM_DATA_THRESHOLD:
- return self.SURE_NO
-
- if self._total_chars != self._freq_chars:
- r = (self._freq_chars / ((self._total_chars - self._freq_chars)
- * self.typical_distribution_ratio))
- if r < self.SURE_YES:
- return r
-
- # normalize confidence (we don't want to be 100% sure)
- return self.SURE_YES
-
- def got_enough_data(self):
- # It is not necessary to receive all data to draw conclusion.
- # For charset detection, certain amount of data is enough
- return self._total_chars > self.ENOUGH_DATA_THRESHOLD
-
- def get_order(self, byte_str):
- # We do not handle characters based on the original encoding string,
- # but convert this encoding string to a number, here called order.
- # This allows multiple encodings of a language to share one frequency
- # table.
- return -1
-
-
-class EUCTWDistributionAnalysis(CharDistributionAnalysis):
- def __init__(self):
- super(EUCTWDistributionAnalysis, self).__init__()
- self._char_to_freq_order = EUCTW_CHAR_TO_FREQ_ORDER
- self._table_size = EUCTW_TABLE_SIZE
- self.typical_distribution_ratio = EUCTW_TYPICAL_DISTRIBUTION_RATIO
-
- def get_order(self, byte_str):
- # for euc-TW encoding, we are interested
- # first byte range: 0xc4 -- 0xfe
- # second byte range: 0xa1 -- 0xfe
- # no validation needed here. State machine has done that
- first_char = byte_str[0]
- if first_char >= 0xC4:
- return 94 * (first_char - 0xC4) + byte_str[1] - 0xA1
- else:
- return -1
-
-
-class EUCKRDistributionAnalysis(CharDistributionAnalysis):
- def __init__(self):
- super(EUCKRDistributionAnalysis, self).__init__()
- self._char_to_freq_order = EUCKR_CHAR_TO_FREQ_ORDER
- self._table_size = EUCKR_TABLE_SIZE
- self.typical_distribution_ratio = EUCKR_TYPICAL_DISTRIBUTION_RATIO
-
- def get_order(self, byte_str):
- # for euc-KR encoding, we are interested
- # first byte range: 0xb0 -- 0xfe
- # second byte range: 0xa1 -- 0xfe
- # no validation needed here. State machine has done that
- first_char = byte_str[0]
- if first_char >= 0xB0:
- return 94 * (first_char - 0xB0) + byte_str[1] - 0xA1
- else:
- return -1
-
-
-class GB2312DistributionAnalysis(CharDistributionAnalysis):
- def __init__(self):
- super(GB2312DistributionAnalysis, self).__init__()
- self._char_to_freq_order = GB2312_CHAR_TO_FREQ_ORDER
- self._table_size = GB2312_TABLE_SIZE
- self.typical_distribution_ratio = GB2312_TYPICAL_DISTRIBUTION_RATIO
-
- def get_order(self, byte_str):
- # for GB2312 encoding, we are interested
- # first byte range: 0xb0 -- 0xfe
- # second byte range: 0xa1 -- 0xfe
- # no validation needed here. State machine has done that
- first_char, second_char = byte_str[0], byte_str[1]
- if (first_char >= 0xB0) and (second_char >= 0xA1):
- return 94 * (first_char - 0xB0) + second_char - 0xA1
- else:
- return -1
-
-
-class Big5DistributionAnalysis(CharDistributionAnalysis):
- def __init__(self):
- super(Big5DistributionAnalysis, self).__init__()
- self._char_to_freq_order = BIG5_CHAR_TO_FREQ_ORDER
- self._table_size = BIG5_TABLE_SIZE
- self.typical_distribution_ratio = BIG5_TYPICAL_DISTRIBUTION_RATIO
-
- def get_order(self, byte_str):
- # for big5 encoding, we are interested
- # first byte range: 0xa4 -- 0xfe
- # second byte range: 0x40 -- 0x7e , 0xa1 -- 0xfe
- # no validation needed here. State machine has done that
- first_char, second_char = byte_str[0], byte_str[1]
- if first_char >= 0xA4:
- if second_char >= 0xA1:
- return 157 * (first_char - 0xA4) + second_char - 0xA1 + 63
- else:
- return 157 * (first_char - 0xA4) + second_char - 0x40
- else:
- return -1
-
-
-class SJISDistributionAnalysis(CharDistributionAnalysis):
- def __init__(self):
- super(SJISDistributionAnalysis, self).__init__()
- self._char_to_freq_order = JIS_CHAR_TO_FREQ_ORDER
- self._table_size = JIS_TABLE_SIZE
- self.typical_distribution_ratio = JIS_TYPICAL_DISTRIBUTION_RATIO
-
- def get_order(self, byte_str):
- # for sjis encoding, we are interested
- # first byte range: 0x81 -- 0x9f , 0xe0 -- 0xfe
- # second byte range: 0x40 -- 0x7e, 0x81 -- oxfe
- # no validation needed here. State machine has done that
- first_char, second_char = byte_str[0], byte_str[1]
- if (first_char >= 0x81) and (first_char <= 0x9F):
- order = 188 * (first_char - 0x81)
- elif (first_char >= 0xE0) and (first_char <= 0xEF):
- order = 188 * (first_char - 0xE0 + 31)
- else:
- return -1
- order = order + second_char - 0x40
- if second_char > 0x7F:
- order = -1
- return order
-
-
-class EUCJPDistributionAnalysis(CharDistributionAnalysis):
- def __init__(self):
- super(EUCJPDistributionAnalysis, self).__init__()
- self._char_to_freq_order = JIS_CHAR_TO_FREQ_ORDER
- self._table_size = JIS_TABLE_SIZE
- self.typical_distribution_ratio = JIS_TYPICAL_DISTRIBUTION_RATIO
-
- def get_order(self, byte_str):
- # for euc-JP encoding, we are interested
- # first byte range: 0xa0 -- 0xfe
- # second byte range: 0xa1 -- 0xfe
- # no validation needed here. State machine has done that
- char = byte_str[0]
- if char >= 0xA0:
- return 94 * (char - 0xA1) + byte_str[1] - 0xa1
- else:
- return -1
diff --git a/lib/chardet/charsetgroupprober.py b/lib/chardet/charsetgroupprober.py
deleted file mode 100644
index 8b3738efd8..0000000000
--- a/lib/chardet/charsetgroupprober.py
+++ /dev/null
@@ -1,106 +0,0 @@
-######################## BEGIN LICENSE BLOCK ########################
-# The Original Code is Mozilla Communicator client code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Mark Pilgrim - port to Python
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301 USA
-######################### END LICENSE BLOCK #########################
-
-from .enums import ProbingState
-from .charsetprober import CharSetProber
-
-
-class CharSetGroupProber(CharSetProber):
- def __init__(self, lang_filter=None):
- super(CharSetGroupProber, self).__init__(lang_filter=lang_filter)
- self._active_num = 0
- self.probers = []
- self._best_guess_prober = None
-
- def reset(self):
- super(CharSetGroupProber, self).reset()
- self._active_num = 0
- for prober in self.probers:
- if prober:
- prober.reset()
- prober.active = True
- self._active_num += 1
- self._best_guess_prober = None
-
- @property
- def charset_name(self):
- if not self._best_guess_prober:
- self.get_confidence()
- if not self._best_guess_prober:
- return None
- return self._best_guess_prober.charset_name
-
- @property
- def language(self):
- if not self._best_guess_prober:
- self.get_confidence()
- if not self._best_guess_prober:
- return None
- return self._best_guess_prober.language
-
- def feed(self, byte_str):
- for prober in self.probers:
- if not prober:
- continue
- if not prober.active:
- continue
- state = prober.feed(byte_str)
- if not state:
- continue
- if state == ProbingState.FOUND_IT:
- self._best_guess_prober = prober
- return self.state
- elif state == ProbingState.NOT_ME:
- prober.active = False
- self._active_num -= 1
- if self._active_num <= 0:
- self._state = ProbingState.NOT_ME
- return self.state
- return self.state
-
- def get_confidence(self):
- state = self.state
- if state == ProbingState.FOUND_IT:
- return 0.99
- elif state == ProbingState.NOT_ME:
- return 0.01
- best_conf = 0.0
- self._best_guess_prober = None
- for prober in self.probers:
- if not prober:
- continue
- if not prober.active:
- self.logger.debug('%s not active', prober.charset_name)
- continue
- conf = prober.get_confidence()
- self.logger.debug('%s %s confidence = %s', prober.charset_name, prober.language, conf)
- if best_conf < conf:
- best_conf = conf
- self._best_guess_prober = prober
- if not self._best_guess_prober:
- return 0.0
- return best_conf
diff --git a/lib/chardet/charsetprober.py b/lib/chardet/charsetprober.py
deleted file mode 100644
index eac4e59865..0000000000
--- a/lib/chardet/charsetprober.py
+++ /dev/null
@@ -1,145 +0,0 @@
-######################## BEGIN LICENSE BLOCK ########################
-# The Original Code is Mozilla Universal charset detector code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 2001
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Mark Pilgrim - port to Python
-# Shy Shalom - original C code
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301 USA
-######################### END LICENSE BLOCK #########################
-
-import logging
-import re
-
-from .enums import ProbingState
-
-
-class CharSetProber(object):
-
- SHORTCUT_THRESHOLD = 0.95
-
- def __init__(self, lang_filter=None):
- self._state = None
- self.lang_filter = lang_filter
- self.logger = logging.getLogger(__name__)
-
- def reset(self):
- self._state = ProbingState.DETECTING
-
- @property
- def charset_name(self):
- return None
-
- def feed(self, buf):
- pass
-
- @property
- def state(self):
- return self._state
-
- def get_confidence(self):
- return 0.0
-
- @staticmethod
- def filter_high_byte_only(buf):
- buf = re.sub(b'([\x00-\x7F])+', b' ', buf)
- return buf
-
- @staticmethod
- def filter_international_words(buf):
- """
- We define three types of bytes:
- alphabet: english alphabets [a-zA-Z]
- international: international characters [\x80-\xFF]
- marker: everything else [^a-zA-Z\x80-\xFF]
-
- The input buffer can be thought to contain a series of words delimited
- by markers. This function works to filter all words that contain at
- least one international character. All contiguous sequences of markers
- are replaced by a single space ascii character.
-
- This filter applies to all scripts which do not use English characters.
- """
- filtered = bytearray()
-
- # This regex expression filters out only words that have at-least one
- # international character. The word may include one marker character at
- # the end.
- words = re.findall(b'[a-zA-Z]*[\x80-\xFF]+[a-zA-Z]*[^a-zA-Z\x80-\xFF]?',
- buf)
-
- for word in words:
- filtered.extend(word[:-1])
-
- # If the last character in the word is a marker, replace it with a
- # space as markers shouldn't affect our analysis (they are used
- # similarly across all languages and may thus have similar
- # frequencies).
- last_char = word[-1:]
- if not last_char.isalpha() and last_char < b'\x80':
- last_char = b' '
- filtered.extend(last_char)
-
- return filtered
-
- @staticmethod
- def filter_with_english_letters(buf):
- """
- Returns a copy of ``buf`` that retains only the sequences of English
- alphabet and high byte characters that are not between <> characters.
- Also retains English alphabet and high byte characters immediately
- before occurrences of >.
-
- This filter can be applied to all scripts which contain both English
- characters and extended ASCII characters, but is currently only used by
- ``Latin1Prober``.
- """
- filtered = bytearray()
- in_tag = False
- prev = 0
-
- for curr in range(len(buf)):
- # Slice here to get bytes instead of an int with Python 3
- buf_char = buf[curr:curr + 1]
- # Check if we're coming out of or entering an HTML tag
- if buf_char == b'>':
- in_tag = False
- elif buf_char == b'<':
- in_tag = True
-
- # If current character is not extended-ASCII and not alphabetic...
- if buf_char < b'\x80' and not buf_char.isalpha():
- # ...and we're not in a tag
- if curr > prev and not in_tag:
- # Keep everything after last non-extended-ASCII,
- # non-alphabetic character
- filtered.extend(buf[prev:curr])
- # Output a space to delimit stretch we kept
- filtered.extend(b' ')
- prev = curr + 1
-
- # If we're not in a tag...
- if not in_tag:
- # Keep everything after last non-extended-ASCII, non-alphabetic
- # character
- filtered.extend(buf[prev:])
-
- return filtered
diff --git a/lib/chardet/cli/__init__.py b/lib/chardet/cli/__init__.py
deleted file mode 100644
index 8b13789179..0000000000
--- a/lib/chardet/cli/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/lib/chardet/cli/chardetect.py b/lib/chardet/cli/chardetect.py
deleted file mode 100644
index f0a4cc5d79..0000000000
--- a/lib/chardet/cli/chardetect.py
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/usr/bin/env python
-"""
-Script which takes one or more file paths and reports on their detected
-encodings
-
-Example::
-
- % chardetect somefile someotherfile
- somefile: windows-1252 with confidence 0.5
- someotherfile: ascii with confidence 1.0
-
-If no paths are provided, it takes its input from stdin.
-
-"""
-
-from __future__ import absolute_import, print_function, unicode_literals
-
-import argparse
-import sys
-
-from chardet import __version__
-from chardet.compat import PY2
-from chardet.universaldetector import UniversalDetector
-
-
-def description_of(lines, name='stdin'):
- """
- Return a string describing the probable encoding of a file or
- list of strings.
-
- :param lines: The lines to get the encoding of.
- :type lines: Iterable of bytes
- :param name: Name of file or collection of lines
- :type name: str
- """
- u = UniversalDetector()
- for line in lines:
- line = bytearray(line)
- u.feed(line)
- # shortcut out of the loop to save reading further - particularly useful if we read a BOM.
- if u.done:
- break
- u.close()
- result = u.result
- if PY2:
- name = name.decode(sys.getfilesystemencoding(), 'ignore')
- if result['encoding']:
- return '{0}: {1} with confidence {2}'.format(name, result['encoding'],
- result['confidence'])
- else:
- return '{0}: no result'.format(name)
-
-
-def main(argv=None):
- """
- Handles command line arguments and gets things started.
-
- :param argv: List of arguments, as if specified on the command-line.
- If None, ``sys.argv[1:]`` is used instead.
- :type argv: list of str
- """
- # Get command line arguments
- parser = argparse.ArgumentParser(
- description="Takes one or more file paths and reports their detected \
- encodings")
- parser.add_argument('input',
- help='File whose encoding we would like to determine. \
- (default: stdin)',
- type=argparse.FileType('rb'), nargs='*',
- default=[sys.stdin if PY2 else sys.stdin.buffer])
- parser.add_argument('--version', action='version',
- version='%(prog)s {0}'.format(__version__))
- args = parser.parse_args(argv)
-
- for f in args.input:
- if f.isatty():
- print("You are running chardetect interactively. Press " +
- "CTRL-D twice at the start of a blank line to signal the " +
- "end of your input. If you want help, run chardetect " +
- "--help\n", file=sys.stderr)
- print(description_of(f, f.name))
-
-
-if __name__ == '__main__':
- main()
diff --git a/lib/chardet/codingstatemachine.py b/lib/chardet/codingstatemachine.py
deleted file mode 100644
index 68fba44f14..0000000000
--- a/lib/chardet/codingstatemachine.py
+++ /dev/null
@@ -1,88 +0,0 @@
-######################## BEGIN LICENSE BLOCK ########################
-# The Original Code is mozilla.org code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Mark Pilgrim - port to Python
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301 USA
-######################### END LICENSE BLOCK #########################
-
-import logging
-
-from .enums import MachineState
-
-
-class CodingStateMachine(object):
- """
- A state machine to verify a byte sequence for a particular encoding. For
- each byte the detector receives, it will feed that byte to every active
- state machine available, one byte at a time. The state machine changes its
- state based on its previous state and the byte it receives. There are 3
- states in a state machine that are of interest to an auto-detector:
-
- START state: This is the state to start with, or a legal byte sequence
- (i.e. a valid code point) for character has been identified.
-
- ME state: This indicates that the state machine identified a byte sequence
- that is specific to the charset it is designed for and that
- there is no other possible encoding which can contain this byte
- sequence. This will to lead to an immediate positive answer for
- the detector.
-
- ERROR state: This indicates the state machine identified an illegal byte
- sequence for that encoding. This will lead to an immediate
- negative answer for this encoding. Detector will exclude this
- encoding from consideration from here on.
- """
- def __init__(self, sm):
- self._model = sm
- self._curr_byte_pos = 0
- self._curr_char_len = 0
- self._curr_state = None
- self.logger = logging.getLogger(__name__)
- self.reset()
-
- def reset(self):
- self._curr_state = MachineState.START
-
- def next_state(self, c):
- # for each byte we get its class
- # if it is first byte, we also get byte length
- byte_class = self._model['class_table'][c]
- if self._curr_state == MachineState.START:
- self._curr_byte_pos = 0
- self._curr_char_len = self._model['char_len_table'][byte_class]
- # from byte's class and state_table, we get its next state
- curr_state = (self._curr_state * self._model['class_factor']
- + byte_class)
- self._curr_state = self._model['state_table'][curr_state]
- self._curr_byte_pos += 1
- return self._curr_state
-
- def get_current_charlen(self):
- return self._curr_char_len
-
- def get_coding_state_machine(self):
- return self._model['name']
-
- @property
- def language(self):
- return self._model['language']
diff --git a/lib/chardet/compat.py b/lib/chardet/compat.py
deleted file mode 100644
index ddd74687c0..0000000000
--- a/lib/chardet/compat.py
+++ /dev/null
@@ -1,34 +0,0 @@
-######################## BEGIN LICENSE BLOCK ########################
-# Contributor(s):
-# Dan Blanchard
-# Ian Cordasco
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301 USA
-######################### END LICENSE BLOCK #########################
-
-import sys
-
-
-if sys.version_info < (3, 0):
- PY2 = True
- PY3 = False
- base_str = (str, unicode)
- text_type = unicode
-else:
- PY2 = False
- PY3 = True
- base_str = (bytes, str)
- text_type = str
diff --git a/lib/chardet/cp949prober.py b/lib/chardet/cp949prober.py
deleted file mode 100644
index efd793abca..0000000000
--- a/lib/chardet/cp949prober.py
+++ /dev/null
@@ -1,49 +0,0 @@
-######################## BEGIN LICENSE BLOCK ########################
-# The Original Code is mozilla.org code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Mark Pilgrim - port to Python
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301 USA
-######################### END LICENSE BLOCK #########################
-
-from .chardistribution import EUCKRDistributionAnalysis
-from .codingstatemachine import CodingStateMachine
-from .mbcharsetprober import MultiByteCharSetProber
-from .mbcssm import CP949_SM_MODEL
-
-
-class CP949Prober(MultiByteCharSetProber):
- def __init__(self):
- super(CP949Prober, self).__init__()
- self.coding_sm = CodingStateMachine(CP949_SM_MODEL)
- # NOTE: CP949 is a superset of EUC-KR, so the distribution should be
- # not different.
- self.distribution_analyzer = EUCKRDistributionAnalysis()
- self.reset()
-
- @property
- def charset_name(self):
- return "CP949"
-
- @property
- def language(self):
- return "Korean"
diff --git a/lib/chardet/enums.py b/lib/chardet/enums.py
deleted file mode 100644
index 0451207225..0000000000
--- a/lib/chardet/enums.py
+++ /dev/null
@@ -1,76 +0,0 @@
-"""
-All of the Enums that are used throughout the chardet package.
-
-:author: Dan Blanchard (dan.blanchard@gmail.com)
-"""
-
-
-class InputState(object):
- """
- This enum represents the different states a universal detector can be in.
- """
- PURE_ASCII = 0
- ESC_ASCII = 1
- HIGH_BYTE = 2
-
-
-class LanguageFilter(object):
- """
- This enum represents the different language filters we can apply to a
- ``UniversalDetector``.
- """
- CHINESE_SIMPLIFIED = 0x01
- CHINESE_TRADITIONAL = 0x02
- JAPANESE = 0x04
- KOREAN = 0x08
- NON_CJK = 0x10
- ALL = 0x1F
- CHINESE = CHINESE_SIMPLIFIED | CHINESE_TRADITIONAL
- CJK = CHINESE | JAPANESE | KOREAN
-
-
-class ProbingState(object):
- """
- This enum represents the different states a prober can be in.
- """
- DETECTING = 0
- FOUND_IT = 1
- NOT_ME = 2
-
-
-class MachineState(object):
- """
- This enum represents the different states a state machine can be in.
- """
- START = 0
- ERROR = 1
- ITS_ME = 2
-
-
-class SequenceLikelihood(object):
- """
- This enum represents the likelihood of a character following the previous one.
- """
- NEGATIVE = 0
- UNLIKELY = 1
- LIKELY = 2
- POSITIVE = 3
-
- @classmethod
- def get_num_categories(cls):
- """:returns: The number of likelihood categories in the enum."""
- return 4
-
-
-class CharacterCategory(object):
- """
- This enum represents the different categories language models for
- ``SingleByteCharsetProber`` put characters into.
-
- Anything less than CONTROL is considered a letter.
- """
- UNDEFINED = 255
- LINE_BREAK = 254
- SYMBOL = 253
- DIGIT = 252
- CONTROL = 251
diff --git a/lib/chardet/escprober.py b/lib/chardet/escprober.py
deleted file mode 100644
index c70493f2b1..0000000000
--- a/lib/chardet/escprober.py
+++ /dev/null
@@ -1,101 +0,0 @@
-######################## BEGIN LICENSE BLOCK ########################
-# The Original Code is mozilla.org code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Mark Pilgrim - port to Python
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301 USA
-######################### END LICENSE BLOCK #########################
-
-from .charsetprober import CharSetProber
-from .codingstatemachine import CodingStateMachine
-from .enums import LanguageFilter, ProbingState, MachineState
-from .escsm import (HZ_SM_MODEL, ISO2022CN_SM_MODEL, ISO2022JP_SM_MODEL,
- ISO2022KR_SM_MODEL)
-
-
-class EscCharSetProber(CharSetProber):
- """
- This CharSetProber uses a "code scheme" approach for detecting encodings,
- whereby easily recognizable escape or shift sequences are relied on to
- identify these encodings.
- """
-
- def __init__(self, lang_filter=None):
- super(EscCharSetProber, self).__init__(lang_filter=lang_filter)
- self.coding_sm = []
- if self.lang_filter & LanguageFilter.CHINESE_SIMPLIFIED:
- self.coding_sm.append(CodingStateMachine(HZ_SM_MODEL))
- self.coding_sm.append(CodingStateMachine(ISO2022CN_SM_MODEL))
- if self.lang_filter & LanguageFilter.JAPANESE:
- self.coding_sm.append(CodingStateMachine(ISO2022JP_SM_MODEL))
- if self.lang_filter & LanguageFilter.KOREAN:
- self.coding_sm.append(CodingStateMachine(ISO2022KR_SM_MODEL))
- self.active_sm_count = None
- self._detected_charset = None
- self._detected_language = None
- self._state = None
- self.reset()
-
- def reset(self):
- super(EscCharSetProber, self).reset()
- for coding_sm in self.coding_sm:
- if not coding_sm:
- continue
- coding_sm.active = True
- coding_sm.reset()
- self.active_sm_count = len(self.coding_sm)
- self._detected_charset = None
- self._detected_language = None
-
- @property
- def charset_name(self):
- return self._detected_charset
-
- @property
- def language(self):
- return self._detected_language
-
- def get_confidence(self):
- if self._detected_charset:
- return 0.99
- else:
- return 0.00
-
- def feed(self, byte_str):
- for c in byte_str:
- for coding_sm in self.coding_sm:
- if not coding_sm or not coding_sm.active:
- continue
- coding_state = coding_sm.next_state(c)
- if coding_state == MachineState.ERROR:
- coding_sm.active = False
- self.active_sm_count -= 1
- if self.active_sm_count <= 0:
- self._state = ProbingState.NOT_ME
- return self.state
- elif coding_state == MachineState.ITS_ME:
- self._state = ProbingState.FOUND_IT
- self._detected_charset = coding_sm.get_coding_state_machine()
- self._detected_language = coding_sm.language
- return self.state
-
- return self.state
diff --git a/lib/chardet/escsm.py b/lib/chardet/escsm.py
deleted file mode 100644
index 0069523a04..0000000000
--- a/lib/chardet/escsm.py
+++ /dev/null
@@ -1,246 +0,0 @@
-######################## BEGIN LICENSE BLOCK ########################
-# The Original Code is mozilla.org code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Mark Pilgrim - port to Python
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301 USA
-######################### END LICENSE BLOCK #########################
-
-from .enums import MachineState
-
-HZ_CLS = (
-1,0,0,0,0,0,0,0, # 00 - 07
-0,0,0,0,0,0,0,0, # 08 - 0f
-0,0,0,0,0,0,0,0, # 10 - 17
-0,0,0,1,0,0,0,0, # 18 - 1f
-0,0,0,0,0,0,0,0, # 20 - 27
-0,0,0,0,0,0,0,0, # 28 - 2f
-0,0,0,0,0,0,0,0, # 30 - 37
-0,0,0,0,0,0,0,0, # 38 - 3f
-0,0,0,0,0,0,0,0, # 40 - 47
-0,0,0,0,0,0,0,0, # 48 - 4f
-0,0,0,0,0,0,0,0, # 50 - 57
-0,0,0,0,0,0,0,0, # 58 - 5f
-0,0,0,0,0,0,0,0, # 60 - 67
-0,0,0,0,0,0,0,0, # 68 - 6f
-0,0,0,0,0,0,0,0, # 70 - 77
-0,0,0,4,0,5,2,0, # 78 - 7f
-1,1,1,1,1,1,1,1, # 80 - 87
-1,1,1,1,1,1,1,1, # 88 - 8f
-1,1,1,1,1,1,1,1, # 90 - 97
-1,1,1,1,1,1,1,1, # 98 - 9f
-1,1,1,1,1,1,1,1, # a0 - a7
-1,1,1,1,1,1,1,1, # a8 - af
-1,1,1,1,1,1,1,1, # b0 - b7
-1,1,1,1,1,1,1,1, # b8 - bf
-1,1,1,1,1,1,1,1, # c0 - c7
-1,1,1,1,1,1,1,1, # c8 - cf
-1,1,1,1,1,1,1,1, # d0 - d7
-1,1,1,1,1,1,1,1, # d8 - df
-1,1,1,1,1,1,1,1, # e0 - e7
-1,1,1,1,1,1,1,1, # e8 - ef
-1,1,1,1,1,1,1,1, # f0 - f7
-1,1,1,1,1,1,1,1, # f8 - ff
-)
-
-HZ_ST = (
-MachineState.START,MachineState.ERROR, 3,MachineState.START,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,# 00-07
-MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,# 08-0f
-MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START, 4,MachineState.ERROR,# 10-17
- 5,MachineState.ERROR, 6,MachineState.ERROR, 5, 5, 4,MachineState.ERROR,# 18-1f
- 4,MachineState.ERROR, 4, 4, 4,MachineState.ERROR, 4,MachineState.ERROR,# 20-27
- 4,MachineState.ITS_ME,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,# 28-2f
-)
-
-HZ_CHAR_LEN_TABLE = (0, 0, 0, 0, 0, 0)
-
-HZ_SM_MODEL = {'class_table': HZ_CLS,
- 'class_factor': 6,
- 'state_table': HZ_ST,
- 'char_len_table': HZ_CHAR_LEN_TABLE,
- 'name': "HZ-GB-2312",
- 'language': 'Chinese'}
-
-ISO2022CN_CLS = (
-2,0,0,0,0,0,0,0, # 00 - 07
-0,0,0,0,0,0,0,0, # 08 - 0f
-0,0,0,0,0,0,0,0, # 10 - 17
-0,0,0,1,0,0,0,0, # 18 - 1f
-0,0,0,0,0,0,0,0, # 20 - 27
-0,3,0,0,0,0,0,0, # 28 - 2f
-0,0,0,0,0,0,0,0, # 30 - 37
-0,0,0,0,0,0,0,0, # 38 - 3f
-0,0,0,4,0,0,0,0, # 40 - 47
-0,0,0,0,0,0,0,0, # 48 - 4f
-0,0,0,0,0,0,0,0, # 50 - 57
-0,0,0,0,0,0,0,0, # 58 - 5f
-0,0,0,0,0,0,0,0, # 60 - 67
-0,0,0,0,0,0,0,0, # 68 - 6f
-0,0,0,0,0,0,0,0, # 70 - 77
-0,0,0,0,0,0,0,0, # 78 - 7f
-2,2,2,2,2,2,2,2, # 80 - 87
-2,2,2,2,2,2,2,2, # 88 - 8f
-2,2,2,2,2,2,2,2, # 90 - 97
-2,2,2,2,2,2,2,2, # 98 - 9f
-2,2,2,2,2,2,2,2, # a0 - a7
-2,2,2,2,2,2,2,2, # a8 - af
-2,2,2,2,2,2,2,2, # b0 - b7
-2,2,2,2,2,2,2,2, # b8 - bf
-2,2,2,2,2,2,2,2, # c0 - c7
-2,2,2,2,2,2,2,2, # c8 - cf
-2,2,2,2,2,2,2,2, # d0 - d7
-2,2,2,2,2,2,2,2, # d8 - df
-2,2,2,2,2,2,2,2, # e0 - e7
-2,2,2,2,2,2,2,2, # e8 - ef
-2,2,2,2,2,2,2,2, # f0 - f7
-2,2,2,2,2,2,2,2, # f8 - ff
-)
-
-ISO2022CN_ST = (
-MachineState.START, 3,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,# 00-07
-MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,# 08-0f
-MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,# 10-17
-MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 4,MachineState.ERROR,# 18-1f
-MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,# 20-27
- 5, 6,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,# 28-2f
-MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,# 30-37
-MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ERROR,MachineState.START,# 38-3f
-)
-
-ISO2022CN_CHAR_LEN_TABLE = (0, 0, 0, 0, 0, 0, 0, 0, 0)
-
-ISO2022CN_SM_MODEL = {'class_table': ISO2022CN_CLS,
- 'class_factor': 9,
- 'state_table': ISO2022CN_ST,
- 'char_len_table': ISO2022CN_CHAR_LEN_TABLE,
- 'name': "ISO-2022-CN",
- 'language': 'Chinese'}
-
-ISO2022JP_CLS = (
-2,0,0,0,0,0,0,0, # 00 - 07
-0,0,0,0,0,0,2,2, # 08 - 0f
-0,0,0,0,0,0,0,0, # 10 - 17
-0,0,0,1,0,0,0,0, # 18 - 1f
-0,0,0,0,7,0,0,0, # 20 - 27
-3,0,0,0,0,0,0,0, # 28 - 2f
-0,0,0,0,0,0,0,0, # 30 - 37
-0,0,0,0,0,0,0,0, # 38 - 3f
-6,0,4,0,8,0,0,0, # 40 - 47
-0,9,5,0,0,0,0,0, # 48 - 4f
-0,0,0,0,0,0,0,0, # 50 - 57
-0,0,0,0,0,0,0,0, # 58 - 5f
-0,0,0,0,0,0,0,0, # 60 - 67
-0,0,0,0,0,0,0,0, # 68 - 6f
-0,0,0,0,0,0,0,0, # 70 - 77
-0,0,0,0,0,0,0,0, # 78 - 7f
-2,2,2,2,2,2,2,2, # 80 - 87
-2,2,2,2,2,2,2,2, # 88 - 8f
-2,2,2,2,2,2,2,2, # 90 - 97
-2,2,2,2,2,2,2,2, # 98 - 9f
-2,2,2,2,2,2,2,2, # a0 - a7
-2,2,2,2,2,2,2,2, # a8 - af
-2,2,2,2,2,2,2,2, # b0 - b7
-2,2,2,2,2,2,2,2, # b8 - bf
-2,2,2,2,2,2,2,2, # c0 - c7
-2,2,2,2,2,2,2,2, # c8 - cf
-2,2,2,2,2,2,2,2, # d0 - d7
-2,2,2,2,2,2,2,2, # d8 - df
-2,2,2,2,2,2,2,2, # e0 - e7
-2,2,2,2,2,2,2,2, # e8 - ef
-2,2,2,2,2,2,2,2, # f0 - f7
-2,2,2,2,2,2,2,2, # f8 - ff
-)
-
-ISO2022JP_ST = (
-MachineState.START, 3,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,# 00-07
-MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,# 08-0f
-MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,# 10-17
-MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,# 18-1f
-MachineState.ERROR, 5,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 4,MachineState.ERROR,MachineState.ERROR,# 20-27
-MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 6,MachineState.ITS_ME,MachineState.ERROR,MachineState.ITS_ME,MachineState.ERROR,# 28-2f
-MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,# 30-37
-MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,# 38-3f
-MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ERROR,MachineState.START,MachineState.START,# 40-47
-)
-
-ISO2022JP_CHAR_LEN_TABLE = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
-
-ISO2022JP_SM_MODEL = {'class_table': ISO2022JP_CLS,
- 'class_factor': 10,
- 'state_table': ISO2022JP_ST,
- 'char_len_table': ISO2022JP_CHAR_LEN_TABLE,
- 'name': "ISO-2022-JP",
- 'language': 'Japanese'}
-
-ISO2022KR_CLS = (
-2,0,0,0,0,0,0,0, # 00 - 07
-0,0,0,0,0,0,0,0, # 08 - 0f
-0,0,0,0,0,0,0,0, # 10 - 17
-0,0,0,1,0,0,0,0, # 18 - 1f
-0,0,0,0,3,0,0,0, # 20 - 27
-0,4,0,0,0,0,0,0, # 28 - 2f
-0,0,0,0,0,0,0,0, # 30 - 37
-0,0,0,0,0,0,0,0, # 38 - 3f
-0,0,0,5,0,0,0,0, # 40 - 47
-0,0,0,0,0,0,0,0, # 48 - 4f
-0,0,0,0,0,0,0,0, # 50 - 57
-0,0,0,0,0,0,0,0, # 58 - 5f
-0,0,0,0,0,0,0,0, # 60 - 67
-0,0,0,0,0,0,0,0, # 68 - 6f
-0,0,0,0,0,0,0,0, # 70 - 77
-0,0,0,0,0,0,0,0, # 78 - 7f
-2,2,2,2,2,2,2,2, # 80 - 87
-2,2,2,2,2,2,2,2, # 88 - 8f
-2,2,2,2,2,2,2,2, # 90 - 97
-2,2,2,2,2,2,2,2, # 98 - 9f
-2,2,2,2,2,2,2,2, # a0 - a7
-2,2,2,2,2,2,2,2, # a8 - af
-2,2,2,2,2,2,2,2, # b0 - b7
-2,2,2,2,2,2,2,2, # b8 - bf
-2,2,2,2,2,2,2,2, # c0 - c7
-2,2,2,2,2,2,2,2, # c8 - cf
-2,2,2,2,2,2,2,2, # d0 - d7
-2,2,2,2,2,2,2,2, # d8 - df
-2,2,2,2,2,2,2,2, # e0 - e7
-2,2,2,2,2,2,2,2, # e8 - ef
-2,2,2,2,2,2,2,2, # f0 - f7
-2,2,2,2,2,2,2,2, # f8 - ff
-)
-
-ISO2022KR_ST = (
-MachineState.START, 3,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,# 00-07
-MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,# 08-0f
-MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 4,MachineState.ERROR,MachineState.ERROR,# 10-17
-MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 5,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,# 18-1f
-MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.START,MachineState.START,MachineState.START,MachineState.START,# 20-27
-)
-
-ISO2022KR_CHAR_LEN_TABLE = (0, 0, 0, 0, 0, 0)
-
-ISO2022KR_SM_MODEL = {'class_table': ISO2022KR_CLS,
- 'class_factor': 6,
- 'state_table': ISO2022KR_ST,
- 'char_len_table': ISO2022KR_CHAR_LEN_TABLE,
- 'name': "ISO-2022-KR",
- 'language': 'Korean'}
-
-
diff --git a/lib/chardet/eucjpprober.py b/lib/chardet/eucjpprober.py
deleted file mode 100644
index 20ce8f7d15..0000000000
--- a/lib/chardet/eucjpprober.py
+++ /dev/null
@@ -1,92 +0,0 @@
-######################## BEGIN LICENSE BLOCK ########################
-# The Original Code is mozilla.org code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Mark Pilgrim - port to Python
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301 USA
-######################### END LICENSE BLOCK #########################
-
-from .enums import ProbingState, MachineState
-from .mbcharsetprober import MultiByteCharSetProber
-from .codingstatemachine import CodingStateMachine
-from .chardistribution import EUCJPDistributionAnalysis
-from .jpcntx import EUCJPContextAnalysis
-from .mbcssm import EUCJP_SM_MODEL
-
-
-class EUCJPProber(MultiByteCharSetProber):
- def __init__(self):
- super(EUCJPProber, self).__init__()
- self.coding_sm = CodingStateMachine(EUCJP_SM_MODEL)
- self.distribution_analyzer = EUCJPDistributionAnalysis()
- self.context_analyzer = EUCJPContextAnalysis()
- self.reset()
-
- def reset(self):
- super(EUCJPProber, self).reset()
- self.context_analyzer.reset()
-
- @property
- def charset_name(self):
- return "EUC-JP"
-
- @property
- def language(self):
- return "Japanese"
-
- def feed(self, byte_str):
- for i in range(len(byte_str)):
- # PY3K: byte_str is a byte array, so byte_str[i] is an int, not a byte
- coding_state = self.coding_sm.next_state(byte_str[i])
- if coding_state == MachineState.ERROR:
- self.logger.debug('%s %s prober hit error at byte %s',
- self.charset_name, self.language, i)
- self._state = ProbingState.NOT_ME
- break
- elif coding_state == MachineState.ITS_ME:
- self._state = ProbingState.FOUND_IT
- break
- elif coding_state == MachineState.START:
- char_len = self.coding_sm.get_current_charlen()
- if i == 0:
- self._last_char[1] = byte_str[0]
- self.context_analyzer.feed(self._last_char, char_len)
- self.distribution_analyzer.feed(self._last_char, char_len)
- else:
- self.context_analyzer.feed(byte_str[i - 1:i + 1],
- char_len)
- self.distribution_analyzer.feed(byte_str[i - 1:i + 1],
- char_len)
-
- self._last_char[0] = byte_str[-1]
-
- if self.state == ProbingState.DETECTING:
- if (self.context_analyzer.got_enough_data() and
- (self.get_confidence() > self.SHORTCUT_THRESHOLD)):
- self._state = ProbingState.FOUND_IT
-
- return self.state
-
- def get_confidence(self):
- context_conf = self.context_analyzer.get_confidence()
- distrib_conf = self.distribution_analyzer.get_confidence()
- return max(context_conf, distrib_conf)
diff --git a/lib/chardet/euckrfreq.py b/lib/chardet/euckrfreq.py
deleted file mode 100644
index b68078cb96..0000000000
--- a/lib/chardet/euckrfreq.py
+++ /dev/null
@@ -1,195 +0,0 @@
-######################## BEGIN LICENSE BLOCK ########################
-# The Original Code is Mozilla Communicator client code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Mark Pilgrim - port to Python
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301 USA
-######################### END LICENSE BLOCK #########################
-
-# Sampling from about 20M text materials include literature and computer technology
-
-# 128 --> 0.79
-# 256 --> 0.92
-# 512 --> 0.986
-# 1024 --> 0.99944
-# 2048 --> 0.99999
-#
-# Idea Distribution Ratio = 0.98653 / (1-0.98653) = 73.24
-# Random Distribution Ration = 512 / (2350-512) = 0.279.
-#
-# Typical Distribution Ratio
-
-EUCKR_TYPICAL_DISTRIBUTION_RATIO = 6.0
-
-EUCKR_TABLE_SIZE = 2352
-
-# Char to FreqOrder table ,
-EUCKR_CHAR_TO_FREQ_ORDER = (
- 13, 130, 120,1396, 481,1719,1720, 328, 609, 212,1721, 707, 400, 299,1722, 87,
-1397,1723, 104, 536,1117,1203,1724,1267, 685,1268, 508,1725,1726,1727,1728,1398,
-1399,1729,1730,1731, 141, 621, 326,1057, 368,1732, 267, 488, 20,1733,1269,1734,
- 945,1400,1735, 47, 904,1270,1736,1737, 773, 248,1738, 409, 313, 786, 429,1739,
- 116, 987, 813,1401, 683, 75,1204, 145,1740,1741,1742,1743, 16, 847, 667, 622,
- 708,1744,1745,1746, 966, 787, 304, 129,1747, 60, 820, 123, 676,1748,1749,1750,
-1751, 617,1752, 626,1753,1754,1755,1756, 653,1757,1758,1759,1760,1761,1762, 856,
- 344,1763,1764,1765,1766, 89, 401, 418, 806, 905, 848,1767,1768,1769, 946,1205,
- 709,1770,1118,1771, 241,1772,1773,1774,1271,1775, 569,1776, 999,1777,1778,1779,
-1780, 337, 751,1058, 28, 628, 254,1781, 177, 906, 270, 349, 891,1079,1782, 19,
-1783, 379,1784, 315,1785, 629, 754,1402, 559,1786, 636, 203,1206,1787, 710, 567,
-1788, 935, 814,1789,1790,1207, 766, 528,1791,1792,1208,1793,1794,1795,1796,1797,
-1403,1798,1799, 533,1059,1404,1405,1156,1406, 936, 884,1080,1800, 351,1801,1802,
-1803,1804,1805, 801,1806,1807,1808,1119,1809,1157, 714, 474,1407,1810, 298, 899,
- 885,1811,1120, 802,1158,1812, 892,1813,1814,1408, 659,1815,1816,1121,1817,1818,
-1819,1820,1821,1822, 319,1823, 594, 545,1824, 815, 937,1209,1825,1826, 573,1409,
-1022,1827,1210,1828,1829,1830,1831,1832,1833, 556, 722, 807,1122,1060,1834, 697,
-1835, 900, 557, 715,1836,1410, 540,1411, 752,1159, 294, 597,1211, 976, 803, 770,
-1412,1837,1838, 39, 794,1413, 358,1839, 371, 925,1840, 453, 661, 788, 531, 723,
- 544,1023,1081, 869, 91,1841, 392, 430, 790, 602,1414, 677,1082, 457,1415,1416,
-1842,1843, 475, 327,1024,1417, 795, 121,1844, 733, 403,1418,1845,1846,1847, 300,
- 119, 711,1212, 627,1848,1272, 207,1849,1850, 796,1213, 382,1851, 519,1852,1083,
- 893,1853,1854,1855, 367, 809, 487, 671,1856, 663,1857,1858, 956, 471, 306, 857,
-1859,1860,1160,1084,1861,1862,1863,1864,1865,1061,1866,1867,1868,1869,1870,1871,
- 282, 96, 574,1872, 502,1085,1873,1214,1874, 907,1875,1876, 827, 977,1419,1420,
-1421, 268,1877,1422,1878,1879,1880, 308,1881, 2, 537,1882,1883,1215,1884,1885,
- 127, 791,1886,1273,1423,1887, 34, 336, 404, 643,1888, 571, 654, 894, 840,1889,
- 0, 886,1274, 122, 575, 260, 908, 938,1890,1275, 410, 316,1891,1892, 100,1893,
-1894,1123, 48,1161,1124,1025,1895, 633, 901,1276,1896,1897, 115, 816,1898, 317,
-1899, 694,1900, 909, 734,1424, 572, 866,1425, 691, 85, 524,1010, 543, 394, 841,
-1901,1902,1903,1026,1904,1905,1906,1907,1908,1909, 30, 451, 651, 988, 310,1910,
-1911,1426, 810,1216, 93,1912,1913,1277,1217,1914, 858, 759, 45, 58, 181, 610,
- 269,1915,1916, 131,1062, 551, 443,1000, 821,1427, 957, 895,1086,1917,1918, 375,
-1919, 359,1920, 687,1921, 822,1922, 293,1923,1924, 40, 662, 118, 692, 29, 939,
- 887, 640, 482, 174,1925, 69,1162, 728,1428, 910,1926,1278,1218,1279, 386, 870,
- 217, 854,1163, 823,1927,1928,1929,1930, 834,1931, 78,1932, 859,1933,1063,1934,
-1935,1936,1937, 438,1164, 208, 595,1938,1939,1940,1941,1219,1125,1942, 280, 888,
-1429,1430,1220,1431,1943,1944,1945,1946,1947,1280, 150, 510,1432,1948,1949,1950,
-1951,1952,1953,1954,1011,1087,1955,1433,1043,1956, 881,1957, 614, 958,1064,1065,
-1221,1958, 638,1001, 860, 967, 896,1434, 989, 492, 553,1281,1165,1959,1282,1002,
-1283,1222,1960,1961,1962,1963, 36, 383, 228, 753, 247, 454,1964, 876, 678,1965,
-1966,1284, 126, 464, 490, 835, 136, 672, 529, 940,1088,1435, 473,1967,1968, 467,
- 50, 390, 227, 587, 279, 378, 598, 792, 968, 240, 151, 160, 849, 882,1126,1285,
- 639,1044, 133, 140, 288, 360, 811, 563,1027, 561, 142, 523,1969,1970,1971, 7,
- 103, 296, 439, 407, 506, 634, 990,1972,1973,1974,1975, 645,1976,1977,1978,1979,
-1980,1981, 236,1982,1436,1983,1984,1089, 192, 828, 618, 518,1166, 333,1127,1985,
- 818,1223,1986,1987,1988,1989,1990,1991,1992,1993, 342,1128,1286, 746, 842,1994,
-1995, 560, 223,1287, 98, 8, 189, 650, 978,1288,1996,1437,1997, 17, 345, 250,
- 423, 277, 234, 512, 226, 97, 289, 42, 167,1998, 201,1999,2000, 843, 836, 824,
- 532, 338, 783,1090, 182, 576, 436,1438,1439, 527, 500,2001, 947, 889,2002,2003,
-2004,2005, 262, 600, 314, 447,2006, 547,2007, 693, 738,1129,2008, 71,1440, 745,
- 619, 688,2009, 829,2010,2011, 147,2012, 33, 948,2013,2014, 74, 224,2015, 61,
- 191, 918, 399, 637,2016,1028,1130, 257, 902,2017,2018,2019,2020,2021,2022,2023,
-2024,2025,2026, 837,2027,2028,2029,2030, 179, 874, 591, 52, 724, 246,2031,2032,
-2033,2034,1167, 969,2035,1289, 630, 605, 911,1091,1168,2036,2037,2038,1441, 912,
-2039, 623,2040,2041, 253,1169,1290,2042,1442, 146, 620, 611, 577, 433,2043,1224,
- 719,1170, 959, 440, 437, 534, 84, 388, 480,1131, 159, 220, 198, 679,2044,1012,
- 819,1066,1443, 113,1225, 194, 318,1003,1029,2045,2046,2047,2048,1067,2049,2050,
-2051,2052,2053, 59, 913, 112,2054, 632,2055, 455, 144, 739,1291,2056, 273, 681,
- 499,2057, 448,2058,2059, 760,2060,2061, 970, 384, 169, 245,1132,2062,2063, 414,
-1444,2064,2065, 41, 235,2066, 157, 252, 877, 568, 919, 789, 580,2067, 725,2068,
-2069,1292,2070,2071,1445,2072,1446,2073,2074, 55, 588, 66,1447, 271,1092,2075,
-1226,2076, 960,1013, 372,2077,2078,2079,2080,2081,1293,2082,2083,2084,2085, 850,
-2086,2087,2088,2089,2090, 186,2091,1068, 180,2092,2093,2094, 109,1227, 522, 606,
-2095, 867,1448,1093, 991,1171, 926, 353,1133,2096, 581,2097,2098,2099,1294,1449,
-1450,2100, 596,1172,1014,1228,2101,1451,1295,1173,1229,2102,2103,1296,1134,1452,
- 949,1135,2104,2105,1094,1453,1454,1455,2106,1095,2107,2108,2109,2110,2111,2112,
-2113,2114,2115,2116,2117, 804,2118,2119,1230,1231, 805,1456, 405,1136,2120,2121,
-2122,2123,2124, 720, 701,1297, 992,1457, 927,1004,2125,2126,2127,2128,2129,2130,
- 22, 417,2131, 303,2132, 385,2133, 971, 520, 513,2134,1174, 73,1096, 231, 274,
- 962,1458, 673,2135,1459,2136, 152,1137,2137,2138,2139,2140,1005,1138,1460,1139,
-2141,2142,2143,2144, 11, 374, 844,2145, 154,1232, 46,1461,2146, 838, 830, 721,
-1233, 106,2147, 90, 428, 462, 578, 566,1175, 352,2148,2149, 538,1234, 124,1298,
-2150,1462, 761, 565,2151, 686,2152, 649,2153, 72, 173,2154, 460, 415,2155,1463,
-2156,1235, 305,2157,2158,2159,2160,2161,2162, 579,2163,2164,2165,2166,2167, 747,
-2168,2169,2170,2171,1464, 669,2172,2173,2174,2175,2176,1465,2177, 23, 530, 285,
-2178, 335, 729,2179, 397,2180,2181,2182,1030,2183,2184, 698,2185,2186, 325,2187,
-2188, 369,2189, 799,1097,1015, 348,2190,1069, 680,2191, 851,1466,2192,2193, 10,
-2194, 613, 424,2195, 979, 108, 449, 589, 27, 172, 81,1031, 80, 774, 281, 350,
-1032, 525, 301, 582,1176,2196, 674,1045,2197,2198,1467, 730, 762,2199,2200,2201,
-2202,1468,2203, 993,2204,2205, 266,1070, 963,1140,2206,2207,2208, 664,1098, 972,
-2209,2210,2211,1177,1469,1470, 871,2212,2213,2214,2215,2216,1471,2217,2218,2219,
-2220,2221,2222,2223,2224,2225,2226,2227,1472,1236,2228,2229,2230,2231,2232,2233,
-2234,2235,1299,2236,2237, 200,2238, 477, 373,2239,2240, 731, 825, 777,2241,2242,
-2243, 521, 486, 548,2244,2245,2246,1473,1300, 53, 549, 137, 875, 76, 158,2247,
-1301,1474, 469, 396,1016, 278, 712,2248, 321, 442, 503, 767, 744, 941,1237,1178,
-1475,2249, 82, 178,1141,1179, 973,2250,1302,2251, 297,2252,2253, 570,2254,2255,
-2256, 18, 450, 206,2257, 290, 292,1142,2258, 511, 162, 99, 346, 164, 735,2259,
-1476,1477, 4, 554, 343, 798,1099,2260,1100,2261, 43, 171,1303, 139, 215,2262,
-2263, 717, 775,2264,1033, 322, 216,2265, 831,2266, 149,2267,1304,2268,2269, 702,
-1238, 135, 845, 347, 309,2270, 484,2271, 878, 655, 238,1006,1478,2272, 67,2273,
- 295,2274,2275, 461,2276, 478, 942, 412,2277,1034,2278,2279,2280, 265,2281, 541,
-2282,2283,2284,2285,2286, 70, 852,1071,2287,2288,2289,2290, 21, 56, 509, 117,
- 432,2291,2292, 331, 980, 552,1101, 148, 284, 105, 393,1180,1239, 755,2293, 187,
-2294,1046,1479,2295, 340,2296, 63,1047, 230,2297,2298,1305, 763,1306, 101, 800,
- 808, 494,2299,2300,2301, 903,2302, 37,1072, 14, 5,2303, 79, 675,2304, 312,
-2305,2306,2307,2308,2309,1480, 6,1307,2310,2311,2312, 1, 470, 35, 24, 229,
-2313, 695, 210, 86, 778, 15, 784, 592, 779, 32, 77, 855, 964,2314, 259,2315,
- 501, 380,2316,2317, 83, 981, 153, 689,1308,1481,1482,1483,2318,2319, 716,1484,
-2320,2321,2322,2323,2324,2325,1485,2326,2327, 128, 57, 68, 261,1048, 211, 170,
-1240, 31,2328, 51, 435, 742,2329,2330,2331, 635,2332, 264, 456,2333,2334,2335,
- 425,2336,1486, 143, 507, 263, 943,2337, 363, 920,1487, 256,1488,1102, 243, 601,
-1489,2338,2339,2340,2341,2342,2343,2344, 861,2345,2346,2347,2348,2349,2350, 395,
-2351,1490,1491, 62, 535, 166, 225,2352,2353, 668, 419,1241, 138, 604, 928,2354,
-1181,2355,1492,1493,2356,2357,2358,1143,2359, 696,2360, 387, 307,1309, 682, 476,
-2361,2362, 332, 12, 222, 156,2363, 232,2364, 641, 276, 656, 517,1494,1495,1035,
- 416, 736,1496,2365,1017, 586,2366,2367,2368,1497,2369, 242,2370,2371,2372,1498,
-2373, 965, 713,2374,2375,2376,2377, 740, 982,1499, 944,1500,1007,2378,2379,1310,
-1501,2380,2381,2382, 785, 329,2383,2384,1502,2385,2386,2387, 932,2388,1503,2389,
-2390,2391,2392,1242,2393,2394,2395,2396,2397, 994, 950,2398,2399,2400,2401,1504,
-1311,2402,2403,2404,2405,1049, 749,2406,2407, 853, 718,1144,1312,2408,1182,1505,
-2409,2410, 255, 516, 479, 564, 550, 214,1506,1507,1313, 413, 239, 444, 339,1145,
-1036,1508,1509,1314,1037,1510,1315,2411,1511,2412,2413,2414, 176, 703, 497, 624,
- 593, 921, 302,2415, 341, 165,1103,1512,2416,1513,2417,2418,2419, 376,2420, 700,
-2421,2422,2423, 258, 768,1316,2424,1183,2425, 995, 608,2426,2427,2428,2429, 221,
-2430,2431,2432,2433,2434,2435,2436,2437, 195, 323, 726, 188, 897, 983,1317, 377,
- 644,1050, 879,2438, 452,2439,2440,2441,2442,2443,2444, 914,2445,2446,2447,2448,
- 915, 489,2449,1514,1184,2450,2451, 515, 64, 427, 495,2452, 583,2453, 483, 485,
-1038, 562, 213,1515, 748, 666,2454,2455,2456,2457, 334,2458, 780, 996,1008, 705,
-1243,2459,2460,2461,2462,2463, 114,2464, 493,1146, 366, 163,1516, 961,1104,2465,
- 291,2466,1318,1105,2467,1517, 365,2468, 355, 951,1244,2469,1319,2470, 631,2471,
-2472, 218,1320, 364, 320, 756,1518,1519,1321,1520,1322,2473,2474,2475,2476, 997,
-2477,2478,2479,2480, 665,1185,2481, 916,1521,2482,2483,2484, 584, 684,2485,2486,
- 797,2487,1051,1186,2488,2489,2490,1522,2491,2492, 370,2493,1039,1187, 65,2494,
- 434, 205, 463,1188,2495, 125, 812, 391, 402, 826, 699, 286, 398, 155, 781, 771,
- 585,2496, 590, 505,1073,2497, 599, 244, 219, 917,1018, 952, 646,1523,2498,1323,
-2499,2500, 49, 984, 354, 741,2501, 625,2502,1324,2503,1019, 190, 357, 757, 491,
- 95, 782, 868,2504,2505,2506,2507,2508,2509, 134,1524,1074, 422,1525, 898,2510,
- 161,2511,2512,2513,2514, 769,2515,1526,2516,2517, 411,1325,2518, 472,1527,2519,
-2520,2521,2522,2523,2524, 985,2525,2526,2527,2528,2529,2530, 764,2531,1245,2532,
-2533, 25, 204, 311,2534, 496,2535,1052,2536,2537,2538,2539,2540,2541,2542, 199,
- 704, 504, 468, 758, 657,1528, 196, 44, 839,1246, 272, 750,2543, 765, 862,2544,
-2545,1326,2546, 132, 615, 933,2547, 732,2548,2549,2550,1189,1529,2551, 283,1247,
-1053, 607, 929,2552,2553,2554, 930, 183, 872, 616,1040,1147,2555,1148,1020, 441,
- 249,1075,2556,2557,2558, 466, 743,2559,2560,2561, 92, 514, 426, 420, 526,2562,
-2563,2564,2565,2566,2567,2568, 185,2569,2570,2571,2572, 776,1530, 658,2573, 362,
-2574, 361, 922,1076, 793,2575,2576,2577,2578,2579,2580,1531, 251,2581,2582,2583,
-2584,1532, 54, 612, 237,1327,2585,2586, 275, 408, 647, 111,2587,1533,1106, 465,
- 3, 458, 9, 38,2588, 107, 110, 890, 209, 26, 737, 498,2589,1534,2590, 431,
- 202, 88,1535, 356, 287,1107, 660,1149,2591, 381,1536, 986,1150, 445,1248,1151,
- 974,2592,2593, 846,2594, 446, 953, 184,1249,1250, 727,2595, 923, 193, 883,2596,
-2597,2598, 102, 324, 539, 817,2599, 421,1041,2600, 832,2601, 94, 175, 197, 406,
-2602, 459,2603,2604,2605,2606,2607, 330, 555,2608,2609,2610, 706,1108, 389,2611,
-2612,2613,2614, 233,2615, 833, 558, 931, 954,1251,2616,2617,1537, 546,2618,2619,
-1009,2620,2621,2622,1538, 690,1328,2623, 955,2624,1539,2625,2626, 772,2627,2628,
-2629,2630,2631, 924, 648, 863, 603,2632,2633, 934,1540, 864, 865,2634, 642,1042,
- 670,1190,2635,2636,2637,2638, 168,2639, 652, 873, 542,1054,1541,2640,2641,2642, # 512, 256
-)
-
diff --git a/lib/chardet/euckrprober.py b/lib/chardet/euckrprober.py
deleted file mode 100644
index 345a060d02..0000000000
--- a/lib/chardet/euckrprober.py
+++ /dev/null
@@ -1,47 +0,0 @@
-######################## BEGIN LICENSE BLOCK ########################
-# The Original Code is mozilla.org code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Mark Pilgrim - port to Python
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301 USA
-######################### END LICENSE BLOCK #########################
-
-from .mbcharsetprober import MultiByteCharSetProber
-from .codingstatemachine import CodingStateMachine
-from .chardistribution import EUCKRDistributionAnalysis
-from .mbcssm import EUCKR_SM_MODEL
-
-
-class EUCKRProber(MultiByteCharSetProber):
- def __init__(self):
- super(EUCKRProber, self).__init__()
- self.coding_sm = CodingStateMachine(EUCKR_SM_MODEL)
- self.distribution_analyzer = EUCKRDistributionAnalysis()
- self.reset()
-
- @property
- def charset_name(self):
- return "EUC-KR"
-
- @property
- def language(self):
- return "Korean"
diff --git a/lib/chardet/euctwfreq.py b/lib/chardet/euctwfreq.py
deleted file mode 100644
index ed7a995a3a..0000000000
--- a/lib/chardet/euctwfreq.py
+++ /dev/null
@@ -1,387 +0,0 @@
-######################## BEGIN LICENSE BLOCK ########################
-# The Original Code is Mozilla Communicator client code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Mark Pilgrim - port to Python
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301 USA
-######################### END LICENSE BLOCK #########################
-
-# EUCTW frequency table
-# Converted from big5 work
-# by Taiwan's Mandarin Promotion Council
-#
-
-# 128 --> 0.42261
-# 256 --> 0.57851
-# 512 --> 0.74851
-# 1024 --> 0.89384
-# 2048 --> 0.97583
-#
-# Idea Distribution Ratio = 0.74851/(1-0.74851) =2.98
-# Random Distribution Ration = 512/(5401-512)=0.105
-#
-# Typical Distribution Ratio about 25% of Ideal one, still much higher than RDR
-
-EUCTW_TYPICAL_DISTRIBUTION_RATIO = 0.75
-
-# Char to FreqOrder table ,
-EUCTW_TABLE_SIZE = 5376
-
-EUCTW_CHAR_TO_FREQ_ORDER = (
- 1,1800,1506, 255,1431, 198, 9, 82, 6,7310, 177, 202,3615,1256,2808, 110, # 2742
-3735, 33,3241, 261, 76, 44,2113, 16,2931,2184,1176, 659,3868, 26,3404,2643, # 2758
-1198,3869,3313,4060, 410,2211, 302, 590, 361,1963, 8, 204, 58,4296,7311,1931, # 2774
- 63,7312,7313, 317,1614, 75, 222, 159,4061,2412,1480,7314,3500,3068, 224,2809, # 2790
-3616, 3, 10,3870,1471, 29,2774,1135,2852,1939, 873, 130,3242,1123, 312,7315, # 2806
-4297,2051, 507, 252, 682,7316, 142,1914, 124, 206,2932, 34,3501,3173, 64, 604, # 2822
-7317,2494,1976,1977, 155,1990, 645, 641,1606,7318,3405, 337, 72, 406,7319, 80, # 2838
- 630, 238,3174,1509, 263, 939,1092,2644, 756,1440,1094,3406, 449, 69,2969, 591, # 2854
- 179,2095, 471, 115,2034,1843, 60, 50,2970, 134, 806,1868, 734,2035,3407, 180, # 2870
- 995,1607, 156, 537,2893, 688,7320, 319,1305, 779,2144, 514,2374, 298,4298, 359, # 2886
-2495, 90,2707,1338, 663, 11, 906,1099,2545, 20,2436, 182, 532,1716,7321, 732, # 2902
-1376,4062,1311,1420,3175, 25,2312,1056, 113, 399, 382,1949, 242,3408,2467, 529, # 2918
-3243, 475,1447,3617,7322, 117, 21, 656, 810,1297,2295,2329,3502,7323, 126,4063, # 2934
- 706, 456, 150, 613,4299, 71,1118,2036,4064, 145,3069, 85, 835, 486,2114,1246, # 2950
-1426, 428, 727,1285,1015, 800, 106, 623, 303,1281,7324,2127,2354, 347,3736, 221, # 2966
-3503,3110,7325,1955,1153,4065, 83, 296,1199,3070, 192, 624, 93,7326, 822,1897, # 2982
-2810,3111, 795,2064, 991,1554,1542,1592, 27, 43,2853, 859, 139,1456, 860,4300, # 2998
- 437, 712,3871, 164,2392,3112, 695, 211,3017,2096, 195,3872,1608,3504,3505,3618, # 3014
-3873, 234, 811,2971,2097,3874,2229,1441,3506,1615,2375, 668,2076,1638, 305, 228, # 3030
-1664,4301, 467, 415,7327, 262,2098,1593, 239, 108, 300, 200,1033, 512,1247,2077, # 3046
-7328,7329,2173,3176,3619,2673, 593, 845,1062,3244, 88,1723,2037,3875,1950, 212, # 3062
- 266, 152, 149, 468,1898,4066,4302, 77, 187,7330,3018, 37, 5,2972,7331,3876, # 3078
-7332,7333, 39,2517,4303,2894,3177,2078, 55, 148, 74,4304, 545, 483,1474,1029, # 3094
-1665, 217,1869,1531,3113,1104,2645,4067, 24, 172,3507, 900,3877,3508,3509,4305, # 3110
- 32,1408,2811,1312, 329, 487,2355,2247,2708, 784,2674, 4,3019,3314,1427,1788, # 3126
- 188, 109, 499,7334,3620,1717,1789, 888,1217,3020,4306,7335,3510,7336,3315,1520, # 3142
-3621,3878, 196,1034, 775,7337,7338, 929,1815, 249, 439, 38,7339,1063,7340, 794, # 3158
-3879,1435,2296, 46, 178,3245,2065,7341,2376,7342, 214,1709,4307, 804, 35, 707, # 3174
- 324,3622,1601,2546, 140, 459,4068,7343,7344,1365, 839, 272, 978,2257,2572,3409, # 3190
-2128,1363,3623,1423, 697, 100,3071, 48, 70,1231, 495,3114,2193,7345,1294,7346, # 3206
-2079, 462, 586,1042,3246, 853, 256, 988, 185,2377,3410,1698, 434,1084,7347,3411, # 3222
- 314,2615,2775,4308,2330,2331, 569,2280, 637,1816,2518, 757,1162,1878,1616,3412, # 3238
- 287,1577,2115, 768,4309,1671,2854,3511,2519,1321,3737, 909,2413,7348,4069, 933, # 3254
-3738,7349,2052,2356,1222,4310, 765,2414,1322, 786,4311,7350,1919,1462,1677,2895, # 3270
-1699,7351,4312,1424,2437,3115,3624,2590,3316,1774,1940,3413,3880,4070, 309,1369, # 3286
-1130,2812, 364,2230,1653,1299,3881,3512,3882,3883,2646, 525,1085,3021, 902,2000, # 3302
-1475, 964,4313, 421,1844,1415,1057,2281, 940,1364,3116, 376,4314,4315,1381, 7, # 3318
-2520, 983,2378, 336,1710,2675,1845, 321,3414, 559,1131,3022,2742,1808,1132,1313, # 3334
- 265,1481,1857,7352, 352,1203,2813,3247, 167,1089, 420,2814, 776, 792,1724,3513, # 3350
-4071,2438,3248,7353,4072,7354, 446, 229, 333,2743, 901,3739,1200,1557,4316,2647, # 3366
-1920, 395,2744,2676,3740,4073,1835, 125, 916,3178,2616,4317,7355,7356,3741,7357, # 3382
-7358,7359,4318,3117,3625,1133,2547,1757,3415,1510,2313,1409,3514,7360,2145, 438, # 3398
-2591,2896,2379,3317,1068, 958,3023, 461, 311,2855,2677,4074,1915,3179,4075,1978, # 3414
- 383, 750,2745,2617,4076, 274, 539, 385,1278,1442,7361,1154,1964, 384, 561, 210, # 3430
- 98,1295,2548,3515,7362,1711,2415,1482,3416,3884,2897,1257, 129,7363,3742, 642, # 3446
- 523,2776,2777,2648,7364, 141,2231,1333, 68, 176, 441, 876, 907,4077, 603,2592, # 3462
- 710, 171,3417, 404, 549, 18,3118,2393,1410,3626,1666,7365,3516,4319,2898,4320, # 3478
-7366,2973, 368,7367, 146, 366, 99, 871,3627,1543, 748, 807,1586,1185, 22,2258, # 3494
- 379,3743,3180,7368,3181, 505,1941,2618,1991,1382,2314,7369, 380,2357, 218, 702, # 3510
-1817,1248,3418,3024,3517,3318,3249,7370,2974,3628, 930,3250,3744,7371, 59,7372, # 3526
- 585, 601,4078, 497,3419,1112,1314,4321,1801,7373,1223,1472,2174,7374, 749,1836, # 3542
- 690,1899,3745,1772,3885,1476, 429,1043,1790,2232,2116, 917,4079, 447,1086,1629, # 3558
-7375, 556,7376,7377,2020,1654, 844,1090, 105, 550, 966,1758,2815,1008,1782, 686, # 3574
-1095,7378,2282, 793,1602,7379,3518,2593,4322,4080,2933,2297,4323,3746, 980,2496, # 3590
- 544, 353, 527,4324, 908,2678,2899,7380, 381,2619,1942,1348,7381,1341,1252, 560, # 3606
-3072,7382,3420,2856,7383,2053, 973, 886,2080, 143,4325,7384,7385, 157,3886, 496, # 3622
-4081, 57, 840, 540,2038,4326,4327,3421,2117,1445, 970,2259,1748,1965,2081,4082, # 3638
-3119,1234,1775,3251,2816,3629, 773,1206,2129,1066,2039,1326,3887,1738,1725,4083, # 3654
- 279,3120, 51,1544,2594, 423,1578,2130,2066, 173,4328,1879,7386,7387,1583, 264, # 3670
- 610,3630,4329,2439, 280, 154,7388,7389,7390,1739, 338,1282,3073, 693,2857,1411, # 3686
-1074,3747,2440,7391,4330,7392,7393,1240, 952,2394,7394,2900,1538,2679, 685,1483, # 3702
-4084,2468,1436, 953,4085,2054,4331, 671,2395, 79,4086,2441,3252, 608, 567,2680, # 3718
-3422,4087,4088,1691, 393,1261,1791,2396,7395,4332,7396,7397,7398,7399,1383,1672, # 3734
-3748,3182,1464, 522,1119, 661,1150, 216, 675,4333,3888,1432,3519, 609,4334,2681, # 3750
-2397,7400,7401,7402,4089,3025, 0,7403,2469, 315, 231,2442, 301,3319,4335,2380, # 3766
-7404, 233,4090,3631,1818,4336,4337,7405, 96,1776,1315,2082,7406, 257,7407,1809, # 3782
-3632,2709,1139,1819,4091,2021,1124,2163,2778,1777,2649,7408,3074, 363,1655,3183, # 3798
-7409,2975,7410,7411,7412,3889,1567,3890, 718, 103,3184, 849,1443, 341,3320,2934, # 3814
-1484,7413,1712, 127, 67, 339,4092,2398, 679,1412, 821,7414,7415, 834, 738, 351, # 3830
-2976,2146, 846, 235,1497,1880, 418,1992,3749,2710, 186,1100,2147,2746,3520,1545, # 3846
-1355,2935,2858,1377, 583,3891,4093,2573,2977,7416,1298,3633,1078,2549,3634,2358, # 3862
- 78,3750,3751, 267,1289,2099,2001,1594,4094, 348, 369,1274,2194,2175,1837,4338, # 3878
-1820,2817,3635,2747,2283,2002,4339,2936,2748, 144,3321, 882,4340,3892,2749,3423, # 3894
-4341,2901,7417,4095,1726, 320,7418,3893,3026, 788,2978,7419,2818,1773,1327,2859, # 3910
-3894,2819,7420,1306,4342,2003,1700,3752,3521,2359,2650, 787,2022, 506, 824,3636, # 3926
- 534, 323,4343,1044,3322,2023,1900, 946,3424,7421,1778,1500,1678,7422,1881,4344, # 3942
- 165, 243,4345,3637,2521, 123, 683,4096, 764,4346, 36,3895,1792, 589,2902, 816, # 3958
- 626,1667,3027,2233,1639,1555,1622,3753,3896,7423,3897,2860,1370,1228,1932, 891, # 3974
-2083,2903, 304,4097,7424, 292,2979,2711,3522, 691,2100,4098,1115,4347, 118, 662, # 3990
-7425, 611,1156, 854,2381,1316,2861, 2, 386, 515,2904,7426,7427,3253, 868,2234, # 4006
-1486, 855,2651, 785,2212,3028,7428,1040,3185,3523,7429,3121, 448,7430,1525,7431, # 4022
-2164,4348,7432,3754,7433,4099,2820,3524,3122, 503, 818,3898,3123,1568, 814, 676, # 4038
-1444, 306,1749,7434,3755,1416,1030, 197,1428, 805,2821,1501,4349,7435,7436,7437, # 4054
-1993,7438,4350,7439,7440,2195, 13,2779,3638,2980,3124,1229,1916,7441,3756,2131, # 4070
-7442,4100,4351,2399,3525,7443,2213,1511,1727,1120,7444,7445, 646,3757,2443, 307, # 4086
-7446,7447,1595,3186,7448,7449,7450,3639,1113,1356,3899,1465,2522,2523,7451, 519, # 4102
-7452, 128,2132, 92,2284,1979,7453,3900,1512, 342,3125,2196,7454,2780,2214,1980, # 4118
-3323,7455, 290,1656,1317, 789, 827,2360,7456,3758,4352, 562, 581,3901,7457, 401, # 4134
-4353,2248, 94,4354,1399,2781,7458,1463,2024,4355,3187,1943,7459, 828,1105,4101, # 4150
-1262,1394,7460,4102, 605,4356,7461,1783,2862,7462,2822, 819,2101, 578,2197,2937, # 4166
-7463,1502, 436,3254,4103,3255,2823,3902,2905,3425,3426,7464,2712,2315,7465,7466, # 4182
-2332,2067, 23,4357, 193, 826,3759,2102, 699,1630,4104,3075, 390,1793,1064,3526, # 4198
-7467,1579,3076,3077,1400,7468,4105,1838,1640,2863,7469,4358,4359, 137,4106, 598, # 4214
-3078,1966, 780, 104, 974,2938,7470, 278, 899, 253, 402, 572, 504, 493,1339,7471, # 4230
-3903,1275,4360,2574,2550,7472,3640,3029,3079,2249, 565,1334,2713, 863, 41,7473, # 4246
-7474,4361,7475,1657,2333, 19, 463,2750,4107, 606,7476,2981,3256,1087,2084,1323, # 4262
-2652,2982,7477,1631,1623,1750,4108,2682,7478,2864, 791,2714,2653,2334, 232,2416, # 4278
-7479,2983,1498,7480,2654,2620, 755,1366,3641,3257,3126,2025,1609, 119,1917,3427, # 4294
- 862,1026,4109,7481,3904,3760,4362,3905,4363,2260,1951,2470,7482,1125, 817,4110, # 4310
-4111,3906,1513,1766,2040,1487,4112,3030,3258,2824,3761,3127,7483,7484,1507,7485, # 4326
-2683, 733, 40,1632,1106,2865, 345,4113, 841,2524, 230,4364,2984,1846,3259,3428, # 4342
-7486,1263, 986,3429,7487, 735, 879, 254,1137, 857, 622,1300,1180,1388,1562,3907, # 4358
-3908,2939, 967,2751,2655,1349, 592,2133,1692,3324,2985,1994,4114,1679,3909,1901, # 4374
-2185,7488, 739,3642,2715,1296,1290,7489,4115,2198,2199,1921,1563,2595,2551,1870, # 4390
-2752,2986,7490, 435,7491, 343,1108, 596, 17,1751,4365,2235,3430,3643,7492,4366, # 4406
- 294,3527,2940,1693, 477, 979, 281,2041,3528, 643,2042,3644,2621,2782,2261,1031, # 4422
-2335,2134,2298,3529,4367, 367,1249,2552,7493,3530,7494,4368,1283,3325,2004, 240, # 4438
-1762,3326,4369,4370, 836,1069,3128, 474,7495,2148,2525, 268,3531,7496,3188,1521, # 4454
-1284,7497,1658,1546,4116,7498,3532,3533,7499,4117,3327,2684,1685,4118, 961,1673, # 4470
-2622, 190,2005,2200,3762,4371,4372,7500, 570,2497,3645,1490,7501,4373,2623,3260, # 4486
-1956,4374, 584,1514, 396,1045,1944,7502,4375,1967,2444,7503,7504,4376,3910, 619, # 4502
-7505,3129,3261, 215,2006,2783,2553,3189,4377,3190,4378, 763,4119,3763,4379,7506, # 4518
-7507,1957,1767,2941,3328,3646,1174, 452,1477,4380,3329,3130,7508,2825,1253,2382, # 4534
-2186,1091,2285,4120, 492,7509, 638,1169,1824,2135,1752,3911, 648, 926,1021,1324, # 4550
-4381, 520,4382, 997, 847,1007, 892,4383,3764,2262,1871,3647,7510,2400,1784,4384, # 4566
-1952,2942,3080,3191,1728,4121,2043,3648,4385,2007,1701,3131,1551, 30,2263,4122, # 4582
-7511,2026,4386,3534,7512, 501,7513,4123, 594,3431,2165,1821,3535,3432,3536,3192, # 4598
- 829,2826,4124,7514,1680,3132,1225,4125,7515,3262,4387,4126,3133,2336,7516,4388, # 4614
-4127,7517,3912,3913,7518,1847,2383,2596,3330,7519,4389, 374,3914, 652,4128,4129, # 4630
- 375,1140, 798,7520,7521,7522,2361,4390,2264, 546,1659, 138,3031,2445,4391,7523, # 4646
-2250, 612,1848, 910, 796,3765,1740,1371, 825,3766,3767,7524,2906,2554,7525, 692, # 4662
- 444,3032,2624, 801,4392,4130,7526,1491, 244,1053,3033,4131,4132, 340,7527,3915, # 4678
-1041,2987, 293,1168, 87,1357,7528,1539, 959,7529,2236, 721, 694,4133,3768, 219, # 4694
-1478, 644,1417,3331,2656,1413,1401,1335,1389,3916,7530,7531,2988,2362,3134,1825, # 4710
- 730,1515, 184,2827, 66,4393,7532,1660,2943, 246,3332, 378,1457, 226,3433, 975, # 4726
-3917,2944,1264,3537, 674, 696,7533, 163,7534,1141,2417,2166, 713,3538,3333,4394, # 4742
-3918,7535,7536,1186, 15,7537,1079,1070,7538,1522,3193,3539, 276,1050,2716, 758, # 4758
-1126, 653,2945,3263,7539,2337, 889,3540,3919,3081,2989, 903,1250,4395,3920,3434, # 4774
-3541,1342,1681,1718, 766,3264, 286, 89,2946,3649,7540,1713,7541,2597,3334,2990, # 4790
-7542,2947,2215,3194,2866,7543,4396,2498,2526, 181, 387,1075,3921, 731,2187,3335, # 4806
-7544,3265, 310, 313,3435,2299, 770,4134, 54,3034, 189,4397,3082,3769,3922,7545, # 4822
-1230,1617,1849, 355,3542,4135,4398,3336, 111,4136,3650,1350,3135,3436,3035,4137, # 4838
-2149,3266,3543,7546,2784,3923,3924,2991, 722,2008,7547,1071, 247,1207,2338,2471, # 4854
-1378,4399,2009, 864,1437,1214,4400, 373,3770,1142,2216, 667,4401, 442,2753,2555, # 4870
-3771,3925,1968,4138,3267,1839, 837, 170,1107, 934,1336,1882,7548,7549,2118,4139, # 4886
-2828, 743,1569,7550,4402,4140, 582,2384,1418,3437,7551,1802,7552, 357,1395,1729, # 4902
-3651,3268,2418,1564,2237,7553,3083,3772,1633,4403,1114,2085,4141,1532,7554, 482, # 4918
-2446,4404,7555,7556,1492, 833,1466,7557,2717,3544,1641,2829,7558,1526,1272,3652, # 4934
-4142,1686,1794, 416,2556,1902,1953,1803,7559,3773,2785,3774,1159,2316,7560,2867, # 4950
-4405,1610,1584,3036,2419,2754, 443,3269,1163,3136,7561,7562,3926,7563,4143,2499, # 4966
-3037,4406,3927,3137,2103,1647,3545,2010,1872,4144,7564,4145, 431,3438,7565, 250, # 4982
- 97, 81,4146,7566,1648,1850,1558, 160, 848,7567, 866, 740,1694,7568,2201,2830, # 4998
-3195,4147,4407,3653,1687, 950,2472, 426, 469,3196,3654,3655,3928,7569,7570,1188, # 5014
- 424,1995, 861,3546,4148,3775,2202,2685, 168,1235,3547,4149,7571,2086,1674,4408, # 5030
-3337,3270, 220,2557,1009,7572,3776, 670,2992, 332,1208, 717,7573,7574,3548,2447, # 5046
-3929,3338,7575, 513,7576,1209,2868,3339,3138,4409,1080,7577,7578,7579,7580,2527, # 5062
-3656,3549, 815,1587,3930,3931,7581,3550,3439,3777,1254,4410,1328,3038,1390,3932, # 5078
-1741,3933,3778,3934,7582, 236,3779,2448,3271,7583,7584,3657,3780,1273,3781,4411, # 5094
-7585, 308,7586,4412, 245,4413,1851,2473,1307,2575, 430, 715,2136,2449,7587, 270, # 5110
- 199,2869,3935,7588,3551,2718,1753, 761,1754, 725,1661,1840,4414,3440,3658,7589, # 5126
-7590, 587, 14,3272, 227,2598, 326, 480,2265, 943,2755,3552, 291, 650,1883,7591, # 5142
-1702,1226, 102,1547, 62,3441, 904,4415,3442,1164,4150,7592,7593,1224,1548,2756, # 5158
- 391, 498,1493,7594,1386,1419,7595,2055,1177,4416, 813, 880,1081,2363, 566,1145, # 5174
-4417,2286,1001,1035,2558,2599,2238, 394,1286,7596,7597,2068,7598, 86,1494,1730, # 5190
-3936, 491,1588, 745, 897,2948, 843,3340,3937,2757,2870,3273,1768, 998,2217,2069, # 5206
- 397,1826,1195,1969,3659,2993,3341, 284,7599,3782,2500,2137,2119,1903,7600,3938, # 5222
-2150,3939,4151,1036,3443,1904, 114,2559,4152, 209,1527,7601,7602,2949,2831,2625, # 5238
-2385,2719,3139, 812,2560,7603,3274,7604,1559, 737,1884,3660,1210, 885, 28,2686, # 5254
-3553,3783,7605,4153,1004,1779,4418,7606, 346,1981,2218,2687,4419,3784,1742, 797, # 5270
-1642,3940,1933,1072,1384,2151, 896,3941,3275,3661,3197,2871,3554,7607,2561,1958, # 5286
-4420,2450,1785,7608,7609,7610,3942,4154,1005,1308,3662,4155,2720,4421,4422,1528, # 5302
-2600, 161,1178,4156,1982, 987,4423,1101,4157, 631,3943,1157,3198,2420,1343,1241, # 5318
-1016,2239,2562, 372, 877,2339,2501,1160, 555,1934, 911,3944,7611, 466,1170, 169, # 5334
-1051,2907,2688,3663,2474,2994,1182,2011,2563,1251,2626,7612, 992,2340,3444,1540, # 5350
-2721,1201,2070,2401,1996,2475,7613,4424, 528,1922,2188,1503,1873,1570,2364,3342, # 5366
-3276,7614, 557,1073,7615,1827,3445,2087,2266,3140,3039,3084, 767,3085,2786,4425, # 5382
-1006,4158,4426,2341,1267,2176,3664,3199, 778,3945,3200,2722,1597,2657,7616,4427, # 5398
-7617,3446,7618,7619,7620,3277,2689,1433,3278, 131, 95,1504,3946, 723,4159,3141, # 5414
-1841,3555,2758,2189,3947,2027,2104,3665,7621,2995,3948,1218,7622,3343,3201,3949, # 5430
-4160,2576, 248,1634,3785, 912,7623,2832,3666,3040,3786, 654, 53,7624,2996,7625, # 5446
-1688,4428, 777,3447,1032,3950,1425,7626, 191, 820,2120,2833, 971,4429, 931,3202, # 5462
- 135, 664, 783,3787,1997, 772,2908,1935,3951,3788,4430,2909,3203, 282,2723, 640, # 5478
-1372,3448,1127, 922, 325,3344,7627,7628, 711,2044,7629,7630,3952,2219,2787,1936, # 5494
-3953,3345,2220,2251,3789,2300,7631,4431,3790,1258,3279,3954,3204,2138,2950,3955, # 5510
-3956,7632,2221, 258,3205,4432, 101,1227,7633,3280,1755,7634,1391,3281,7635,2910, # 5526
-2056, 893,7636,7637,7638,1402,4161,2342,7639,7640,3206,3556,7641,7642, 878,1325, # 5542
-1780,2788,4433, 259,1385,2577, 744,1183,2267,4434,7643,3957,2502,7644, 684,1024, # 5558
-4162,7645, 472,3557,3449,1165,3282,3958,3959, 322,2152, 881, 455,1695,1152,1340, # 5574
- 660, 554,2153,4435,1058,4436,4163, 830,1065,3346,3960,4437,1923,7646,1703,1918, # 5590
-7647, 932,2268, 122,7648,4438, 947, 677,7649,3791,2627, 297,1905,1924,2269,4439, # 5606
-2317,3283,7650,7651,4164,7652,4165, 84,4166, 112, 989,7653, 547,1059,3961, 701, # 5622
-3558,1019,7654,4167,7655,3450, 942, 639, 457,2301,2451, 993,2951, 407, 851, 494, # 5638
-4440,3347, 927,7656,1237,7657,2421,3348, 573,4168, 680, 921,2911,1279,1874, 285, # 5654
- 790,1448,1983, 719,2167,7658,7659,4441,3962,3963,1649,7660,1541, 563,7661,1077, # 5670
-7662,3349,3041,3451, 511,2997,3964,3965,3667,3966,1268,2564,3350,3207,4442,4443, # 5686
-7663, 535,1048,1276,1189,2912,2028,3142,1438,1373,2834,2952,1134,2012,7664,4169, # 5702
-1238,2578,3086,1259,7665, 700,7666,2953,3143,3668,4170,7667,4171,1146,1875,1906, # 5718
-4444,2601,3967, 781,2422, 132,1589, 203, 147, 273,2789,2402, 898,1786,2154,3968, # 5734
-3969,7668,3792,2790,7669,7670,4445,4446,7671,3208,7672,1635,3793, 965,7673,1804, # 5750
-2690,1516,3559,1121,1082,1329,3284,3970,1449,3794, 65,1128,2835,2913,2759,1590, # 5766
-3795,7674,7675, 12,2658, 45, 976,2579,3144,4447, 517,2528,1013,1037,3209,7676, # 5782
-3796,2836,7677,3797,7678,3452,7679,2602, 614,1998,2318,3798,3087,2724,2628,7680, # 5798
-2580,4172, 599,1269,7681,1810,3669,7682,2691,3088, 759,1060, 489,1805,3351,3285, # 5814
-1358,7683,7684,2386,1387,1215,2629,2252, 490,7685,7686,4173,1759,2387,2343,7687, # 5830
-4448,3799,1907,3971,2630,1806,3210,4449,3453,3286,2760,2344, 874,7688,7689,3454, # 5846
-3670,1858, 91,2914,3671,3042,3800,4450,7690,3145,3972,2659,7691,3455,1202,1403, # 5862
-3801,2954,2529,1517,2503,4451,3456,2504,7692,4452,7693,2692,1885,1495,1731,3973, # 5878
-2365,4453,7694,2029,7695,7696,3974,2693,1216, 237,2581,4174,2319,3975,3802,4454, # 5894
-4455,2694,3560,3457, 445,4456,7697,7698,7699,7700,2761, 61,3976,3672,1822,3977, # 5910
-7701, 687,2045, 935, 925, 405,2660, 703,1096,1859,2725,4457,3978,1876,1367,2695, # 5926
-3352, 918,2105,1781,2476, 334,3287,1611,1093,4458, 564,3146,3458,3673,3353, 945, # 5942
-2631,2057,4459,7702,1925, 872,4175,7703,3459,2696,3089, 349,4176,3674,3979,4460, # 5958
-3803,4177,3675,2155,3980,4461,4462,4178,4463,2403,2046, 782,3981, 400, 251,4179, # 5974
-1624,7704,7705, 277,3676, 299,1265, 476,1191,3804,2121,4180,4181,1109, 205,7706, # 5990
-2582,1000,2156,3561,1860,7707,7708,7709,4464,7710,4465,2565, 107,2477,2157,3982, # 6006
-3460,3147,7711,1533, 541,1301, 158, 753,4182,2872,3562,7712,1696, 370,1088,4183, # 6022
-4466,3563, 579, 327, 440, 162,2240, 269,1937,1374,3461, 968,3043, 56,1396,3090, # 6038
-2106,3288,3354,7713,1926,2158,4467,2998,7714,3564,7715,7716,3677,4468,2478,7717, # 6054
-2791,7718,1650,4469,7719,2603,7720,7721,3983,2661,3355,1149,3356,3984,3805,3985, # 6070
-7722,1076, 49,7723, 951,3211,3289,3290, 450,2837, 920,7724,1811,2792,2366,4184, # 6086
-1908,1138,2367,3806,3462,7725,3212,4470,1909,1147,1518,2423,4471,3807,7726,4472, # 6102
-2388,2604, 260,1795,3213,7727,7728,3808,3291, 708,7729,3565,1704,7730,3566,1351, # 6118
-1618,3357,2999,1886, 944,4185,3358,4186,3044,3359,4187,7731,3678, 422, 413,1714, # 6134
-3292, 500,2058,2345,4188,2479,7732,1344,1910, 954,7733,1668,7734,7735,3986,2404, # 6150
-4189,3567,3809,4190,7736,2302,1318,2505,3091, 133,3092,2873,4473, 629, 31,2838, # 6166
-2697,3810,4474, 850, 949,4475,3987,2955,1732,2088,4191,1496,1852,7737,3988, 620, # 6182
-3214, 981,1242,3679,3360,1619,3680,1643,3293,2139,2452,1970,1719,3463,2168,7738, # 6198
-3215,7739,7740,3361,1828,7741,1277,4476,1565,2047,7742,1636,3568,3093,7743, 869, # 6214
-2839, 655,3811,3812,3094,3989,3000,3813,1310,3569,4477,7744,7745,7746,1733, 558, # 6230
-4478,3681, 335,1549,3045,1756,4192,3682,1945,3464,1829,1291,1192, 470,2726,2107, # 6246
-2793, 913,1054,3990,7747,1027,7748,3046,3991,4479, 982,2662,3362,3148,3465,3216, # 6262
-3217,1946,2794,7749, 571,4480,7750,1830,7751,3570,2583,1523,2424,7752,2089, 984, # 6278
-4481,3683,1959,7753,3684, 852, 923,2795,3466,3685, 969,1519, 999,2048,2320,1705, # 6294
-7754,3095, 615,1662, 151, 597,3992,2405,2321,1049, 275,4482,3686,4193, 568,3687, # 6310
-3571,2480,4194,3688,7755,2425,2270, 409,3218,7756,1566,2874,3467,1002, 769,2840, # 6326
- 194,2090,3149,3689,2222,3294,4195, 628,1505,7757,7758,1763,2177,3001,3993, 521, # 6342
-1161,2584,1787,2203,2406,4483,3994,1625,4196,4197, 412, 42,3096, 464,7759,2632, # 6358
-4484,3363,1760,1571,2875,3468,2530,1219,2204,3814,2633,2140,2368,4485,4486,3295, # 6374
-1651,3364,3572,7760,7761,3573,2481,3469,7762,3690,7763,7764,2271,2091, 460,7765, # 6390
-4487,7766,3002, 962, 588,3574, 289,3219,2634,1116, 52,7767,3047,1796,7768,7769, # 6406
-7770,1467,7771,1598,1143,3691,4198,1984,1734,1067,4488,1280,3365, 465,4489,1572, # 6422
- 510,7772,1927,2241,1812,1644,3575,7773,4490,3692,7774,7775,2663,1573,1534,7776, # 6438
-7777,4199, 536,1807,1761,3470,3815,3150,2635,7778,7779,7780,4491,3471,2915,1911, # 6454
-2796,7781,3296,1122, 377,3220,7782, 360,7783,7784,4200,1529, 551,7785,2059,3693, # 6470
-1769,2426,7786,2916,4201,3297,3097,2322,2108,2030,4492,1404, 136,1468,1479, 672, # 6486
-1171,3221,2303, 271,3151,7787,2762,7788,2049, 678,2727, 865,1947,4493,7789,2013, # 6502
-3995,2956,7790,2728,2223,1397,3048,3694,4494,4495,1735,2917,3366,3576,7791,3816, # 6518
- 509,2841,2453,2876,3817,7792,7793,3152,3153,4496,4202,2531,4497,2304,1166,1010, # 6534
- 552, 681,1887,7794,7795,2957,2958,3996,1287,1596,1861,3154, 358, 453, 736, 175, # 6550
- 478,1117, 905,1167,1097,7796,1853,1530,7797,1706,7798,2178,3472,2287,3695,3473, # 6566
-3577,4203,2092,4204,7799,3367,1193,2482,4205,1458,2190,2205,1862,1888,1421,3298, # 6582
-2918,3049,2179,3474, 595,2122,7800,3997,7801,7802,4206,1707,2636, 223,3696,1359, # 6598
- 751,3098, 183,3475,7803,2797,3003, 419,2369, 633, 704,3818,2389, 241,7804,7805, # 6614
-7806, 838,3004,3697,2272,2763,2454,3819,1938,2050,3998,1309,3099,2242,1181,7807, # 6630
-1136,2206,3820,2370,1446,4207,2305,4498,7808,7809,4208,1055,2605, 484,3698,7810, # 6646
-3999, 625,4209,2273,3368,1499,4210,4000,7811,4001,4211,3222,2274,2275,3476,7812, # 6662
-7813,2764, 808,2606,3699,3369,4002,4212,3100,2532, 526,3370,3821,4213, 955,7814, # 6678
-1620,4214,2637,2427,7815,1429,3700,1669,1831, 994, 928,7816,3578,1260,7817,7818, # 6694
-7819,1948,2288, 741,2919,1626,4215,2729,2455, 867,1184, 362,3371,1392,7820,7821, # 6710
-4003,4216,1770,1736,3223,2920,4499,4500,1928,2698,1459,1158,7822,3050,3372,2877, # 6726
-1292,1929,2506,2842,3701,1985,1187,2071,2014,2607,4217,7823,2566,2507,2169,3702, # 6742
-2483,3299,7824,3703,4501,7825,7826, 666,1003,3005,1022,3579,4218,7827,4502,1813, # 6758
-2253, 574,3822,1603, 295,1535, 705,3823,4219, 283, 858, 417,7828,7829,3224,4503, # 6774
-4504,3051,1220,1889,1046,2276,2456,4004,1393,1599, 689,2567, 388,4220,7830,2484, # 6790
- 802,7831,2798,3824,2060,1405,2254,7832,4505,3825,2109,1052,1345,3225,1585,7833, # 6806
- 809,7834,7835,7836, 575,2730,3477, 956,1552,1469,1144,2323,7837,2324,1560,2457, # 6822
-3580,3226,4005, 616,2207,3155,2180,2289,7838,1832,7839,3478,4506,7840,1319,3704, # 6838
-3705,1211,3581,1023,3227,1293,2799,7841,7842,7843,3826, 607,2306,3827, 762,2878, # 6854
-1439,4221,1360,7844,1485,3052,7845,4507,1038,4222,1450,2061,2638,4223,1379,4508, # 6870
-2585,7846,7847,4224,1352,1414,2325,2921,1172,7848,7849,3828,3829,7850,1797,1451, # 6886
-7851,7852,7853,7854,2922,4006,4007,2485,2346, 411,4008,4009,3582,3300,3101,4509, # 6902
-1561,2664,1452,4010,1375,7855,7856, 47,2959, 316,7857,1406,1591,2923,3156,7858, # 6918
-1025,2141,3102,3157, 354,2731, 884,2224,4225,2407, 508,3706, 726,3583, 996,2428, # 6934
-3584, 729,7859, 392,2191,1453,4011,4510,3707,7860,7861,2458,3585,2608,1675,2800, # 6950
- 919,2347,2960,2348,1270,4511,4012, 73,7862,7863, 647,7864,3228,2843,2255,1550, # 6966
-1346,3006,7865,1332, 883,3479,7866,7867,7868,7869,3301,2765,7870,1212, 831,1347, # 6982
-4226,4512,2326,3830,1863,3053, 720,3831,4513,4514,3832,7871,4227,7872,7873,4515, # 6998
-7874,7875,1798,4516,3708,2609,4517,3586,1645,2371,7876,7877,2924, 669,2208,2665, # 7014
-2429,7878,2879,7879,7880,1028,3229,7881,4228,2408,7882,2256,1353,7883,7884,4518, # 7030
-3158, 518,7885,4013,7886,4229,1960,7887,2142,4230,7888,7889,3007,2349,2350,3833, # 7046
- 516,1833,1454,4014,2699,4231,4519,2225,2610,1971,1129,3587,7890,2766,7891,2961, # 7062
-1422, 577,1470,3008,1524,3373,7892,7893, 432,4232,3054,3480,7894,2586,1455,2508, # 7078
-2226,1972,1175,7895,1020,2732,4015,3481,4520,7896,2733,7897,1743,1361,3055,3482, # 7094
-2639,4016,4233,4521,2290, 895, 924,4234,2170, 331,2243,3056, 166,1627,3057,1098, # 7110
-7898,1232,2880,2227,3374,4522, 657, 403,1196,2372, 542,3709,3375,1600,4235,3483, # 7126
-7899,4523,2767,3230, 576, 530,1362,7900,4524,2533,2666,3710,4017,7901, 842,3834, # 7142
-7902,2801,2031,1014,4018, 213,2700,3376, 665, 621,4236,7903,3711,2925,2430,7904, # 7158
-2431,3302,3588,3377,7905,4237,2534,4238,4525,3589,1682,4239,3484,1380,7906, 724, # 7174
-2277, 600,1670,7907,1337,1233,4526,3103,2244,7908,1621,4527,7909, 651,4240,7910, # 7190
-1612,4241,2611,7911,2844,7912,2734,2307,3058,7913, 716,2459,3059, 174,1255,2701, # 7206
-4019,3590, 548,1320,1398, 728,4020,1574,7914,1890,1197,3060,4021,7915,3061,3062, # 7222
-3712,3591,3713, 747,7916, 635,4242,4528,7917,7918,7919,4243,7920,7921,4529,7922, # 7238
-3378,4530,2432, 451,7923,3714,2535,2072,4244,2735,4245,4022,7924,1764,4531,7925, # 7254
-4246, 350,7926,2278,2390,2486,7927,4247,4023,2245,1434,4024, 488,4532, 458,4248, # 7270
-4025,3715, 771,1330,2391,3835,2568,3159,2159,2409,1553,2667,3160,4249,7928,2487, # 7286
-2881,2612,1720,2702,4250,3379,4533,7929,2536,4251,7930,3231,4252,2768,7931,2015, # 7302
-2736,7932,1155,1017,3716,3836,7933,3303,2308, 201,1864,4253,1430,7934,4026,7935, # 7318
-7936,7937,7938,7939,4254,1604,7940, 414,1865, 371,2587,4534,4535,3485,2016,3104, # 7334
-4536,1708, 960,4255, 887, 389,2171,1536,1663,1721,7941,2228,4027,2351,2926,1580, # 7350
-7942,7943,7944,1744,7945,2537,4537,4538,7946,4539,7947,2073,7948,7949,3592,3380, # 7366
-2882,4256,7950,4257,2640,3381,2802, 673,2703,2460, 709,3486,4028,3593,4258,7951, # 7382
-1148, 502, 634,7952,7953,1204,4540,3594,1575,4541,2613,3717,7954,3718,3105, 948, # 7398
-3232, 121,1745,3837,1110,7955,4259,3063,2509,3009,4029,3719,1151,1771,3838,1488, # 7414
-4030,1986,7956,2433,3487,7957,7958,2093,7959,4260,3839,1213,1407,2803, 531,2737, # 7430
-2538,3233,1011,1537,7960,2769,4261,3106,1061,7961,3720,3721,1866,2883,7962,2017, # 7446
- 120,4262,4263,2062,3595,3234,2309,3840,2668,3382,1954,4542,7963,7964,3488,1047, # 7462
-2704,1266,7965,1368,4543,2845, 649,3383,3841,2539,2738,1102,2846,2669,7966,7967, # 7478
-1999,7968,1111,3596,2962,7969,2488,3842,3597,2804,1854,3384,3722,7970,7971,3385, # 7494
-2410,2884,3304,3235,3598,7972,2569,7973,3599,2805,4031,1460, 856,7974,3600,7975, # 7510
-2885,2963,7976,2886,3843,7977,4264, 632,2510, 875,3844,1697,3845,2291,7978,7979, # 7526
-4544,3010,1239, 580,4545,4265,7980, 914, 936,2074,1190,4032,1039,2123,7981,7982, # 7542
-7983,3386,1473,7984,1354,4266,3846,7985,2172,3064,4033, 915,3305,4267,4268,3306, # 7558
-1605,1834,7986,2739, 398,3601,4269,3847,4034, 328,1912,2847,4035,3848,1331,4270, # 7574
-3011, 937,4271,7987,3602,4036,4037,3387,2160,4546,3388, 524, 742, 538,3065,1012, # 7590
-7988,7989,3849,2461,7990, 658,1103, 225,3850,7991,7992,4547,7993,4548,7994,3236, # 7606
-1243,7995,4038, 963,2246,4549,7996,2705,3603,3161,7997,7998,2588,2327,7999,4550, # 7622
-8000,8001,8002,3489,3307, 957,3389,2540,2032,1930,2927,2462, 870,2018,3604,1746, # 7638
-2770,2771,2434,2463,8003,3851,8004,3723,3107,3724,3490,3390,3725,8005,1179,3066, # 7654
-8006,3162,2373,4272,3726,2541,3163,3108,2740,4039,8007,3391,1556,2542,2292, 977, # 7670
-2887,2033,4040,1205,3392,8008,1765,3393,3164,2124,1271,1689, 714,4551,3491,8009, # 7686
-2328,3852, 533,4273,3605,2181, 617,8010,2464,3308,3492,2310,8011,8012,3165,8013, # 7702
-8014,3853,1987, 618, 427,2641,3493,3394,8015,8016,1244,1690,8017,2806,4274,4552, # 7718
-8018,3494,8019,8020,2279,1576, 473,3606,4275,3395, 972,8021,3607,8022,3067,8023, # 7734
-8024,4553,4554,8025,3727,4041,4042,8026, 153,4555, 356,8027,1891,2888,4276,2143, # 7750
- 408, 803,2352,8028,3854,8029,4277,1646,2570,2511,4556,4557,3855,8030,3856,4278, # 7766
-8031,2411,3396, 752,8032,8033,1961,2964,8034, 746,3012,2465,8035,4279,3728, 698, # 7782
-4558,1892,4280,3608,2543,4559,3609,3857,8036,3166,3397,8037,1823,1302,4043,2706, # 7798
-3858,1973,4281,8038,4282,3167, 823,1303,1288,1236,2848,3495,4044,3398, 774,3859, # 7814
-8039,1581,4560,1304,2849,3860,4561,8040,2435,2161,1083,3237,4283,4045,4284, 344, # 7830
-1173, 288,2311, 454,1683,8041,8042,1461,4562,4046,2589,8043,8044,4563, 985, 894, # 7846
-8045,3399,3168,8046,1913,2928,3729,1988,8047,2110,1974,8048,4047,8049,2571,1194, # 7862
- 425,8050,4564,3169,1245,3730,4285,8051,8052,2850,8053, 636,4565,1855,3861, 760, # 7878
-1799,8054,4286,2209,1508,4566,4048,1893,1684,2293,8055,8056,8057,4287,4288,2210, # 7894
- 479,8058,8059, 832,8060,4049,2489,8061,2965,2490,3731, 990,3109, 627,1814,2642, # 7910
-4289,1582,4290,2125,2111,3496,4567,8062, 799,4291,3170,8063,4568,2112,1737,3013, # 7926
-1018, 543, 754,4292,3309,1676,4569,4570,4050,8064,1489,8065,3497,8066,2614,2889, # 7942
-4051,8067,8068,2966,8069,8070,8071,8072,3171,4571,4572,2182,1722,8073,3238,3239, # 7958
-1842,3610,1715, 481, 365,1975,1856,8074,8075,1962,2491,4573,8076,2126,3611,3240, # 7974
- 433,1894,2063,2075,8077, 602,2741,8078,8079,8080,8081,8082,3014,1628,3400,8083, # 7990
-3172,4574,4052,2890,4575,2512,8084,2544,2772,8085,8086,8087,3310,4576,2891,8088, # 8006
-4577,8089,2851,4578,4579,1221,2967,4053,2513,8090,8091,8092,1867,1989,8093,8094, # 8022
-8095,1895,8096,8097,4580,1896,4054, 318,8098,2094,4055,4293,8099,8100, 485,8101, # 8038
- 938,3862, 553,2670, 116,8102,3863,3612,8103,3498,2671,2773,3401,3311,2807,8104, # 8054
-3613,2929,4056,1747,2930,2968,8105,8106, 207,8107,8108,2672,4581,2514,8109,3015, # 8070
- 890,3614,3864,8110,1877,3732,3402,8111,2183,2353,3403,1652,8112,8113,8114, 941, # 8086
-2294, 208,3499,4057,2019, 330,4294,3865,2892,2492,3733,4295,8115,8116,8117,8118, # 8102
-)
-
diff --git a/lib/chardet/euctwprober.py b/lib/chardet/euctwprober.py
deleted file mode 100644
index 35669cc4dd..0000000000
--- a/lib/chardet/euctwprober.py
+++ /dev/null
@@ -1,46 +0,0 @@
-######################## BEGIN LICENSE BLOCK ########################
-# The Original Code is mozilla.org code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Mark Pilgrim - port to Python
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301 USA
-######################### END LICENSE BLOCK #########################
-
-from .mbcharsetprober import MultiByteCharSetProber
-from .codingstatemachine import CodingStateMachine
-from .chardistribution import EUCTWDistributionAnalysis
-from .mbcssm import EUCTW_SM_MODEL
-
-class EUCTWProber(MultiByteCharSetProber):
- def __init__(self):
- super(EUCTWProber, self).__init__()
- self.coding_sm = CodingStateMachine(EUCTW_SM_MODEL)
- self.distribution_analyzer = EUCTWDistributionAnalysis()
- self.reset()
-
- @property
- def charset_name(self):
- return "EUC-TW"
-
- @property
- def language(self):
- return "Taiwan"
diff --git a/lib/chardet/gb2312freq.py b/lib/chardet/gb2312freq.py
deleted file mode 100644
index 697837bd9a..0000000000
--- a/lib/chardet/gb2312freq.py
+++ /dev/null
@@ -1,283 +0,0 @@
-######################## BEGIN LICENSE BLOCK ########################
-# The Original Code is Mozilla Communicator client code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Mark Pilgrim - port to Python
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301 USA
-######################### END LICENSE BLOCK #########################
-
-# GB2312 most frequently used character table
-#
-# Char to FreqOrder table , from hz6763
-
-# 512 --> 0.79 -- 0.79
-# 1024 --> 0.92 -- 0.13
-# 2048 --> 0.98 -- 0.06
-# 6768 --> 1.00 -- 0.02
-#
-# Ideal Distribution Ratio = 0.79135/(1-0.79135) = 3.79
-# Random Distribution Ration = 512 / (3755 - 512) = 0.157
-#
-# Typical Distribution Ratio about 25% of Ideal one, still much higher that RDR
-
-GB2312_TYPICAL_DISTRIBUTION_RATIO = 0.9
-
-GB2312_TABLE_SIZE = 3760
-
-GB2312_CHAR_TO_FREQ_ORDER = (
-1671, 749,1443,2364,3924,3807,2330,3921,1704,3463,2691,1511,1515, 572,3191,2205,
-2361, 224,2558, 479,1711, 963,3162, 440,4060,1905,2966,2947,3580,2647,3961,3842,
-2204, 869,4207, 970,2678,5626,2944,2956,1479,4048, 514,3595, 588,1346,2820,3409,
- 249,4088,1746,1873,2047,1774, 581,1813, 358,1174,3590,1014,1561,4844,2245, 670,
-1636,3112, 889,1286, 953, 556,2327,3060,1290,3141, 613, 185,3477,1367, 850,3820,
-1715,2428,2642,2303,2732,3041,2562,2648,3566,3946,1349, 388,3098,2091,1360,3585,
- 152,1687,1539, 738,1559, 59,1232,2925,2267,1388,1249,1741,1679,2960, 151,1566,
-1125,1352,4271, 924,4296, 385,3166,4459, 310,1245,2850, 70,3285,2729,3534,3575,
-2398,3298,3466,1960,2265, 217,3647, 864,1909,2084,4401,2773,1010,3269,5152, 853,
-3051,3121,1244,4251,1895, 364,1499,1540,2313,1180,3655,2268, 562, 715,2417,3061,
- 544, 336,3768,2380,1752,4075, 950, 280,2425,4382, 183,2759,3272, 333,4297,2155,
-1688,2356,1444,1039,4540, 736,1177,3349,2443,2368,2144,2225, 565, 196,1482,3406,
- 927,1335,4147, 692, 878,1311,1653,3911,3622,1378,4200,1840,2969,3149,2126,1816,
-2534,1546,2393,2760, 737,2494, 13, 447, 245,2747, 38,2765,2129,2589,1079, 606,
- 360, 471,3755,2890, 404, 848, 699,1785,1236, 370,2221,1023,3746,2074,2026,2023,
-2388,1581,2119, 812,1141,3091,2536,1519, 804,2053, 406,1596,1090, 784, 548,4414,
-1806,2264,2936,1100, 343,4114,5096, 622,3358, 743,3668,1510,1626,5020,3567,2513,
-3195,4115,5627,2489,2991, 24,2065,2697,1087,2719, 48,1634, 315, 68, 985,2052,
- 198,2239,1347,1107,1439, 597,2366,2172, 871,3307, 919,2487,2790,1867, 236,2570,
-1413,3794, 906,3365,3381,1701,1982,1818,1524,2924,1205, 616,2586,2072,2004, 575,
- 253,3099, 32,1365,1182, 197,1714,2454,1201, 554,3388,3224,2748, 756,2587, 250,
-2567,1507,1517,3529,1922,2761,2337,3416,1961,1677,2452,2238,3153, 615, 911,1506,
-1474,2495,1265,1906,2749,3756,3280,2161, 898,2714,1759,3450,2243,2444, 563, 26,
-3286,2266,3769,3344,2707,3677, 611,1402, 531,1028,2871,4548,1375, 261,2948, 835,
-1190,4134, 353, 840,2684,1900,3082,1435,2109,1207,1674, 329,1872,2781,4055,2686,
-2104, 608,3318,2423,2957,2768,1108,3739,3512,3271,3985,2203,1771,3520,1418,2054,
-1681,1153, 225,1627,2929, 162,2050,2511,3687,1954, 124,1859,2431,1684,3032,2894,
- 585,4805,3969,2869,2704,2088,2032,2095,3656,2635,4362,2209, 256, 518,2042,2105,
-3777,3657, 643,2298,1148,1779, 190, 989,3544, 414, 11,2135,2063,2979,1471, 403,
-3678, 126, 770,1563, 671,2499,3216,2877, 600,1179, 307,2805,4937,1268,1297,2694,
- 252,4032,1448,1494,1331,1394, 127,2256, 222,1647,1035,1481,3056,1915,1048, 873,
-3651, 210, 33,1608,2516, 200,1520, 415, 102, 0,3389,1287, 817, 91,3299,2940,
- 836,1814, 549,2197,1396,1669,2987,3582,2297,2848,4528,1070, 687, 20,1819, 121,
-1552,1364,1461,1968,2617,3540,2824,2083, 177, 948,4938,2291, 110,4549,2066, 648,
-3359,1755,2110,2114,4642,4845,1693,3937,3308,1257,1869,2123, 208,1804,3159,2992,
-2531,2549,3361,2418,1350,2347,2800,2568,1291,2036,2680, 72, 842,1990, 212,1233,
-1154,1586, 75,2027,3410,4900,1823,1337,2710,2676, 728,2810,1522,3026,4995, 157,
- 755,1050,4022, 710, 785,1936,2194,2085,1406,2777,2400, 150,1250,4049,1206, 807,
-1910, 534, 529,3309,1721,1660, 274, 39,2827, 661,2670,1578, 925,3248,3815,1094,
-4278,4901,4252, 41,1150,3747,2572,2227,4501,3658,4902,3813,3357,3617,2884,2258,
- 887, 538,4187,3199,1294,2439,3042,2329,2343,2497,1255, 107, 543,1527, 521,3478,
-3568, 194,5062, 15, 961,3870,1241,1192,2664, 66,5215,3260,2111,1295,1127,2152,
-3805,4135, 901,1164,1976, 398,1278, 530,1460, 748, 904,1054,1966,1426, 53,2909,
- 509, 523,2279,1534, 536,1019, 239,1685, 460,2353, 673,1065,2401,3600,4298,2272,
-1272,2363, 284,1753,3679,4064,1695, 81, 815,2677,2757,2731,1386, 859, 500,4221,
-2190,2566, 757,1006,2519,2068,1166,1455, 337,2654,3203,1863,1682,1914,3025,1252,
-1409,1366, 847, 714,2834,2038,3209, 964,2970,1901, 885,2553,1078,1756,3049, 301,
-1572,3326, 688,2130,1996,2429,1805,1648,2930,3421,2750,3652,3088, 262,1158,1254,
- 389,1641,1812, 526,1719, 923,2073,1073,1902, 468, 489,4625,1140, 857,2375,3070,
-3319,2863, 380, 116,1328,2693,1161,2244, 273,1212,1884,2769,3011,1775,1142, 461,
-3066,1200,2147,2212, 790, 702,2695,4222,1601,1058, 434,2338,5153,3640, 67,2360,
-4099,2502, 618,3472,1329, 416,1132, 830,2782,1807,2653,3211,3510,1662, 192,2124,
- 296,3979,1739,1611,3684, 23, 118, 324, 446,1239,1225, 293,2520,3814,3795,2535,
-3116, 17,1074, 467,2692,2201, 387,2922, 45,1326,3055,1645,3659,2817, 958, 243,
-1903,2320,1339,2825,1784,3289, 356, 576, 865,2315,2381,3377,3916,1088,3122,1713,
-1655, 935, 628,4689,1034,1327, 441, 800, 720, 894,1979,2183,1528,5289,2702,1071,
-4046,3572,2399,1571,3281, 79, 761,1103, 327, 134, 758,1899,1371,1615, 879, 442,
- 215,2605,2579, 173,2048,2485,1057,2975,3317,1097,2253,3801,4263,1403,1650,2946,
- 814,4968,3487,1548,2644,1567,1285, 2, 295,2636, 97, 946,3576, 832, 141,4257,
-3273, 760,3821,3521,3156,2607, 949,1024,1733,1516,1803,1920,2125,2283,2665,3180,
-1501,2064,3560,2171,1592, 803,3518,1416, 732,3897,4258,1363,1362,2458, 119,1427,
- 602,1525,2608,1605,1639,3175, 694,3064, 10, 465, 76,2000,4846,4208, 444,3781,
-1619,3353,2206,1273,3796, 740,2483, 320,1723,2377,3660,2619,1359,1137,1762,1724,
-2345,2842,1850,1862, 912, 821,1866, 612,2625,1735,2573,3369,1093, 844, 89, 937,
- 930,1424,3564,2413,2972,1004,3046,3019,2011, 711,3171,1452,4178, 428, 801,1943,
- 432, 445,2811, 206,4136,1472, 730, 349, 73, 397,2802,2547, 998,1637,1167, 789,
- 396,3217, 154,1218, 716,1120,1780,2819,4826,1931,3334,3762,2139,1215,2627, 552,
-3664,3628,3232,1405,2383,3111,1356,2652,3577,3320,3101,1703, 640,1045,1370,1246,
-4996, 371,1575,2436,1621,2210, 984,4033,1734,2638, 16,4529, 663,2755,3255,1451,
-3917,2257,1253,1955,2234,1263,2951, 214,1229, 617, 485, 359,1831,1969, 473,2310,
- 750,2058, 165, 80,2864,2419, 361,4344,2416,2479,1134, 796,3726,1266,2943, 860,
-2715, 938, 390,2734,1313,1384, 248, 202, 877,1064,2854, 522,3907, 279,1602, 297,
-2357, 395,3740, 137,2075, 944,4089,2584,1267,3802, 62,1533,2285, 178, 176, 780,
-2440, 201,3707, 590, 478,1560,4354,2117,1075, 30, 74,4643,4004,1635,1441,2745,
- 776,2596, 238,1077,1692,1912,2844, 605, 499,1742,3947, 241,3053, 980,1749, 936,
-2640,4511,2582, 515,1543,2162,5322,2892,2993, 890,2148,1924, 665,1827,3581,1032,
- 968,3163, 339,1044,1896, 270, 583,1791,1720,4367,1194,3488,3669, 43,2523,1657,
- 163,2167, 290,1209,1622,3378, 550, 634,2508,2510, 695,2634,2384,2512,1476,1414,
- 220,1469,2341,2138,2852,3183,2900,4939,2865,3502,1211,3680, 854,3227,1299,2976,
-3172, 186,2998,1459, 443,1067,3251,1495, 321,1932,3054, 909, 753,1410,1828, 436,
-2441,1119,1587,3164,2186,1258, 227, 231,1425,1890,3200,3942, 247, 959, 725,5254,
-2741, 577,2158,2079, 929, 120, 174, 838,2813, 591,1115, 417,2024, 40,3240,1536,
-1037, 291,4151,2354, 632,1298,2406,2500,3535,1825,1846,3451, 205,1171, 345,4238,
- 18,1163, 811, 685,2208,1217, 425,1312,1508,1175,4308,2552,1033, 587,1381,3059,
-2984,3482, 340,1316,4023,3972, 792,3176, 519, 777,4690, 918, 933,4130,2981,3741,
- 90,3360,2911,2200,5184,4550, 609,3079,2030, 272,3379,2736, 363,3881,1130,1447,
- 286, 779, 357,1169,3350,3137,1630,1220,2687,2391, 747,1277,3688,2618,2682,2601,
-1156,3196,5290,4034,3102,1689,3596,3128, 874, 219,2783, 798, 508,1843,2461, 269,
-1658,1776,1392,1913,2983,3287,2866,2159,2372, 829,4076, 46,4253,2873,1889,1894,
- 915,1834,1631,2181,2318, 298, 664,2818,3555,2735, 954,3228,3117, 527,3511,2173,
- 681,2712,3033,2247,2346,3467,1652, 155,2164,3382, 113,1994, 450, 899, 494, 994,
-1237,2958,1875,2336,1926,3727, 545,1577,1550, 633,3473, 204,1305,3072,2410,1956,
-2471, 707,2134, 841,2195,2196,2663,3843,1026,4940, 990,3252,4997, 368,1092, 437,
-3212,3258,1933,1829, 675,2977,2893, 412, 943,3723,4644,3294,3283,2230,2373,5154,
-2389,2241,2661,2323,1404,2524, 593, 787, 677,3008,1275,2059, 438,2709,2609,2240,
-2269,2246,1446, 36,1568,1373,3892,1574,2301,1456,3962, 693,2276,5216,2035,1143,
-2720,1919,1797,1811,2763,4137,2597,1830,1699,1488,1198,2090, 424,1694, 312,3634,
-3390,4179,3335,2252,1214, 561,1059,3243,2295,2561, 975,5155,2321,2751,3772, 472,
-1537,3282,3398,1047,2077,2348,2878,1323,3340,3076, 690,2906, 51, 369, 170,3541,
-1060,2187,2688,3670,2541,1083,1683, 928,3918, 459, 109,4427, 599,3744,4286, 143,
-2101,2730,2490, 82,1588,3036,2121, 281,1860, 477,4035,1238,2812,3020,2716,3312,
-1530,2188,2055,1317, 843, 636,1808,1173,3495, 649, 181,1002, 147,3641,1159,2414,
-3750,2289,2795, 813,3123,2610,1136,4368, 5,3391,4541,2174, 420, 429,1728, 754,
-1228,2115,2219, 347,2223,2733, 735,1518,3003,2355,3134,1764,3948,3329,1888,2424,
-1001,1234,1972,3321,3363,1672,1021,1450,1584, 226, 765, 655,2526,3404,3244,2302,
-3665, 731, 594,2184, 319,1576, 621, 658,2656,4299,2099,3864,1279,2071,2598,2739,
- 795,3086,3699,3908,1707,2352,2402,1382,3136,2475,1465,4847,3496,3865,1085,3004,
-2591,1084, 213,2287,1963,3565,2250, 822, 793,4574,3187,1772,1789,3050, 595,1484,
-1959,2770,1080,2650, 456, 422,2996, 940,3322,4328,4345,3092,2742, 965,2784, 739,
-4124, 952,1358,2498,2949,2565, 332,2698,2378, 660,2260,2473,4194,3856,2919, 535,
-1260,2651,1208,1428,1300,1949,1303,2942, 433,2455,2450,1251,1946, 614,1269, 641,
-1306,1810,2737,3078,2912, 564,2365,1419,1415,1497,4460,2367,2185,1379,3005,1307,
-3218,2175,1897,3063, 682,1157,4040,4005,1712,1160,1941,1399, 394, 402,2952,1573,
-1151,2986,2404, 862, 299,2033,1489,3006, 346, 171,2886,3401,1726,2932, 168,2533,
- 47,2507,1030,3735,1145,3370,1395,1318,1579,3609,4560,2857,4116,1457,2529,1965,
- 504,1036,2690,2988,2405, 745,5871, 849,2397,2056,3081, 863,2359,3857,2096, 99,
-1397,1769,2300,4428,1643,3455,1978,1757,3718,1440, 35,4879,3742,1296,4228,2280,
- 160,5063,1599,2013, 166, 520,3479,1646,3345,3012, 490,1937,1545,1264,2182,2505,
-1096,1188,1369,1436,2421,1667,2792,2460,1270,2122, 727,3167,2143, 806,1706,1012,
-1800,3037, 960,2218,1882, 805, 139,2456,1139,1521, 851,1052,3093,3089, 342,2039,
- 744,5097,1468,1502,1585,2087, 223, 939, 326,2140,2577, 892,2481,1623,4077, 982,
-3708, 135,2131, 87,2503,3114,2326,1106, 876,1616, 547,2997,2831,2093,3441,4530,
-4314, 9,3256,4229,4148, 659,1462,1986,1710,2046,2913,2231,4090,4880,5255,3392,
-3274,1368,3689,4645,1477, 705,3384,3635,1068,1529,2941,1458,3782,1509, 100,1656,
-2548, 718,2339, 408,1590,2780,3548,1838,4117,3719,1345,3530, 717,3442,2778,3220,
-2898,1892,4590,3614,3371,2043,1998,1224,3483, 891, 635, 584,2559,3355, 733,1766,
-1729,1172,3789,1891,2307, 781,2982,2271,1957,1580,5773,2633,2005,4195,3097,1535,
-3213,1189,1934,5693,3262, 586,3118,1324,1598, 517,1564,2217,1868,1893,4445,3728,
-2703,3139,1526,1787,1992,3882,2875,1549,1199,1056,2224,1904,2711,5098,4287, 338,
-1993,3129,3489,2689,1809,2815,1997, 957,1855,3898,2550,3275,3057,1105,1319, 627,
-1505,1911,1883,3526, 698,3629,3456,1833,1431, 746, 77,1261,2017,2296,1977,1885,
- 125,1334,1600, 525,1798,1109,2222,1470,1945, 559,2236,1186,3443,2476,1929,1411,
-2411,3135,1777,3372,2621,1841,1613,3229, 668,1430,1839,2643,2916, 195,1989,2671,
-2358,1387, 629,3205,2293,5256,4439, 123,1310, 888,1879,4300,3021,3605,1003,1162,
-3192,2910,2010, 140,2395,2859, 55,1082,2012,2901, 662, 419,2081,1438, 680,2774,
-4654,3912,1620,1731,1625,5035,4065,2328, 512,1344, 802,5443,2163,2311,2537, 524,
-3399, 98,1155,2103,1918,2606,3925,2816,1393,2465,1504,3773,2177,3963,1478,4346,
- 180,1113,4655,3461,2028,1698, 833,2696,1235,1322,1594,4408,3623,3013,3225,2040,
-3022, 541,2881, 607,3632,2029,1665,1219, 639,1385,1686,1099,2803,3231,1938,3188,
-2858, 427, 676,2772,1168,2025, 454,3253,2486,3556, 230,1950, 580, 791,1991,1280,
-1086,1974,2034, 630, 257,3338,2788,4903,1017, 86,4790, 966,2789,1995,1696,1131,
- 259,3095,4188,1308, 179,1463,5257, 289,4107,1248, 42,3413,1725,2288, 896,1947,
- 774,4474,4254, 604,3430,4264, 392,2514,2588, 452, 237,1408,3018, 988,4531,1970,
-3034,3310, 540,2370,1562,1288,2990, 502,4765,1147, 4,1853,2708, 207, 294,2814,
-4078,2902,2509, 684, 34,3105,3532,2551, 644, 709,2801,2344, 573,1727,3573,3557,
-2021,1081,3100,4315,2100,3681, 199,2263,1837,2385, 146,3484,1195,2776,3949, 997,
-1939,3973,1008,1091,1202,1962,1847,1149,4209,5444,1076, 493, 117,5400,2521, 972,
-1490,2934,1796,4542,2374,1512,2933,2657, 413,2888,1135,2762,2314,2156,1355,2369,
- 766,2007,2527,2170,3124,2491,2593,2632,4757,2437, 234,3125,3591,1898,1750,1376,
-1942,3468,3138, 570,2127,2145,3276,4131, 962, 132,1445,4196, 19, 941,3624,3480,
-3366,1973,1374,4461,3431,2629, 283,2415,2275, 808,2887,3620,2112,2563,1353,3610,
- 955,1089,3103,1053, 96, 88,4097, 823,3808,1583, 399, 292,4091,3313, 421,1128,
- 642,4006, 903,2539,1877,2082, 596, 29,4066,1790, 722,2157, 130, 995,1569, 769,
-1485, 464, 513,2213, 288,1923,1101,2453,4316, 133, 486,2445, 50, 625, 487,2207,
- 57, 423, 481,2962, 159,3729,1558, 491, 303, 482, 501, 240,2837, 112,3648,2392,
-1783, 362, 8,3433,3422, 610,2793,3277,1390,1284,1654, 21,3823, 734, 367, 623,
- 193, 287, 374,1009,1483, 816, 476, 313,2255,2340,1262,2150,2899,1146,2581, 782,
-2116,1659,2018,1880, 255,3586,3314,1110,2867,2137,2564, 986,2767,5185,2006, 650,
- 158, 926, 762, 881,3157,2717,2362,3587, 306,3690,3245,1542,3077,2427,1691,2478,
-2118,2985,3490,2438, 539,2305, 983, 129,1754, 355,4201,2386, 827,2923, 104,1773,
-2838,2771, 411,2905,3919, 376, 767, 122,1114, 828,2422,1817,3506, 266,3460,1007,
-1609,4998, 945,2612,4429,2274, 726,1247,1964,2914,2199,2070,4002,4108, 657,3323,
-1422, 579, 455,2764,4737,1222,2895,1670, 824,1223,1487,2525, 558, 861,3080, 598,
-2659,2515,1967, 752,2583,2376,2214,4180, 977, 704,2464,4999,2622,4109,1210,2961,
- 819,1541, 142,2284, 44, 418, 457,1126,3730,4347,4626,1644,1876,3671,1864, 302,
-1063,5694, 624, 723,1984,3745,1314,1676,2488,1610,1449,3558,3569,2166,2098, 409,
-1011,2325,3704,2306, 818,1732,1383,1824,1844,3757, 999,2705,3497,1216,1423,2683,
-2426,2954,2501,2726,2229,1475,2554,5064,1971,1794,1666,2014,1343, 783, 724, 191,
-2434,1354,2220,5065,1763,2752,2472,4152, 131, 175,2885,3434, 92,1466,4920,2616,
-3871,3872,3866, 128,1551,1632, 669,1854,3682,4691,4125,1230, 188,2973,3290,1302,
-1213, 560,3266, 917, 763,3909,3249,1760, 868,1958, 764,1782,2097, 145,2277,3774,
-4462, 64,1491,3062, 971,2132,3606,2442, 221,1226,1617, 218, 323,1185,3207,3147,
- 571, 619,1473,1005,1744,2281, 449,1887,2396,3685, 275, 375,3816,1743,3844,3731,
- 845,1983,2350,4210,1377, 773, 967,3499,3052,3743,2725,4007,1697,1022,3943,1464,
-3264,2855,2722,1952,1029,2839,2467, 84,4383,2215, 820,1391,2015,2448,3672, 377,
-1948,2168, 797,2545,3536,2578,2645, 94,2874,1678, 405,1259,3071, 771, 546,1315,
- 470,1243,3083, 895,2468, 981, 969,2037, 846,4181, 653,1276,2928, 14,2594, 557,
-3007,2474, 156, 902,1338,1740,2574, 537,2518, 973,2282,2216,2433,1928, 138,2903,
-1293,2631,1612, 646,3457, 839,2935, 111, 496,2191,2847, 589,3186, 149,3994,2060,
-4031,2641,4067,3145,1870, 37,3597,2136,1025,2051,3009,3383,3549,1121,1016,3261,
-1301, 251,2446,2599,2153, 872,3246, 637, 334,3705, 831, 884, 921,3065,3140,4092,
-2198,1944, 246,2964, 108,2045,1152,1921,2308,1031, 203,3173,4170,1907,3890, 810,
-1401,2003,1690, 506, 647,1242,2828,1761,1649,3208,2249,1589,3709,2931,5156,1708,
- 498, 666,2613, 834,3817,1231, 184,2851,1124, 883,3197,2261,3710,1765,1553,2658,
-1178,2639,2351, 93,1193, 942,2538,2141,4402, 235,1821, 870,1591,2192,1709,1871,
-3341,1618,4126,2595,2334, 603, 651, 69, 701, 268,2662,3411,2555,1380,1606, 503,
- 448, 254,2371,2646, 574,1187,2309,1770, 322,2235,1292,1801, 305, 566,1133, 229,
-2067,2057, 706, 167, 483,2002,2672,3295,1820,3561,3067, 316, 378,2746,3452,1112,
- 136,1981, 507,1651,2917,1117, 285,4591, 182,2580,3522,1304, 335,3303,1835,2504,
-1795,1792,2248, 674,1018,2106,2449,1857,2292,2845, 976,3047,1781,2600,2727,1389,
-1281, 52,3152, 153, 265,3950, 672,3485,3951,4463, 430,1183, 365, 278,2169, 27,
-1407,1336,2304, 209,1340,1730,2202,1852,2403,2883, 979,1737,1062, 631,2829,2542,
-3876,2592, 825,2086,2226,3048,3625, 352,1417,3724, 542, 991, 431,1351,3938,1861,
-2294, 826,1361,2927,3142,3503,1738, 463,2462,2723, 582,1916,1595,2808, 400,3845,
-3891,2868,3621,2254, 58,2492,1123, 910,2160,2614,1372,1603,1196,1072,3385,1700,
-3267,1980, 696, 480,2430, 920, 799,1570,2920,1951,2041,4047,2540,1321,4223,2469,
-3562,2228,1271,2602, 401,2833,3351,2575,5157, 907,2312,1256, 410, 263,3507,1582,
- 996, 678,1849,2316,1480, 908,3545,2237, 703,2322, 667,1826,2849,1531,2604,2999,
-2407,3146,2151,2630,1786,3711, 469,3542, 497,3899,2409, 858, 837,4446,3393,1274,
- 786, 620,1845,2001,3311, 484, 308,3367,1204,1815,3691,2332,1532,2557,1842,2020,
-2724,1927,2333,4440, 567, 22,1673,2728,4475,1987,1858,1144,1597, 101,1832,3601,
- 12, 974,3783,4391, 951,1412, 1,3720, 453,4608,4041, 528,1041,1027,3230,2628,
-1129, 875,1051,3291,1203,2262,1069,2860,2799,2149,2615,3278, 144,1758,3040, 31,
- 475,1680, 366,2685,3184, 311,1642,4008,2466,5036,1593,1493,2809, 216,1420,1668,
- 233, 304,2128,3284, 232,1429,1768,1040,2008,3407,2740,2967,2543, 242,2133, 778,
-1565,2022,2620, 505,2189,2756,1098,2273, 372,1614, 708, 553,2846,2094,2278, 169,
-3626,2835,4161, 228,2674,3165, 809,1454,1309, 466,1705,1095, 900,3423, 880,2667,
-3751,5258,2317,3109,2571,4317,2766,1503,1342, 866,4447,1118, 63,2076, 314,1881,
-1348,1061, 172, 978,3515,1747, 532, 511,3970, 6, 601, 905,2699,3300,1751, 276,
-1467,3725,2668, 65,4239,2544,2779,2556,1604, 578,2451,1802, 992,2331,2624,1320,
-3446, 713,1513,1013, 103,2786,2447,1661, 886,1702, 916, 654,3574,2031,1556, 751,
-2178,2821,2179,1498,1538,2176, 271, 914,2251,2080,1325, 638,1953,2937,3877,2432,
-2754, 95,3265,1716, 260,1227,4083, 775, 106,1357,3254, 426,1607, 555,2480, 772,
-1985, 244,2546, 474, 495,1046,2611,1851,2061, 71,2089,1675,2590, 742,3758,2843,
-3222,1433, 267,2180,2576,2826,2233,2092,3913,2435, 956,1745,3075, 856,2113,1116,
- 451, 3,1988,2896,1398, 993,2463,1878,2049,1341,2718,2721,2870,2108, 712,2904,
-4363,2753,2324, 277,2872,2349,2649, 384, 987, 435, 691,3000, 922, 164,3939, 652,
-1500,1184,4153,2482,3373,2165,4848,2335,3775,3508,3154,2806,2830,1554,2102,1664,
-2530,1434,2408, 893,1547,2623,3447,2832,2242,2532,3169,2856,3223,2078, 49,3770,
-3469, 462, 318, 656,2259,3250,3069, 679,1629,2758, 344,1138,1104,3120,1836,1283,
-3115,2154,1437,4448, 934, 759,1999, 794,2862,1038, 533,2560,1722,2342, 855,2626,
-1197,1663,4476,3127, 85,4240,2528, 25,1111,1181,3673, 407,3470,4561,2679,2713,
- 768,1925,2841,3986,1544,1165, 932, 373,1240,2146,1930,2673, 721,4766, 354,4333,
- 391,2963, 187, 61,3364,1442,1102, 330,1940,1767, 341,3809,4118, 393,2496,2062,
-2211, 105, 331, 300, 439, 913,1332, 626, 379,3304,1557, 328, 689,3952, 309,1555,
- 931, 317,2517,3027, 325, 569, 686,2107,3084, 60,1042,1333,2794, 264,3177,4014,
-1628, 258,3712, 7,4464,1176,1043,1778, 683, 114,1975, 78,1492, 383,1886, 510,
- 386, 645,5291,2891,2069,3305,4138,3867,2939,2603,2493,1935,1066,1848,3588,1015,
-1282,1289,4609, 697,1453,3044,2666,3611,1856,2412, 54, 719,1330, 568,3778,2459,
-1748, 788, 492, 551,1191,1000, 488,3394,3763, 282,1799, 348,2016,1523,3155,2390,
-1049, 382,2019,1788,1170, 729,2968,3523, 897,3926,2785,2938,3292, 350,2319,3238,
-1718,1717,2655,3453,3143,4465, 161,2889,2980,2009,1421, 56,1908,1640,2387,2232,
-1917,1874,2477,4921, 148, 83,3438, 592,4245,2882,1822,1055, 741, 115,1496,1624,
- 381,1638,4592,1020, 516,3214, 458, 947,4575,1432, 211,1514,2926,1865,2142, 189,
- 852,1221,1400,1486, 882,2299,4036, 351, 28,1122, 700,6479,6480,6481,6482,6483, #last 512
-)
-
diff --git a/lib/chardet/gb2312prober.py b/lib/chardet/gb2312prober.py
deleted file mode 100644
index 8446d2dd95..0000000000
--- a/lib/chardet/gb2312prober.py
+++ /dev/null
@@ -1,46 +0,0 @@
-######################## BEGIN LICENSE BLOCK ########################
-# The Original Code is mozilla.org code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Mark Pilgrim - port to Python
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301 USA
-######################### END LICENSE BLOCK #########################
-
-from .mbcharsetprober import MultiByteCharSetProber
-from .codingstatemachine import CodingStateMachine
-from .chardistribution import GB2312DistributionAnalysis
-from .mbcssm import GB2312_SM_MODEL
-
-class GB2312Prober(MultiByteCharSetProber):
- def __init__(self):
- super(GB2312Prober, self).__init__()
- self.coding_sm = CodingStateMachine(GB2312_SM_MODEL)
- self.distribution_analyzer = GB2312DistributionAnalysis()
- self.reset()
-
- @property
- def charset_name(self):
- return "GB2312"
-
- @property
- def language(self):
- return "Chinese"
diff --git a/lib/chardet/hebrewprober.py b/lib/chardet/hebrewprober.py
deleted file mode 100644
index b0e1bf4926..0000000000
--- a/lib/chardet/hebrewprober.py
+++ /dev/null
@@ -1,292 +0,0 @@
-######################## BEGIN LICENSE BLOCK ########################
-# The Original Code is Mozilla Universal charset detector code.
-#
-# The Initial Developer of the Original Code is
-# Shy Shalom
-# Portions created by the Initial Developer are Copyright (C) 2005
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Mark Pilgrim - port to Python
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301 USA
-######################### END LICENSE BLOCK #########################
-
-from .charsetprober import CharSetProber
-from .enums import ProbingState
-
-# This prober doesn't actually recognize a language or a charset.
-# It is a helper prober for the use of the Hebrew model probers
-
-### General ideas of the Hebrew charset recognition ###
-#
-# Four main charsets exist in Hebrew:
-# "ISO-8859-8" - Visual Hebrew
-# "windows-1255" - Logical Hebrew
-# "ISO-8859-8-I" - Logical Hebrew
-# "x-mac-hebrew" - ?? Logical Hebrew ??
-#
-# Both "ISO" charsets use a completely identical set of code points, whereas
-# "windows-1255" and "x-mac-hebrew" are two different proper supersets of
-# these code points. windows-1255 defines additional characters in the range
-# 0x80-0x9F as some misc punctuation marks as well as some Hebrew-specific
-# diacritics and additional 'Yiddish' ligature letters in the range 0xc0-0xd6.
-# x-mac-hebrew defines similar additional code points but with a different
-# mapping.
-#
-# As far as an average Hebrew text with no diacritics is concerned, all four
-# charsets are identical with respect to code points. Meaning that for the
-# main Hebrew alphabet, all four map the same values to all 27 Hebrew letters
-# (including final letters).
-#
-# The dominant difference between these charsets is their directionality.
-# "Visual" directionality means that the text is ordered as if the renderer is
-# not aware of a BIDI rendering algorithm. The renderer sees the text and
-# draws it from left to right. The text itself when ordered naturally is read
-# backwards. A buffer of Visual Hebrew generally looks like so:
-# "[last word of first line spelled backwards] [whole line ordered backwards
-# and spelled backwards] [first word of first line spelled backwards]
-# [end of line] [last word of second line] ... etc' "
-# adding punctuation marks, numbers and English text to visual text is
-# naturally also "visual" and from left to right.
-#
-# "Logical" directionality means the text is ordered "naturally" according to
-# the order it is read. It is the responsibility of the renderer to display
-# the text from right to left. A BIDI algorithm is used to place general
-# punctuation marks, numbers and English text in the text.
-#
-# Texts in x-mac-hebrew are almost impossible to find on the Internet. From
-# what little evidence I could find, it seems that its general directionality
-# is Logical.
-#
-# To sum up all of the above, the Hebrew probing mechanism knows about two
-# charsets:
-# Visual Hebrew - "ISO-8859-8" - backwards text - Words and sentences are
-# backwards while line order is natural. For charset recognition purposes
-# the line order is unimportant (In fact, for this implementation, even
-# word order is unimportant).
-# Logical Hebrew - "windows-1255" - normal, naturally ordered text.
-#
-# "ISO-8859-8-I" is a subset of windows-1255 and doesn't need to be
-# specifically identified.
-# "x-mac-hebrew" is also identified as windows-1255. A text in x-mac-hebrew
-# that contain special punctuation marks or diacritics is displayed with
-# some unconverted characters showing as question marks. This problem might
-# be corrected using another model prober for x-mac-hebrew. Due to the fact
-# that x-mac-hebrew texts are so rare, writing another model prober isn't
-# worth the effort and performance hit.
-#
-#### The Prober ####
-#
-# The prober is divided between two SBCharSetProbers and a HebrewProber,
-# all of which are managed, created, fed data, inquired and deleted by the
-# SBCSGroupProber. The two SBCharSetProbers identify that the text is in
-# fact some kind of Hebrew, Logical or Visual. The final decision about which
-# one is it is made by the HebrewProber by combining final-letter scores
-# with the scores of the two SBCharSetProbers to produce a final answer.
-#
-# The SBCSGroupProber is responsible for stripping the original text of HTML
-# tags, English characters, numbers, low-ASCII punctuation characters, spaces
-# and new lines. It reduces any sequence of such characters to a single space.
-# The buffer fed to each prober in the SBCS group prober is pure text in
-# high-ASCII.
-# The two SBCharSetProbers (model probers) share the same language model:
-# Win1255Model.
-# The first SBCharSetProber uses the model normally as any other
-# SBCharSetProber does, to recognize windows-1255, upon which this model was
-# built. The second SBCharSetProber is told to make the pair-of-letter
-# lookup in the language model backwards. This in practice exactly simulates
-# a visual Hebrew model using the windows-1255 logical Hebrew model.
-#
-# The HebrewProber is not using any language model. All it does is look for
-# final-letter evidence suggesting the text is either logical Hebrew or visual
-# Hebrew. Disjointed from the model probers, the results of the HebrewProber
-# alone are meaningless. HebrewProber always returns 0.00 as confidence
-# since it never identifies a charset by itself. Instead, the pointer to the
-# HebrewProber is passed to the model probers as a helper "Name Prober".
-# When the Group prober receives a positive identification from any prober,
-# it asks for the name of the charset identified. If the prober queried is a
-# Hebrew model prober, the model prober forwards the call to the
-# HebrewProber to make the final decision. In the HebrewProber, the
-# decision is made according to the final-letters scores maintained and Both
-# model probers scores. The answer is returned in the form of the name of the
-# charset identified, either "windows-1255" or "ISO-8859-8".
-
-class HebrewProber(CharSetProber):
- # windows-1255 / ISO-8859-8 code points of interest
- FINAL_KAF = 0xea
- NORMAL_KAF = 0xeb
- FINAL_MEM = 0xed
- NORMAL_MEM = 0xee
- FINAL_NUN = 0xef
- NORMAL_NUN = 0xf0
- FINAL_PE = 0xf3
- NORMAL_PE = 0xf4
- FINAL_TSADI = 0xf5
- NORMAL_TSADI = 0xf6
-
- # Minimum Visual vs Logical final letter score difference.
- # If the difference is below this, don't rely solely on the final letter score
- # distance.
- MIN_FINAL_CHAR_DISTANCE = 5
-
- # Minimum Visual vs Logical model score difference.
- # If the difference is below this, don't rely at all on the model score
- # distance.
- MIN_MODEL_DISTANCE = 0.01
-
- VISUAL_HEBREW_NAME = "ISO-8859-8"
- LOGICAL_HEBREW_NAME = "windows-1255"
-
- def __init__(self):
- super(HebrewProber, self).__init__()
- self._final_char_logical_score = None
- self._final_char_visual_score = None
- self._prev = None
- self._before_prev = None
- self._logical_prober = None
- self._visual_prober = None
- self.reset()
-
- def reset(self):
- self._final_char_logical_score = 0
- self._final_char_visual_score = 0
- # The two last characters seen in the previous buffer,
- # mPrev and mBeforePrev are initialized to space in order to simulate
- # a word delimiter at the beginning of the data
- self._prev = ' '
- self._before_prev = ' '
- # These probers are owned by the group prober.
-
- def set_model_probers(self, logicalProber, visualProber):
- self._logical_prober = logicalProber
- self._visual_prober = visualProber
-
- def is_final(self, c):
- return c in [self.FINAL_KAF, self.FINAL_MEM, self.FINAL_NUN,
- self.FINAL_PE, self.FINAL_TSADI]
-
- def is_non_final(self, c):
- # The normal Tsadi is not a good Non-Final letter due to words like
- # 'lechotet' (to chat) containing an apostrophe after the tsadi. This
- # apostrophe is converted to a space in FilterWithoutEnglishLetters
- # causing the Non-Final tsadi to appear at an end of a word even
- # though this is not the case in the original text.
- # The letters Pe and Kaf rarely display a related behavior of not being
- # a good Non-Final letter. Words like 'Pop', 'Winamp' and 'Mubarak'
- # for example legally end with a Non-Final Pe or Kaf. However, the
- # benefit of these letters as Non-Final letters outweighs the damage
- # since these words are quite rare.
- return c in [self.NORMAL_KAF, self.NORMAL_MEM,
- self.NORMAL_NUN, self.NORMAL_PE]
-
- def feed(self, byte_str):
- # Final letter analysis for logical-visual decision.
- # Look for evidence that the received buffer is either logical Hebrew
- # or visual Hebrew.
- # The following cases are checked:
- # 1) A word longer than 1 letter, ending with a final letter. This is
- # an indication that the text is laid out "naturally" since the
- # final letter really appears at the end. +1 for logical score.
- # 2) A word longer than 1 letter, ending with a Non-Final letter. In
- # normal Hebrew, words ending with Kaf, Mem, Nun, Pe or Tsadi,
- # should not end with the Non-Final form of that letter. Exceptions
- # to this rule are mentioned above in isNonFinal(). This is an
- # indication that the text is laid out backwards. +1 for visual
- # score
- # 3) A word longer than 1 letter, starting with a final letter. Final
- # letters should not appear at the beginning of a word. This is an
- # indication that the text is laid out backwards. +1 for visual
- # score.
- #
- # The visual score and logical score are accumulated throughout the
- # text and are finally checked against each other in GetCharSetName().
- # No checking for final letters in the middle of words is done since
- # that case is not an indication for either Logical or Visual text.
- #
- # We automatically filter out all 7-bit characters (replace them with
- # spaces) so the word boundary detection works properly. [MAP]
-
- if self.state == ProbingState.NOT_ME:
- # Both model probers say it's not them. No reason to continue.
- return ProbingState.NOT_ME
-
- byte_str = self.filter_high_byte_only(byte_str)
-
- for cur in byte_str:
- if cur == ' ':
- # We stand on a space - a word just ended
- if self._before_prev != ' ':
- # next-to-last char was not a space so self._prev is not a
- # 1 letter word
- if self.is_final(self._prev):
- # case (1) [-2:not space][-1:final letter][cur:space]
- self._final_char_logical_score += 1
- elif self.is_non_final(self._prev):
- # case (2) [-2:not space][-1:Non-Final letter][
- # cur:space]
- self._final_char_visual_score += 1
- else:
- # Not standing on a space
- if ((self._before_prev == ' ') and
- (self.is_final(self._prev)) and (cur != ' ')):
- # case (3) [-2:space][-1:final letter][cur:not space]
- self._final_char_visual_score += 1
- self._before_prev = self._prev
- self._prev = cur
-
- # Forever detecting, till the end or until both model probers return
- # ProbingState.NOT_ME (handled above)
- return ProbingState.DETECTING
-
- @property
- def charset_name(self):
- # Make the decision: is it Logical or Visual?
- # If the final letter score distance is dominant enough, rely on it.
- finalsub = self._final_char_logical_score - self._final_char_visual_score
- if finalsub >= self.MIN_FINAL_CHAR_DISTANCE:
- return self.LOGICAL_HEBREW_NAME
- if finalsub <= -self.MIN_FINAL_CHAR_DISTANCE:
- return self.VISUAL_HEBREW_NAME
-
- # It's not dominant enough, try to rely on the model scores instead.
- modelsub = (self._logical_prober.get_confidence()
- - self._visual_prober.get_confidence())
- if modelsub > self.MIN_MODEL_DISTANCE:
- return self.LOGICAL_HEBREW_NAME
- if modelsub < -self.MIN_MODEL_DISTANCE:
- return self.VISUAL_HEBREW_NAME
-
- # Still no good, back to final letter distance, maybe it'll save the
- # day.
- if finalsub < 0.0:
- return self.VISUAL_HEBREW_NAME
-
- # (finalsub > 0 - Logical) or (don't know what to do) default to
- # Logical.
- return self.LOGICAL_HEBREW_NAME
-
- @property
- def language(self):
- return 'Hebrew'
-
- @property
- def state(self):
- # Remain active as long as any of the model probers are active.
- if (self._logical_prober.state == ProbingState.NOT_ME) and \
- (self._visual_prober.state == ProbingState.NOT_ME):
- return ProbingState.NOT_ME
- return ProbingState.DETECTING
diff --git a/lib/chardet/jisfreq.py b/lib/chardet/jisfreq.py
deleted file mode 100644
index 83fc082b54..0000000000
--- a/lib/chardet/jisfreq.py
+++ /dev/null
@@ -1,325 +0,0 @@
-######################## BEGIN LICENSE BLOCK ########################
-# The Original Code is Mozilla Communicator client code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Mark Pilgrim - port to Python
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301 USA
-######################### END LICENSE BLOCK #########################
-
-# Sampling from about 20M text materials include literature and computer technology
-#
-# Japanese frequency table, applied to both S-JIS and EUC-JP
-# They are sorted in order.
-
-# 128 --> 0.77094
-# 256 --> 0.85710
-# 512 --> 0.92635
-# 1024 --> 0.97130
-# 2048 --> 0.99431
-#
-# Ideal Distribution Ratio = 0.92635 / (1-0.92635) = 12.58
-# Random Distribution Ration = 512 / (2965+62+83+86-512) = 0.191
-#
-# Typical Distribution Ratio, 25% of IDR
-
-JIS_TYPICAL_DISTRIBUTION_RATIO = 3.0
-
-# Char to FreqOrder table ,
-JIS_TABLE_SIZE = 4368
-
-JIS_CHAR_TO_FREQ_ORDER = (
- 40, 1, 6, 182, 152, 180, 295,2127, 285, 381,3295,4304,3068,4606,3165,3510, # 16
-3511,1822,2785,4607,1193,2226,5070,4608, 171,2996,1247, 18, 179,5071, 856,1661, # 32
-1262,5072, 619, 127,3431,3512,3230,1899,1700, 232, 228,1294,1298, 284, 283,2041, # 48
-2042,1061,1062, 48, 49, 44, 45, 433, 434,1040,1041, 996, 787,2997,1255,4305, # 64
-2108,4609,1684,1648,5073,5074,5075,5076,5077,5078,3687,5079,4610,5080,3927,3928, # 80
-5081,3296,3432, 290,2285,1471,2187,5082,2580,2825,1303,2140,1739,1445,2691,3375, # 96
-1691,3297,4306,4307,4611, 452,3376,1182,2713,3688,3069,4308,5083,5084,5085,5086, # 112
-5087,5088,5089,5090,5091,5092,5093,5094,5095,5096,5097,5098,5099,5100,5101,5102, # 128
-5103,5104,5105,5106,5107,5108,5109,5110,5111,5112,4097,5113,5114,5115,5116,5117, # 144
-5118,5119,5120,5121,5122,5123,5124,5125,5126,5127,5128,5129,5130,5131,5132,5133, # 160
-5134,5135,5136,5137,5138,5139,5140,5141,5142,5143,5144,5145,5146,5147,5148,5149, # 176
-5150,5151,5152,4612,5153,5154,5155,5156,5157,5158,5159,5160,5161,5162,5163,5164, # 192
-5165,5166,5167,5168,5169,5170,5171,5172,5173,5174,5175,1472, 598, 618, 820,1205, # 208
-1309,1412,1858,1307,1692,5176,5177,5178,5179,5180,5181,5182,1142,1452,1234,1172, # 224
-1875,2043,2149,1793,1382,2973, 925,2404,1067,1241, 960,1377,2935,1491, 919,1217, # 240
-1865,2030,1406,1499,2749,4098,5183,5184,5185,5186,5187,5188,2561,4099,3117,1804, # 256
-2049,3689,4309,3513,1663,5189,3166,3118,3298,1587,1561,3433,5190,3119,1625,2998, # 272
-3299,4613,1766,3690,2786,4614,5191,5192,5193,5194,2161, 26,3377, 2,3929, 20, # 288
-3691, 47,4100, 50, 17, 16, 35, 268, 27, 243, 42, 155, 24, 154, 29, 184, # 304
- 4, 91, 14, 92, 53, 396, 33, 289, 9, 37, 64, 620, 21, 39, 321, 5, # 320
- 12, 11, 52, 13, 3, 208, 138, 0, 7, 60, 526, 141, 151,1069, 181, 275, # 336
-1591, 83, 132,1475, 126, 331, 829, 15, 69, 160, 59, 22, 157, 55,1079, 312, # 352
- 109, 38, 23, 25, 10, 19, 79,5195, 61, 382,1124, 8, 30,5196,5197,5198, # 368
-5199,5200,5201,5202,5203,5204,5205,5206, 89, 62, 74, 34,2416, 112, 139, 196, # 384
- 271, 149, 84, 607, 131, 765, 46, 88, 153, 683, 76, 874, 101, 258, 57, 80, # 400
- 32, 364, 121,1508, 169,1547, 68, 235, 145,2999, 41, 360,3027, 70, 63, 31, # 416
- 43, 259, 262,1383, 99, 533, 194, 66, 93, 846, 217, 192, 56, 106, 58, 565, # 432
- 280, 272, 311, 256, 146, 82, 308, 71, 100, 128, 214, 655, 110, 261, 104,1140, # 448
- 54, 51, 36, 87, 67,3070, 185,2618,2936,2020, 28,1066,2390,2059,5207,5208, # 464
-5209,5210,5211,5212,5213,5214,5215,5216,4615,5217,5218,5219,5220,5221,5222,5223, # 480
-5224,5225,5226,5227,5228,5229,5230,5231,5232,5233,5234,5235,5236,3514,5237,5238, # 496
-5239,5240,5241,5242,5243,5244,2297,2031,4616,4310,3692,5245,3071,5246,3598,5247, # 512
-4617,3231,3515,5248,4101,4311,4618,3808,4312,4102,5249,4103,4104,3599,5250,5251, # 528
-5252,5253,5254,5255,5256,5257,5258,5259,5260,5261,5262,5263,5264,5265,5266,5267, # 544
-5268,5269,5270,5271,5272,5273,5274,5275,5276,5277,5278,5279,5280,5281,5282,5283, # 560
-5284,5285,5286,5287,5288,5289,5290,5291,5292,5293,5294,5295,5296,5297,5298,5299, # 576
-5300,5301,5302,5303,5304,5305,5306,5307,5308,5309,5310,5311,5312,5313,5314,5315, # 592
-5316,5317,5318,5319,5320,5321,5322,5323,5324,5325,5326,5327,5328,5329,5330,5331, # 608
-5332,5333,5334,5335,5336,5337,5338,5339,5340,5341,5342,5343,5344,5345,5346,5347, # 624
-5348,5349,5350,5351,5352,5353,5354,5355,5356,5357,5358,5359,5360,5361,5362,5363, # 640
-5364,5365,5366,5367,5368,5369,5370,5371,5372,5373,5374,5375,5376,5377,5378,5379, # 656
-5380,5381, 363, 642,2787,2878,2788,2789,2316,3232,2317,3434,2011, 165,1942,3930, # 672
-3931,3932,3933,5382,4619,5383,4620,5384,5385,5386,5387,5388,5389,5390,5391,5392, # 688
-5393,5394,5395,5396,5397,5398,5399,5400,5401,5402,5403,5404,5405,5406,5407,5408, # 704
-5409,5410,5411,5412,5413,5414,5415,5416,5417,5418,5419,5420,5421,5422,5423,5424, # 720
-5425,5426,5427,5428,5429,5430,5431,5432,5433,5434,5435,5436,5437,5438,5439,5440, # 736
-5441,5442,5443,5444,5445,5446,5447,5448,5449,5450,5451,5452,5453,5454,5455,5456, # 752
-5457,5458,5459,5460,5461,5462,5463,5464,5465,5466,5467,5468,5469,5470,5471,5472, # 768
-5473,5474,5475,5476,5477,5478,5479,5480,5481,5482,5483,5484,5485,5486,5487,5488, # 784
-5489,5490,5491,5492,5493,5494,5495,5496,5497,5498,5499,5500,5501,5502,5503,5504, # 800
-5505,5506,5507,5508,5509,5510,5511,5512,5513,5514,5515,5516,5517,5518,5519,5520, # 816
-5521,5522,5523,5524,5525,5526,5527,5528,5529,5530,5531,5532,5533,5534,5535,5536, # 832
-5537,5538,5539,5540,5541,5542,5543,5544,5545,5546,5547,5548,5549,5550,5551,5552, # 848
-5553,5554,5555,5556,5557,5558,5559,5560,5561,5562,5563,5564,5565,5566,5567,5568, # 864
-5569,5570,5571,5572,5573,5574,5575,5576,5577,5578,5579,5580,5581,5582,5583,5584, # 880
-5585,5586,5587,5588,5589,5590,5591,5592,5593,5594,5595,5596,5597,5598,5599,5600, # 896
-5601,5602,5603,5604,5605,5606,5607,5608,5609,5610,5611,5612,5613,5614,5615,5616, # 912
-5617,5618,5619,5620,5621,5622,5623,5624,5625,5626,5627,5628,5629,5630,5631,5632, # 928
-5633,5634,5635,5636,5637,5638,5639,5640,5641,5642,5643,5644,5645,5646,5647,5648, # 944
-5649,5650,5651,5652,5653,5654,5655,5656,5657,5658,5659,5660,5661,5662,5663,5664, # 960
-5665,5666,5667,5668,5669,5670,5671,5672,5673,5674,5675,5676,5677,5678,5679,5680, # 976
-5681,5682,5683,5684,5685,5686,5687,5688,5689,5690,5691,5692,5693,5694,5695,5696, # 992
-5697,5698,5699,5700,5701,5702,5703,5704,5705,5706,5707,5708,5709,5710,5711,5712, # 1008
-5713,5714,5715,5716,5717,5718,5719,5720,5721,5722,5723,5724,5725,5726,5727,5728, # 1024
-5729,5730,5731,5732,5733,5734,5735,5736,5737,5738,5739,5740,5741,5742,5743,5744, # 1040
-5745,5746,5747,5748,5749,5750,5751,5752,5753,5754,5755,5756,5757,5758,5759,5760, # 1056
-5761,5762,5763,5764,5765,5766,5767,5768,5769,5770,5771,5772,5773,5774,5775,5776, # 1072
-5777,5778,5779,5780,5781,5782,5783,5784,5785,5786,5787,5788,5789,5790,5791,5792, # 1088
-5793,5794,5795,5796,5797,5798,5799,5800,5801,5802,5803,5804,5805,5806,5807,5808, # 1104
-5809,5810,5811,5812,5813,5814,5815,5816,5817,5818,5819,5820,5821,5822,5823,5824, # 1120
-5825,5826,5827,5828,5829,5830,5831,5832,5833,5834,5835,5836,5837,5838,5839,5840, # 1136
-5841,5842,5843,5844,5845,5846,5847,5848,5849,5850,5851,5852,5853,5854,5855,5856, # 1152
-5857,5858,5859,5860,5861,5862,5863,5864,5865,5866,5867,5868,5869,5870,5871,5872, # 1168
-5873,5874,5875,5876,5877,5878,5879,5880,5881,5882,5883,5884,5885,5886,5887,5888, # 1184
-5889,5890,5891,5892,5893,5894,5895,5896,5897,5898,5899,5900,5901,5902,5903,5904, # 1200
-5905,5906,5907,5908,5909,5910,5911,5912,5913,5914,5915,5916,5917,5918,5919,5920, # 1216
-5921,5922,5923,5924,5925,5926,5927,5928,5929,5930,5931,5932,5933,5934,5935,5936, # 1232
-5937,5938,5939,5940,5941,5942,5943,5944,5945,5946,5947,5948,5949,5950,5951,5952, # 1248
-5953,5954,5955,5956,5957,5958,5959,5960,5961,5962,5963,5964,5965,5966,5967,5968, # 1264
-5969,5970,5971,5972,5973,5974,5975,5976,5977,5978,5979,5980,5981,5982,5983,5984, # 1280
-5985,5986,5987,5988,5989,5990,5991,5992,5993,5994,5995,5996,5997,5998,5999,6000, # 1296
-6001,6002,6003,6004,6005,6006,6007,6008,6009,6010,6011,6012,6013,6014,6015,6016, # 1312
-6017,6018,6019,6020,6021,6022,6023,6024,6025,6026,6027,6028,6029,6030,6031,6032, # 1328
-6033,6034,6035,6036,6037,6038,6039,6040,6041,6042,6043,6044,6045,6046,6047,6048, # 1344
-6049,6050,6051,6052,6053,6054,6055,6056,6057,6058,6059,6060,6061,6062,6063,6064, # 1360
-6065,6066,6067,6068,6069,6070,6071,6072,6073,6074,6075,6076,6077,6078,6079,6080, # 1376
-6081,6082,6083,6084,6085,6086,6087,6088,6089,6090,6091,6092,6093,6094,6095,6096, # 1392
-6097,6098,6099,6100,6101,6102,6103,6104,6105,6106,6107,6108,6109,6110,6111,6112, # 1408
-6113,6114,2044,2060,4621, 997,1235, 473,1186,4622, 920,3378,6115,6116, 379,1108, # 1424
-4313,2657,2735,3934,6117,3809, 636,3233, 573,1026,3693,3435,2974,3300,2298,4105, # 1440
- 854,2937,2463, 393,2581,2417, 539, 752,1280,2750,2480, 140,1161, 440, 708,1569, # 1456
- 665,2497,1746,1291,1523,3000, 164,1603, 847,1331, 537,1997, 486, 508,1693,2418, # 1472
-1970,2227, 878,1220, 299,1030, 969, 652,2751, 624,1137,3301,2619, 65,3302,2045, # 1488
-1761,1859,3120,1930,3694,3516, 663,1767, 852, 835,3695, 269, 767,2826,2339,1305, # 1504
- 896,1150, 770,1616,6118, 506,1502,2075,1012,2519, 775,2520,2975,2340,2938,4314, # 1520
-3028,2086,1224,1943,2286,6119,3072,4315,2240,1273,1987,3935,1557, 175, 597, 985, # 1536
-3517,2419,2521,1416,3029, 585, 938,1931,1007,1052,1932,1685,6120,3379,4316,4623, # 1552
- 804, 599,3121,1333,2128,2539,1159,1554,2032,3810, 687,2033,2904, 952, 675,1467, # 1568
-3436,6121,2241,1096,1786,2440,1543,1924, 980,1813,2228, 781,2692,1879, 728,1918, # 1584
-3696,4624, 548,1950,4625,1809,1088,1356,3303,2522,1944, 502, 972, 373, 513,2827, # 1600
- 586,2377,2391,1003,1976,1631,6122,2464,1084, 648,1776,4626,2141, 324, 962,2012, # 1616
-2177,2076,1384, 742,2178,1448,1173,1810, 222, 102, 301, 445, 125,2420, 662,2498, # 1632
- 277, 200,1476,1165,1068, 224,2562,1378,1446, 450,1880, 659, 791, 582,4627,2939, # 1648
-3936,1516,1274, 555,2099,3697,1020,1389,1526,3380,1762,1723,1787,2229, 412,2114, # 1664
-1900,2392,3518, 512,2597, 427,1925,2341,3122,1653,1686,2465,2499, 697, 330, 273, # 1680
- 380,2162, 951, 832, 780, 991,1301,3073, 965,2270,3519, 668,2523,2636,1286, 535, # 1696
-1407, 518, 671, 957,2658,2378, 267, 611,2197,3030,6123, 248,2299, 967,1799,2356, # 1712
- 850,1418,3437,1876,1256,1480,2828,1718,6124,6125,1755,1664,2405,6126,4628,2879, # 1728
-2829, 499,2179, 676,4629, 557,2329,2214,2090, 325,3234, 464, 811,3001, 992,2342, # 1744
-2481,1232,1469, 303,2242, 466,1070,2163, 603,1777,2091,4630,2752,4631,2714, 322, # 1760
-2659,1964,1768, 481,2188,1463,2330,2857,3600,2092,3031,2421,4632,2318,2070,1849, # 1776
-2598,4633,1302,2254,1668,1701,2422,3811,2905,3032,3123,2046,4106,1763,1694,4634, # 1792
-1604, 943,1724,1454, 917, 868,2215,1169,2940, 552,1145,1800,1228,1823,1955, 316, # 1808
-1080,2510, 361,1807,2830,4107,2660,3381,1346,1423,1134,4108,6127, 541,1263,1229, # 1824
-1148,2540, 545, 465,1833,2880,3438,1901,3074,2482, 816,3937, 713,1788,2500, 122, # 1840
-1575, 195,1451,2501,1111,6128, 859, 374,1225,2243,2483,4317, 390,1033,3439,3075, # 1856
-2524,1687, 266, 793,1440,2599, 946, 779, 802, 507, 897,1081, 528,2189,1292, 711, # 1872
-1866,1725,1167,1640, 753, 398,2661,1053, 246, 348,4318, 137,1024,3440,1600,2077, # 1888
-2129, 825,4319, 698, 238, 521, 187,2300,1157,2423,1641,1605,1464,1610,1097,2541, # 1904
-1260,1436, 759,2255,1814,2150, 705,3235, 409,2563,3304, 561,3033,2005,2564, 726, # 1920
-1956,2343,3698,4109, 949,3812,3813,3520,1669, 653,1379,2525, 881,2198, 632,2256, # 1936
-1027, 778,1074, 733,1957, 514,1481,2466, 554,2180, 702,3938,1606,1017,1398,6129, # 1952
-1380,3521, 921, 993,1313, 594, 449,1489,1617,1166, 768,1426,1360, 495,1794,3601, # 1968
-1177,3602,1170,4320,2344, 476, 425,3167,4635,3168,1424, 401,2662,1171,3382,1998, # 1984
-1089,4110, 477,3169, 474,6130,1909, 596,2831,1842, 494, 693,1051,1028,1207,3076, # 2000
- 606,2115, 727,2790,1473,1115, 743,3522, 630, 805,1532,4321,2021, 366,1057, 838, # 2016
- 684,1114,2142,4322,2050,1492,1892,1808,2271,3814,2424,1971,1447,1373,3305,1090, # 2032
-1536,3939,3523,3306,1455,2199, 336, 369,2331,1035, 584,2393, 902, 718,2600,6131, # 2048
-2753, 463,2151,1149,1611,2467, 715,1308,3124,1268, 343,1413,3236,1517,1347,2663, # 2064
-2093,3940,2022,1131,1553,2100,2941,1427,3441,2942,1323,2484,6132,1980, 872,2368, # 2080
-2441,2943, 320,2369,2116,1082, 679,1933,3941,2791,3815, 625,1143,2023, 422,2200, # 2096
-3816,6133, 730,1695, 356,2257,1626,2301,2858,2637,1627,1778, 937, 883,2906,2693, # 2112
-3002,1769,1086, 400,1063,1325,3307,2792,4111,3077, 456,2345,1046, 747,6134,1524, # 2128
- 884,1094,3383,1474,2164,1059, 974,1688,2181,2258,1047, 345,1665,1187, 358, 875, # 2144
-3170, 305, 660,3524,2190,1334,1135,3171,1540,1649,2542,1527, 927, 968,2793, 885, # 2160
-1972,1850, 482, 500,2638,1218,1109,1085,2543,1654,2034, 876, 78,2287,1482,1277, # 2176
- 861,1675,1083,1779, 724,2754, 454, 397,1132,1612,2332, 893, 672,1237, 257,2259, # 2192
-2370, 135,3384, 337,2244, 547, 352, 340, 709,2485,1400, 788,1138,2511, 540, 772, # 2208
-1682,2260,2272,2544,2013,1843,1902,4636,1999,1562,2288,4637,2201,1403,1533, 407, # 2224
- 576,3308,1254,2071, 978,3385, 170, 136,1201,3125,2664,3172,2394, 213, 912, 873, # 2240
-3603,1713,2202, 699,3604,3699, 813,3442, 493, 531,1054, 468,2907,1483, 304, 281, # 2256
-4112,1726,1252,2094, 339,2319,2130,2639, 756,1563,2944, 748, 571,2976,1588,2425, # 2272
-2715,1851,1460,2426,1528,1392,1973,3237, 288,3309, 685,3386, 296, 892,2716,2216, # 2288
-1570,2245, 722,1747,2217, 905,3238,1103,6135,1893,1441,1965, 251,1805,2371,3700, # 2304
-2601,1919,1078, 75,2182,1509,1592,1270,2640,4638,2152,6136,3310,3817, 524, 706, # 2320
-1075, 292,3818,1756,2602, 317, 98,3173,3605,3525,1844,2218,3819,2502, 814, 567, # 2336
- 385,2908,1534,6137, 534,1642,3239, 797,6138,1670,1529, 953,4323, 188,1071, 538, # 2352
- 178, 729,3240,2109,1226,1374,2000,2357,2977, 731,2468,1116,2014,2051,6139,1261, # 2368
-1593, 803,2859,2736,3443, 556, 682, 823,1541,6140,1369,2289,1706,2794, 845, 462, # 2384
-2603,2665,1361, 387, 162,2358,1740, 739,1770,1720,1304,1401,3241,1049, 627,1571, # 2400
-2427,3526,1877,3942,1852,1500, 431,1910,1503, 677, 297,2795, 286,1433,1038,1198, # 2416
-2290,1133,1596,4113,4639,2469,1510,1484,3943,6141,2442, 108, 712,4640,2372, 866, # 2432
-3701,2755,3242,1348, 834,1945,1408,3527,2395,3243,1811, 824, 994,1179,2110,1548, # 2448
-1453, 790,3003, 690,4324,4325,2832,2909,3820,1860,3821, 225,1748, 310, 346,1780, # 2464
-2470, 821,1993,2717,2796, 828, 877,3528,2860,2471,1702,2165,2910,2486,1789, 453, # 2480
- 359,2291,1676, 73,1164,1461,1127,3311, 421, 604, 314,1037, 589, 116,2487, 737, # 2496
- 837,1180, 111, 244, 735,6142,2261,1861,1362, 986, 523, 418, 581,2666,3822, 103, # 2512
- 855, 503,1414,1867,2488,1091, 657,1597, 979, 605,1316,4641,1021,2443,2078,2001, # 2528
-1209, 96, 587,2166,1032, 260,1072,2153, 173, 94, 226,3244, 819,2006,4642,4114, # 2544
-2203, 231,1744, 782, 97,2667, 786,3387, 887, 391, 442,2219,4326,1425,6143,2694, # 2560
- 633,1544,1202, 483,2015, 592,2052,1958,2472,1655, 419, 129,4327,3444,3312,1714, # 2576
-1257,3078,4328,1518,1098, 865,1310,1019,1885,1512,1734, 469,2444, 148, 773, 436, # 2592
-1815,1868,1128,1055,4329,1245,2756,3445,2154,1934,1039,4643, 579,1238, 932,2320, # 2608
- 353, 205, 801, 115,2428, 944,2321,1881, 399,2565,1211, 678, 766,3944, 335,2101, # 2624
-1459,1781,1402,3945,2737,2131,1010, 844, 981,1326,1013, 550,1816,1545,2620,1335, # 2640
-1008, 371,2881, 936,1419,1613,3529,1456,1395,2273,1834,2604,1317,2738,2503, 416, # 2656
-1643,4330, 806,1126, 229, 591,3946,1314,1981,1576,1837,1666, 347,1790, 977,3313, # 2672
- 764,2861,1853, 688,2429,1920,1462, 77, 595, 415,2002,3034, 798,1192,4115,6144, # 2688
-2978,4331,3035,2695,2582,2072,2566, 430,2430,1727, 842,1396,3947,3702, 613, 377, # 2704
- 278, 236,1417,3388,3314,3174, 757,1869, 107,3530,6145,1194, 623,2262, 207,1253, # 2720
-2167,3446,3948, 492,1117,1935, 536,1838,2757,1246,4332, 696,2095,2406,1393,1572, # 2736
-3175,1782, 583, 190, 253,1390,2230, 830,3126,3389, 934,3245,1703,1749,2979,1870, # 2752
-2545,1656,2204, 869,2346,4116,3176,1817, 496,1764,4644, 942,1504, 404,1903,1122, # 2768
-1580,3606,2945,1022, 515, 372,1735, 955,2431,3036,6146,2797,1110,2302,2798, 617, # 2784
-6147, 441, 762,1771,3447,3607,3608,1904, 840,3037, 86, 939,1385, 572,1370,2445, # 2800
-1336, 114,3703, 898, 294, 203,3315, 703,1583,2274, 429, 961,4333,1854,1951,3390, # 2816
-2373,3704,4334,1318,1381, 966,1911,2322,1006,1155, 309, 989, 458,2718,1795,1372, # 2832
-1203, 252,1689,1363,3177, 517,1936, 168,1490, 562, 193,3823,1042,4117,1835, 551, # 2848
- 470,4645, 395, 489,3448,1871,1465,2583,2641, 417,1493, 279,1295, 511,1236,1119, # 2864
- 72,1231,1982,1812,3004, 871,1564, 984,3449,1667,2696,2096,4646,2347,2833,1673, # 2880
-3609, 695,3246,2668, 807,1183,4647, 890, 388,2333,1801,1457,2911,1765,1477,1031, # 2896
-3316,3317,1278,3391,2799,2292,2526, 163,3450,4335,2669,1404,1802,6148,2323,2407, # 2912
-1584,1728,1494,1824,1269, 298, 909,3318,1034,1632, 375, 776,1683,2061, 291, 210, # 2928
-1123, 809,1249,1002,2642,3038, 206,1011,2132, 144, 975, 882,1565, 342, 667, 754, # 2944
-1442,2143,1299,2303,2062, 447, 626,2205,1221,2739,2912,1144,1214,2206,2584, 760, # 2960
-1715, 614, 950,1281,2670,2621, 810, 577,1287,2546,4648, 242,2168, 250,2643, 691, # 2976
- 123,2644, 647, 313,1029, 689,1357,2946,1650, 216, 771,1339,1306, 808,2063, 549, # 2992
- 913,1371,2913,2914,6149,1466,1092,1174,1196,1311,2605,2396,1783,1796,3079, 406, # 3008
-2671,2117,3949,4649, 487,1825,2220,6150,2915, 448,2348,1073,6151,2397,1707, 130, # 3024
- 900,1598, 329, 176,1959,2527,1620,6152,2275,4336,3319,1983,2191,3705,3610,2155, # 3040
-3706,1912,1513,1614,6153,1988, 646, 392,2304,1589,3320,3039,1826,1239,1352,1340, # 3056
-2916, 505,2567,1709,1437,2408,2547, 906,6154,2672, 384,1458,1594,1100,1329, 710, # 3072
- 423,3531,2064,2231,2622,1989,2673,1087,1882, 333, 841,3005,1296,2882,2379, 580, # 3088
-1937,1827,1293,2585, 601, 574, 249,1772,4118,2079,1120, 645, 901,1176,1690, 795, # 3104
-2207, 478,1434, 516,1190,1530, 761,2080, 930,1264, 355, 435,1552, 644,1791, 987, # 3120
- 220,1364,1163,1121,1538, 306,2169,1327,1222, 546,2645, 218, 241, 610,1704,3321, # 3136
-1984,1839,1966,2528, 451,6155,2586,3707,2568, 907,3178, 254,2947, 186,1845,4650, # 3152
- 745, 432,1757, 428,1633, 888,2246,2221,2489,3611,2118,1258,1265, 956,3127,1784, # 3168
-4337,2490, 319, 510, 119, 457,3612, 274,2035,2007,4651,1409,3128, 970,2758, 590, # 3184
-2800, 661,2247,4652,2008,3950,1420,1549,3080,3322,3951,1651,1375,2111, 485,2491, # 3200
-1429,1156,6156,2548,2183,1495, 831,1840,2529,2446, 501,1657, 307,1894,3247,1341, # 3216
- 666, 899,2156,1539,2549,1559, 886, 349,2208,3081,2305,1736,3824,2170,2759,1014, # 3232
-1913,1386, 542,1397,2948, 490, 368, 716, 362, 159, 282,2569,1129,1658,1288,1750, # 3248
-2674, 276, 649,2016, 751,1496, 658,1818,1284,1862,2209,2087,2512,3451, 622,2834, # 3264
- 376, 117,1060,2053,1208,1721,1101,1443, 247,1250,3179,1792,3952,2760,2398,3953, # 3280
-6157,2144,3708, 446,2432,1151,2570,3452,2447,2761,2835,1210,2448,3082, 424,2222, # 3296
-1251,2449,2119,2836, 504,1581,4338, 602, 817, 857,3825,2349,2306, 357,3826,1470, # 3312
-1883,2883, 255, 958, 929,2917,3248, 302,4653,1050,1271,1751,2307,1952,1430,2697, # 3328
-2719,2359, 354,3180, 777, 158,2036,4339,1659,4340,4654,2308,2949,2248,1146,2232, # 3344
-3532,2720,1696,2623,3827,6158,3129,1550,2698,1485,1297,1428, 637, 931,2721,2145, # 3360
- 914,2550,2587, 81,2450, 612, 827,2646,1242,4655,1118,2884, 472,1855,3181,3533, # 3376
-3534, 569,1353,2699,1244,1758,2588,4119,2009,2762,2171,3709,1312,1531,6159,1152, # 3392
-1938, 134,1830, 471,3710,2276,1112,1535,3323,3453,3535, 982,1337,2950, 488, 826, # 3408
- 674,1058,1628,4120,2017, 522,2399, 211, 568,1367,3454, 350, 293,1872,1139,3249, # 3424
-1399,1946,3006,1300,2360,3324, 588, 736,6160,2606, 744, 669,3536,3828,6161,1358, # 3440
- 199, 723, 848, 933, 851,1939,1505,1514,1338,1618,1831,4656,1634,3613, 443,2740, # 3456
-3829, 717,1947, 491,1914,6162,2551,1542,4121,1025,6163,1099,1223, 198,3040,2722, # 3472
- 370, 410,1905,2589, 998,1248,3182,2380, 519,1449,4122,1710, 947, 928,1153,4341, # 3488
-2277, 344,2624,1511, 615, 105, 161,1212,1076,1960,3130,2054,1926,1175,1906,2473, # 3504
- 414,1873,2801,6164,2309, 315,1319,3325, 318,2018,2146,2157, 963, 631, 223,4342, # 3520
-4343,2675, 479,3711,1197,2625,3712,2676,2361,6165,4344,4123,6166,2451,3183,1886, # 3536
-2184,1674,1330,1711,1635,1506, 799, 219,3250,3083,3954,1677,3713,3326,2081,3614, # 3552
-1652,2073,4657,1147,3041,1752, 643,1961, 147,1974,3955,6167,1716,2037, 918,3007, # 3568
-1994, 120,1537, 118, 609,3184,4345, 740,3455,1219, 332,1615,3830,6168,1621,2980, # 3584
-1582, 783, 212, 553,2350,3714,1349,2433,2082,4124, 889,6169,2310,1275,1410, 973, # 3600
- 166,1320,3456,1797,1215,3185,2885,1846,2590,2763,4658, 629, 822,3008, 763, 940, # 3616
-1990,2862, 439,2409,1566,1240,1622, 926,1282,1907,2764, 654,2210,1607, 327,1130, # 3632
-3956,1678,1623,6170,2434,2192, 686, 608,3831,3715, 903,3957,3042,6171,2741,1522, # 3648
-1915,1105,1555,2552,1359, 323,3251,4346,3457, 738,1354,2553,2311,2334,1828,2003, # 3664
-3832,1753,2351,1227,6172,1887,4125,1478,6173,2410,1874,1712,1847, 520,1204,2607, # 3680
- 264,4659, 836,2677,2102, 600,4660,3833,2278,3084,6174,4347,3615,1342, 640, 532, # 3696
- 543,2608,1888,2400,2591,1009,4348,1497, 341,1737,3616,2723,1394, 529,3252,1321, # 3712
- 983,4661,1515,2120, 971,2592, 924, 287,1662,3186,4349,2700,4350,1519, 908,1948, # 3728
-2452, 156, 796,1629,1486,2223,2055, 694,4126,1259,1036,3392,1213,2249,2742,1889, # 3744
-1230,3958,1015, 910, 408, 559,3617,4662, 746, 725, 935,4663,3959,3009,1289, 563, # 3760
- 867,4664,3960,1567,2981,2038,2626, 988,2263,2381,4351, 143,2374, 704,1895,6175, # 3776
-1188,3716,2088, 673,3085,2362,4352, 484,1608,1921,2765,2918, 215, 904,3618,3537, # 3792
- 894, 509, 976,3043,2701,3961,4353,2837,2982, 498,6176,6177,1102,3538,1332,3393, # 3808
-1487,1636,1637, 233, 245,3962, 383, 650, 995,3044, 460,1520,1206,2352, 749,3327, # 3824
- 530, 700, 389,1438,1560,1773,3963,2264, 719,2951,2724,3834, 870,1832,1644,1000, # 3840
- 839,2474,3717, 197,1630,3394, 365,2886,3964,1285,2133, 734, 922, 818,1106, 732, # 3856
- 480,2083,1774,3458, 923,2279,1350, 221,3086, 85,2233,2234,3835,1585,3010,2147, # 3872
-1387,1705,2382,1619,2475, 133, 239,2802,1991,1016,2084,2383, 411,2838,1113, 651, # 3888
-1985,1160,3328, 990,1863,3087,1048,1276,2647, 265,2627,1599,3253,2056, 150, 638, # 3904
-2019, 656, 853, 326,1479, 680,1439,4354,1001,1759, 413,3459,3395,2492,1431, 459, # 3920
-4355,1125,3329,2265,1953,1450,2065,2863, 849, 351,2678,3131,3254,3255,1104,1577, # 3936
- 227,1351,1645,2453,2193,1421,2887, 812,2121, 634, 95,2435, 201,2312,4665,1646, # 3952
-1671,2743,1601,2554,2702,2648,2280,1315,1366,2089,3132,1573,3718,3965,1729,1189, # 3968
- 328,2679,1077,1940,1136, 558,1283, 964,1195, 621,2074,1199,1743,3460,3619,1896, # 3984
-1916,1890,3836,2952,1154,2112,1064, 862, 378,3011,2066,2113,2803,1568,2839,6178, # 4000
-3088,2919,1941,1660,2004,1992,2194, 142, 707,1590,1708,1624,1922,1023,1836,1233, # 4016
-1004,2313, 789, 741,3620,6179,1609,2411,1200,4127,3719,3720,4666,2057,3721, 593, # 4032
-2840, 367,2920,1878,6180,3461,1521, 628,1168, 692,2211,2649, 300, 720,2067,2571, # 4048
-2953,3396, 959,2504,3966,3539,3462,1977, 701,6181, 954,1043, 800, 681, 183,3722, # 4064
-1803,1730,3540,4128,2103, 815,2314, 174, 467, 230,2454,1093,2134, 755,3541,3397, # 4080
-1141,1162,6182,1738,2039, 270,3256,2513,1005,1647,2185,3837, 858,1679,1897,1719, # 4096
-2954,2324,1806, 402, 670, 167,4129,1498,2158,2104, 750,6183, 915, 189,1680,1551, # 4112
- 455,4356,1501,2455, 405,1095,2955, 338,1586,1266,1819, 570, 641,1324, 237,1556, # 4128
-2650,1388,3723,6184,1368,2384,1343,1978,3089,2436, 879,3724, 792,1191, 758,3012, # 4144
-1411,2135,1322,4357, 240,4667,1848,3725,1574,6185, 420,3045,1546,1391, 714,4358, # 4160
-1967, 941,1864, 863, 664, 426, 560,1731,2680,1785,2864,1949,2363, 403,3330,1415, # 4176
-1279,2136,1697,2335, 204, 721,2097,3838, 90,6186,2085,2505, 191,3967, 124,2148, # 4192
-1376,1798,1178,1107,1898,1405, 860,4359,1243,1272,2375,2983,1558,2456,1638, 113, # 4208
-3621, 578,1923,2609, 880, 386,4130, 784,2186,2266,1422,2956,2172,1722, 497, 263, # 4224
-2514,1267,2412,2610, 177,2703,3542, 774,1927,1344, 616,1432,1595,1018, 172,4360, # 4240
-2325, 911,4361, 438,1468,3622, 794,3968,2024,2173,1681,1829,2957, 945, 895,3090, # 4256
- 575,2212,2476, 475,2401,2681, 785,2744,1745,2293,2555,1975,3133,2865, 394,4668, # 4272
-3839, 635,4131, 639, 202,1507,2195,2766,1345,1435,2572,3726,1908,1184,1181,2457, # 4288
-3727,3134,4362, 843,2611, 437, 916,4669, 234, 769,1884,3046,3047,3623, 833,6187, # 4304
-1639,2250,2402,1355,1185,2010,2047, 999, 525,1732,1290,1488,2612, 948,1578,3728, # 4320
-2413,2477,1216,2725,2159, 334,3840,1328,3624,2921,1525,4132, 564,1056, 891,4363, # 4336
-1444,1698,2385,2251,3729,1365,2281,2235,1717,6188, 864,3841,2515, 444, 527,2767, # 4352
-2922,3625, 544, 461,6189, 566, 209,2437,3398,2098,1065,2068,3331,3626,3257,2137, # 4368 #last 512
-)
-
-
diff --git a/lib/chardet/jpcntx.py b/lib/chardet/jpcntx.py
deleted file mode 100644
index 20044e4bc8..0000000000
--- a/lib/chardet/jpcntx.py
+++ /dev/null
@@ -1,233 +0,0 @@
-######################## BEGIN LICENSE BLOCK ########################
-# The Original Code is Mozilla Communicator client code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Mark Pilgrim - port to Python
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301 USA
-######################### END LICENSE BLOCK #########################
-
-
-# This is hiragana 2-char sequence table, the number in each cell represents its frequency category
-jp2CharContext = (
-(0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1),
-(2,4,0,4,0,3,0,4,0,3,4,4,4,2,4,3,3,4,3,2,3,3,4,2,3,3,3,2,4,1,4,3,3,1,5,4,3,4,3,4,3,5,3,0,3,5,4,2,0,3,1,0,3,3,0,3,3,0,1,1,0,4,3,0,3,3,0,4,0,2,0,3,5,5,5,5,4,0,4,1,0,3,4),
-(0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2),
-(0,4,0,5,0,5,0,4,0,4,5,4,4,3,5,3,5,1,5,3,4,3,4,4,3,4,3,3,4,3,5,4,4,3,5,5,3,5,5,5,3,5,5,3,4,5,5,3,1,3,2,0,3,4,0,4,2,0,4,2,1,5,3,2,3,5,0,4,0,2,0,5,4,4,5,4,5,0,4,0,0,4,4),
-(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
-(0,3,0,4,0,3,0,3,0,4,5,4,3,3,3,3,4,3,5,4,4,3,5,4,4,3,4,3,4,4,4,4,5,3,4,4,3,4,5,5,4,5,5,1,4,5,4,3,0,3,3,1,3,3,0,4,4,0,3,3,1,5,3,3,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,2,5,3,4,3,2,2,3,0,0,3,0,2,1,0,1,2,0,0,0,0,2,1,1,3,1,0,2,0,4,0,3,4,4,4,5,2,0,2,0,0,1,3),
-(0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,1,0,0,1,1,0,0,0,4,2,1,1,0,1,0,3,2,0,0,3,1,1,1,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,1,0,0,0,2,0,0,0,1,4,0,4,2,1,0,0,0,0,0,1),
-(0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,0,1,0,1,0,0,0,0,3,1,0,0,0,2,0,2,1,0,0,1,2,1,0,1,1,0,0,3,0,0,0,0,0,0,0,0,0,0,0,1,3,1,0,0,0,0,0,1,0,0,2,1,0,0,0,0,0,0,0,0,2),
-(0,4,0,4,0,4,0,3,0,4,4,3,4,2,4,3,2,0,4,4,4,3,5,3,5,3,3,2,4,2,4,3,4,3,1,4,0,2,3,4,4,4,3,3,3,4,4,4,3,4,1,3,4,3,2,1,2,1,3,3,3,4,4,3,3,5,0,4,0,3,0,4,3,3,3,2,1,0,3,0,0,3,3),
-(0,4,0,3,0,3,0,3,0,3,5,5,3,3,3,3,4,3,4,3,3,3,4,4,4,3,3,3,3,4,3,5,3,3,1,3,2,4,5,5,5,5,4,3,4,5,5,3,2,2,3,3,3,3,2,3,3,1,2,3,2,4,3,3,3,4,0,4,0,2,0,4,3,2,2,1,2,0,3,0,0,4,1),
-)
-
-class JapaneseContextAnalysis(object):
- NUM_OF_CATEGORY = 6
- DONT_KNOW = -1
- ENOUGH_REL_THRESHOLD = 100
- MAX_REL_THRESHOLD = 1000
- MINIMUM_DATA_THRESHOLD = 4
-
- def __init__(self):
- self._total_rel = None
- self._rel_sample = None
- self._need_to_skip_char_num = None
- self._last_char_order = None
- self._done = None
- self.reset()
-
- def reset(self):
- self._total_rel = 0 # total sequence received
- # category counters, each integer counts sequence in its category
- self._rel_sample = [0] * self.NUM_OF_CATEGORY
- # if last byte in current buffer is not the last byte of a character,
- # we need to know how many bytes to skip in next buffer
- self._need_to_skip_char_num = 0
- self._last_char_order = -1 # The order of previous char
- # If this flag is set to True, detection is done and conclusion has
- # been made
- self._done = False
-
- def feed(self, byte_str, num_bytes):
- if self._done:
- return
-
- # The buffer we got is byte oriented, and a character may span in more than one
- # buffers. In case the last one or two byte in last buffer is not
- # complete, we record how many byte needed to complete that character
- # and skip these bytes here. We can choose to record those bytes as
- # well and analyse the character once it is complete, but since a
- # character will not make much difference, by simply skipping
- # this character will simply our logic and improve performance.
- i = self._need_to_skip_char_num
- while i < num_bytes:
- order, char_len = self.get_order(byte_str[i:i + 2])
- i += char_len
- if i > num_bytes:
- self._need_to_skip_char_num = i - num_bytes
- self._last_char_order = -1
- else:
- if (order != -1) and (self._last_char_order != -1):
- self._total_rel += 1
- if self._total_rel > self.MAX_REL_THRESHOLD:
- self._done = True
- break
- self._rel_sample[jp2CharContext[self._last_char_order][order]] += 1
- self._last_char_order = order
-
- def got_enough_data(self):
- return self._total_rel > self.ENOUGH_REL_THRESHOLD
-
- def get_confidence(self):
- # This is just one way to calculate confidence. It works well for me.
- if self._total_rel > self.MINIMUM_DATA_THRESHOLD:
- return (self._total_rel - self._rel_sample[0]) / self._total_rel
- else:
- return self.DONT_KNOW
-
- def get_order(self, byte_str):
- return -1, 1
-
-class SJISContextAnalysis(JapaneseContextAnalysis):
- def __init__(self):
- super(SJISContextAnalysis, self).__init__()
- self._charset_name = "SHIFT_JIS"
-
- @property
- def charset_name(self):
- return self._charset_name
-
- def get_order(self, byte_str):
- if not byte_str:
- return -1, 1
- # find out current char's byte length
- first_char = byte_str[0]
- if (0x81 <= first_char <= 0x9F) or (0xE0 <= first_char <= 0xFC):
- char_len = 2
- if (first_char == 0x87) or (0xFA <= first_char <= 0xFC):
- self._charset_name = "CP932"
- else:
- char_len = 1
-
- # return its order if it is hiragana
- if len(byte_str) > 1:
- second_char = byte_str[1]
- if (first_char == 202) and (0x9F <= second_char <= 0xF1):
- return second_char - 0x9F, char_len
-
- return -1, char_len
-
-class EUCJPContextAnalysis(JapaneseContextAnalysis):
- def get_order(self, byte_str):
- if not byte_str:
- return -1, 1
- # find out current char's byte length
- first_char = byte_str[0]
- if (first_char == 0x8E) or (0xA1 <= first_char <= 0xFE):
- char_len = 2
- elif first_char == 0x8F:
- char_len = 3
- else:
- char_len = 1
-
- # return its order if it is hiragana
- if len(byte_str) > 1:
- second_char = byte_str[1]
- if (first_char == 0xA4) and (0xA1 <= second_char <= 0xF3):
- return second_char - 0xA1, char_len
-
- return -1, char_len
-
-
diff --git a/lib/chardet/langbulgarianmodel.py b/lib/chardet/langbulgarianmodel.py
deleted file mode 100644
index 2aa4fb2e22..0000000000
--- a/lib/chardet/langbulgarianmodel.py
+++ /dev/null
@@ -1,228 +0,0 @@
-######################## BEGIN LICENSE BLOCK ########################
-# The Original Code is Mozilla Communicator client code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Mark Pilgrim - port to Python
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301 USA
-######################### END LICENSE BLOCK #########################
-
-# 255: Control characters that usually does not exist in any text
-# 254: Carriage/Return
-# 253: symbol (punctuation) that does not belong to word
-# 252: 0 - 9
-
-# Character Mapping Table:
-# this table is modified base on win1251BulgarianCharToOrderMap, so
-# only number <64 is sure valid
-
-Latin5_BulgarianCharToOrderMap = (
-255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10
-253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20
-252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30
-253, 77, 90, 99,100, 72,109,107,101, 79,185, 81,102, 76, 94, 82, # 40
-110,186,108, 91, 74,119, 84, 96,111,187,115,253,253,253,253,253, # 50
-253, 65, 69, 70, 66, 63, 68,112,103, 92,194,104, 95, 86, 87, 71, # 60
-116,195, 85, 93, 97,113,196,197,198,199,200,253,253,253,253,253, # 70
-194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209, # 80
-210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225, # 90
- 81,226,227,228,229,230,105,231,232,233,234,235,236, 45,237,238, # a0
- 31, 32, 35, 43, 37, 44, 55, 47, 40, 59, 33, 46, 38, 36, 41, 30, # b0
- 39, 28, 34, 51, 48, 49, 53, 50, 54, 57, 61,239, 67,240, 60, 56, # c0
- 1, 18, 9, 20, 11, 3, 23, 15, 2, 26, 12, 10, 14, 6, 4, 13, # d0
- 7, 8, 5, 19, 29, 25, 22, 21, 27, 24, 17, 75, 52,241, 42, 16, # e0
- 62,242,243,244, 58,245, 98,246,247,248,249,250,251, 91,252,253, # f0
-)
-
-win1251BulgarianCharToOrderMap = (
-255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10
-253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20
-252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30
-253, 77, 90, 99,100, 72,109,107,101, 79,185, 81,102, 76, 94, 82, # 40
-110,186,108, 91, 74,119, 84, 96,111,187,115,253,253,253,253,253, # 50
-253, 65, 69, 70, 66, 63, 68,112,103, 92,194,104, 95, 86, 87, 71, # 60
-116,195, 85, 93, 97,113,196,197,198,199,200,253,253,253,253,253, # 70
-206,207,208,209,210,211,212,213,120,214,215,216,217,218,219,220, # 80
-221, 78, 64, 83,121, 98,117,105,222,223,224,225,226,227,228,229, # 90
- 88,230,231,232,233,122, 89,106,234,235,236,237,238, 45,239,240, # a0
- 73, 80,118,114,241,242,243,244,245, 62, 58,246,247,248,249,250, # b0
- 31, 32, 35, 43, 37, 44, 55, 47, 40, 59, 33, 46, 38, 36, 41, 30, # c0
- 39, 28, 34, 51, 48, 49, 53, 50, 54, 57, 61,251, 67,252, 60, 56, # d0
- 1, 18, 9, 20, 11, 3, 23, 15, 2, 26, 12, 10, 14, 6, 4, 13, # e0
- 7, 8, 5, 19, 29, 25, 22, 21, 27, 24, 17, 75, 52,253, 42, 16, # f0
-)
-
-# Model Table:
-# total sequences: 100%
-# first 512 sequences: 96.9392%
-# first 1024 sequences:3.0618%
-# rest sequences: 0.2992%
-# negative sequences: 0.0020%
-BulgarianLangModel = (
-0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,2,3,3,3,3,3,
-3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,3,3,2,2,3,2,2,1,2,2,
-3,1,3,3,2,3,3,3,3,3,3,3,3,3,3,3,3,0,3,3,3,3,3,3,3,3,3,3,0,3,0,1,
-0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
-3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,3,2,3,3,3,3,3,3,3,3,0,3,1,0,
-0,1,0,0,0,0,0,0,0,0,1,1,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
-3,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,1,3,2,3,3,3,3,3,3,3,3,0,3,0,0,
-0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3,2,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0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-1,0,0,1,2,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,
-0,1,1,0,1,1,1,0,0,1,0,0,1,0,1,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,
-1,0,1,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,1,0,2,0,0,2,0,1,0,0,1,0,0,1,
-1,1,0,0,1,1,0,1,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,
-1,1,1,1,1,1,1,2,0,0,0,0,0,0,2,1,0,1,1,0,0,1,1,1,0,1,0,0,0,0,0,0,
-2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,1,0,1,1,1,1,1,0,1,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
-)
-
-Latin5BulgarianModel = {
- 'char_to_order_map': Latin5_BulgarianCharToOrderMap,
- 'precedence_matrix': BulgarianLangModel,
- 'typical_positive_ratio': 0.969392,
- 'keep_english_letter': False,
- 'charset_name': "ISO-8859-5",
- 'language': 'Bulgairan',
-}
-
-Win1251BulgarianModel = {
- 'char_to_order_map': win1251BulgarianCharToOrderMap,
- 'precedence_matrix': BulgarianLangModel,
- 'typical_positive_ratio': 0.969392,
- 'keep_english_letter': False,
- 'charset_name': "windows-1251",
- 'language': 'Bulgarian',
-}
diff --git a/lib/chardet/langcyrillicmodel.py b/lib/chardet/langcyrillicmodel.py
deleted file mode 100644
index e5f9a1fd19..0000000000
--- a/lib/chardet/langcyrillicmodel.py
+++ /dev/null
@@ -1,333 +0,0 @@
-######################## BEGIN LICENSE BLOCK ########################
-# The Original Code is Mozilla Communicator client code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Mark Pilgrim - port to Python
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301 USA
-######################### END LICENSE BLOCK #########################
-
-# KOI8-R language model
-# Character Mapping Table:
-KOI8R_char_to_order_map = (
-255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10
-253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20
-252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30
-253,142,143,144,145,146,147,148,149,150,151,152, 74,153, 75,154, # 40
-155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253, # 50
-253, 71,172, 66,173, 65,174, 76,175, 64,176,177, 77, 72,178, 69, # 60
- 67,179, 78, 73,180,181, 79,182,183,184,185,253,253,253,253,253, # 70
-191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206, # 80
-207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222, # 90
-223,224,225, 68,226,227,228,229,230,231,232,233,234,235,236,237, # a0
-238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253, # b0
- 27, 3, 21, 28, 13, 2, 39, 19, 26, 4, 23, 11, 8, 12, 5, 1, # c0
- 15, 16, 9, 7, 6, 14, 24, 10, 17, 18, 20, 25, 30, 29, 22, 54, # d0
- 59, 37, 44, 58, 41, 48, 53, 46, 55, 42, 60, 36, 49, 38, 31, 34, # e0
- 35, 43, 45, 32, 40, 52, 56, 33, 61, 62, 51, 57, 47, 63, 50, 70, # f0
-)
-
-win1251_char_to_order_map = (
-255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10
-253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20
-252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30
-253,142,143,144,145,146,147,148,149,150,151,152, 74,153, 75,154, # 40
-155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253, # 50
-253, 71,172, 66,173, 65,174, 76,175, 64,176,177, 77, 72,178, 69, # 60
- 67,179, 78, 73,180,181, 79,182,183,184,185,253,253,253,253,253, # 70
-191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,
-207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,
-223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,
-239,240,241,242,243,244,245,246, 68,247,248,249,250,251,252,253,
- 37, 44, 33, 46, 41, 48, 56, 51, 42, 60, 36, 49, 38, 31, 34, 35,
- 45, 32, 40, 52, 53, 55, 58, 50, 57, 63, 70, 62, 61, 47, 59, 43,
- 3, 21, 10, 19, 13, 2, 24, 20, 4, 23, 11, 8, 12, 5, 1, 15,
- 9, 7, 6, 14, 39, 26, 28, 22, 25, 29, 54, 18, 17, 30, 27, 16,
-)
-
-latin5_char_to_order_map = (
-255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10
-253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20
-252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30
-253,142,143,144,145,146,147,148,149,150,151,152, 74,153, 75,154, # 40
-155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253, # 50
-253, 71,172, 66,173, 65,174, 76,175, 64,176,177, 77, 72,178, 69, # 60
- 67,179, 78, 73,180,181, 79,182,183,184,185,253,253,253,253,253, # 70
-191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,
-207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,
-223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,
- 37, 44, 33, 46, 41, 48, 56, 51, 42, 60, 36, 49, 38, 31, 34, 35,
- 45, 32, 40, 52, 53, 55, 58, 50, 57, 63, 70, 62, 61, 47, 59, 43,
- 3, 21, 10, 19, 13, 2, 24, 20, 4, 23, 11, 8, 12, 5, 1, 15,
- 9, 7, 6, 14, 39, 26, 28, 22, 25, 29, 54, 18, 17, 30, 27, 16,
-239, 68,240,241,242,243,244,245,246,247,248,249,250,251,252,255,
-)
-
-macCyrillic_char_to_order_map = (
-255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10
-253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20
-252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30
-253,142,143,144,145,146,147,148,149,150,151,152, 74,153, 75,154, # 40
-155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253, # 50
-253, 71,172, 66,173, 65,174, 76,175, 64,176,177, 77, 72,178, 69, # 60
- 67,179, 78, 73,180,181, 79,182,183,184,185,253,253,253,253,253, # 70
- 37, 44, 33, 46, 41, 48, 56, 51, 42, 60, 36, 49, 38, 31, 34, 35,
- 45, 32, 40, 52, 53, 55, 58, 50, 57, 63, 70, 62, 61, 47, 59, 43,
-191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,
-207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,
-223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,
-239,240,241,242,243,244,245,246,247,248,249,250,251,252, 68, 16,
- 3, 21, 10, 19, 13, 2, 24, 20, 4, 23, 11, 8, 12, 5, 1, 15,
- 9, 7, 6, 14, 39, 26, 28, 22, 25, 29, 54, 18, 17, 30, 27,255,
-)
-
-IBM855_char_to_order_map = (
-255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10
-253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20
-252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30
-253,142,143,144,145,146,147,148,149,150,151,152, 74,153, 75,154, # 40
-155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253, # 50
-253, 71,172, 66,173, 65,174, 76,175, 64,176,177, 77, 72,178, 69, # 60
- 67,179, 78, 73,180,181, 79,182,183,184,185,253,253,253,253,253, # 70
-191,192,193,194, 68,195,196,197,198,199,200,201,202,203,204,205,
-206,207,208,209,210,211,212,213,214,215,216,217, 27, 59, 54, 70,
- 3, 37, 21, 44, 28, 58, 13, 41, 2, 48, 39, 53, 19, 46,218,219,
-220,221,222,223,224, 26, 55, 4, 42,225,226,227,228, 23, 60,229,
-230,231,232,233,234,235, 11, 36,236,237,238,239,240,241,242,243,
- 8, 49, 12, 38, 5, 31, 1, 34, 15,244,245,246,247, 35, 16,248,
- 43, 9, 45, 7, 32, 6, 40, 14, 52, 24, 56, 10, 33, 17, 61,249,
-250, 18, 62, 20, 51, 25, 57, 30, 47, 29, 63, 22, 50,251,252,255,
-)
-
-IBM866_char_to_order_map = (
-255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10
-253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20
-252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30
-253,142,143,144,145,146,147,148,149,150,151,152, 74,153, 75,154, # 40
-155,156,157,158,159,160,161,162,163,164,165,253,253,253,253,253, # 50
-253, 71,172, 66,173, 65,174, 76,175, 64,176,177, 77, 72,178, 69, # 60
- 67,179, 78, 73,180,181, 79,182,183,184,185,253,253,253,253,253, # 70
- 37, 44, 33, 46, 41, 48, 56, 51, 42, 60, 36, 49, 38, 31, 34, 35,
- 45, 32, 40, 52, 53, 55, 58, 50, 57, 63, 70, 62, 61, 47, 59, 43,
- 3, 21, 10, 19, 13, 2, 24, 20, 4, 23, 11, 8, 12, 5, 1, 15,
-191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,
-207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,
-223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,
- 9, 7, 6, 14, 39, 26, 28, 22, 25, 29, 54, 18, 17, 30, 27, 16,
-239, 68,240,241,242,243,244,245,246,247,248,249,250,251,252,255,
-)
-
-# Model Table:
-# total sequences: 100%
-# first 512 sequences: 97.6601%
-# first 1024 sequences: 2.3389%
-# rest sequences: 0.1237%
-# negative sequences: 0.0009%
-RussianLangModel = (
-0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,1,3,3,3,3,1,3,3,3,2,3,2,3,3,
-3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,0,3,2,2,2,2,2,0,0,2,
-3,3,3,2,3,3,3,3,3,3,3,3,3,3,2,3,3,0,0,3,3,3,3,3,3,3,3,3,2,3,2,0,
-0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-3,3,3,2,2,3,3,3,3,3,3,3,3,3,2,3,3,0,0,3,3,3,3,3,3,3,3,2,3,3,1,0,
-0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0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,2,0,0,0,0,0,0,0,0,0,1,1,0,0,0,1,1,
-0,0,1,0,1,1,0,0,0,0,1,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,
-1,0,2,1,2,0,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,
-0,0,1,0,1,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,
-1,0,0,0,0,2,0,1,2,1,0,1,1,1,0,1,0,0,0,1,0,1,0,0,1,0,1,0,0,0,0,1,
-0,0,0,0,0,1,0,0,1,1,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,
-2,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
-1,0,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,0,0,
-2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
-1,1,1,0,1,0,1,0,0,1,1,1,1,0,0,0,1,0,0,0,0,1,0,0,0,1,0,1,0,0,0,0,
-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
-1,1,0,1,1,0,1,0,1,0,0,0,0,1,1,0,1,1,0,0,0,0,0,1,0,1,1,0,1,0,0,0,
-0,1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,
-)
-
-Koi8rModel = {
- 'char_to_order_map': KOI8R_char_to_order_map,
- 'precedence_matrix': RussianLangModel,
- 'typical_positive_ratio': 0.976601,
- 'keep_english_letter': False,
- 'charset_name': "KOI8-R",
- 'language': 'Russian',
-}
-
-Win1251CyrillicModel = {
- 'char_to_order_map': win1251_char_to_order_map,
- 'precedence_matrix': RussianLangModel,
- 'typical_positive_ratio': 0.976601,
- 'keep_english_letter': False,
- 'charset_name': "windows-1251",
- 'language': 'Russian',
-}
-
-Latin5CyrillicModel = {
- 'char_to_order_map': latin5_char_to_order_map,
- 'precedence_matrix': RussianLangModel,
- 'typical_positive_ratio': 0.976601,
- 'keep_english_letter': False,
- 'charset_name': "ISO-8859-5",
- 'language': 'Russian',
-}
-
-MacCyrillicModel = {
- 'char_to_order_map': macCyrillic_char_to_order_map,
- 'precedence_matrix': RussianLangModel,
- 'typical_positive_ratio': 0.976601,
- 'keep_english_letter': False,
- 'charset_name': "MacCyrillic",
- 'language': 'Russian',
-}
-
-Ibm866Model = {
- 'char_to_order_map': IBM866_char_to_order_map,
- 'precedence_matrix': RussianLangModel,
- 'typical_positive_ratio': 0.976601,
- 'keep_english_letter': False,
- 'charset_name': "IBM866",
- 'language': 'Russian',
-}
-
-Ibm855Model = {
- 'char_to_order_map': IBM855_char_to_order_map,
- 'precedence_matrix': RussianLangModel,
- 'typical_positive_ratio': 0.976601,
- 'keep_english_letter': False,
- 'charset_name': "IBM855",
- 'language': 'Russian',
-}
diff --git a/lib/chardet/langgreekmodel.py b/lib/chardet/langgreekmodel.py
deleted file mode 100644
index 533222166c..0000000000
--- a/lib/chardet/langgreekmodel.py
+++ /dev/null
@@ -1,225 +0,0 @@
-######################## BEGIN LICENSE BLOCK ########################
-# The Original Code is Mozilla Communicator client code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Mark Pilgrim - port to Python
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301 USA
-######################### END LICENSE BLOCK #########################
-
-# 255: Control characters that usually does not exist in any text
-# 254: Carriage/Return
-# 253: symbol (punctuation) that does not belong to word
-# 252: 0 - 9
-
-# Character Mapping Table:
-Latin7_char_to_order_map = (
-255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10
-253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20
-252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30
-253, 82,100,104, 94, 98,101,116,102,111,187,117, 92, 88,113, 85, # 40
- 79,118,105, 83, 67,114,119, 95, 99,109,188,253,253,253,253,253, # 50
-253, 72, 70, 80, 81, 60, 96, 93, 89, 68,120, 97, 77, 86, 69, 55, # 60
- 78,115, 65, 66, 58, 76,106,103, 87,107,112,253,253,253,253,253, # 70
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 80
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 90
-253,233, 90,253,253,253,253,253,253,253,253,253,253, 74,253,253, # a0
-253,253,253,253,247,248, 61, 36, 46, 71, 73,253, 54,253,108,123, # b0
-110, 31, 51, 43, 41, 34, 91, 40, 52, 47, 44, 53, 38, 49, 59, 39, # c0
- 35, 48,250, 37, 33, 45, 56, 50, 84, 57,120,121, 17, 18, 22, 15, # d0
-124, 1, 29, 20, 21, 3, 32, 13, 25, 5, 11, 16, 10, 6, 30, 4, # e0
- 9, 8, 14, 7, 2, 12, 28, 23, 42, 24, 64, 75, 19, 26, 27,253, # f0
-)
-
-win1253_char_to_order_map = (
-255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10
-253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20
-252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30
-253, 82,100,104, 94, 98,101,116,102,111,187,117, 92, 88,113, 85, # 40
- 79,118,105, 83, 67,114,119, 95, 99,109,188,253,253,253,253,253, # 50
-253, 72, 70, 80, 81, 60, 96, 93, 89, 68,120, 97, 77, 86, 69, 55, # 60
- 78,115, 65, 66, 58, 76,106,103, 87,107,112,253,253,253,253,253, # 70
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 80
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 90
-253,233, 61,253,253,253,253,253,253,253,253,253,253, 74,253,253, # a0
-253,253,253,253,247,253,253, 36, 46, 71, 73,253, 54,253,108,123, # b0
-110, 31, 51, 43, 41, 34, 91, 40, 52, 47, 44, 53, 38, 49, 59, 39, # c0
- 35, 48,250, 37, 33, 45, 56, 50, 84, 57,120,121, 17, 18, 22, 15, # d0
-124, 1, 29, 20, 21, 3, 32, 13, 25, 5, 11, 16, 10, 6, 30, 4, # e0
- 9, 8, 14, 7, 2, 12, 28, 23, 42, 24, 64, 75, 19, 26, 27,253, # f0
-)
-
-# Model Table:
-# total sequences: 100%
-# first 512 sequences: 98.2851%
-# first 1024 sequences:1.7001%
-# rest sequences: 0.0359%
-# negative sequences: 0.0148%
-GreekLangModel = (
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,3,2,2,3,3,3,3,3,3,3,3,1,3,3,3,0,2,2,3,3,0,3,0,3,2,0,3,3,3,0,
-3,0,0,0,2,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,3,3,3,3,3,0,3,3,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map': Latin7_char_to_order_map,
- 'precedence_matrix': GreekLangModel,
- 'typical_positive_ratio': 0.982851,
- 'keep_english_letter': False,
- 'charset_name': "ISO-8859-7",
- 'language': 'Greek',
-}
-
-Win1253GreekModel = {
- 'char_to_order_map': win1253_char_to_order_map,
- 'precedence_matrix': GreekLangModel,
- 'typical_positive_ratio': 0.982851,
- 'keep_english_letter': False,
- 'charset_name': "windows-1253",
- 'language': 'Greek',
-}
diff --git a/lib/chardet/langhebrewmodel.py b/lib/chardet/langhebrewmodel.py
deleted file mode 100644
index 58f4c875ec..0000000000
--- a/lib/chardet/langhebrewmodel.py
+++ /dev/null
@@ -1,200 +0,0 @@
-######################## BEGIN LICENSE BLOCK ########################
-# The Original Code is Mozilla Universal charset detector code.
-#
-# The Initial Developer of the Original Code is
-# Simon Montagu
-# Portions created by the Initial Developer are Copyright (C) 2005
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Mark Pilgrim - port to Python
-# Shy Shalom - original C code
-# Shoshannah Forbes - original C code (?)
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301 USA
-######################### END LICENSE BLOCK #########################
-
-# 255: Control characters that usually does not exist in any text
-# 254: Carriage/Return
-# 253: symbol (punctuation) that does not belong to word
-# 252: 0 - 9
-
-# Windows-1255 language model
-# Character Mapping Table:
-WIN1255_CHAR_TO_ORDER_MAP = (
-255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10
-253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20
-252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30
-253, 69, 91, 79, 80, 92, 89, 97, 90, 68,111,112, 82, 73, 95, 85, # 40
- 78,121, 86, 71, 67,102,107, 84,114,103,115,253,253,253,253,253, # 50
-253, 50, 74, 60, 61, 42, 76, 70, 64, 53,105, 93, 56, 65, 54, 49, # 60
- 66,110, 51, 43, 44, 63, 81, 77, 98, 75,108,253,253,253,253,253, # 70
-124,202,203,204,205, 40, 58,206,207,208,209,210,211,212,213,214,
-215, 83, 52, 47, 46, 72, 32, 94,216,113,217,109,218,219,220,221,
- 34,116,222,118,100,223,224,117,119,104,125,225,226, 87, 99,227,
-106,122,123,228, 55,229,230,101,231,232,120,233, 48, 39, 57,234,
- 30, 59, 41, 88, 33, 37, 36, 31, 29, 35,235, 62, 28,236,126,237,
-238, 38, 45,239,240,241,242,243,127,244,245,246,247,248,249,250,
- 9, 8, 20, 16, 3, 2, 24, 14, 22, 1, 25, 15, 4, 11, 6, 23,
- 12, 19, 13, 26, 18, 27, 21, 17, 7, 10, 5,251,252,128, 96,253,
-)
-
-# Model Table:
-# total sequences: 100%
-# first 512 sequences: 98.4004%
-# first 1024 sequences: 1.5981%
-# rest sequences: 0.087%
-# negative sequences: 0.0015%
-HEBREW_LANG_MODEL = (
-0,3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,3,3,3,2,3,2,1,2,0,1,0,0,
-3,0,3,1,0,0,1,3,2,0,1,1,2,0,2,2,2,1,1,1,1,2,1,1,1,2,0,0,2,2,0,1,
-3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,2,2,2,
-1,2,1,2,1,2,0,0,2,0,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,1,0,
-3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,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HEBREW_LANG_MODEL,
- 'typical_positive_ratio': 0.984004,
- 'keep_english_letter': False,
- 'charset_name': "windows-1255",
- 'language': 'Hebrew',
-}
diff --git a/lib/chardet/langhungarianmodel.py b/lib/chardet/langhungarianmodel.py
deleted file mode 100644
index bb7c095e1e..0000000000
--- a/lib/chardet/langhungarianmodel.py
+++ /dev/null
@@ -1,225 +0,0 @@
-######################## BEGIN LICENSE BLOCK ########################
-# The Original Code is Mozilla Communicator client code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Mark Pilgrim - port to Python
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301 USA
-######################### END LICENSE BLOCK #########################
-
-# 255: Control characters that usually does not exist in any text
-# 254: Carriage/Return
-# 253: symbol (punctuation) that does not belong to word
-# 252: 0 - 9
-
-# Character Mapping Table:
-Latin2_HungarianCharToOrderMap = (
-255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10
-253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20
-252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30
-253, 28, 40, 54, 45, 32, 50, 49, 38, 39, 53, 36, 41, 34, 35, 47,
- 46, 71, 43, 33, 37, 57, 48, 64, 68, 55, 52,253,253,253,253,253,
-253, 2, 18, 26, 17, 1, 27, 12, 20, 9, 22, 7, 6, 13, 4, 8,
- 23, 67, 10, 5, 3, 21, 19, 65, 62, 16, 11,253,253,253,253,253,
-159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,
-175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,
-191,192,193,194,195,196,197, 75,198,199,200,201,202,203,204,205,
- 79,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,
-221, 51, 81,222, 78,223,224,225,226, 44,227,228,229, 61,230,231,
-232,233,234, 58,235, 66, 59,236,237,238, 60, 69, 63,239,240,241,
- 82, 14, 74,242, 70, 80,243, 72,244, 15, 83, 77, 84, 30, 76, 85,
-245,246,247, 25, 73, 42, 24,248,249,250, 31, 56, 29,251,252,253,
-)
-
-win1250HungarianCharToOrderMap = (
-255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10
-253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20
-252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30
-253, 28, 40, 54, 45, 32, 50, 49, 38, 39, 53, 36, 41, 34, 35, 47,
- 46, 72, 43, 33, 37, 57, 48, 64, 68, 55, 52,253,253,253,253,253,
-253, 2, 18, 26, 17, 1, 27, 12, 20, 9, 22, 7, 6, 13, 4, 8,
- 23, 67, 10, 5, 3, 21, 19, 65, 62, 16, 11,253,253,253,253,253,
-161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,
-177,178,179,180, 78,181, 69,182,183,184,185,186,187,188,189,190,
-191,192,193,194,195,196,197, 76,198,199,200,201,202,203,204,205,
- 81,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,
-221, 51, 83,222, 80,223,224,225,226, 44,227,228,229, 61,230,231,
-232,233,234, 58,235, 66, 59,236,237,238, 60, 70, 63,239,240,241,
- 84, 14, 75,242, 71, 82,243, 73,244, 15, 85, 79, 86, 30, 77, 87,
-245,246,247, 25, 74, 42, 24,248,249,250, 31, 56, 29,251,252,253,
-)
-
-# Model Table:
-# total sequences: 100%
-# first 512 sequences: 94.7368%
-# first 1024 sequences:5.2623%
-# rest sequences: 0.8894%
-# negative sequences: 0.0009%
-HungarianLangModel = (
-0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,
-3,3,3,3,3,3,3,3,3,3,2,3,3,3,3,3,3,3,3,2,2,3,3,1,1,2,2,2,2,2,1,2,
-3,2,2,3,3,3,3,3,2,3,3,3,3,3,3,1,2,3,3,3,3,2,3,3,1,1,3,3,0,1,1,1,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,
-3,2,1,3,3,3,3,3,2,3,3,3,3,3,1,1,2,3,3,3,3,3,3,3,1,1,3,2,0,1,1,1,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,
-3,3,3,3,3,3,3,3,3,3,3,1,1,2,3,3,3,1,3,3,3,3,3,1,3,3,2,2,0,3,2,3,
-0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,
-3,3,3,3,3,3,2,3,3,3,2,3,3,2,3,3,3,3,3,2,3,3,2,2,3,2,3,2,0,3,2,2,
-0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,
-3,3,3,3,3,3,2,3,3,3,3,3,2,3,3,3,1,2,3,2,2,3,1,2,3,3,2,2,0,3,3,3,
-0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,
-3,3,3,3,3,3,3,3,3,3,2,2,3,3,3,3,3,3,2,3,3,3,3,2,3,3,3,3,0,2,3,2,
-0,0,0,1,1,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,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0,1,1,2,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,1,1,1,0,1,0,0,1,1,0,1,0,1,1,0,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,0,
-2,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,1,0,0,1,0,1,0,1,1,1,0,0,1,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-1,0,0,1,1,1,1,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
-0,1,1,1,1,1,1,0,1,1,0,1,0,1,0,0,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,
-)
-
-Latin2HungarianModel = {
- 'char_to_order_map': Latin2_HungarianCharToOrderMap,
- 'precedence_matrix': HungarianLangModel,
- 'typical_positive_ratio': 0.947368,
- 'keep_english_letter': True,
- 'charset_name': "ISO-8859-2",
- 'language': 'Hungarian',
-}
-
-Win1250HungarianModel = {
- 'char_to_order_map': win1250HungarianCharToOrderMap,
- 'precedence_matrix': HungarianLangModel,
- 'typical_positive_ratio': 0.947368,
- 'keep_english_letter': True,
- 'charset_name': "windows-1250",
- 'language': 'Hungarian',
-}
diff --git a/lib/chardet/langthaimodel.py b/lib/chardet/langthaimodel.py
deleted file mode 100644
index 15f94c2df0..0000000000
--- a/lib/chardet/langthaimodel.py
+++ /dev/null
@@ -1,199 +0,0 @@
-######################## BEGIN LICENSE BLOCK ########################
-# The Original Code is Mozilla Communicator client code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Mark Pilgrim - port to Python
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301 USA
-######################### END LICENSE BLOCK #########################
-
-# 255: Control characters that usually does not exist in any text
-# 254: Carriage/Return
-# 253: symbol (punctuation) that does not belong to word
-# 252: 0 - 9
-
-# The following result for thai was collected from a limited sample (1M).
-
-# Character Mapping Table:
-TIS620CharToOrderMap = (
-255,255,255,255,255,255,255,255,255,255,254,255,255,254,255,255, # 00
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255, # 10
-253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253, # 20
-252,252,252,252,252,252,252,252,252,252,253,253,253,253,253,253, # 30
-253,182,106,107,100,183,184,185,101, 94,186,187,108,109,110,111, # 40
-188,189,190, 89, 95,112,113,191,192,193,194,253,253,253,253,253, # 50
-253, 64, 72, 73,114, 74,115,116,102, 81,201,117, 90,103, 78, 82, # 60
- 96,202, 91, 79, 84,104,105, 97, 98, 92,203,253,253,253,253,253, # 70
-209,210,211,212,213, 88,214,215,216,217,218,219,220,118,221,222,
-223,224, 99, 85, 83,225,226,227,228,229,230,231,232,233,234,235,
-236, 5, 30,237, 24,238, 75, 8, 26, 52, 34, 51,119, 47, 58, 57,
- 49, 53, 55, 43, 20, 19, 44, 14, 48, 3, 17, 25, 39, 62, 31, 54,
- 45, 9, 16, 2, 61, 15,239, 12, 42, 46, 18, 21, 76, 4, 66, 63,
- 22, 10, 1, 36, 23, 13, 40, 27, 32, 35, 86,240,241,242,243,244,
- 11, 28, 41, 29, 33,245, 50, 37, 6, 7, 67, 77, 38, 93,246,247,
- 68, 56, 59, 65, 69, 60, 70, 80, 71, 87,248,249,250,251,252,253,
-)
-
-# Model Table:
-# total sequences: 100%
-# first 512 sequences: 92.6386%
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0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,1,1,0,0,2,1,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-)
-
-TIS620ThaiModel = {
- 'char_to_order_map': TIS620CharToOrderMap,
- 'precedence_matrix': ThaiLangModel,
- 'typical_positive_ratio': 0.926386,
- 'keep_english_letter': False,
- 'charset_name': "TIS-620",
- 'language': 'Thai',
-}
diff --git a/lib/chardet/langturkishmodel.py b/lib/chardet/langturkishmodel.py
deleted file mode 100644
index a427a45739..0000000000
--- a/lib/chardet/langturkishmodel.py
+++ /dev/null
@@ -1,193 +0,0 @@
-# -*- coding: utf-8 -*-
-######################## BEGIN LICENSE BLOCK ########################
-# The Original Code is Mozilla Communicator client code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Mark Pilgrim - port to Python
-# Özgür Baskın - Turkish Language Model
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301 USA
-######################### END LICENSE BLOCK #########################
-
-# 255: Control characters that usually does not exist in any text
-# 254: Carriage/Return
-# 253: symbol (punctuation) that does not belong to word
-# 252: 0 - 9
-
-# Character Mapping Table:
-Latin5_TurkishCharToOrderMap = (
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
-255, 23, 37, 47, 39, 29, 52, 36, 45, 53, 60, 16, 49, 20, 46, 42,
- 48, 69, 44, 35, 31, 51, 38, 62, 65, 43, 56,255,255,255,255,255,
-255, 1, 21, 28, 12, 2, 18, 27, 25, 3, 24, 10, 5, 13, 4, 15,
- 26, 64, 7, 8, 9, 14, 32, 57, 58, 11, 22,255,255,255,255,255,
-180,179,178,177,176,175,174,173,172,171,170,169,168,167,166,165,
-164,163,162,161,160,159,101,158,157,156,155,154,153,152,151,106,
-150,149,148,147,146,145,144,100,143,142,141,140,139,138,137,136,
- 94, 80, 93,135,105,134,133, 63,132,131,130,129,128,127,126,125,
-124,104, 73, 99, 79, 85,123, 54,122, 98, 92,121,120, 91,103,119,
- 68,118,117, 97,116,115, 50, 90,114,113,112,111, 55, 41, 40, 86,
- 89, 70, 59, 78, 71, 82, 88, 33, 77, 66, 84, 83,110, 75, 61, 96,
- 30, 67,109, 74, 87,102, 34, 95, 81,108, 76, 72, 17, 6, 19,107,
-)
-
-TurkishLangModel = (
-3,2,3,3,3,1,3,3,3,3,3,3,3,3,2,1,1,3,3,1,3,3,0,3,3,3,3,3,0,3,1,3,
-3,2,1,0,0,1,1,0,0,0,1,0,0,1,1,1,1,0,0,0,0,0,0,0,2,2,0,0,1,0,0,1,
-3,2,2,3,3,0,3,3,3,3,3,3,3,2,3,1,0,3,3,1,3,3,0,3,3,3,3,3,0,3,0,3,
-3,1,1,0,1,0,1,0,0,0,0,0,0,1,1,1,1,0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,0,0,0,0,0,0,0,0,0,0,
-)
-
-Latin5TurkishModel = {
- 'char_to_order_map': Latin5_TurkishCharToOrderMap,
- 'precedence_matrix': TurkishLangModel,
- 'typical_positive_ratio': 0.970290,
- 'keep_english_letter': True,
- 'charset_name': "ISO-8859-9",
- 'language': 'Turkish',
-}
diff --git a/lib/chardet/latin1prober.py b/lib/chardet/latin1prober.py
deleted file mode 100644
index 7d1e8c20fb..0000000000
--- a/lib/chardet/latin1prober.py
+++ /dev/null
@@ -1,145 +0,0 @@
-######################## BEGIN LICENSE BLOCK ########################
-# The Original Code is Mozilla Universal charset detector code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 2001
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Mark Pilgrim - port to Python
-# Shy Shalom - original C code
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301 USA
-######################### END LICENSE BLOCK #########################
-
-from .charsetprober import CharSetProber
-from .enums import ProbingState
-
-FREQ_CAT_NUM = 4
-
-UDF = 0 # undefined
-OTH = 1 # other
-ASC = 2 # ascii capital letter
-ASS = 3 # ascii small letter
-ACV = 4 # accent capital vowel
-ACO = 5 # accent capital other
-ASV = 6 # accent small vowel
-ASO = 7 # accent small other
-CLASS_NUM = 8 # total classes
-
-Latin1_CharToClass = (
- OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # 00 - 07
- OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # 08 - 0F
- OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # 10 - 17
- OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # 18 - 1F
- OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # 20 - 27
- OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # 28 - 2F
- OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # 30 - 37
- OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # 38 - 3F
- OTH, ASC, ASC, ASC, ASC, ASC, ASC, ASC, # 40 - 47
- ASC, ASC, ASC, ASC, ASC, ASC, ASC, ASC, # 48 - 4F
- ASC, ASC, ASC, ASC, ASC, ASC, ASC, ASC, # 50 - 57
- ASC, ASC, ASC, OTH, OTH, OTH, OTH, OTH, # 58 - 5F
- OTH, ASS, ASS, ASS, ASS, ASS, ASS, ASS, # 60 - 67
- ASS, ASS, ASS, ASS, ASS, ASS, ASS, ASS, # 68 - 6F
- ASS, ASS, ASS, ASS, ASS, ASS, ASS, ASS, # 70 - 77
- ASS, ASS, ASS, OTH, OTH, OTH, OTH, OTH, # 78 - 7F
- OTH, UDF, OTH, ASO, OTH, OTH, OTH, OTH, # 80 - 87
- OTH, OTH, ACO, OTH, ACO, UDF, ACO, UDF, # 88 - 8F
- UDF, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # 90 - 97
- OTH, OTH, ASO, OTH, ASO, UDF, ASO, ACO, # 98 - 9F
- OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # A0 - A7
- OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # A8 - AF
- OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # B0 - B7
- OTH, OTH, OTH, OTH, OTH, OTH, OTH, OTH, # B8 - BF
- ACV, ACV, ACV, ACV, ACV, ACV, ACO, ACO, # C0 - C7
- ACV, ACV, ACV, ACV, ACV, ACV, ACV, ACV, # C8 - CF
- ACO, ACO, ACV, ACV, ACV, ACV, ACV, OTH, # D0 - D7
- ACV, ACV, ACV, ACV, ACV, ACO, ACO, ACO, # D8 - DF
- ASV, ASV, ASV, ASV, ASV, ASV, ASO, ASO, # E0 - E7
- ASV, ASV, ASV, ASV, ASV, ASV, ASV, ASV, # E8 - EF
- ASO, ASO, ASV, ASV, ASV, ASV, ASV, OTH, # F0 - F7
- ASV, ASV, ASV, ASV, ASV, ASO, ASO, ASO, # F8 - FF
-)
-
-# 0 : illegal
-# 1 : very unlikely
-# 2 : normal
-# 3 : very likely
-Latin1ClassModel = (
-# UDF OTH ASC ASS ACV ACO ASV ASO
- 0, 0, 0, 0, 0, 0, 0, 0, # UDF
- 0, 3, 3, 3, 3, 3, 3, 3, # OTH
- 0, 3, 3, 3, 3, 3, 3, 3, # ASC
- 0, 3, 3, 3, 1, 1, 3, 3, # ASS
- 0, 3, 3, 3, 1, 2, 1, 2, # ACV
- 0, 3, 3, 3, 3, 3, 3, 3, # ACO
- 0, 3, 1, 3, 1, 1, 1, 3, # ASV
- 0, 3, 1, 3, 1, 1, 3, 3, # ASO
-)
-
-
-class Latin1Prober(CharSetProber):
- def __init__(self):
- super(Latin1Prober, self).__init__()
- self._last_char_class = None
- self._freq_counter = None
- self.reset()
-
- def reset(self):
- self._last_char_class = OTH
- self._freq_counter = [0] * FREQ_CAT_NUM
- CharSetProber.reset(self)
-
- @property
- def charset_name(self):
- return "ISO-8859-1"
-
- @property
- def language(self):
- return ""
-
- def feed(self, byte_str):
- byte_str = self.filter_with_english_letters(byte_str)
- for c in byte_str:
- char_class = Latin1_CharToClass[c]
- freq = Latin1ClassModel[(self._last_char_class * CLASS_NUM)
- + char_class]
- if freq == 0:
- self._state = ProbingState.NOT_ME
- break
- self._freq_counter[freq] += 1
- self._last_char_class = char_class
-
- return self.state
-
- def get_confidence(self):
- if self.state == ProbingState.NOT_ME:
- return 0.01
-
- total = sum(self._freq_counter)
- if total < 0.01:
- confidence = 0.0
- else:
- confidence = ((self._freq_counter[3] - self._freq_counter[1] * 20.0)
- / total)
- if confidence < 0.0:
- confidence = 0.0
- # lower the confidence of latin1 so that other more accurate
- # detector can take priority.
- confidence = confidence * 0.73
- return confidence
diff --git a/lib/chardet/mbcharsetprober.py b/lib/chardet/mbcharsetprober.py
deleted file mode 100644
index 6256ecfd1e..0000000000
--- a/lib/chardet/mbcharsetprober.py
+++ /dev/null
@@ -1,91 +0,0 @@
-######################## BEGIN LICENSE BLOCK ########################
-# The Original Code is Mozilla Universal charset detector code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 2001
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Mark Pilgrim - port to Python
-# Shy Shalom - original C code
-# Proofpoint, Inc.
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301 USA
-######################### END LICENSE BLOCK #########################
-
-from .charsetprober import CharSetProber
-from .enums import ProbingState, MachineState
-
-
-class MultiByteCharSetProber(CharSetProber):
- """
- MultiByteCharSetProber
- """
-
- def __init__(self, lang_filter=None):
- super(MultiByteCharSetProber, self).__init__(lang_filter=lang_filter)
- self.distribution_analyzer = None
- self.coding_sm = None
- self._last_char = [0, 0]
-
- def reset(self):
- super(MultiByteCharSetProber, self).reset()
- if self.coding_sm:
- self.coding_sm.reset()
- if self.distribution_analyzer:
- self.distribution_analyzer.reset()
- self._last_char = [0, 0]
-
- @property
- def charset_name(self):
- raise NotImplementedError
-
- @property
- def language(self):
- raise NotImplementedError
-
- def feed(self, byte_str):
- for i in range(len(byte_str)):
- coding_state = self.coding_sm.next_state(byte_str[i])
- if coding_state == MachineState.ERROR:
- self.logger.debug('%s %s prober hit error at byte %s',
- self.charset_name, self.language, i)
- self._state = ProbingState.NOT_ME
- break
- elif coding_state == MachineState.ITS_ME:
- self._state = ProbingState.FOUND_IT
- break
- elif coding_state == MachineState.START:
- char_len = self.coding_sm.get_current_charlen()
- if i == 0:
- self._last_char[1] = byte_str[0]
- self.distribution_analyzer.feed(self._last_char, char_len)
- else:
- self.distribution_analyzer.feed(byte_str[i - 1:i + 1],
- char_len)
-
- self._last_char[0] = byte_str[-1]
-
- if self.state == ProbingState.DETECTING:
- if (self.distribution_analyzer.got_enough_data() and
- (self.get_confidence() > self.SHORTCUT_THRESHOLD)):
- self._state = ProbingState.FOUND_IT
-
- return self.state
-
- def get_confidence(self):
- return self.distribution_analyzer.get_confidence()
diff --git a/lib/chardet/mbcsgroupprober.py b/lib/chardet/mbcsgroupprober.py
deleted file mode 100644
index 530abe75e0..0000000000
--- a/lib/chardet/mbcsgroupprober.py
+++ /dev/null
@@ -1,54 +0,0 @@
-######################## BEGIN LICENSE BLOCK ########################
-# The Original Code is Mozilla Universal charset detector code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 2001
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Mark Pilgrim - port to Python
-# Shy Shalom - original C code
-# Proofpoint, Inc.
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301 USA
-######################### END LICENSE BLOCK #########################
-
-from .charsetgroupprober import CharSetGroupProber
-from .utf8prober import UTF8Prober
-from .sjisprober import SJISProber
-from .eucjpprober import EUCJPProber
-from .gb2312prober import GB2312Prober
-from .euckrprober import EUCKRProber
-from .cp949prober import CP949Prober
-from .big5prober import Big5Prober
-from .euctwprober import EUCTWProber
-
-
-class MBCSGroupProber(CharSetGroupProber):
- def __init__(self, lang_filter=None):
- super(MBCSGroupProber, self).__init__(lang_filter=lang_filter)
- self.probers = [
- UTF8Prober(),
- SJISProber(),
- EUCJPProber(),
- GB2312Prober(),
- EUCKRProber(),
- CP949Prober(),
- Big5Prober(),
- EUCTWProber()
- ]
- self.reset()
diff --git a/lib/chardet/mbcssm.py b/lib/chardet/mbcssm.py
deleted file mode 100644
index 8360d0f284..0000000000
--- a/lib/chardet/mbcssm.py
+++ /dev/null
@@ -1,572 +0,0 @@
-######################## BEGIN LICENSE BLOCK ########################
-# The Original Code is mozilla.org code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Mark Pilgrim - port to Python
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301 USA
-######################### END LICENSE BLOCK #########################
-
-from .enums import MachineState
-
-# BIG5
-
-BIG5_CLS = (
- 1,1,1,1,1,1,1,1, # 00 - 07 #allow 0x00 as legal value
- 1,1,1,1,1,1,0,0, # 08 - 0f
- 1,1,1,1,1,1,1,1, # 10 - 17
- 1,1,1,0,1,1,1,1, # 18 - 1f
- 1,1,1,1,1,1,1,1, # 20 - 27
- 1,1,1,1,1,1,1,1, # 28 - 2f
- 1,1,1,1,1,1,1,1, # 30 - 37
- 1,1,1,1,1,1,1,1, # 38 - 3f
- 2,2,2,2,2,2,2,2, # 40 - 47
- 2,2,2,2,2,2,2,2, # 48 - 4f
- 2,2,2,2,2,2,2,2, # 50 - 57
- 2,2,2,2,2,2,2,2, # 58 - 5f
- 2,2,2,2,2,2,2,2, # 60 - 67
- 2,2,2,2,2,2,2,2, # 68 - 6f
- 2,2,2,2,2,2,2,2, # 70 - 77
- 2,2,2,2,2,2,2,1, # 78 - 7f
- 4,4,4,4,4,4,4,4, # 80 - 87
- 4,4,4,4,4,4,4,4, # 88 - 8f
- 4,4,4,4,4,4,4,4, # 90 - 97
- 4,4,4,4,4,4,4,4, # 98 - 9f
- 4,3,3,3,3,3,3,3, # a0 - a7
- 3,3,3,3,3,3,3,3, # a8 - af
- 3,3,3,3,3,3,3,3, # b0 - b7
- 3,3,3,3,3,3,3,3, # b8 - bf
- 3,3,3,3,3,3,3,3, # c0 - c7
- 3,3,3,3,3,3,3,3, # c8 - cf
- 3,3,3,3,3,3,3,3, # d0 - d7
- 3,3,3,3,3,3,3,3, # d8 - df
- 3,3,3,3,3,3,3,3, # e0 - e7
- 3,3,3,3,3,3,3,3, # e8 - ef
- 3,3,3,3,3,3,3,3, # f0 - f7
- 3,3,3,3,3,3,3,0 # f8 - ff
-)
-
-BIG5_ST = (
- MachineState.ERROR,MachineState.START,MachineState.START, 3,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#00-07
- MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,#08-0f
- MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START#10-17
-)
-
-BIG5_CHAR_LEN_TABLE = (0, 1, 1, 2, 0)
-
-BIG5_SM_MODEL = {'class_table': BIG5_CLS,
- 'class_factor': 5,
- 'state_table': BIG5_ST,
- 'char_len_table': BIG5_CHAR_LEN_TABLE,
- 'name': 'Big5'}
-
-# CP949
-
-CP949_CLS = (
- 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,0,0, # 00 - 0f
- 1,1,1,1,1,1,1,1, 1,1,1,0,1,1,1,1, # 10 - 1f
- 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, # 20 - 2f
- 1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, # 30 - 3f
- 1,4,4,4,4,4,4,4, 4,4,4,4,4,4,4,4, # 40 - 4f
- 4,4,5,5,5,5,5,5, 5,5,5,1,1,1,1,1, # 50 - 5f
- 1,5,5,5,5,5,5,5, 5,5,5,5,5,5,5,5, # 60 - 6f
- 5,5,5,5,5,5,5,5, 5,5,5,1,1,1,1,1, # 70 - 7f
- 0,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6, # 80 - 8f
- 6,6,6,6,6,6,6,6, 6,6,6,6,6,6,6,6, # 90 - 9f
- 6,7,7,7,7,7,7,7, 7,7,7,7,7,8,8,8, # a0 - af
- 7,7,7,7,7,7,7,7, 7,7,7,7,7,7,7,7, # b0 - bf
- 7,7,7,7,7,7,9,2, 2,3,2,2,2,2,2,2, # c0 - cf
- 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, # d0 - df
- 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2, # e0 - ef
- 2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,0, # f0 - ff
-)
-
-CP949_ST = (
-#cls= 0 1 2 3 4 5 6 7 8 9 # previous state =
- MachineState.ERROR,MachineState.START, 3,MachineState.ERROR,MachineState.START,MachineState.START, 4, 5,MachineState.ERROR, 6, # MachineState.START
- MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, # MachineState.ERROR
- MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME, # MachineState.ITS_ME
- MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START, # 3
- MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START, # 4
- MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START, # 5
- MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START, # 6
-)
-
-CP949_CHAR_LEN_TABLE = (0, 1, 2, 0, 1, 1, 2, 2, 0, 2)
-
-CP949_SM_MODEL = {'class_table': CP949_CLS,
- 'class_factor': 10,
- 'state_table': CP949_ST,
- 'char_len_table': CP949_CHAR_LEN_TABLE,
- 'name': 'CP949'}
-
-# EUC-JP
-
-EUCJP_CLS = (
- 4,4,4,4,4,4,4,4, # 00 - 07
- 4,4,4,4,4,4,5,5, # 08 - 0f
- 4,4,4,4,4,4,4,4, # 10 - 17
- 4,4,4,5,4,4,4,4, # 18 - 1f
- 4,4,4,4,4,4,4,4, # 20 - 27
- 4,4,4,4,4,4,4,4, # 28 - 2f
- 4,4,4,4,4,4,4,4, # 30 - 37
- 4,4,4,4,4,4,4,4, # 38 - 3f
- 4,4,4,4,4,4,4,4, # 40 - 47
- 4,4,4,4,4,4,4,4, # 48 - 4f
- 4,4,4,4,4,4,4,4, # 50 - 57
- 4,4,4,4,4,4,4,4, # 58 - 5f
- 4,4,4,4,4,4,4,4, # 60 - 67
- 4,4,4,4,4,4,4,4, # 68 - 6f
- 4,4,4,4,4,4,4,4, # 70 - 77
- 4,4,4,4,4,4,4,4, # 78 - 7f
- 5,5,5,5,5,5,5,5, # 80 - 87
- 5,5,5,5,5,5,1,3, # 88 - 8f
- 5,5,5,5,5,5,5,5, # 90 - 97
- 5,5,5,5,5,5,5,5, # 98 - 9f
- 5,2,2,2,2,2,2,2, # a0 - a7
- 2,2,2,2,2,2,2,2, # a8 - af
- 2,2,2,2,2,2,2,2, # b0 - b7
- 2,2,2,2,2,2,2,2, # b8 - bf
- 2,2,2,2,2,2,2,2, # c0 - c7
- 2,2,2,2,2,2,2,2, # c8 - cf
- 2,2,2,2,2,2,2,2, # d0 - d7
- 2,2,2,2,2,2,2,2, # d8 - df
- 0,0,0,0,0,0,0,0, # e0 - e7
- 0,0,0,0,0,0,0,0, # e8 - ef
- 0,0,0,0,0,0,0,0, # f0 - f7
- 0,0,0,0,0,0,0,5 # f8 - ff
-)
-
-EUCJP_ST = (
- 3, 4, 3, 5,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#00-07
- MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f
- MachineState.ITS_ME,MachineState.ITS_ME,MachineState.START,MachineState.ERROR,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#10-17
- MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 3,MachineState.ERROR,#18-1f
- 3,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START#20-27
-)
-
-EUCJP_CHAR_LEN_TABLE = (2, 2, 2, 3, 1, 0)
-
-EUCJP_SM_MODEL = {'class_table': EUCJP_CLS,
- 'class_factor': 6,
- 'state_table': EUCJP_ST,
- 'char_len_table': EUCJP_CHAR_LEN_TABLE,
- 'name': 'EUC-JP'}
-
-# EUC-KR
-
-EUCKR_CLS = (
- 1,1,1,1,1,1,1,1, # 00 - 07
- 1,1,1,1,1,1,0,0, # 08 - 0f
- 1,1,1,1,1,1,1,1, # 10 - 17
- 1,1,1,0,1,1,1,1, # 18 - 1f
- 1,1,1,1,1,1,1,1, # 20 - 27
- 1,1,1,1,1,1,1,1, # 28 - 2f
- 1,1,1,1,1,1,1,1, # 30 - 37
- 1,1,1,1,1,1,1,1, # 38 - 3f
- 1,1,1,1,1,1,1,1, # 40 - 47
- 1,1,1,1,1,1,1,1, # 48 - 4f
- 1,1,1,1,1,1,1,1, # 50 - 57
- 1,1,1,1,1,1,1,1, # 58 - 5f
- 1,1,1,1,1,1,1,1, # 60 - 67
- 1,1,1,1,1,1,1,1, # 68 - 6f
- 1,1,1,1,1,1,1,1, # 70 - 77
- 1,1,1,1,1,1,1,1, # 78 - 7f
- 0,0,0,0,0,0,0,0, # 80 - 87
- 0,0,0,0,0,0,0,0, # 88 - 8f
- 0,0,0,0,0,0,0,0, # 90 - 97
- 0,0,0,0,0,0,0,0, # 98 - 9f
- 0,2,2,2,2,2,2,2, # a0 - a7
- 2,2,2,2,2,3,3,3, # a8 - af
- 2,2,2,2,2,2,2,2, # b0 - b7
- 2,2,2,2,2,2,2,2, # b8 - bf
- 2,2,2,2,2,2,2,2, # c0 - c7
- 2,3,2,2,2,2,2,2, # c8 - cf
- 2,2,2,2,2,2,2,2, # d0 - d7
- 2,2,2,2,2,2,2,2, # d8 - df
- 2,2,2,2,2,2,2,2, # e0 - e7
- 2,2,2,2,2,2,2,2, # e8 - ef
- 2,2,2,2,2,2,2,2, # f0 - f7
- 2,2,2,2,2,2,2,0 # f8 - ff
-)
-
-EUCKR_ST = (
- MachineState.ERROR,MachineState.START, 3,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#00-07
- MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START #08-0f
-)
-
-EUCKR_CHAR_LEN_TABLE = (0, 1, 2, 0)
-
-EUCKR_SM_MODEL = {'class_table': EUCKR_CLS,
- 'class_factor': 4,
- 'state_table': EUCKR_ST,
- 'char_len_table': EUCKR_CHAR_LEN_TABLE,
- 'name': 'EUC-KR'}
-
-# EUC-TW
-
-EUCTW_CLS = (
- 2,2,2,2,2,2,2,2, # 00 - 07
- 2,2,2,2,2,2,0,0, # 08 - 0f
- 2,2,2,2,2,2,2,2, # 10 - 17
- 2,2,2,0,2,2,2,2, # 18 - 1f
- 2,2,2,2,2,2,2,2, # 20 - 27
- 2,2,2,2,2,2,2,2, # 28 - 2f
- 2,2,2,2,2,2,2,2, # 30 - 37
- 2,2,2,2,2,2,2,2, # 38 - 3f
- 2,2,2,2,2,2,2,2, # 40 - 47
- 2,2,2,2,2,2,2,2, # 48 - 4f
- 2,2,2,2,2,2,2,2, # 50 - 57
- 2,2,2,2,2,2,2,2, # 58 - 5f
- 2,2,2,2,2,2,2,2, # 60 - 67
- 2,2,2,2,2,2,2,2, # 68 - 6f
- 2,2,2,2,2,2,2,2, # 70 - 77
- 2,2,2,2,2,2,2,2, # 78 - 7f
- 0,0,0,0,0,0,0,0, # 80 - 87
- 0,0,0,0,0,0,6,0, # 88 - 8f
- 0,0,0,0,0,0,0,0, # 90 - 97
- 0,0,0,0,0,0,0,0, # 98 - 9f
- 0,3,4,4,4,4,4,4, # a0 - a7
- 5,5,1,1,1,1,1,1, # a8 - af
- 1,1,1,1,1,1,1,1, # b0 - b7
- 1,1,1,1,1,1,1,1, # b8 - bf
- 1,1,3,1,3,3,3,3, # c0 - c7
- 3,3,3,3,3,3,3,3, # c8 - cf
- 3,3,3,3,3,3,3,3, # d0 - d7
- 3,3,3,3,3,3,3,3, # d8 - df
- 3,3,3,3,3,3,3,3, # e0 - e7
- 3,3,3,3,3,3,3,3, # e8 - ef
- 3,3,3,3,3,3,3,3, # f0 - f7
- 3,3,3,3,3,3,3,0 # f8 - ff
-)
-
-EUCTW_ST = (
- MachineState.ERROR,MachineState.ERROR,MachineState.START, 3, 3, 3, 4,MachineState.ERROR,#00-07
- MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f
- MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.START,MachineState.ERROR,#10-17
- MachineState.START,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#18-1f
- 5,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.ERROR,MachineState.START,MachineState.START,#20-27
- MachineState.START,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START #28-2f
-)
-
-EUCTW_CHAR_LEN_TABLE = (0, 0, 1, 2, 2, 2, 3)
-
-EUCTW_SM_MODEL = {'class_table': EUCTW_CLS,
- 'class_factor': 7,
- 'state_table': EUCTW_ST,
- 'char_len_table': EUCTW_CHAR_LEN_TABLE,
- 'name': 'x-euc-tw'}
-
-# GB2312
-
-GB2312_CLS = (
- 1,1,1,1,1,1,1,1, # 00 - 07
- 1,1,1,1,1,1,0,0, # 08 - 0f
- 1,1,1,1,1,1,1,1, # 10 - 17
- 1,1,1,0,1,1,1,1, # 18 - 1f
- 1,1,1,1,1,1,1,1, # 20 - 27
- 1,1,1,1,1,1,1,1, # 28 - 2f
- 3,3,3,3,3,3,3,3, # 30 - 37
- 3,3,1,1,1,1,1,1, # 38 - 3f
- 2,2,2,2,2,2,2,2, # 40 - 47
- 2,2,2,2,2,2,2,2, # 48 - 4f
- 2,2,2,2,2,2,2,2, # 50 - 57
- 2,2,2,2,2,2,2,2, # 58 - 5f
- 2,2,2,2,2,2,2,2, # 60 - 67
- 2,2,2,2,2,2,2,2, # 68 - 6f
- 2,2,2,2,2,2,2,2, # 70 - 77
- 2,2,2,2,2,2,2,4, # 78 - 7f
- 5,6,6,6,6,6,6,6, # 80 - 87
- 6,6,6,6,6,6,6,6, # 88 - 8f
- 6,6,6,6,6,6,6,6, # 90 - 97
- 6,6,6,6,6,6,6,6, # 98 - 9f
- 6,6,6,6,6,6,6,6, # a0 - a7
- 6,6,6,6,6,6,6,6, # a8 - af
- 6,6,6,6,6,6,6,6, # b0 - b7
- 6,6,6,6,6,6,6,6, # b8 - bf
- 6,6,6,6,6,6,6,6, # c0 - c7
- 6,6,6,6,6,6,6,6, # c8 - cf
- 6,6,6,6,6,6,6,6, # d0 - d7
- 6,6,6,6,6,6,6,6, # d8 - df
- 6,6,6,6,6,6,6,6, # e0 - e7
- 6,6,6,6,6,6,6,6, # e8 - ef
- 6,6,6,6,6,6,6,6, # f0 - f7
- 6,6,6,6,6,6,6,0 # f8 - ff
-)
-
-GB2312_ST = (
- MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START, 3,MachineState.ERROR,#00-07
- MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f
- MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.START,#10-17
- 4,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#18-1f
- MachineState.ERROR,MachineState.ERROR, 5,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ERROR,#20-27
- MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.START #28-2f
-)
-
-# To be accurate, the length of class 6 can be either 2 or 4.
-# But it is not necessary to discriminate between the two since
-# it is used for frequency analysis only, and we are validating
-# each code range there as well. So it is safe to set it to be
-# 2 here.
-GB2312_CHAR_LEN_TABLE = (0, 1, 1, 1, 1, 1, 2)
-
-GB2312_SM_MODEL = {'class_table': GB2312_CLS,
- 'class_factor': 7,
- 'state_table': GB2312_ST,
- 'char_len_table': GB2312_CHAR_LEN_TABLE,
- 'name': 'GB2312'}
-
-# Shift_JIS
-
-SJIS_CLS = (
- 1,1,1,1,1,1,1,1, # 00 - 07
- 1,1,1,1,1,1,0,0, # 08 - 0f
- 1,1,1,1,1,1,1,1, # 10 - 17
- 1,1,1,0,1,1,1,1, # 18 - 1f
- 1,1,1,1,1,1,1,1, # 20 - 27
- 1,1,1,1,1,1,1,1, # 28 - 2f
- 1,1,1,1,1,1,1,1, # 30 - 37
- 1,1,1,1,1,1,1,1, # 38 - 3f
- 2,2,2,2,2,2,2,2, # 40 - 47
- 2,2,2,2,2,2,2,2, # 48 - 4f
- 2,2,2,2,2,2,2,2, # 50 - 57
- 2,2,2,2,2,2,2,2, # 58 - 5f
- 2,2,2,2,2,2,2,2, # 60 - 67
- 2,2,2,2,2,2,2,2, # 68 - 6f
- 2,2,2,2,2,2,2,2, # 70 - 77
- 2,2,2,2,2,2,2,1, # 78 - 7f
- 3,3,3,3,3,2,2,3, # 80 - 87
- 3,3,3,3,3,3,3,3, # 88 - 8f
- 3,3,3,3,3,3,3,3, # 90 - 97
- 3,3,3,3,3,3,3,3, # 98 - 9f
- #0xa0 is illegal in sjis encoding, but some pages does
- #contain such byte. We need to be more error forgiven.
- 2,2,2,2,2,2,2,2, # a0 - a7
- 2,2,2,2,2,2,2,2, # a8 - af
- 2,2,2,2,2,2,2,2, # b0 - b7
- 2,2,2,2,2,2,2,2, # b8 - bf
- 2,2,2,2,2,2,2,2, # c0 - c7
- 2,2,2,2,2,2,2,2, # c8 - cf
- 2,2,2,2,2,2,2,2, # d0 - d7
- 2,2,2,2,2,2,2,2, # d8 - df
- 3,3,3,3,3,3,3,3, # e0 - e7
- 3,3,3,3,3,4,4,4, # e8 - ef
- 3,3,3,3,3,3,3,3, # f0 - f7
- 3,3,3,3,3,0,0,0) # f8 - ff
-
-
-SJIS_ST = (
- MachineState.ERROR,MachineState.START,MachineState.START, 3,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#00-07
- MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f
- MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START #10-17
-)
-
-SJIS_CHAR_LEN_TABLE = (0, 1, 1, 2, 0, 0)
-
-SJIS_SM_MODEL = {'class_table': SJIS_CLS,
- 'class_factor': 6,
- 'state_table': SJIS_ST,
- 'char_len_table': SJIS_CHAR_LEN_TABLE,
- 'name': 'Shift_JIS'}
-
-# UCS2-BE
-
-UCS2BE_CLS = (
- 0,0,0,0,0,0,0,0, # 00 - 07
- 0,0,1,0,0,2,0,0, # 08 - 0f
- 0,0,0,0,0,0,0,0, # 10 - 17
- 0,0,0,3,0,0,0,0, # 18 - 1f
- 0,0,0,0,0,0,0,0, # 20 - 27
- 0,3,3,3,3,3,0,0, # 28 - 2f
- 0,0,0,0,0,0,0,0, # 30 - 37
- 0,0,0,0,0,0,0,0, # 38 - 3f
- 0,0,0,0,0,0,0,0, # 40 - 47
- 0,0,0,0,0,0,0,0, # 48 - 4f
- 0,0,0,0,0,0,0,0, # 50 - 57
- 0,0,0,0,0,0,0,0, # 58 - 5f
- 0,0,0,0,0,0,0,0, # 60 - 67
- 0,0,0,0,0,0,0,0, # 68 - 6f
- 0,0,0,0,0,0,0,0, # 70 - 77
- 0,0,0,0,0,0,0,0, # 78 - 7f
- 0,0,0,0,0,0,0,0, # 80 - 87
- 0,0,0,0,0,0,0,0, # 88 - 8f
- 0,0,0,0,0,0,0,0, # 90 - 97
- 0,0,0,0,0,0,0,0, # 98 - 9f
- 0,0,0,0,0,0,0,0, # a0 - a7
- 0,0,0,0,0,0,0,0, # a8 - af
- 0,0,0,0,0,0,0,0, # b0 - b7
- 0,0,0,0,0,0,0,0, # b8 - bf
- 0,0,0,0,0,0,0,0, # c0 - c7
- 0,0,0,0,0,0,0,0, # c8 - cf
- 0,0,0,0,0,0,0,0, # d0 - d7
- 0,0,0,0,0,0,0,0, # d8 - df
- 0,0,0,0,0,0,0,0, # e0 - e7
- 0,0,0,0,0,0,0,0, # e8 - ef
- 0,0,0,0,0,0,0,0, # f0 - f7
- 0,0,0,0,0,0,4,5 # f8 - ff
-)
-
-UCS2BE_ST = (
- 5, 7, 7,MachineState.ERROR, 4, 3,MachineState.ERROR,MachineState.ERROR,#00-07
- MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f
- MachineState.ITS_ME,MachineState.ITS_ME, 6, 6, 6, 6,MachineState.ERROR,MachineState.ERROR,#10-17
- 6, 6, 6, 6, 6,MachineState.ITS_ME, 6, 6,#18-1f
- 6, 6, 6, 6, 5, 7, 7,MachineState.ERROR,#20-27
- 5, 8, 6, 6,MachineState.ERROR, 6, 6, 6,#28-2f
- 6, 6, 6, 6,MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START #30-37
-)
-
-UCS2BE_CHAR_LEN_TABLE = (2, 2, 2, 0, 2, 2)
-
-UCS2BE_SM_MODEL = {'class_table': UCS2BE_CLS,
- 'class_factor': 6,
- 'state_table': UCS2BE_ST,
- 'char_len_table': UCS2BE_CHAR_LEN_TABLE,
- 'name': 'UTF-16BE'}
-
-# UCS2-LE
-
-UCS2LE_CLS = (
- 0,0,0,0,0,0,0,0, # 00 - 07
- 0,0,1,0,0,2,0,0, # 08 - 0f
- 0,0,0,0,0,0,0,0, # 10 - 17
- 0,0,0,3,0,0,0,0, # 18 - 1f
- 0,0,0,0,0,0,0,0, # 20 - 27
- 0,3,3,3,3,3,0,0, # 28 - 2f
- 0,0,0,0,0,0,0,0, # 30 - 37
- 0,0,0,0,0,0,0,0, # 38 - 3f
- 0,0,0,0,0,0,0,0, # 40 - 47
- 0,0,0,0,0,0,0,0, # 48 - 4f
- 0,0,0,0,0,0,0,0, # 50 - 57
- 0,0,0,0,0,0,0,0, # 58 - 5f
- 0,0,0,0,0,0,0,0, # 60 - 67
- 0,0,0,0,0,0,0,0, # 68 - 6f
- 0,0,0,0,0,0,0,0, # 70 - 77
- 0,0,0,0,0,0,0,0, # 78 - 7f
- 0,0,0,0,0,0,0,0, # 80 - 87
- 0,0,0,0,0,0,0,0, # 88 - 8f
- 0,0,0,0,0,0,0,0, # 90 - 97
- 0,0,0,0,0,0,0,0, # 98 - 9f
- 0,0,0,0,0,0,0,0, # a0 - a7
- 0,0,0,0,0,0,0,0, # a8 - af
- 0,0,0,0,0,0,0,0, # b0 - b7
- 0,0,0,0,0,0,0,0, # b8 - bf
- 0,0,0,0,0,0,0,0, # c0 - c7
- 0,0,0,0,0,0,0,0, # c8 - cf
- 0,0,0,0,0,0,0,0, # d0 - d7
- 0,0,0,0,0,0,0,0, # d8 - df
- 0,0,0,0,0,0,0,0, # e0 - e7
- 0,0,0,0,0,0,0,0, # e8 - ef
- 0,0,0,0,0,0,0,0, # f0 - f7
- 0,0,0,0,0,0,4,5 # f8 - ff
-)
-
-UCS2LE_ST = (
- 6, 6, 7, 6, 4, 3,MachineState.ERROR,MachineState.ERROR,#00-07
- MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#08-0f
- MachineState.ITS_ME,MachineState.ITS_ME, 5, 5, 5,MachineState.ERROR,MachineState.ITS_ME,MachineState.ERROR,#10-17
- 5, 5, 5,MachineState.ERROR, 5,MachineState.ERROR, 6, 6,#18-1f
- 7, 6, 8, 8, 5, 5, 5,MachineState.ERROR,#20-27
- 5, 5, 5,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 5, 5,#28-2f
- 5, 5, 5,MachineState.ERROR, 5,MachineState.ERROR,MachineState.START,MachineState.START #30-37
-)
-
-UCS2LE_CHAR_LEN_TABLE = (2, 2, 2, 2, 2, 2)
-
-UCS2LE_SM_MODEL = {'class_table': UCS2LE_CLS,
- 'class_factor': 6,
- 'state_table': UCS2LE_ST,
- 'char_len_table': UCS2LE_CHAR_LEN_TABLE,
- 'name': 'UTF-16LE'}
-
-# UTF-8
-
-UTF8_CLS = (
- 1,1,1,1,1,1,1,1, # 00 - 07 #allow 0x00 as a legal value
- 1,1,1,1,1,1,0,0, # 08 - 0f
- 1,1,1,1,1,1,1,1, # 10 - 17
- 1,1,1,0,1,1,1,1, # 18 - 1f
- 1,1,1,1,1,1,1,1, # 20 - 27
- 1,1,1,1,1,1,1,1, # 28 - 2f
- 1,1,1,1,1,1,1,1, # 30 - 37
- 1,1,1,1,1,1,1,1, # 38 - 3f
- 1,1,1,1,1,1,1,1, # 40 - 47
- 1,1,1,1,1,1,1,1, # 48 - 4f
- 1,1,1,1,1,1,1,1, # 50 - 57
- 1,1,1,1,1,1,1,1, # 58 - 5f
- 1,1,1,1,1,1,1,1, # 60 - 67
- 1,1,1,1,1,1,1,1, # 68 - 6f
- 1,1,1,1,1,1,1,1, # 70 - 77
- 1,1,1,1,1,1,1,1, # 78 - 7f
- 2,2,2,2,3,3,3,3, # 80 - 87
- 4,4,4,4,4,4,4,4, # 88 - 8f
- 4,4,4,4,4,4,4,4, # 90 - 97
- 4,4,4,4,4,4,4,4, # 98 - 9f
- 5,5,5,5,5,5,5,5, # a0 - a7
- 5,5,5,5,5,5,5,5, # a8 - af
- 5,5,5,5,5,5,5,5, # b0 - b7
- 5,5,5,5,5,5,5,5, # b8 - bf
- 0,0,6,6,6,6,6,6, # c0 - c7
- 6,6,6,6,6,6,6,6, # c8 - cf
- 6,6,6,6,6,6,6,6, # d0 - d7
- 6,6,6,6,6,6,6,6, # d8 - df
- 7,8,8,8,8,8,8,8, # e0 - e7
- 8,8,8,8,8,9,8,8, # e8 - ef
- 10,11,11,11,11,11,11,11, # f0 - f7
- 12,13,13,13,14,15,0,0 # f8 - ff
-)
-
-UTF8_ST = (
- MachineState.ERROR,MachineState.START,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 12, 10,#00-07
- 9, 11, 8, 7, 6, 5, 4, 3,#08-0f
- MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#10-17
- MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#18-1f
- MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#20-27
- MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,MachineState.ITS_ME,#28-2f
- MachineState.ERROR,MachineState.ERROR, 5, 5, 5, 5,MachineState.ERROR,MachineState.ERROR,#30-37
- MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#38-3f
- MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 5, 5, 5,MachineState.ERROR,MachineState.ERROR,#40-47
- MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#48-4f
- MachineState.ERROR,MachineState.ERROR, 7, 7, 7, 7,MachineState.ERROR,MachineState.ERROR,#50-57
- MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#58-5f
- MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 7, 7,MachineState.ERROR,MachineState.ERROR,#60-67
- MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#68-6f
- MachineState.ERROR,MachineState.ERROR, 9, 9, 9, 9,MachineState.ERROR,MachineState.ERROR,#70-77
- MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#78-7f
- MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 9,MachineState.ERROR,MachineState.ERROR,#80-87
- MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#88-8f
- MachineState.ERROR,MachineState.ERROR, 12, 12, 12, 12,MachineState.ERROR,MachineState.ERROR,#90-97
- MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#98-9f
- MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR, 12,MachineState.ERROR,MachineState.ERROR,#a0-a7
- MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#a8-af
- MachineState.ERROR,MachineState.ERROR, 12, 12, 12,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#b0-b7
- MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,#b8-bf
- MachineState.ERROR,MachineState.ERROR,MachineState.START,MachineState.START,MachineState.START,MachineState.START,MachineState.ERROR,MachineState.ERROR,#c0-c7
- MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR,MachineState.ERROR #c8-cf
-)
-
-UTF8_CHAR_LEN_TABLE = (0, 1, 0, 0, 0, 0, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6)
-
-UTF8_SM_MODEL = {'class_table': UTF8_CLS,
- 'class_factor': 16,
- 'state_table': UTF8_ST,
- 'char_len_table': UTF8_CHAR_LEN_TABLE,
- 'name': 'UTF-8'}
diff --git a/lib/chardet/sbcharsetprober.py b/lib/chardet/sbcharsetprober.py
deleted file mode 100644
index 0adb51de5a..0000000000
--- a/lib/chardet/sbcharsetprober.py
+++ /dev/null
@@ -1,132 +0,0 @@
-######################## BEGIN LICENSE BLOCK ########################
-# The Original Code is Mozilla Universal charset detector code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 2001
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Mark Pilgrim - port to Python
-# Shy Shalom - original C code
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301 USA
-######################### END LICENSE BLOCK #########################
-
-from .charsetprober import CharSetProber
-from .enums import CharacterCategory, ProbingState, SequenceLikelihood
-
-
-class SingleByteCharSetProber(CharSetProber):
- SAMPLE_SIZE = 64
- SB_ENOUGH_REL_THRESHOLD = 1024 # 0.25 * SAMPLE_SIZE^2
- POSITIVE_SHORTCUT_THRESHOLD = 0.95
- NEGATIVE_SHORTCUT_THRESHOLD = 0.05
-
- def __init__(self, model, reversed=False, name_prober=None):
- super(SingleByteCharSetProber, self).__init__()
- self._model = model
- # TRUE if we need to reverse every pair in the model lookup
- self._reversed = reversed
- # Optional auxiliary prober for name decision
- self._name_prober = name_prober
- self._last_order = None
- self._seq_counters = None
- self._total_seqs = None
- self._total_char = None
- self._freq_char = None
- self.reset()
-
- def reset(self):
- super(SingleByteCharSetProber, self).reset()
- # char order of last character
- self._last_order = 255
- self._seq_counters = [0] * SequenceLikelihood.get_num_categories()
- self._total_seqs = 0
- self._total_char = 0
- # characters that fall in our sampling range
- self._freq_char = 0
-
- @property
- def charset_name(self):
- if self._name_prober:
- return self._name_prober.charset_name
- else:
- return self._model['charset_name']
-
- @property
- def language(self):
- if self._name_prober:
- return self._name_prober.language
- else:
- return self._model.get('language')
-
- def feed(self, byte_str):
- if not self._model['keep_english_letter']:
- byte_str = self.filter_international_words(byte_str)
- if not byte_str:
- return self.state
- char_to_order_map = self._model['char_to_order_map']
- for i, c in enumerate(byte_str):
- # XXX: Order is in range 1-64, so one would think we want 0-63 here,
- # but that leads to 27 more test failures than before.
- order = char_to_order_map[c]
- # XXX: This was SYMBOL_CAT_ORDER before, with a value of 250, but
- # CharacterCategory.SYMBOL is actually 253, so we use CONTROL
- # to make it closer to the original intent. The only difference
- # is whether or not we count digits and control characters for
- # _total_char purposes.
- if order < CharacterCategory.CONTROL:
- self._total_char += 1
- if order < self.SAMPLE_SIZE:
- self._freq_char += 1
- if self._last_order < self.SAMPLE_SIZE:
- self._total_seqs += 1
- if not self._reversed:
- i = (self._last_order * self.SAMPLE_SIZE) + order
- model = self._model['precedence_matrix'][i]
- else: # reverse the order of the letters in the lookup
- i = (order * self.SAMPLE_SIZE) + self._last_order
- model = self._model['precedence_matrix'][i]
- self._seq_counters[model] += 1
- self._last_order = order
-
- charset_name = self._model['charset_name']
- if self.state == ProbingState.DETECTING:
- if self._total_seqs > self.SB_ENOUGH_REL_THRESHOLD:
- confidence = self.get_confidence()
- if confidence > self.POSITIVE_SHORTCUT_THRESHOLD:
- self.logger.debug('%s confidence = %s, we have a winner',
- charset_name, confidence)
- self._state = ProbingState.FOUND_IT
- elif confidence < self.NEGATIVE_SHORTCUT_THRESHOLD:
- self.logger.debug('%s confidence = %s, below negative '
- 'shortcut threshhold %s', charset_name,
- confidence,
- self.NEGATIVE_SHORTCUT_THRESHOLD)
- self._state = ProbingState.NOT_ME
-
- return self.state
-
- def get_confidence(self):
- r = 0.01
- if self._total_seqs > 0:
- r = ((1.0 * self._seq_counters[SequenceLikelihood.POSITIVE]) /
- self._total_seqs / self._model['typical_positive_ratio'])
- r = r * self._freq_char / self._total_char
- if r >= 1.0:
- r = 0.99
- return r
diff --git a/lib/chardet/sbcsgroupprober.py b/lib/chardet/sbcsgroupprober.py
deleted file mode 100644
index 98e95dc1a3..0000000000
--- a/lib/chardet/sbcsgroupprober.py
+++ /dev/null
@@ -1,73 +0,0 @@
-######################## BEGIN LICENSE BLOCK ########################
-# The Original Code is Mozilla Universal charset detector code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 2001
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Mark Pilgrim - port to Python
-# Shy Shalom - original C code
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301 USA
-######################### END LICENSE BLOCK #########################
-
-from .charsetgroupprober import CharSetGroupProber
-from .sbcharsetprober import SingleByteCharSetProber
-from .langcyrillicmodel import (Win1251CyrillicModel, Koi8rModel,
- Latin5CyrillicModel, MacCyrillicModel,
- Ibm866Model, Ibm855Model)
-from .langgreekmodel import Latin7GreekModel, Win1253GreekModel
-from .langbulgarianmodel import Latin5BulgarianModel, Win1251BulgarianModel
-# from .langhungarianmodel import Latin2HungarianModel, Win1250HungarianModel
-from .langthaimodel import TIS620ThaiModel
-from .langhebrewmodel import Win1255HebrewModel
-from .hebrewprober import HebrewProber
-from .langturkishmodel import Latin5TurkishModel
-
-
-class SBCSGroupProber(CharSetGroupProber):
- def __init__(self):
- super(SBCSGroupProber, self).__init__()
- self.probers = [
- SingleByteCharSetProber(Win1251CyrillicModel),
- SingleByteCharSetProber(Koi8rModel),
- SingleByteCharSetProber(Latin5CyrillicModel),
- SingleByteCharSetProber(MacCyrillicModel),
- SingleByteCharSetProber(Ibm866Model),
- SingleByteCharSetProber(Ibm855Model),
- SingleByteCharSetProber(Latin7GreekModel),
- SingleByteCharSetProber(Win1253GreekModel),
- SingleByteCharSetProber(Latin5BulgarianModel),
- SingleByteCharSetProber(Win1251BulgarianModel),
- # TODO: Restore Hungarian encodings (iso-8859-2 and windows-1250)
- # after we retrain model.
- # SingleByteCharSetProber(Latin2HungarianModel),
- # SingleByteCharSetProber(Win1250HungarianModel),
- SingleByteCharSetProber(TIS620ThaiModel),
- SingleByteCharSetProber(Latin5TurkishModel),
- ]
- hebrew_prober = HebrewProber()
- logical_hebrew_prober = SingleByteCharSetProber(Win1255HebrewModel,
- False, hebrew_prober)
- visual_hebrew_prober = SingleByteCharSetProber(Win1255HebrewModel, True,
- hebrew_prober)
- hebrew_prober.set_model_probers(logical_hebrew_prober, visual_hebrew_prober)
- self.probers.extend([hebrew_prober, logical_hebrew_prober,
- visual_hebrew_prober])
-
- self.reset()
diff --git a/lib/chardet/sjisprober.py b/lib/chardet/sjisprober.py
deleted file mode 100644
index 9e29623bdc..0000000000
--- a/lib/chardet/sjisprober.py
+++ /dev/null
@@ -1,92 +0,0 @@
-######################## BEGIN LICENSE BLOCK ########################
-# The Original Code is mozilla.org code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Mark Pilgrim - port to Python
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301 USA
-######################### END LICENSE BLOCK #########################
-
-from .mbcharsetprober import MultiByteCharSetProber
-from .codingstatemachine import CodingStateMachine
-from .chardistribution import SJISDistributionAnalysis
-from .jpcntx import SJISContextAnalysis
-from .mbcssm import SJIS_SM_MODEL
-from .enums import ProbingState, MachineState
-
-
-class SJISProber(MultiByteCharSetProber):
- def __init__(self):
- super(SJISProber, self).__init__()
- self.coding_sm = CodingStateMachine(SJIS_SM_MODEL)
- self.distribution_analyzer = SJISDistributionAnalysis()
- self.context_analyzer = SJISContextAnalysis()
- self.reset()
-
- def reset(self):
- super(SJISProber, self).reset()
- self.context_analyzer.reset()
-
- @property
- def charset_name(self):
- return self.context_analyzer.charset_name
-
- @property
- def language(self):
- return "Japanese"
-
- def feed(self, byte_str):
- for i in range(len(byte_str)):
- coding_state = self.coding_sm.next_state(byte_str[i])
- if coding_state == MachineState.ERROR:
- self.logger.debug('%s %s prober hit error at byte %s',
- self.charset_name, self.language, i)
- self._state = ProbingState.NOT_ME
- break
- elif coding_state == MachineState.ITS_ME:
- self._state = ProbingState.FOUND_IT
- break
- elif coding_state == MachineState.START:
- char_len = self.coding_sm.get_current_charlen()
- if i == 0:
- self._last_char[1] = byte_str[0]
- self.context_analyzer.feed(self._last_char[2 - char_len:],
- char_len)
- self.distribution_analyzer.feed(self._last_char, char_len)
- else:
- self.context_analyzer.feed(byte_str[i + 1 - char_len:i + 3
- - char_len], char_len)
- self.distribution_analyzer.feed(byte_str[i - 1:i + 1],
- char_len)
-
- self._last_char[0] = byte_str[-1]
-
- if self.state == ProbingState.DETECTING:
- if (self.context_analyzer.got_enough_data() and
- (self.get_confidence() > self.SHORTCUT_THRESHOLD)):
- self._state = ProbingState.FOUND_IT
-
- return self.state
-
- def get_confidence(self):
- context_conf = self.context_analyzer.get_confidence()
- distrib_conf = self.distribution_analyzer.get_confidence()
- return max(context_conf, distrib_conf)
diff --git a/lib/chardet/universaldetector.py b/lib/chardet/universaldetector.py
deleted file mode 100644
index 7b4e92d615..0000000000
--- a/lib/chardet/universaldetector.py
+++ /dev/null
@@ -1,286 +0,0 @@
-######################## BEGIN LICENSE BLOCK ########################
-# The Original Code is Mozilla Universal charset detector code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 2001
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Mark Pilgrim - port to Python
-# Shy Shalom - original C code
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301 USA
-######################### END LICENSE BLOCK #########################
-"""
-Module containing the UniversalDetector detector class, which is the primary
-class a user of ``chardet`` should use.
-
-:author: Mark Pilgrim (initial port to Python)
-:author: Shy Shalom (original C code)
-:author: Dan Blanchard (major refactoring for 3.0)
-:author: Ian Cordasco
-"""
-
-
-import codecs
-import logging
-import re
-
-from .charsetgroupprober import CharSetGroupProber
-from .enums import InputState, LanguageFilter, ProbingState
-from .escprober import EscCharSetProber
-from .latin1prober import Latin1Prober
-from .mbcsgroupprober import MBCSGroupProber
-from .sbcsgroupprober import SBCSGroupProber
-
-
-class UniversalDetector(object):
- """
- The ``UniversalDetector`` class underlies the ``chardet.detect`` function
- and coordinates all of the different charset probers.
-
- To get a ``dict`` containing an encoding and its confidence, you can simply
- run:
-
- .. code::
-
- u = UniversalDetector()
- u.feed(some_bytes)
- u.close()
- detected = u.result
-
- """
-
- MINIMUM_THRESHOLD = 0.20
- HIGH_BYTE_DETECTOR = re.compile(b'[\x80-\xFF]')
- ESC_DETECTOR = re.compile(b'(\033|~{)')
- WIN_BYTE_DETECTOR = re.compile(b'[\x80-\x9F]')
- ISO_WIN_MAP = {'iso-8859-1': 'Windows-1252',
- 'iso-8859-2': 'Windows-1250',
- 'iso-8859-5': 'Windows-1251',
- 'iso-8859-6': 'Windows-1256',
- 'iso-8859-7': 'Windows-1253',
- 'iso-8859-8': 'Windows-1255',
- 'iso-8859-9': 'Windows-1254',
- 'iso-8859-13': 'Windows-1257'}
-
- def __init__(self, lang_filter=LanguageFilter.ALL):
- self._esc_charset_prober = None
- self._charset_probers = []
- self.result = None
- self.done = None
- self._got_data = None
- self._input_state = None
- self._last_char = None
- self.lang_filter = lang_filter
- self.logger = logging.getLogger(__name__)
- self._has_win_bytes = None
- self.reset()
-
- def reset(self):
- """
- Reset the UniversalDetector and all of its probers back to their
- initial states. This is called by ``__init__``, so you only need to
- call this directly in between analyses of different documents.
- """
- self.result = {'encoding': None, 'confidence': 0.0, 'language': None}
- self.done = False
- self._got_data = False
- self._has_win_bytes = False
- self._input_state = InputState.PURE_ASCII
- self._last_char = b''
- if self._esc_charset_prober:
- self._esc_charset_prober.reset()
- for prober in self._charset_probers:
- prober.reset()
-
- def feed(self, byte_str):
- """
- Takes a chunk of a document and feeds it through all of the relevant
- charset probers.
-
- After calling ``feed``, you can check the value of the ``done``
- attribute to see if you need to continue feeding the
- ``UniversalDetector`` more data, or if it has made a prediction
- (in the ``result`` attribute).
-
- .. note::
- You should always call ``close`` when you're done feeding in your
- document if ``done`` is not already ``True``.
- """
- if self.done:
- return
-
- if not len(byte_str):
- return
-
- if not isinstance(byte_str, bytearray):
- byte_str = bytearray(byte_str)
-
- # First check for known BOMs, since these are guaranteed to be correct
- if not self._got_data:
- # If the data starts with BOM, we know it is UTF
- if byte_str.startswith(codecs.BOM_UTF8):
- # EF BB BF UTF-8 with BOM
- self.result = {'encoding': "UTF-8-SIG",
- 'confidence': 1.0,
- 'language': ''}
- elif byte_str.startswith((codecs.BOM_UTF32_LE,
- codecs.BOM_UTF32_BE)):
- # FF FE 00 00 UTF-32, little-endian BOM
- # 00 00 FE FF UTF-32, big-endian BOM
- self.result = {'encoding': "UTF-32",
- 'confidence': 1.0,
- 'language': ''}
- elif byte_str.startswith(b'\xFE\xFF\x00\x00'):
- # FE FF 00 00 UCS-4, unusual octet order BOM (3412)
- self.result = {'encoding': "X-ISO-10646-UCS-4-3412",
- 'confidence': 1.0,
- 'language': ''}
- elif byte_str.startswith(b'\x00\x00\xFF\xFE'):
- # 00 00 FF FE UCS-4, unusual octet order BOM (2143)
- self.result = {'encoding': "X-ISO-10646-UCS-4-2143",
- 'confidence': 1.0,
- 'language': ''}
- elif byte_str.startswith((codecs.BOM_LE, codecs.BOM_BE)):
- # FF FE UTF-16, little endian BOM
- # FE FF UTF-16, big endian BOM
- self.result = {'encoding': "UTF-16",
- 'confidence': 1.0,
- 'language': ''}
-
- self._got_data = True
- if self.result['encoding'] is not None:
- self.done = True
- return
-
- # If none of those matched and we've only see ASCII so far, check
- # for high bytes and escape sequences
- if self._input_state == InputState.PURE_ASCII:
- if self.HIGH_BYTE_DETECTOR.search(byte_str):
- self._input_state = InputState.HIGH_BYTE
- elif self._input_state == InputState.PURE_ASCII and \
- self.ESC_DETECTOR.search(self._last_char + byte_str):
- self._input_state = InputState.ESC_ASCII
-
- self._last_char = byte_str[-1:]
-
- # If we've seen escape sequences, use the EscCharSetProber, which
- # uses a simple state machine to check for known escape sequences in
- # HZ and ISO-2022 encodings, since those are the only encodings that
- # use such sequences.
- if self._input_state == InputState.ESC_ASCII:
- if not self._esc_charset_prober:
- self._esc_charset_prober = EscCharSetProber(self.lang_filter)
- if self._esc_charset_prober.feed(byte_str) == ProbingState.FOUND_IT:
- self.result = {'encoding':
- self._esc_charset_prober.charset_name,
- 'confidence':
- self._esc_charset_prober.get_confidence(),
- 'language':
- self._esc_charset_prober.language}
- self.done = True
- # If we've seen high bytes (i.e., those with values greater than 127),
- # we need to do more complicated checks using all our multi-byte and
- # single-byte probers that are left. The single-byte probers
- # use character bigram distributions to determine the encoding, whereas
- # the multi-byte probers use a combination of character unigram and
- # bigram distributions.
- elif self._input_state == InputState.HIGH_BYTE:
- if not self._charset_probers:
- self._charset_probers = [MBCSGroupProber(self.lang_filter)]
- # If we're checking non-CJK encodings, use single-byte prober
- if self.lang_filter & LanguageFilter.NON_CJK:
- self._charset_probers.append(SBCSGroupProber())
- self._charset_probers.append(Latin1Prober())
- for prober in self._charset_probers:
- if prober.feed(byte_str) == ProbingState.FOUND_IT:
- self.result = {'encoding': prober.charset_name,
- 'confidence': prober.get_confidence(),
- 'language': prober.language}
- self.done = True
- break
- if self.WIN_BYTE_DETECTOR.search(byte_str):
- self._has_win_bytes = True
-
- def close(self):
- """
- Stop analyzing the current document and come up with a final
- prediction.
-
- :returns: The ``result`` attribute, a ``dict`` with the keys
- `encoding`, `confidence`, and `language`.
- """
- # Don't bother with checks if we're already done
- if self.done:
- return self.result
- self.done = True
-
- if not self._got_data:
- self.logger.debug('no data received!')
-
- # Default to ASCII if it is all we've seen so far
- elif self._input_state == InputState.PURE_ASCII:
- self.result = {'encoding': 'ascii',
- 'confidence': 1.0,
- 'language': ''}
-
- # If we have seen non-ASCII, return the best that met MINIMUM_THRESHOLD
- elif self._input_state == InputState.HIGH_BYTE:
- prober_confidence = None
- max_prober_confidence = 0.0
- max_prober = None
- for prober in self._charset_probers:
- if not prober:
- continue
- prober_confidence = prober.get_confidence()
- if prober_confidence > max_prober_confidence:
- max_prober_confidence = prober_confidence
- max_prober = prober
- if max_prober and (max_prober_confidence > self.MINIMUM_THRESHOLD):
- charset_name = max_prober.charset_name
- lower_charset_name = max_prober.charset_name.lower()
- confidence = max_prober.get_confidence()
- # Use Windows encoding name instead of ISO-8859 if we saw any
- # extra Windows-specific bytes
- if lower_charset_name.startswith('iso-8859'):
- if self._has_win_bytes:
- charset_name = self.ISO_WIN_MAP.get(lower_charset_name,
- charset_name)
- self.result = {'encoding': charset_name,
- 'confidence': confidence,
- 'language': max_prober.language}
-
- # Log all prober confidences if none met MINIMUM_THRESHOLD
- if self.logger.getEffectiveLevel() == logging.DEBUG:
- if self.result['encoding'] is None:
- self.logger.debug('no probers hit minimum threshold')
- for group_prober in self._charset_probers:
- if not group_prober:
- continue
- if isinstance(group_prober, CharSetGroupProber):
- for prober in group_prober.probers:
- self.logger.debug('%s %s confidence = %s',
- prober.charset_name,
- prober.language,
- prober.get_confidence())
- else:
- self.logger.debug('%s %s confidence = %s',
- prober.charset_name,
- prober.language,
- prober.get_confidence())
- return self.result
diff --git a/lib/chardet/utf8prober.py b/lib/chardet/utf8prober.py
deleted file mode 100644
index 6c3196cc2d..0000000000
--- a/lib/chardet/utf8prober.py
+++ /dev/null
@@ -1,82 +0,0 @@
-######################## BEGIN LICENSE BLOCK ########################
-# The Original Code is mozilla.org code.
-#
-# The Initial Developer of the Original Code is
-# Netscape Communications Corporation.
-# Portions created by the Initial Developer are Copyright (C) 1998
-# the Initial Developer. All Rights Reserved.
-#
-# Contributor(s):
-# Mark Pilgrim - port to Python
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation; either
-# version 2.1 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-# 02110-1301 USA
-######################### END LICENSE BLOCK #########################
-
-from .charsetprober import CharSetProber
-from .enums import ProbingState, MachineState
-from .codingstatemachine import CodingStateMachine
-from .mbcssm import UTF8_SM_MODEL
-
-
-
-class UTF8Prober(CharSetProber):
- ONE_CHAR_PROB = 0.5
-
- def __init__(self):
- super(UTF8Prober, self).__init__()
- self.coding_sm = CodingStateMachine(UTF8_SM_MODEL)
- self._num_mb_chars = None
- self.reset()
-
- def reset(self):
- super(UTF8Prober, self).reset()
- self.coding_sm.reset()
- self._num_mb_chars = 0
-
- @property
- def charset_name(self):
- return "utf-8"
-
- @property
- def language(self):
- return ""
-
- def feed(self, byte_str):
- for c in byte_str:
- coding_state = self.coding_sm.next_state(c)
- if coding_state == MachineState.ERROR:
- self._state = ProbingState.NOT_ME
- break
- elif coding_state == MachineState.ITS_ME:
- self._state = ProbingState.FOUND_IT
- break
- elif coding_state == MachineState.START:
- if self.coding_sm.get_current_charlen() >= 2:
- self._num_mb_chars += 1
-
- if self.state == ProbingState.DETECTING:
- if self.get_confidence() > self.SHORTCUT_THRESHOLD:
- self._state = ProbingState.FOUND_IT
-
- return self.state
-
- def get_confidence(self):
- unlike = 0.99
- if self._num_mb_chars < 6:
- unlike *= self.ONE_CHAR_PROB ** self._num_mb_chars
- return 1.0 - unlike
- else:
- return unlike
diff --git a/lib/chardet/version.py b/lib/chardet/version.py
deleted file mode 100644
index bb2a34a70e..0000000000
--- a/lib/chardet/version.py
+++ /dev/null
@@ -1,9 +0,0 @@
-"""
-This module exists only to simplify retrieving the version number of chardet
-from within setup.py and from chardet subpackages.
-
-:author: Dan Blanchard (dan.blanchard@gmail.com)
-"""
-
-__version__ = "3.0.4"
-VERSION = __version__.split('.')
diff --git a/lib/click/__init__.py b/lib/click/__init__.py
deleted file mode 100644
index d3c33660a9..0000000000
--- a/lib/click/__init__.py
+++ /dev/null
@@ -1,97 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
-click
-~~~~~
-
-Click is a simple Python module inspired by the stdlib optparse to make
-writing command line scripts fun. Unlike other modules, it's based
-around a simple API that does not come with too much magic and is
-composable.
-
-:copyright: © 2014 by the Pallets team.
-:license: BSD, see LICENSE.rst for more details.
-"""
-
-# Core classes
-from .core import Context, BaseCommand, Command, MultiCommand, Group, \
- CommandCollection, Parameter, Option, Argument
-
-# Globals
-from .globals import get_current_context
-
-# Decorators
-from .decorators import pass_context, pass_obj, make_pass_decorator, \
- command, group, argument, option, confirmation_option, \
- password_option, version_option, help_option
-
-# Types
-from .types import ParamType, File, Path, Choice, IntRange, Tuple, \
- DateTime, STRING, INT, FLOAT, BOOL, UUID, UNPROCESSED, FloatRange
-
-# Utilities
-from .utils import echo, get_binary_stream, get_text_stream, open_file, \
- format_filename, get_app_dir, get_os_args
-
-# Terminal functions
-from .termui import prompt, confirm, get_terminal_size, echo_via_pager, \
- progressbar, clear, style, unstyle, secho, edit, launch, getchar, \
- pause
-
-# Exceptions
-from .exceptions import ClickException, UsageError, BadParameter, \
- FileError, Abort, NoSuchOption, BadOptionUsage, BadArgumentUsage, \
- MissingParameter
-
-# Formatting
-from .formatting import HelpFormatter, wrap_text
-
-# Parsing
-from .parser import OptionParser
-
-
-__all__ = [
- # Core classes
- 'Context', 'BaseCommand', 'Command', 'MultiCommand', 'Group',
- 'CommandCollection', 'Parameter', 'Option', 'Argument',
-
- # Globals
- 'get_current_context',
-
- # Decorators
- 'pass_context', 'pass_obj', 'make_pass_decorator', 'command', 'group',
- 'argument', 'option', 'confirmation_option', 'password_option',
- 'version_option', 'help_option',
-
- # Types
- 'ParamType', 'File', 'Path', 'Choice', 'IntRange', 'Tuple',
- 'DateTime', 'STRING', 'INT', 'FLOAT', 'BOOL', 'UUID', 'UNPROCESSED',
- 'FloatRange',
-
- # Utilities
- 'echo', 'get_binary_stream', 'get_text_stream', 'open_file',
- 'format_filename', 'get_app_dir', 'get_os_args',
-
- # Terminal functions
- 'prompt', 'confirm', 'get_terminal_size', 'echo_via_pager',
- 'progressbar', 'clear', 'style', 'unstyle', 'secho', 'edit', 'launch',
- 'getchar', 'pause',
-
- # Exceptions
- 'ClickException', 'UsageError', 'BadParameter', 'FileError',
- 'Abort', 'NoSuchOption', 'BadOptionUsage', 'BadArgumentUsage',
- 'MissingParameter',
-
- # Formatting
- 'HelpFormatter', 'wrap_text',
-
- # Parsing
- 'OptionParser',
-]
-
-
-# Controls if click should emit the warning about the use of unicode
-# literals.
-disable_unicode_literals_warning = False
-
-
-__version__ = '7.0'
diff --git a/lib/click/_bashcomplete.py b/lib/click/_bashcomplete.py
deleted file mode 100644
index a5f1084c9a..0000000000
--- a/lib/click/_bashcomplete.py
+++ /dev/null
@@ -1,293 +0,0 @@
-import copy
-import os
-import re
-
-from .utils import echo
-from .parser import split_arg_string
-from .core import MultiCommand, Option, Argument
-from .types import Choice
-
-try:
- from collections import abc
-except ImportError:
- import collections as abc
-
-WORDBREAK = '='
-
-# Note, only BASH version 4.4 and later have the nosort option.
-COMPLETION_SCRIPT_BASH = '''
-%(complete_func)s() {
- local IFS=$'\n'
- COMPREPLY=( $( env COMP_WORDS="${COMP_WORDS[*]}" \\
- COMP_CWORD=$COMP_CWORD \\
- %(autocomplete_var)s=complete $1 ) )
- return 0
-}
-
-%(complete_func)setup() {
- local COMPLETION_OPTIONS=""
- local BASH_VERSION_ARR=(${BASH_VERSION//./ })
- # Only BASH version 4.4 and later have the nosort option.
- if [ ${BASH_VERSION_ARR[0]} -gt 4 ] || ([ ${BASH_VERSION_ARR[0]} -eq 4 ] && [ ${BASH_VERSION_ARR[1]} -ge 4 ]); then
- COMPLETION_OPTIONS="-o nosort"
- fi
-
- complete $COMPLETION_OPTIONS -F %(complete_func)s %(script_names)s
-}
-
-%(complete_func)setup
-'''
-
-COMPLETION_SCRIPT_ZSH = '''
-%(complete_func)s() {
- local -a completions
- local -a completions_with_descriptions
- local -a response
- response=("${(@f)$( env COMP_WORDS=\"${words[*]}\" \\
- COMP_CWORD=$((CURRENT-1)) \\
- %(autocomplete_var)s=\"complete_zsh\" \\
- %(script_names)s )}")
-
- for key descr in ${(kv)response}; do
- if [[ "$descr" == "_" ]]; then
- completions+=("$key")
- else
- completions_with_descriptions+=("$key":"$descr")
- fi
- done
-
- if [ -n "$completions_with_descriptions" ]; then
- _describe -V unsorted completions_with_descriptions -U -Q
- fi
-
- if [ -n "$completions" ]; then
- compadd -U -V unsorted -Q -a completions
- fi
- compstate[insert]="automenu"
-}
-
-compdef %(complete_func)s %(script_names)s
-'''
-
-_invalid_ident_char_re = re.compile(r'[^a-zA-Z0-9_]')
-
-
-def get_completion_script(prog_name, complete_var, shell):
- cf_name = _invalid_ident_char_re.sub('', prog_name.replace('-', '_'))
- script = COMPLETION_SCRIPT_ZSH if shell == 'zsh' else COMPLETION_SCRIPT_BASH
- return (script % {
- 'complete_func': '_%s_completion' % cf_name,
- 'script_names': prog_name,
- 'autocomplete_var': complete_var,
- }).strip() + ';'
-
-
-def resolve_ctx(cli, prog_name, args):
- """
- Parse into a hierarchy of contexts. Contexts are connected through the parent variable.
- :param cli: command definition
- :param prog_name: the program that is running
- :param args: full list of args
- :return: the final context/command parsed
- """
- ctx = cli.make_context(prog_name, args, resilient_parsing=True)
- args = ctx.protected_args + ctx.args
- while args:
- if isinstance(ctx.command, MultiCommand):
- if not ctx.command.chain:
- cmd_name, cmd, args = ctx.command.resolve_command(ctx, args)
- if cmd is None:
- return ctx
- ctx = cmd.make_context(cmd_name, args, parent=ctx,
- resilient_parsing=True)
- args = ctx.protected_args + ctx.args
- else:
- # Walk chained subcommand contexts saving the last one.
- while args:
- cmd_name, cmd, args = ctx.command.resolve_command(ctx, args)
- if cmd is None:
- return ctx
- sub_ctx = cmd.make_context(cmd_name, args, parent=ctx,
- allow_extra_args=True,
- allow_interspersed_args=False,
- resilient_parsing=True)
- args = sub_ctx.args
- ctx = sub_ctx
- args = sub_ctx.protected_args + sub_ctx.args
- else:
- break
- return ctx
-
-
-def start_of_option(param_str):
- """
- :param param_str: param_str to check
- :return: whether or not this is the start of an option declaration (i.e. starts "-" or "--")
- """
- return param_str and param_str[:1] == '-'
-
-
-def is_incomplete_option(all_args, cmd_param):
- """
- :param all_args: the full original list of args supplied
- :param cmd_param: the current command paramter
- :return: whether or not the last option declaration (i.e. starts "-" or "--") is incomplete and
- corresponds to this cmd_param. In other words whether this cmd_param option can still accept
- values
- """
- if not isinstance(cmd_param, Option):
- return False
- if cmd_param.is_flag:
- return False
- last_option = None
- for index, arg_str in enumerate(reversed([arg for arg in all_args if arg != WORDBREAK])):
- if index + 1 > cmd_param.nargs:
- break
- if start_of_option(arg_str):
- last_option = arg_str
-
- return True if last_option and last_option in cmd_param.opts else False
-
-
-def is_incomplete_argument(current_params, cmd_param):
- """
- :param current_params: the current params and values for this argument as already entered
- :param cmd_param: the current command parameter
- :return: whether or not the last argument is incomplete and corresponds to this cmd_param. In
- other words whether or not the this cmd_param argument can still accept values
- """
- if not isinstance(cmd_param, Argument):
- return False
- current_param_values = current_params[cmd_param.name]
- if current_param_values is None:
- return True
- if cmd_param.nargs == -1:
- return True
- if isinstance(current_param_values, abc.Iterable) \
- and cmd_param.nargs > 1 and len(current_param_values) < cmd_param.nargs:
- return True
- return False
-
-
-def get_user_autocompletions(ctx, args, incomplete, cmd_param):
- """
- :param ctx: context associated with the parsed command
- :param args: full list of args
- :param incomplete: the incomplete text to autocomplete
- :param cmd_param: command definition
- :return: all the possible user-specified completions for the param
- """
- results = []
- if isinstance(cmd_param.type, Choice):
- # Choices don't support descriptions.
- results = [(c, None)
- for c in cmd_param.type.choices if str(c).startswith(incomplete)]
- elif cmd_param.autocompletion is not None:
- dynamic_completions = cmd_param.autocompletion(ctx=ctx,
- args=args,
- incomplete=incomplete)
- results = [c if isinstance(c, tuple) else (c, None)
- for c in dynamic_completions]
- return results
-
-
-def get_visible_commands_starting_with(ctx, starts_with):
- """
- :param ctx: context associated with the parsed command
- :starts_with: string that visible commands must start with.
- :return: all visible (not hidden) commands that start with starts_with.
- """
- for c in ctx.command.list_commands(ctx):
- if c.startswith(starts_with):
- command = ctx.command.get_command(ctx, c)
- if not command.hidden:
- yield command
-
-
-def add_subcommand_completions(ctx, incomplete, completions_out):
- # Add subcommand completions.
- if isinstance(ctx.command, MultiCommand):
- completions_out.extend(
- [(c.name, c.get_short_help_str()) for c in get_visible_commands_starting_with(ctx, incomplete)])
-
- # Walk up the context list and add any other completion possibilities from chained commands
- while ctx.parent is not None:
- ctx = ctx.parent
- if isinstance(ctx.command, MultiCommand) and ctx.command.chain:
- remaining_commands = [c for c in get_visible_commands_starting_with(ctx, incomplete)
- if c.name not in ctx.protected_args]
- completions_out.extend([(c.name, c.get_short_help_str()) for c in remaining_commands])
-
-
-def get_choices(cli, prog_name, args, incomplete):
- """
- :param cli: command definition
- :param prog_name: the program that is running
- :param args: full list of args
- :param incomplete: the incomplete text to autocomplete
- :return: all the possible completions for the incomplete
- """
- all_args = copy.deepcopy(args)
-
- ctx = resolve_ctx(cli, prog_name, args)
- if ctx is None:
- return []
-
- # In newer versions of bash long opts with '='s are partitioned, but it's easier to parse
- # without the '='
- if start_of_option(incomplete) and WORDBREAK in incomplete:
- partition_incomplete = incomplete.partition(WORDBREAK)
- all_args.append(partition_incomplete[0])
- incomplete = partition_incomplete[2]
- elif incomplete == WORDBREAK:
- incomplete = ''
-
- completions = []
- if start_of_option(incomplete):
- # completions for partial options
- for param in ctx.command.params:
- if isinstance(param, Option) and not param.hidden:
- param_opts = [param_opt for param_opt in param.opts +
- param.secondary_opts if param_opt not in all_args or param.multiple]
- completions.extend([(o, param.help) for o in param_opts if o.startswith(incomplete)])
- return completions
- # completion for option values from user supplied values
- for param in ctx.command.params:
- if is_incomplete_option(all_args, param):
- return get_user_autocompletions(ctx, all_args, incomplete, param)
- # completion for argument values from user supplied values
- for param in ctx.command.params:
- if is_incomplete_argument(ctx.params, param):
- return get_user_autocompletions(ctx, all_args, incomplete, param)
-
- add_subcommand_completions(ctx, incomplete, completions)
- # Sort before returning so that proper ordering can be enforced in custom types.
- return sorted(completions)
-
-
-def do_complete(cli, prog_name, include_descriptions):
- cwords = split_arg_string(os.environ['COMP_WORDS'])
- cword = int(os.environ['COMP_CWORD'])
- args = cwords[1:cword]
- try:
- incomplete = cwords[cword]
- except IndexError:
- incomplete = ''
-
- for item in get_choices(cli, prog_name, args, incomplete):
- echo(item[0])
- if include_descriptions:
- # ZSH has trouble dealing with empty array parameters when returned from commands, so use a well defined character '_' to indicate no description is present.
- echo(item[1] if item[1] else '_')
-
- return True
-
-
-def bashcomplete(cli, prog_name, complete_var, complete_instr):
- if complete_instr.startswith('source'):
- shell = 'zsh' if complete_instr == 'source_zsh' else 'bash'
- echo(get_completion_script(prog_name, complete_var, shell))
- return True
- elif complete_instr == 'complete' or complete_instr == 'complete_zsh':
- return do_complete(cli, prog_name, complete_instr == 'complete_zsh')
- return False
diff --git a/lib/click/_compat.py b/lib/click/_compat.py
deleted file mode 100644
index 937e2301d4..0000000000
--- a/lib/click/_compat.py
+++ /dev/null
@@ -1,703 +0,0 @@
-import re
-import io
-import os
-import sys
-import codecs
-from weakref import WeakKeyDictionary
-
-
-PY2 = sys.version_info[0] == 2
-CYGWIN = sys.platform.startswith('cygwin')
-# Determine local App Engine environment, per Google's own suggestion
-APP_ENGINE = ('APPENGINE_RUNTIME' in os.environ and
- 'Development/' in os.environ['SERVER_SOFTWARE'])
-WIN = sys.platform.startswith('win') and not APP_ENGINE
-DEFAULT_COLUMNS = 80
-
-
-_ansi_re = re.compile(r'\033\[((?:\d|;)*)([a-zA-Z])')
-
-
-def get_filesystem_encoding():
- return sys.getfilesystemencoding() or sys.getdefaultencoding()
-
-
-def _make_text_stream(stream, encoding, errors,
- force_readable=False, force_writable=False):
- if encoding is None:
- encoding = get_best_encoding(stream)
- if errors is None:
- errors = 'replace'
- return _NonClosingTextIOWrapper(stream, encoding, errors,
- line_buffering=True,
- force_readable=force_readable,
- force_writable=force_writable)
-
-
-def is_ascii_encoding(encoding):
- """Checks if a given encoding is ascii."""
- try:
- return codecs.lookup(encoding).name == 'ascii'
- except LookupError:
- return False
-
-
-def get_best_encoding(stream):
- """Returns the default stream encoding if not found."""
- rv = getattr(stream, 'encoding', None) or sys.getdefaultencoding()
- if is_ascii_encoding(rv):
- return 'utf-8'
- return rv
-
-
-class _NonClosingTextIOWrapper(io.TextIOWrapper):
-
- def __init__(self, stream, encoding, errors,
- force_readable=False, force_writable=False, **extra):
- self._stream = stream = _FixupStream(stream, force_readable,
- force_writable)
- io.TextIOWrapper.__init__(self, stream, encoding, errors, **extra)
-
- # The io module is a place where the Python 3 text behavior
- # was forced upon Python 2, so we need to unbreak
- # it to look like Python 2.
- if PY2:
- def write(self, x):
- if isinstance(x, str) or is_bytes(x):
- try:
- self.flush()
- except Exception:
- pass
- return self.buffer.write(str(x))
- return io.TextIOWrapper.write(self, x)
-
- def writelines(self, lines):
- for line in lines:
- self.write(line)
-
- def __del__(self):
- try:
- self.detach()
- except Exception:
- pass
-
- def isatty(self):
- # https://bitbucket.org/pypy/pypy/issue/1803
- return self._stream.isatty()
-
-
-class _FixupStream(object):
- """The new io interface needs more from streams than streams
- traditionally implement. As such, this fix-up code is necessary in
- some circumstances.
-
- The forcing of readable and writable flags are there because some tools
- put badly patched objects on sys (one such offender are certain version
- of jupyter notebook).
- """
-
- def __init__(self, stream, force_readable=False, force_writable=False):
- self._stream = stream
- self._force_readable = force_readable
- self._force_writable = force_writable
-
- def __getattr__(self, name):
- return getattr(self._stream, name)
-
- def read1(self, size):
- f = getattr(self._stream, 'read1', None)
- if f is not None:
- return f(size)
- # We only dispatch to readline instead of read in Python 2 as we
- # do not want cause problems with the different implementation
- # of line buffering.
- if PY2:
- return self._stream.readline(size)
- return self._stream.read(size)
-
- def readable(self):
- if self._force_readable:
- return True
- x = getattr(self._stream, 'readable', None)
- if x is not None:
- return x()
- try:
- self._stream.read(0)
- except Exception:
- return False
- return True
-
- def writable(self):
- if self._force_writable:
- return True
- x = getattr(self._stream, 'writable', None)
- if x is not None:
- return x()
- try:
- self._stream.write('')
- except Exception:
- try:
- self._stream.write(b'')
- except Exception:
- return False
- return True
-
- def seekable(self):
- x = getattr(self._stream, 'seekable', None)
- if x is not None:
- return x()
- try:
- self._stream.seek(self._stream.tell())
- except Exception:
- return False
- return True
-
-
-if PY2:
- text_type = unicode
- bytes = str
- raw_input = raw_input
- string_types = (str, unicode)
- int_types = (int, long)
- iteritems = lambda x: x.iteritems()
- range_type = xrange
-
- def is_bytes(x):
- return isinstance(x, (buffer, bytearray))
-
- _identifier_re = re.compile(r'^[a-zA-Z_][a-zA-Z0-9_]*$')
-
- # For Windows, we need to force stdout/stdin/stderr to binary if it's
- # fetched for that. This obviously is not the most correct way to do
- # it as it changes global state. Unfortunately, there does not seem to
- # be a clear better way to do it as just reopening the file in binary
- # mode does not change anything.
- #
- # An option would be to do what Python 3 does and to open the file as
- # binary only, patch it back to the system, and then use a wrapper
- # stream that converts newlines. It's not quite clear what's the
- # correct option here.
- #
- # This code also lives in _winconsole for the fallback to the console
- # emulation stream.
- #
- # There are also Windows environments where the `msvcrt` module is not
- # available (which is why we use try-catch instead of the WIN variable
- # here), such as the Google App Engine development server on Windows. In
- # those cases there is just nothing we can do.
- def set_binary_mode(f):
- return f
-
- try:
- import msvcrt
- except ImportError:
- pass
- else:
- def set_binary_mode(f):
- try:
- fileno = f.fileno()
- except Exception:
- pass
- else:
- msvcrt.setmode(fileno, os.O_BINARY)
- return f
-
- try:
- import fcntl
- except ImportError:
- pass
- else:
- def set_binary_mode(f):
- try:
- fileno = f.fileno()
- except Exception:
- pass
- else:
- flags = fcntl.fcntl(fileno, fcntl.F_GETFL)
- fcntl.fcntl(fileno, fcntl.F_SETFL, flags & ~os.O_NONBLOCK)
- return f
-
- def isidentifier(x):
- return _identifier_re.search(x) is not None
-
- def get_binary_stdin():
- return set_binary_mode(sys.stdin)
-
- def get_binary_stdout():
- _wrap_std_stream('stdout')
- return set_binary_mode(sys.stdout)
-
- def get_binary_stderr():
- _wrap_std_stream('stderr')
- return set_binary_mode(sys.stderr)
-
- def get_text_stdin(encoding=None, errors=None):
- rv = _get_windows_console_stream(sys.stdin, encoding, errors)
- if rv is not None:
- return rv
- return _make_text_stream(sys.stdin, encoding, errors,
- force_readable=True)
-
- def get_text_stdout(encoding=None, errors=None):
- _wrap_std_stream('stdout')
- rv = _get_windows_console_stream(sys.stdout, encoding, errors)
- if rv is not None:
- return rv
- return _make_text_stream(sys.stdout, encoding, errors,
- force_writable=True)
-
- def get_text_stderr(encoding=None, errors=None):
- _wrap_std_stream('stderr')
- rv = _get_windows_console_stream(sys.stderr, encoding, errors)
- if rv is not None:
- return rv
- return _make_text_stream(sys.stderr, encoding, errors,
- force_writable=True)
-
- def filename_to_ui(value):
- if isinstance(value, bytes):
- value = value.decode(get_filesystem_encoding(), 'replace')
- return value
-else:
- import io
- text_type = str
- raw_input = input
- string_types = (str,)
- int_types = (int,)
- range_type = range
- isidentifier = lambda x: x.isidentifier()
- iteritems = lambda x: iter(x.items())
-
- def is_bytes(x):
- return isinstance(x, (bytes, memoryview, bytearray))
-
- def _is_binary_reader(stream, default=False):
- try:
- return isinstance(stream.read(0), bytes)
- except Exception:
- return default
- # This happens in some cases where the stream was already
- # closed. In this case, we assume the default.
-
- def _is_binary_writer(stream, default=False):
- try:
- stream.write(b'')
- except Exception:
- try:
- stream.write('')
- return False
- except Exception:
- pass
- return default
- return True
-
- def _find_binary_reader(stream):
- # We need to figure out if the given stream is already binary.
- # This can happen because the official docs recommend detaching
- # the streams to get binary streams. Some code might do this, so
- # we need to deal with this case explicitly.
- if _is_binary_reader(stream, False):
- return stream
-
- buf = getattr(stream, 'buffer', None)
-
- # Same situation here; this time we assume that the buffer is
- # actually binary in case it's closed.
- if buf is not None and _is_binary_reader(buf, True):
- return buf
-
- def _find_binary_writer(stream):
- # We need to figure out if the given stream is already binary.
- # This can happen because the official docs recommend detatching
- # the streams to get binary streams. Some code might do this, so
- # we need to deal with this case explicitly.
- if _is_binary_writer(stream, False):
- return stream
-
- buf = getattr(stream, 'buffer', None)
-
- # Same situation here; this time we assume that the buffer is
- # actually binary in case it's closed.
- if buf is not None and _is_binary_writer(buf, True):
- return buf
-
- def _stream_is_misconfigured(stream):
- """A stream is misconfigured if its encoding is ASCII."""
- # If the stream does not have an encoding set, we assume it's set
- # to ASCII. This appears to happen in certain unittest
- # environments. It's not quite clear what the correct behavior is
- # but this at least will force Click to recover somehow.
- return is_ascii_encoding(getattr(stream, 'encoding', None) or 'ascii')
-
- def _is_compatible_text_stream(stream, encoding, errors):
- stream_encoding = getattr(stream, 'encoding', None)
- stream_errors = getattr(stream, 'errors', None)
-
- # Perfect match.
- if stream_encoding == encoding and stream_errors == errors:
- return True
-
- # Otherwise, it's only a compatible stream if we did not ask for
- # an encoding.
- if encoding is None:
- return stream_encoding is not None
-
- return False
-
- def _force_correct_text_reader(text_reader, encoding, errors,
- force_readable=False):
- if _is_binary_reader(text_reader, False):
- binary_reader = text_reader
- else:
- # If there is no target encoding set, we need to verify that the
- # reader is not actually misconfigured.
- if encoding is None and not _stream_is_misconfigured(text_reader):
- return text_reader
-
- if _is_compatible_text_stream(text_reader, encoding, errors):
- return text_reader
-
- # If the reader has no encoding, we try to find the underlying
- # binary reader for it. If that fails because the environment is
- # misconfigured, we silently go with the same reader because this
- # is too common to happen. In that case, mojibake is better than
- # exceptions.
- binary_reader = _find_binary_reader(text_reader)
- if binary_reader is None:
- return text_reader
-
- # At this point, we default the errors to replace instead of strict
- # because nobody handles those errors anyways and at this point
- # we're so fundamentally fucked that nothing can repair it.
- if errors is None:
- errors = 'replace'
- return _make_text_stream(binary_reader, encoding, errors,
- force_readable=force_readable)
-
- def _force_correct_text_writer(text_writer, encoding, errors,
- force_writable=False):
- if _is_binary_writer(text_writer, False):
- binary_writer = text_writer
- else:
- # If there is no target encoding set, we need to verify that the
- # writer is not actually misconfigured.
- if encoding is None and not _stream_is_misconfigured(text_writer):
- return text_writer
-
- if _is_compatible_text_stream(text_writer, encoding, errors):
- return text_writer
-
- # If the writer has no encoding, we try to find the underlying
- # binary writer for it. If that fails because the environment is
- # misconfigured, we silently go with the same writer because this
- # is too common to happen. In that case, mojibake is better than
- # exceptions.
- binary_writer = _find_binary_writer(text_writer)
- if binary_writer is None:
- return text_writer
-
- # At this point, we default the errors to replace instead of strict
- # because nobody handles those errors anyways and at this point
- # we're so fundamentally fucked that nothing can repair it.
- if errors is None:
- errors = 'replace'
- return _make_text_stream(binary_writer, encoding, errors,
- force_writable=force_writable)
-
- def get_binary_stdin():
- reader = _find_binary_reader(sys.stdin)
- if reader is None:
- raise RuntimeError('Was not able to determine binary '
- 'stream for sys.stdin.')
- return reader
-
- def get_binary_stdout():
- writer = _find_binary_writer(sys.stdout)
- if writer is None:
- raise RuntimeError('Was not able to determine binary '
- 'stream for sys.stdout.')
- return writer
-
- def get_binary_stderr():
- writer = _find_binary_writer(sys.stderr)
- if writer is None:
- raise RuntimeError('Was not able to determine binary '
- 'stream for sys.stderr.')
- return writer
-
- def get_text_stdin(encoding=None, errors=None):
- rv = _get_windows_console_stream(sys.stdin, encoding, errors)
- if rv is not None:
- return rv
- return _force_correct_text_reader(sys.stdin, encoding, errors,
- force_readable=True)
-
- def get_text_stdout(encoding=None, errors=None):
- rv = _get_windows_console_stream(sys.stdout, encoding, errors)
- if rv is not None:
- return rv
- return _force_correct_text_writer(sys.stdout, encoding, errors,
- force_writable=True)
-
- def get_text_stderr(encoding=None, errors=None):
- rv = _get_windows_console_stream(sys.stderr, encoding, errors)
- if rv is not None:
- return rv
- return _force_correct_text_writer(sys.stderr, encoding, errors,
- force_writable=True)
-
- def filename_to_ui(value):
- if isinstance(value, bytes):
- value = value.decode(get_filesystem_encoding(), 'replace')
- else:
- value = value.encode('utf-8', 'surrogateescape') \
- .decode('utf-8', 'replace')
- return value
-
-
-def get_streerror(e, default=None):
- if hasattr(e, 'strerror'):
- msg = e.strerror
- else:
- if default is not None:
- msg = default
- else:
- msg = str(e)
- if isinstance(msg, bytes):
- msg = msg.decode('utf-8', 'replace')
- return msg
-
-
-def open_stream(filename, mode='r', encoding=None, errors='strict',
- atomic=False):
- # Standard streams first. These are simple because they don't need
- # special handling for the atomic flag. It's entirely ignored.
- if filename == '-':
- if any(m in mode for m in ['w', 'a', 'x']):
- if 'b' in mode:
- return get_binary_stdout(), False
- return get_text_stdout(encoding=encoding, errors=errors), False
- if 'b' in mode:
- return get_binary_stdin(), False
- return get_text_stdin(encoding=encoding, errors=errors), False
-
- # Non-atomic writes directly go out through the regular open functions.
- if not atomic:
- if encoding is None:
- return open(filename, mode), True
- return io.open(filename, mode, encoding=encoding, errors=errors), True
-
- # Some usability stuff for atomic writes
- if 'a' in mode:
- raise ValueError(
- 'Appending to an existing file is not supported, because that '
- 'would involve an expensive `copy`-operation to a temporary '
- 'file. Open the file in normal `w`-mode and copy explicitly '
- 'if that\'s what you\'re after.'
- )
- if 'x' in mode:
- raise ValueError('Use the `overwrite`-parameter instead.')
- if 'w' not in mode:
- raise ValueError('Atomic writes only make sense with `w`-mode.')
-
- # Atomic writes are more complicated. They work by opening a file
- # as a proxy in the same folder and then using the fdopen
- # functionality to wrap it in a Python file. Then we wrap it in an
- # atomic file that moves the file over on close.
- import tempfile
- fd, tmp_filename = tempfile.mkstemp(dir=os.path.dirname(filename),
- prefix='.__atomic-write')
-
- if encoding is not None:
- f = io.open(fd, mode, encoding=encoding, errors=errors)
- else:
- f = os.fdopen(fd, mode)
-
- return _AtomicFile(f, tmp_filename, os.path.realpath(filename)), True
-
-
-# Used in a destructor call, needs extra protection from interpreter cleanup.
-if hasattr(os, 'replace'):
- _replace = os.replace
- _can_replace = True
-else:
- _replace = os.rename
- _can_replace = not WIN
-
-
-class _AtomicFile(object):
-
- def __init__(self, f, tmp_filename, real_filename):
- self._f = f
- self._tmp_filename = tmp_filename
- self._real_filename = real_filename
- self.closed = False
-
- @property
- def name(self):
- return self._real_filename
-
- def close(self, delete=False):
- if self.closed:
- return
- self._f.close()
- if not _can_replace:
- try:
- os.remove(self._real_filename)
- except OSError:
- pass
- _replace(self._tmp_filename, self._real_filename)
- self.closed = True
-
- def __getattr__(self, name):
- return getattr(self._f, name)
-
- def __enter__(self):
- return self
-
- def __exit__(self, exc_type, exc_value, tb):
- self.close(delete=exc_type is not None)
-
- def __repr__(self):
- return repr(self._f)
-
-
-auto_wrap_for_ansi = None
-colorama = None
-get_winterm_size = None
-
-
-def strip_ansi(value):
- return _ansi_re.sub('', value)
-
-
-def should_strip_ansi(stream=None, color=None):
- if color is None:
- if stream is None:
- stream = sys.stdin
- return not isatty(stream)
- return not color
-
-
-# If we're on Windows, we provide transparent integration through
-# colorama. This will make ANSI colors through the echo function
-# work automatically.
-if WIN:
- # Windows has a smaller terminal
- DEFAULT_COLUMNS = 79
-
- from ._winconsole import _get_windows_console_stream, _wrap_std_stream
-
- def _get_argv_encoding():
- import locale
- return locale.getpreferredencoding()
-
- if PY2:
- def raw_input(prompt=''):
- sys.stderr.flush()
- if prompt:
- stdout = _default_text_stdout()
- stdout.write(prompt)
- stdin = _default_text_stdin()
- return stdin.readline().rstrip('\r\n')
-
- try:
- import colorama
- except ImportError:
- pass
- else:
- _ansi_stream_wrappers = WeakKeyDictionary()
-
- def auto_wrap_for_ansi(stream, color=None):
- """This function wraps a stream so that calls through colorama
- are issued to the win32 console API to recolor on demand. It
- also ensures to reset the colors if a write call is interrupted
- to not destroy the console afterwards.
- """
- try:
- cached = _ansi_stream_wrappers.get(stream)
- except Exception:
- cached = None
- if cached is not None:
- return cached
- strip = should_strip_ansi(stream, color)
- ansi_wrapper = colorama.AnsiToWin32(stream, strip=strip)
- rv = ansi_wrapper.stream
- _write = rv.write
-
- def _safe_write(s):
- try:
- return _write(s)
- except:
- ansi_wrapper.reset_all()
- raise
-
- rv.write = _safe_write
- try:
- _ansi_stream_wrappers[stream] = rv
- except Exception:
- pass
- return rv
-
- def get_winterm_size():
- win = colorama.win32.GetConsoleScreenBufferInfo(
- colorama.win32.STDOUT).srWindow
- return win.Right - win.Left, win.Bottom - win.Top
-else:
- def _get_argv_encoding():
- return getattr(sys.stdin, 'encoding', None) or get_filesystem_encoding()
-
- _get_windows_console_stream = lambda *x: None
- _wrap_std_stream = lambda *x: None
-
-
-def term_len(x):
- return len(strip_ansi(x))
-
-
-def isatty(stream):
- try:
- return stream.isatty()
- except Exception:
- return False
-
-
-def _make_cached_stream_func(src_func, wrapper_func):
- cache = WeakKeyDictionary()
- def func():
- stream = src_func()
- try:
- rv = cache.get(stream)
- except Exception:
- rv = None
- if rv is not None:
- return rv
- rv = wrapper_func()
- try:
- stream = src_func() # In case wrapper_func() modified the stream
- cache[stream] = rv
- except Exception:
- pass
- return rv
- return func
-
-
-_default_text_stdin = _make_cached_stream_func(
- lambda: sys.stdin, get_text_stdin)
-_default_text_stdout = _make_cached_stream_func(
- lambda: sys.stdout, get_text_stdout)
-_default_text_stderr = _make_cached_stream_func(
- lambda: sys.stderr, get_text_stderr)
-
-
-binary_streams = {
- 'stdin': get_binary_stdin,
- 'stdout': get_binary_stdout,
- 'stderr': get_binary_stderr,
-}
-
-text_streams = {
- 'stdin': get_text_stdin,
- 'stdout': get_text_stdout,
- 'stderr': get_text_stderr,
-}
diff --git a/lib/click/_termui_impl.py b/lib/click/_termui_impl.py
deleted file mode 100644
index 00a8e5ef1c..0000000000
--- a/lib/click/_termui_impl.py
+++ /dev/null
@@ -1,621 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
-click._termui_impl
-~~~~~~~~~~~~~~~~~~
-
-This module contains implementations for the termui module. To keep the
-import time of Click down, some infrequently used functionality is
-placed in this module and only imported as needed.
-
-:copyright: © 2014 by the Pallets team.
-:license: BSD, see LICENSE.rst for more details.
-"""
-
-import os
-import sys
-import time
-import math
-import contextlib
-from ._compat import _default_text_stdout, range_type, PY2, isatty, \
- open_stream, strip_ansi, term_len, get_best_encoding, WIN, int_types, \
- CYGWIN
-from .utils import echo
-from .exceptions import ClickException
-
-
-if os.name == 'nt':
- BEFORE_BAR = '\r'
- AFTER_BAR = '\n'
-else:
- BEFORE_BAR = '\r\033[?25l'
- AFTER_BAR = '\033[?25h\n'
-
-
-def _length_hint(obj):
- """Returns the length hint of an object."""
- try:
- return len(obj)
- except (AttributeError, TypeError):
- try:
- get_hint = type(obj).__length_hint__
- except AttributeError:
- return None
- try:
- hint = get_hint(obj)
- except TypeError:
- return None
- if hint is NotImplemented or \
- not isinstance(hint, int_types) or \
- hint < 0:
- return None
- return hint
-
-
-class ProgressBar(object):
-
- def __init__(self, iterable, length=None, fill_char='#', empty_char=' ',
- bar_template='%(bar)s', info_sep=' ', show_eta=True,
- show_percent=None, show_pos=False, item_show_func=None,
- label=None, file=None, color=None, width=30):
- self.fill_char = fill_char
- self.empty_char = empty_char
- self.bar_template = bar_template
- self.info_sep = info_sep
- self.show_eta = show_eta
- self.show_percent = show_percent
- self.show_pos = show_pos
- self.item_show_func = item_show_func
- self.label = label or ''
- if file is None:
- file = _default_text_stdout()
- self.file = file
- self.color = color
- self.width = width
- self.autowidth = width == 0
-
- if length is None:
- length = _length_hint(iterable)
- if iterable is None:
- if length is None:
- raise TypeError('iterable or length is required')
- iterable = range_type(length)
- self.iter = iter(iterable)
- self.length = length
- self.length_known = length is not None
- self.pos = 0
- self.avg = []
- self.start = self.last_eta = time.time()
- self.eta_known = False
- self.finished = False
- self.max_width = None
- self.entered = False
- self.current_item = None
- self.is_hidden = not isatty(self.file)
- self._last_line = None
- self.short_limit = 0.5
-
- def __enter__(self):
- self.entered = True
- self.render_progress()
- return self
-
- def __exit__(self, exc_type, exc_value, tb):
- self.render_finish()
-
- def __iter__(self):
- if not self.entered:
- raise RuntimeError('You need to use progress bars in a with block.')
- self.render_progress()
- return self.generator()
-
- def is_fast(self):
- return time.time() - self.start <= self.short_limit
-
- def render_finish(self):
- if self.is_hidden or self.is_fast():
- return
- self.file.write(AFTER_BAR)
- self.file.flush()
-
- @property
- def pct(self):
- if self.finished:
- return 1.0
- return min(self.pos / (float(self.length) or 1), 1.0)
-
- @property
- def time_per_iteration(self):
- if not self.avg:
- return 0.0
- return sum(self.avg) / float(len(self.avg))
-
- @property
- def eta(self):
- if self.length_known and not self.finished:
- return self.time_per_iteration * (self.length - self.pos)
- return 0.0
-
- def format_eta(self):
- if self.eta_known:
- t = int(self.eta)
- seconds = t % 60
- t //= 60
- minutes = t % 60
- t //= 60
- hours = t % 24
- t //= 24
- if t > 0:
- days = t
- return '%dd %02d:%02d:%02d' % (days, hours, minutes, seconds)
- else:
- return '%02d:%02d:%02d' % (hours, minutes, seconds)
- return ''
-
- def format_pos(self):
- pos = str(self.pos)
- if self.length_known:
- pos += '/%s' % self.length
- return pos
-
- def format_pct(self):
- return ('% 4d%%' % int(self.pct * 100))[1:]
-
- def format_bar(self):
- if self.length_known:
- bar_length = int(self.pct * self.width)
- bar = self.fill_char * bar_length
- bar += self.empty_char * (self.width - bar_length)
- elif self.finished:
- bar = self.fill_char * self.width
- else:
- bar = list(self.empty_char * (self.width or 1))
- if self.time_per_iteration != 0:
- bar[int((math.cos(self.pos * self.time_per_iteration)
- / 2.0 + 0.5) * self.width)] = self.fill_char
- bar = ''.join(bar)
- return bar
-
- def format_progress_line(self):
- show_percent = self.show_percent
-
- info_bits = []
- if self.length_known and show_percent is None:
- show_percent = not self.show_pos
-
- if self.show_pos:
- info_bits.append(self.format_pos())
- if show_percent:
- info_bits.append(self.format_pct())
- if self.show_eta and self.eta_known and not self.finished:
- info_bits.append(self.format_eta())
- if self.item_show_func is not None:
- item_info = self.item_show_func(self.current_item)
- if item_info is not None:
- info_bits.append(item_info)
-
- return (self.bar_template % {
- 'label': self.label,
- 'bar': self.format_bar(),
- 'info': self.info_sep.join(info_bits)
- }).rstrip()
-
- def render_progress(self):
- from .termui import get_terminal_size
-
- if self.is_hidden:
- return
-
- buf = []
- # Update width in case the terminal has been resized
- if self.autowidth:
- old_width = self.width
- self.width = 0
- clutter_length = term_len(self.format_progress_line())
- new_width = max(0, get_terminal_size()[0] - clutter_length)
- if new_width < old_width:
- buf.append(BEFORE_BAR)
- buf.append(' ' * self.max_width)
- self.max_width = new_width
- self.width = new_width
-
- clear_width = self.width
- if self.max_width is not None:
- clear_width = self.max_width
-
- buf.append(BEFORE_BAR)
- line = self.format_progress_line()
- line_len = term_len(line)
- if self.max_width is None or self.max_width < line_len:
- self.max_width = line_len
-
- buf.append(line)
- buf.append(' ' * (clear_width - line_len))
- line = ''.join(buf)
- # Render the line only if it changed.
-
- if line != self._last_line and not self.is_fast():
- self._last_line = line
- echo(line, file=self.file, color=self.color, nl=False)
- self.file.flush()
-
- def make_step(self, n_steps):
- self.pos += n_steps
- if self.length_known and self.pos >= self.length:
- self.finished = True
-
- if (time.time() - self.last_eta) < 1.0:
- return
-
- self.last_eta = time.time()
-
- # self.avg is a rolling list of length <= 7 of steps where steps are
- # defined as time elapsed divided by the total progress through
- # self.length.
- if self.pos:
- step = (time.time() - self.start) / self.pos
- else:
- step = time.time() - self.start
-
- self.avg = self.avg[-6:] + [step]
-
- self.eta_known = self.length_known
-
- def update(self, n_steps):
- self.make_step(n_steps)
- self.render_progress()
-
- def finish(self):
- self.eta_known = 0
- self.current_item = None
- self.finished = True
-
- def generator(self):
- """
- Returns a generator which yields the items added to the bar during
- construction, and updates the progress bar *after* the yielded block
- returns.
- """
- if not self.entered:
- raise RuntimeError('You need to use progress bars in a with block.')
-
- if self.is_hidden:
- for rv in self.iter:
- yield rv
- else:
- for rv in self.iter:
- self.current_item = rv
- yield rv
- self.update(1)
- self.finish()
- self.render_progress()
-
-
-def pager(generator, color=None):
- """Decide what method to use for paging through text."""
- stdout = _default_text_stdout()
- if not isatty(sys.stdin) or not isatty(stdout):
- return _nullpager(stdout, generator, color)
- pager_cmd = (os.environ.get('PAGER', None) or '').strip()
- if pager_cmd:
- if WIN:
- return _tempfilepager(generator, pager_cmd, color)
- return _pipepager(generator, pager_cmd, color)
- if os.environ.get('TERM') in ('dumb', 'emacs'):
- return _nullpager(stdout, generator, color)
- if WIN or sys.platform.startswith('os2'):
- return _tempfilepager(generator, 'more <', color)
- if hasattr(os, 'system') and os.system('(less) 2>/dev/null') == 0:
- return _pipepager(generator, 'less', color)
-
- import tempfile
- fd, filename = tempfile.mkstemp()
- os.close(fd)
- try:
- if hasattr(os, 'system') and os.system('more "%s"' % filename) == 0:
- return _pipepager(generator, 'more', color)
- return _nullpager(stdout, generator, color)
- finally:
- os.unlink(filename)
-
-
-def _pipepager(generator, cmd, color):
- """Page through text by feeding it to another program. Invoking a
- pager through this might support colors.
- """
- import subprocess
- env = dict(os.environ)
-
- # If we're piping to less we might support colors under the
- # condition that
- cmd_detail = cmd.rsplit('/', 1)[-1].split()
- if color is None and cmd_detail[0] == 'less':
- less_flags = os.environ.get('LESS', '') + ' '.join(cmd_detail[1:])
- if not less_flags:
- env['LESS'] = '-R'
- color = True
- elif 'r' in less_flags or 'R' in less_flags:
- color = True
-
- c = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE,
- env=env)
- encoding = get_best_encoding(c.stdin)
- try:
- for text in generator:
- if not color:
- text = strip_ansi(text)
-
- c.stdin.write(text.encode(encoding, 'replace'))
- except (IOError, KeyboardInterrupt):
- pass
- else:
- c.stdin.close()
-
- # Less doesn't respect ^C, but catches it for its own UI purposes (aborting
- # search or other commands inside less).
- #
- # That means when the user hits ^C, the parent process (click) terminates,
- # but less is still alive, paging the output and messing up the terminal.
- #
- # If the user wants to make the pager exit on ^C, they should set
- # `LESS='-K'`. It's not our decision to make.
- while True:
- try:
- c.wait()
- except KeyboardInterrupt:
- pass
- else:
- break
-
-
-def _tempfilepager(generator, cmd, color):
- """Page through text by invoking a program on a temporary file."""
- import tempfile
- filename = tempfile.mktemp()
- # TODO: This never terminates if the passed generator never terminates.
- text = "".join(generator)
- if not color:
- text = strip_ansi(text)
- encoding = get_best_encoding(sys.stdout)
- with open_stream(filename, 'wb')[0] as f:
- f.write(text.encode(encoding))
- try:
- os.system(cmd + ' "' + filename + '"')
- finally:
- os.unlink(filename)
-
-
-def _nullpager(stream, generator, color):
- """Simply print unformatted text. This is the ultimate fallback."""
- for text in generator:
- if not color:
- text = strip_ansi(text)
- stream.write(text)
-
-
-class Editor(object):
-
- def __init__(self, editor=None, env=None, require_save=True,
- extension='.txt'):
- self.editor = editor
- self.env = env
- self.require_save = require_save
- self.extension = extension
-
- def get_editor(self):
- if self.editor is not None:
- return self.editor
- for key in 'VISUAL', 'EDITOR':
- rv = os.environ.get(key)
- if rv:
- return rv
- if WIN:
- return 'notepad'
- for editor in 'vim', 'nano':
- if os.system('which %s >/dev/null 2>&1' % editor) == 0:
- return editor
- return 'vi'
-
- def edit_file(self, filename):
- import subprocess
- editor = self.get_editor()
- if self.env:
- environ = os.environ.copy()
- environ.update(self.env)
- else:
- environ = None
- try:
- c = subprocess.Popen('%s "%s"' % (editor, filename),
- env=environ, shell=True)
- exit_code = c.wait()
- if exit_code != 0:
- raise ClickException('%s: Editing failed!' % editor)
- except OSError as e:
- raise ClickException('%s: Editing failed: %s' % (editor, e))
-
- def edit(self, text):
- import tempfile
-
- text = text or ''
- if text and not text.endswith('\n'):
- text += '\n'
-
- fd, name = tempfile.mkstemp(prefix='editor-', suffix=self.extension)
- try:
- if WIN:
- encoding = 'utf-8-sig'
- text = text.replace('\n', '\r\n')
- else:
- encoding = 'utf-8'
- text = text.encode(encoding)
-
- f = os.fdopen(fd, 'wb')
- f.write(text)
- f.close()
- timestamp = os.path.getmtime(name)
-
- self.edit_file(name)
-
- if self.require_save \
- and os.path.getmtime(name) == timestamp:
- return None
-
- f = open(name, 'rb')
- try:
- rv = f.read()
- finally:
- f.close()
- return rv.decode('utf-8-sig').replace('\r\n', '\n')
- finally:
- os.unlink(name)
-
-
-def open_url(url, wait=False, locate=False):
- import subprocess
-
- def _unquote_file(url):
- try:
- import urllib
- except ImportError:
- import urllib
- if url.startswith('file://'):
- url = urllib.unquote(url[7:])
- return url
-
- if sys.platform == 'darwin':
- args = ['open']
- if wait:
- args.append('-W')
- if locate:
- args.append('-R')
- args.append(_unquote_file(url))
- null = open('/dev/null', 'w')
- try:
- return subprocess.Popen(args, stderr=null).wait()
- finally:
- null.close()
- elif WIN:
- if locate:
- url = _unquote_file(url)
- args = 'explorer /select,"%s"' % _unquote_file(
- url.replace('"', ''))
- else:
- args = 'start %s "" "%s"' % (
- wait and '/WAIT' or '', url.replace('"', ''))
- return os.system(args)
- elif CYGWIN:
- if locate:
- url = _unquote_file(url)
- args = 'cygstart "%s"' % (os.path.dirname(url).replace('"', ''))
- else:
- args = 'cygstart %s "%s"' % (
- wait and '-w' or '', url.replace('"', ''))
- return os.system(args)
-
- try:
- if locate:
- url = os.path.dirname(_unquote_file(url)) or '.'
- else:
- url = _unquote_file(url)
- c = subprocess.Popen(['xdg-open', url])
- if wait:
- return c.wait()
- return 0
- except OSError:
- if url.startswith(('http://', 'https://')) and not locate and not wait:
- import webbrowser
- webbrowser.open(url)
- return 0
- return 1
-
-
-def _translate_ch_to_exc(ch):
- if ch == u'\x03':
- raise KeyboardInterrupt()
- if ch == u'\x04' and not WIN: # Unix-like, Ctrl+D
- raise EOFError()
- if ch == u'\x1a' and WIN: # Windows, Ctrl+Z
- raise EOFError()
-
-
-if WIN:
- import msvcrt
-
- @contextlib.contextmanager
- def raw_terminal():
- yield
-
- def getchar(echo):
- # The function `getch` will return a bytes object corresponding to
- # the pressed character. Since Windows 10 build 1803, it will also
- # return \x00 when called a second time after pressing a regular key.
- #
- # `getwch` does not share this probably-bugged behavior. Moreover, it
- # returns a Unicode object by default, which is what we want.
- #
- # Either of these functions will return \x00 or \xe0 to indicate
- # a special key, and you need to call the same function again to get
- # the "rest" of the code. The fun part is that \u00e0 is
- # "latin small letter a with grave", so if you type that on a French
- # keyboard, you _also_ get a \xe0.
- # E.g., consider the Up arrow. This returns \xe0 and then \x48. The
- # resulting Unicode string reads as "a with grave" + "capital H".
- # This is indistinguishable from when the user actually types
- # "a with grave" and then "capital H".
- #
- # When \xe0 is returned, we assume it's part of a special-key sequence
- # and call `getwch` again, but that means that when the user types
- # the \u00e0 character, `getchar` doesn't return until a second
- # character is typed.
- # The alternative is returning immediately, but that would mess up
- # cross-platform handling of arrow keys and others that start with
- # \xe0. Another option is using `getch`, but then we can't reliably
- # read non-ASCII characters, because return values of `getch` are
- # limited to the current 8-bit codepage.
- #
- # Anyway, Click doesn't claim to do this Right(tm), and using `getwch`
- # is doing the right thing in more situations than with `getch`.
- if echo:
- func = msvcrt.getwche
- else:
- func = msvcrt.getwch
-
- rv = func()
- if rv in (u'\x00', u'\xe0'):
- # \x00 and \xe0 are control characters that indicate special key,
- # see above.
- rv += func()
- _translate_ch_to_exc(rv)
- return rv
-else:
- import tty
- import termios
-
- @contextlib.contextmanager
- def raw_terminal():
- if not isatty(sys.stdin):
- f = open('/dev/tty')
- fd = f.fileno()
- else:
- fd = sys.stdin.fileno()
- f = None
- try:
- old_settings = termios.tcgetattr(fd)
- try:
- tty.setraw(fd)
- yield fd
- finally:
- termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)
- sys.stdout.flush()
- if f is not None:
- f.close()
- except termios.error:
- pass
-
- def getchar(echo):
- with raw_terminal() as fd:
- ch = os.read(fd, 32)
- ch = ch.decode(get_best_encoding(sys.stdin), 'replace')
- if echo and isatty(sys.stdout):
- sys.stdout.write(ch)
- _translate_ch_to_exc(ch)
- return ch
diff --git a/lib/click/_textwrap.py b/lib/click/_textwrap.py
deleted file mode 100644
index 7e776031ea..0000000000
--- a/lib/click/_textwrap.py
+++ /dev/null
@@ -1,38 +0,0 @@
-import textwrap
-from contextlib import contextmanager
-
-
-class TextWrapper(textwrap.TextWrapper):
-
- def _handle_long_word(self, reversed_chunks, cur_line, cur_len, width):
- space_left = max(width - cur_len, 1)
-
- if self.break_long_words:
- last = reversed_chunks[-1]
- cut = last[:space_left]
- res = last[space_left:]
- cur_line.append(cut)
- reversed_chunks[-1] = res
- elif not cur_line:
- cur_line.append(reversed_chunks.pop())
-
- @contextmanager
- def extra_indent(self, indent):
- old_initial_indent = self.initial_indent
- old_subsequent_indent = self.subsequent_indent
- self.initial_indent += indent
- self.subsequent_indent += indent
- try:
- yield
- finally:
- self.initial_indent = old_initial_indent
- self.subsequent_indent = old_subsequent_indent
-
- def indent_only(self, text):
- rv = []
- for idx, line in enumerate(text.splitlines()):
- indent = self.initial_indent
- if idx > 0:
- indent = self.subsequent_indent
- rv.append(indent + line)
- return '\n'.join(rv)
diff --git a/lib/click/_unicodefun.py b/lib/click/_unicodefun.py
deleted file mode 100644
index 620edff37e..0000000000
--- a/lib/click/_unicodefun.py
+++ /dev/null
@@ -1,125 +0,0 @@
-import os
-import sys
-import codecs
-
-from ._compat import PY2
-
-
-# If someone wants to vendor click, we want to ensure the
-# correct package is discovered. Ideally we could use a
-# relative import here but unfortunately Python does not
-# support that.
-click = sys.modules[__name__.rsplit('.', 1)[0]]
-
-
-def _find_unicode_literals_frame():
- import __future__
- if not hasattr(sys, '_getframe'): # not all Python implementations have it
- return 0
- frm = sys._getframe(1)
- idx = 1
- while frm is not None:
- if frm.f_globals.get('__name__', '').startswith('click.'):
- frm = frm.f_back
- idx += 1
- elif frm.f_code.co_flags & __future__.unicode_literals.compiler_flag:
- return idx
- else:
- break
- return 0
-
-
-def _check_for_unicode_literals():
- if not __debug__:
- return
- if not PY2 or click.disable_unicode_literals_warning:
- return
- bad_frame = _find_unicode_literals_frame()
- if bad_frame <= 0:
- return
- from warnings import warn
- warn(Warning('Click detected the use of the unicode_literals '
- '__future__ import. This is heavily discouraged '
- 'because it can introduce subtle bugs in your '
- 'code. You should instead use explicit u"" literals '
- 'for your unicode strings. For more information see '
- 'https://click.palletsprojects.com/python3/'),
- stacklevel=bad_frame)
-
-
-def _verify_python3_env():
- """Ensures that the environment is good for unicode on Python 3."""
- if PY2:
- return
- try:
- import locale
- fs_enc = codecs.lookup(locale.getpreferredencoding()).name
- except Exception:
- fs_enc = 'ascii'
- if fs_enc != 'ascii':
- return
-
- extra = ''
- if os.name == 'posix':
- import subprocess
- try:
- rv = subprocess.Popen(['locale', '-a'], stdout=subprocess.PIPE,
- stderr=subprocess.PIPE).communicate()[0]
- except OSError:
- rv = b''
- good_locales = set()
- has_c_utf8 = False
-
- # Make sure we're operating on text here.
- if isinstance(rv, bytes):
- rv = rv.decode('ascii', 'replace')
-
- for line in rv.splitlines():
- locale = line.strip()
- if locale.lower().endswith(('.utf-8', '.utf8')):
- good_locales.add(locale)
- if locale.lower() in ('c.utf8', 'c.utf-8'):
- has_c_utf8 = True
-
- extra += '\n\n'
- if not good_locales:
- extra += (
- 'Additional information: on this system no suitable UTF-8\n'
- 'locales were discovered. This most likely requires resolving\n'
- 'by reconfiguring the locale system.'
- )
- elif has_c_utf8:
- extra += (
- 'This system supports the C.UTF-8 locale which is recommended.\n'
- 'You might be able to resolve your issue by exporting the\n'
- 'following environment variables:\n\n'
- ' export LC_ALL=C.UTF-8\n'
- ' export LANG=C.UTF-8'
- )
- else:
- extra += (
- 'This system lists a couple of UTF-8 supporting locales that\n'
- 'you can pick from. The following suitable locales were\n'
- 'discovered: %s'
- ) % ', '.join(sorted(good_locales))
-
- bad_locale = None
- for locale in os.environ.get('LC_ALL'), os.environ.get('LANG'):
- if locale and locale.lower().endswith(('.utf-8', '.utf8')):
- bad_locale = locale
- if locale is not None:
- break
- if bad_locale is not None:
- extra += (
- '\n\nClick discovered that you exported a UTF-8 locale\n'
- 'but the locale system could not pick up from it because\n'
- 'it does not exist. The exported locale is "%s" but it\n'
- 'is not supported'
- ) % bad_locale
-
- raise RuntimeError(
- 'Click will abort further execution because Python 3 was'
- ' configured to use ASCII as encoding for the environment.'
- ' Consult https://click.palletsprojects.com/en/7.x/python3/ for'
- ' mitigation steps.' + extra
- )
diff --git a/lib/click/_winconsole.py b/lib/click/_winconsole.py
deleted file mode 100644
index bbb080ddae..0000000000
--- a/lib/click/_winconsole.py
+++ /dev/null
@@ -1,307 +0,0 @@
-# -*- coding: utf-8 -*-
-# This module is based on the excellent work by Adam Bartoš who
-# provided a lot of what went into the implementation here in
-# the discussion to issue1602 in the Python bug tracker.
-#
-# There are some general differences in regards to how this works
-# compared to the original patches as we do not need to patch
-# the entire interpreter but just work in our little world of
-# echo and prmopt.
-
-import io
-import os
-import sys
-import zlib
-import time
-import ctypes
-import msvcrt
-from ._compat import _NonClosingTextIOWrapper, text_type, PY2
-from ctypes import byref, POINTER, c_int, c_char, c_char_p, \
- c_void_p, py_object, c_ssize_t, c_ulong, windll, WINFUNCTYPE
-try:
- from ctypes import pythonapi
- PyObject_GetBuffer = pythonapi.PyObject_GetBuffer
- PyBuffer_Release = pythonapi.PyBuffer_Release
-except ImportError:
- pythonapi = None
-from ctypes.wintypes import LPWSTR, LPCWSTR
-
-
-c_ssize_p = POINTER(c_ssize_t)
-
-kernel32 = windll.kernel32
-GetStdHandle = kernel32.GetStdHandle
-ReadConsoleW = kernel32.ReadConsoleW
-WriteConsoleW = kernel32.WriteConsoleW
-GetLastError = kernel32.GetLastError
-GetCommandLineW = WINFUNCTYPE(LPWSTR)(
- ('GetCommandLineW', windll.kernel32))
-CommandLineToArgvW = WINFUNCTYPE(
- POINTER(LPWSTR), LPCWSTR, POINTER(c_int))(
- ('CommandLineToArgvW', windll.shell32))
-
-
-STDIN_HANDLE = GetStdHandle(-10)
-STDOUT_HANDLE = GetStdHandle(-11)
-STDERR_HANDLE = GetStdHandle(-12)
-
-
-PyBUF_SIMPLE = 0
-PyBUF_WRITABLE = 1
-
-ERROR_SUCCESS = 0
-ERROR_NOT_ENOUGH_MEMORY = 8
-ERROR_OPERATION_ABORTED = 995
-
-STDIN_FILENO = 0
-STDOUT_FILENO = 1
-STDERR_FILENO = 2
-
-EOF = b'\x1a'
-MAX_BYTES_WRITTEN = 32767
-
-
-class Py_buffer(ctypes.Structure):
- _fields_ = [
- ('buf', c_void_p),
- ('obj', py_object),
- ('len', c_ssize_t),
- ('itemsize', c_ssize_t),
- ('readonly', c_int),
- ('ndim', c_int),
- ('format', c_char_p),
- ('shape', c_ssize_p),
- ('strides', c_ssize_p),
- ('suboffsets', c_ssize_p),
- ('internal', c_void_p)
- ]
-
- if PY2:
- _fields_.insert(-1, ('smalltable', c_ssize_t * 2))
-
-
-# On PyPy we cannot get buffers so our ability to operate here is
-# serverly limited.
-if pythonapi is None:
- get_buffer = None
-else:
- def get_buffer(obj, writable=False):
- buf = Py_buffer()
- flags = PyBUF_WRITABLE if writable else PyBUF_SIMPLE
- PyObject_GetBuffer(py_object(obj), byref(buf), flags)
- try:
- buffer_type = c_char * buf.len
- return buffer_type.from_address(buf.buf)
- finally:
- PyBuffer_Release(byref(buf))
-
-
-class _WindowsConsoleRawIOBase(io.RawIOBase):
-
- def __init__(self, handle):
- self.handle = handle
-
- def isatty(self):
- io.RawIOBase.isatty(self)
- return True
-
-
-class _WindowsConsoleReader(_WindowsConsoleRawIOBase):
-
- def readable(self):
- return True
-
- def readinto(self, b):
- bytes_to_be_read = len(b)
- if not bytes_to_be_read:
- return 0
- elif bytes_to_be_read % 2:
- raise ValueError('cannot read odd number of bytes from '
- 'UTF-16-LE encoded console')
-
- buffer = get_buffer(b, writable=True)
- code_units_to_be_read = bytes_to_be_read // 2
- code_units_read = c_ulong()
-
- rv = ReadConsoleW(self.handle, buffer, code_units_to_be_read,
- byref(code_units_read), None)
- if GetLastError() == ERROR_OPERATION_ABORTED:
- # wait for KeyboardInterrupt
- time.sleep(0.1)
- if not rv:
- raise OSError('Windows error: %s' % GetLastError())
-
- if buffer[0] == EOF:
- return 0
- return 2 * code_units_read.value
-
-
-class _WindowsConsoleWriter(_WindowsConsoleRawIOBase):
-
- def writable(self):
- return True
-
- @staticmethod
- def _get_error_message(errno):
- if errno == ERROR_SUCCESS:
- return 'ERROR_SUCCESS'
- elif errno == ERROR_NOT_ENOUGH_MEMORY:
- return 'ERROR_NOT_ENOUGH_MEMORY'
- return 'Windows error %s' % errno
-
- def write(self, b):
- bytes_to_be_written = len(b)
- buf = get_buffer(b)
- code_units_to_be_written = min(bytes_to_be_written,
- MAX_BYTES_WRITTEN) // 2
- code_units_written = c_ulong()
-
- WriteConsoleW(self.handle, buf, code_units_to_be_written,
- byref(code_units_written), None)
- bytes_written = 2 * code_units_written.value
-
- if bytes_written == 0 and bytes_to_be_written > 0:
- raise OSError(self._get_error_message(GetLastError()))
- return bytes_written
-
-
-class ConsoleStream(object):
-
- def __init__(self, text_stream, byte_stream):
- self._text_stream = text_stream
- self.buffer = byte_stream
-
- @property
- def name(self):
- return self.buffer.name
-
- def write(self, x):
- if isinstance(x, text_type):
- return self._text_stream.write(x)
- try:
- self.flush()
- except Exception:
- pass
- return self.buffer.write(x)
-
- def writelines(self, lines):
- for line in lines:
- self.write(line)
-
- def __getattr__(self, name):
- return getattr(self._text_stream, name)
-
- def isatty(self):
- return self.buffer.isatty()
-
- def __repr__(self):
- return '' % (
- self.name,
- self.encoding,
- )
-
-
-class WindowsChunkedWriter(object):
- """
- Wraps a stream (such as stdout), acting as a transparent proxy for all
- attribute access apart from method 'write()' which we wrap to write in
- limited chunks due to a Windows limitation on binary console streams.
- """
- def __init__(self, wrapped):
- # double-underscore everything to prevent clashes with names of
- # attributes on the wrapped stream object.
- self.__wrapped = wrapped
-
- def __getattr__(self, name):
- return getattr(self.__wrapped, name)
-
- def write(self, text):
- total_to_write = len(text)
- written = 0
-
- while written < total_to_write:
- to_write = min(total_to_write - written, MAX_BYTES_WRITTEN)
- self.__wrapped.write(text[written:written+to_write])
- written += to_write
-
-
-_wrapped_std_streams = set()
-
-
-def _wrap_std_stream(name):
- # Python 2 & Windows 7 and below
- if PY2 and sys.getwindowsversion()[:2] <= (6, 1) and name not in _wrapped_std_streams:
- setattr(sys, name, WindowsChunkedWriter(getattr(sys, name)))
- _wrapped_std_streams.add(name)
-
-
-def _get_text_stdin(buffer_stream):
- text_stream = _NonClosingTextIOWrapper(
- io.BufferedReader(_WindowsConsoleReader(STDIN_HANDLE)),
- 'utf-16-le', 'strict', line_buffering=True)
- return ConsoleStream(text_stream, buffer_stream)
-
-
-def _get_text_stdout(buffer_stream):
- text_stream = _NonClosingTextIOWrapper(
- io.BufferedWriter(_WindowsConsoleWriter(STDOUT_HANDLE)),
- 'utf-16-le', 'strict', line_buffering=True)
- return ConsoleStream(text_stream, buffer_stream)
-
-
-def _get_text_stderr(buffer_stream):
- text_stream = _NonClosingTextIOWrapper(
- io.BufferedWriter(_WindowsConsoleWriter(STDERR_HANDLE)),
- 'utf-16-le', 'strict', line_buffering=True)
- return ConsoleStream(text_stream, buffer_stream)
-
-
-if PY2:
- def _hash_py_argv():
- return zlib.crc32('\x00'.join(sys.argv[1:]))
-
- _initial_argv_hash = _hash_py_argv()
-
- def _get_windows_argv():
- argc = c_int(0)
- argv_unicode = CommandLineToArgvW(GetCommandLineW(), byref(argc))
- argv = [argv_unicode[i] for i in range(0, argc.value)]
-
- if not hasattr(sys, 'frozen'):
- argv = argv[1:]
- while len(argv) > 0:
- arg = argv[0]
- if not arg.startswith('-') or arg == '-':
- break
- argv = argv[1:]
- if arg.startswith(('-c', '-m')):
- break
-
- return argv[1:]
-
-
-_stream_factories = {
- 0: _get_text_stdin,
- 1: _get_text_stdout,
- 2: _get_text_stderr,
-}
-
-
-def _get_windows_console_stream(f, encoding, errors):
- if get_buffer is not None and \
- encoding in ('utf-16-le', None) \
- and errors in ('strict', None) and \
- hasattr(f, 'isatty') and f.isatty():
- func = _stream_factories.get(f.fileno())
- if func is not None:
- if not PY2:
- f = getattr(f, 'buffer', None)
- if f is None:
- return None
- else:
- # If we are on Python 2 we need to set the stream that we
- # deal with to binary mode as otherwise the exercise if a
- # bit moot. The same problems apply as for
- # get_binary_stdin and friends from _compat.
- msvcrt.setmode(f.fileno(), os.O_BINARY)
- return func(f)
diff --git a/lib/click/core.py b/lib/click/core.py
deleted file mode 100644
index 7a1e3422be..0000000000
--- a/lib/click/core.py
+++ /dev/null
@@ -1,1856 +0,0 @@
-import errno
-import inspect
-import os
-import sys
-from contextlib import contextmanager
-from itertools import repeat
-from functools import update_wrapper
-
-from .types import convert_type, IntRange, BOOL
-from .utils import PacifyFlushWrapper, make_str, make_default_short_help, \
- echo, get_os_args
-from .exceptions import ClickException, UsageError, BadParameter, Abort, \
- MissingParameter, Exit
-from .termui import prompt, confirm, style
-from .formatting import HelpFormatter, join_options
-from .parser import OptionParser, split_opt
-from .globals import push_context, pop_context
-
-from ._compat import PY2, isidentifier, iteritems, string_types
-from ._unicodefun import _check_for_unicode_literals, _verify_python3_env
-
-
-_missing = object()
-
-
-SUBCOMMAND_METAVAR = 'COMMAND [ARGS]...'
-SUBCOMMANDS_METAVAR = 'COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]...'
-
-DEPRECATED_HELP_NOTICE = ' (DEPRECATED)'
-DEPRECATED_INVOKE_NOTICE = 'DeprecationWarning: ' + \
- 'The command %(name)s is deprecated.'
-
-
-def _maybe_show_deprecated_notice(cmd):
- if cmd.deprecated:
- echo(style(DEPRECATED_INVOKE_NOTICE % {'name': cmd.name}, fg='red'), err=True)
-
-
-def fast_exit(code):
- """Exit without garbage collection, this speeds up exit by about 10ms for
- things like bash completion.
- """
- sys.stdout.flush()
- sys.stderr.flush()
- os._exit(code)
-
-
-def _bashcomplete(cmd, prog_name, complete_var=None):
- """Internal handler for the bash completion support."""
- if complete_var is None:
- complete_var = '_%s_COMPLETE' % (prog_name.replace('-', '_')).upper()
- complete_instr = os.environ.get(complete_var)
- if not complete_instr:
- return
-
- from ._bashcomplete import bashcomplete
- if bashcomplete(cmd, prog_name, complete_var, complete_instr):
- fast_exit(1)
-
-
-def _check_multicommand(base_command, cmd_name, cmd, register=False):
- if not base_command.chain or not isinstance(cmd, MultiCommand):
- return
- if register:
- hint = 'It is not possible to add multi commands as children to ' \
- 'another multi command that is in chain mode'
- else:
- hint = 'Found a multi command as subcommand to a multi command ' \
- 'that is in chain mode. This is not supported'
- raise RuntimeError('%s. Command "%s" is set to chain and "%s" was '
- 'added as subcommand but it in itself is a '
- 'multi command. ("%s" is a %s within a chained '
- '%s named "%s").' % (
- hint, base_command.name, cmd_name,
- cmd_name, cmd.__class__.__name__,
- base_command.__class__.__name__,
- base_command.name))
-
-
-def batch(iterable, batch_size):
- return list(zip(*repeat(iter(iterable), batch_size)))
-
-
-def invoke_param_callback(callback, ctx, param, value):
- code = getattr(callback, '__code__', None)
- args = getattr(code, 'co_argcount', 3)
-
- if args < 3:
- # This will become a warning in Click 3.0:
- from warnings import warn
- warn(Warning('Invoked legacy parameter callback "%s". The new '
- 'signature for such callbacks starting with '
- 'click 2.0 is (ctx, param, value).'
- % callback), stacklevel=3)
- return callback(ctx, value)
- return callback(ctx, param, value)
-
-
-@contextmanager
-def augment_usage_errors(ctx, param=None):
- """Context manager that attaches extra information to exceptions that
- fly.
- """
- try:
- yield
- except BadParameter as e:
- if e.ctx is None:
- e.ctx = ctx
- if param is not None and e.param is None:
- e.param = param
- raise
- except UsageError as e:
- if e.ctx is None:
- e.ctx = ctx
- raise
-
-
-def iter_params_for_processing(invocation_order, declaration_order):
- """Given a sequence of parameters in the order as should be considered
- for processing and an iterable of parameters that exist, this returns
- a list in the correct order as they should be processed.
- """
- def sort_key(item):
- try:
- idx = invocation_order.index(item)
- except ValueError:
- idx = float('inf')
- return (not item.is_eager, idx)
-
- return sorted(declaration_order, key=sort_key)
-
-
-class Context(object):
- """The context is a special internal object that holds state relevant
- for the script execution at every single level. It's normally invisible
- to commands unless they opt-in to getting access to it.
-
- The context is useful as it can pass internal objects around and can
- control special execution features such as reading data from
- environment variables.
-
- A context can be used as context manager in which case it will call
- :meth:`close` on teardown.
-
- .. versionadded:: 2.0
- Added the `resilient_parsing`, `help_option_names`,
- `token_normalize_func` parameters.
-
- .. versionadded:: 3.0
- Added the `allow_extra_args` and `allow_interspersed_args`
- parameters.
-
- .. versionadded:: 4.0
- Added the `color`, `ignore_unknown_options`, and
- `max_content_width` parameters.
-
- :param command: the command class for this context.
- :param parent: the parent context.
- :param info_name: the info name for this invocation. Generally this
- is the most descriptive name for the script or
- command. For the toplevel script it is usually
- the name of the script, for commands below it it's
- the name of the script.
- :param obj: an arbitrary object of user data.
- :param auto_envvar_prefix: the prefix to use for automatic environment
- variables. If this is `None` then reading
- from environment variables is disabled. This
- does not affect manually set environment
- variables which are always read.
- :param default_map: a dictionary (like object) with default values
- for parameters.
- :param terminal_width: the width of the terminal. The default is
- inherit from parent context. If no context
- defines the terminal width then auto
- detection will be applied.
- :param max_content_width: the maximum width for content rendered by
- Click (this currently only affects help
- pages). This defaults to 80 characters if
- not overridden. In other words: even if the
- terminal is larger than that, Click will not
- format things wider than 80 characters by
- default. In addition to that, formatters might
- add some safety mapping on the right.
- :param resilient_parsing: if this flag is enabled then Click will
- parse without any interactivity or callback
- invocation. Default values will also be
- ignored. This is useful for implementing
- things such as completion support.
- :param allow_extra_args: if this is set to `True` then extra arguments
- at the end will not raise an error and will be
- kept on the context. The default is to inherit
- from the command.
- :param allow_interspersed_args: if this is set to `False` then options
- and arguments cannot be mixed. The
- default is to inherit from the command.
- :param ignore_unknown_options: instructs click to ignore options it does
- not know and keeps them for later
- processing.
- :param help_option_names: optionally a list of strings that define how
- the default help parameter is named. The
- default is ``['--help']``.
- :param token_normalize_func: an optional function that is used to
- normalize tokens (options, choices,
- etc.). This for instance can be used to
- implement case insensitive behavior.
- :param color: controls if the terminal supports ANSI colors or not. The
- default is autodetection. This is only needed if ANSI
- codes are used in texts that Click prints which is by
- default not the case. This for instance would affect
- help output.
- """
-
- def __init__(self, command, parent=None, info_name=None, obj=None,
- auto_envvar_prefix=None, default_map=None,
- terminal_width=None, max_content_width=None,
- resilient_parsing=False, allow_extra_args=None,
- allow_interspersed_args=None,
- ignore_unknown_options=None, help_option_names=None,
- token_normalize_func=None, color=None):
- #: the parent context or `None` if none exists.
- self.parent = parent
- #: the :class:`Command` for this context.
- self.command = command
- #: the descriptive information name
- self.info_name = info_name
- #: the parsed parameters except if the value is hidden in which
- #: case it's not remembered.
- self.params = {}
- #: the leftover arguments.
- self.args = []
- #: protected arguments. These are arguments that are prepended
- #: to `args` when certain parsing scenarios are encountered but
- #: must be never propagated to another arguments. This is used
- #: to implement nested parsing.
- self.protected_args = []
- if obj is None and parent is not None:
- obj = parent.obj
- #: the user object stored.
- self.obj = obj
- self._meta = getattr(parent, 'meta', {})
-
- #: A dictionary (-like object) with defaults for parameters.
- if default_map is None \
- and parent is not None \
- and parent.default_map is not None:
- default_map = parent.default_map.get(info_name)
- self.default_map = default_map
-
- #: This flag indicates if a subcommand is going to be executed. A
- #: group callback can use this information to figure out if it's
- #: being executed directly or because the execution flow passes
- #: onwards to a subcommand. By default it's None, but it can be
- #: the name of the subcommand to execute.
- #:
- #: If chaining is enabled this will be set to ``'*'`` in case
- #: any commands are executed. It is however not possible to
- #: figure out which ones. If you require this knowledge you
- #: should use a :func:`resultcallback`.
- self.invoked_subcommand = None
-
- if terminal_width is None and parent is not None:
- terminal_width = parent.terminal_width
- #: The width of the terminal (None is autodetection).
- self.terminal_width = terminal_width
-
- if max_content_width is None and parent is not None:
- max_content_width = parent.max_content_width
- #: The maximum width of formatted content (None implies a sensible
- #: default which is 80 for most things).
- self.max_content_width = max_content_width
-
- if allow_extra_args is None:
- allow_extra_args = command.allow_extra_args
- #: Indicates if the context allows extra args or if it should
- #: fail on parsing.
- #:
- #: .. versionadded:: 3.0
- self.allow_extra_args = allow_extra_args
-
- if allow_interspersed_args is None:
- allow_interspersed_args = command.allow_interspersed_args
- #: Indicates if the context allows mixing of arguments and
- #: options or not.
- #:
- #: .. versionadded:: 3.0
- self.allow_interspersed_args = allow_interspersed_args
-
- if ignore_unknown_options is None:
- ignore_unknown_options = command.ignore_unknown_options
- #: Instructs click to ignore options that a command does not
- #: understand and will store it on the context for later
- #: processing. This is primarily useful for situations where you
- #: want to call into external programs. Generally this pattern is
- #: strongly discouraged because it's not possibly to losslessly
- #: forward all arguments.
- #:
- #: .. versionadded:: 4.0
- self.ignore_unknown_options = ignore_unknown_options
-
- if help_option_names is None:
- if parent is not None:
- help_option_names = parent.help_option_names
- else:
- help_option_names = ['--help']
-
- #: The names for the help options.
- self.help_option_names = help_option_names
-
- if token_normalize_func is None and parent is not None:
- token_normalize_func = parent.token_normalize_func
-
- #: An optional normalization function for tokens. This is
- #: options, choices, commands etc.
- self.token_normalize_func = token_normalize_func
-
- #: Indicates if resilient parsing is enabled. In that case Click
- #: will do its best to not cause any failures and default values
- #: will be ignored. Useful for completion.
- self.resilient_parsing = resilient_parsing
-
- # If there is no envvar prefix yet, but the parent has one and
- # the command on this level has a name, we can expand the envvar
- # prefix automatically.
- if auto_envvar_prefix is None:
- if parent is not None \
- and parent.auto_envvar_prefix is not None and \
- self.info_name is not None:
- auto_envvar_prefix = '%s_%s' % (parent.auto_envvar_prefix,
- self.info_name.upper())
- else:
- auto_envvar_prefix = auto_envvar_prefix.upper()
- self.auto_envvar_prefix = auto_envvar_prefix
-
- if color is None and parent is not None:
- color = parent.color
-
- #: Controls if styling output is wanted or not.
- self.color = color
-
- self._close_callbacks = []
- self._depth = 0
-
- def __enter__(self):
- self._depth += 1
- push_context(self)
- return self
-
- def __exit__(self, exc_type, exc_value, tb):
- self._depth -= 1
- if self._depth == 0:
- self.close()
- pop_context()
-
- @contextmanager
- def scope(self, cleanup=True):
- """This helper method can be used with the context object to promote
- it to the current thread local (see :func:`get_current_context`).
- The default behavior of this is to invoke the cleanup functions which
- can be disabled by setting `cleanup` to `False`. The cleanup
- functions are typically used for things such as closing file handles.
-
- If the cleanup is intended the context object can also be directly
- used as a context manager.
-
- Example usage::
-
- with ctx.scope():
- assert get_current_context() is ctx
-
- This is equivalent::
-
- with ctx:
- assert get_current_context() is ctx
-
- .. versionadded:: 5.0
-
- :param cleanup: controls if the cleanup functions should be run or
- not. The default is to run these functions. In
- some situations the context only wants to be
- temporarily pushed in which case this can be disabled.
- Nested pushes automatically defer the cleanup.
- """
- if not cleanup:
- self._depth += 1
- try:
- with self as rv:
- yield rv
- finally:
- if not cleanup:
- self._depth -= 1
-
- @property
- def meta(self):
- """This is a dictionary which is shared with all the contexts
- that are nested. It exists so that click utilities can store some
- state here if they need to. It is however the responsibility of
- that code to manage this dictionary well.
-
- The keys are supposed to be unique dotted strings. For instance
- module paths are a good choice for it. What is stored in there is
- irrelevant for the operation of click. However what is important is
- that code that places data here adheres to the general semantics of
- the system.
-
- Example usage::
-
- LANG_KEY = __name__ + '.lang'
-
- def set_language(value):
- ctx = get_current_context()
- ctx.meta[LANG_KEY] = value
-
- def get_language():
- return get_current_context().meta.get(LANG_KEY, 'en_US')
-
- .. versionadded:: 5.0
- """
- return self._meta
-
- def make_formatter(self):
- """Creates the formatter for the help and usage output."""
- return HelpFormatter(width=self.terminal_width,
- max_width=self.max_content_width)
-
- def call_on_close(self, f):
- """This decorator remembers a function as callback that should be
- executed when the context tears down. This is most useful to bind
- resource handling to the script execution. For instance, file objects
- opened by the :class:`File` type will register their close callbacks
- here.
-
- :param f: the function to execute on teardown.
- """
- self._close_callbacks.append(f)
- return f
-
- def close(self):
- """Invokes all close callbacks."""
- for cb in self._close_callbacks:
- cb()
- self._close_callbacks = []
-
- @property
- def command_path(self):
- """The computed command path. This is used for the ``usage``
- information on the help page. It's automatically created by
- combining the info names of the chain of contexts to the root.
- """
- rv = ''
- if self.info_name is not None:
- rv = self.info_name
- if self.parent is not None:
- rv = self.parent.command_path + ' ' + rv
- return rv.lstrip()
-
- def find_root(self):
- """Finds the outermost context."""
- node = self
- while node.parent is not None:
- node = node.parent
- return node
-
- def find_object(self, object_type):
- """Finds the closest object of a given type."""
- node = self
- while node is not None:
- if isinstance(node.obj, object_type):
- return node.obj
- node = node.parent
-
- def ensure_object(self, object_type):
- """Like :meth:`find_object` but sets the innermost object to a
- new instance of `object_type` if it does not exist.
- """
- rv = self.find_object(object_type)
- if rv is None:
- self.obj = rv = object_type()
- return rv
-
- def lookup_default(self, name):
- """Looks up the default for a parameter name. This by default
- looks into the :attr:`default_map` if available.
- """
- if self.default_map is not None:
- rv = self.default_map.get(name)
- if callable(rv):
- rv = rv()
- return rv
-
- def fail(self, message):
- """Aborts the execution of the program with a specific error
- message.
-
- :param message: the error message to fail with.
- """
- raise UsageError(message, self)
-
- def abort(self):
- """Aborts the script."""
- raise Abort()
-
- def exit(self, code=0):
- """Exits the application with a given exit code."""
- raise Exit(code)
-
- def get_usage(self):
- """Helper method to get formatted usage string for the current
- context and command.
- """
- return self.command.get_usage(self)
-
- def get_help(self):
- """Helper method to get formatted help page for the current
- context and command.
- """
- return self.command.get_help(self)
-
- def invoke(*args, **kwargs):
- """Invokes a command callback in exactly the way it expects. There
- are two ways to invoke this method:
-
- 1. the first argument can be a callback and all other arguments and
- keyword arguments are forwarded directly to the function.
- 2. the first argument is a click command object. In that case all
- arguments are forwarded as well but proper click parameters
- (options and click arguments) must be keyword arguments and Click
- will fill in defaults.
-
- Note that before Click 3.2 keyword arguments were not properly filled
- in against the intention of this code and no context was created. For
- more information about this change and why it was done in a bugfix
- release see :ref:`upgrade-to-3.2`.
- """
- self, callback = args[:2]
- ctx = self
-
- # It's also possible to invoke another command which might or
- # might not have a callback. In that case we also fill
- # in defaults and make a new context for this command.
- if isinstance(callback, Command):
- other_cmd = callback
- callback = other_cmd.callback
- ctx = Context(other_cmd, info_name=other_cmd.name, parent=self)
- if callback is None:
- raise TypeError('The given command does not have a '
- 'callback that can be invoked.')
-
- for param in other_cmd.params:
- if param.name not in kwargs and param.expose_value:
- kwargs[param.name] = param.get_default(ctx)
-
- args = args[2:]
- with augment_usage_errors(self):
- with ctx:
- return callback(*args, **kwargs)
-
- def forward(*args, **kwargs):
- """Similar to :meth:`invoke` but fills in default keyword
- arguments from the current context if the other command expects
- it. This cannot invoke callbacks directly, only other commands.
- """
- self, cmd = args[:2]
-
- # It's also possible to invoke another command which might or
- # might not have a callback.
- if not isinstance(cmd, Command):
- raise TypeError('Callback is not a command.')
-
- for param in self.params:
- if param not in kwargs:
- kwargs[param] = self.params[param]
-
- return self.invoke(cmd, **kwargs)
-
-
-class BaseCommand(object):
- """The base command implements the minimal API contract of commands.
- Most code will never use this as it does not implement a lot of useful
- functionality but it can act as the direct subclass of alternative
- parsing methods that do not depend on the Click parser.
-
- For instance, this can be used to bridge Click and other systems like
- argparse or docopt.
-
- Because base commands do not implement a lot of the API that other
- parts of Click take for granted, they are not supported for all
- operations. For instance, they cannot be used with the decorators
- usually and they have no built-in callback system.
-
- .. versionchanged:: 2.0
- Added the `context_settings` parameter.
-
- :param name: the name of the command to use unless a group overrides it.
- :param context_settings: an optional dictionary with defaults that are
- passed to the context object.
- """
- #: the default for the :attr:`Context.allow_extra_args` flag.
- allow_extra_args = False
- #: the default for the :attr:`Context.allow_interspersed_args` flag.
- allow_interspersed_args = True
- #: the default for the :attr:`Context.ignore_unknown_options` flag.
- ignore_unknown_options = False
-
- def __init__(self, name, context_settings=None):
- #: the name the command thinks it has. Upon registering a command
- #: on a :class:`Group` the group will default the command name
- #: with this information. You should instead use the
- #: :class:`Context`\'s :attr:`~Context.info_name` attribute.
- self.name = name
- if context_settings is None:
- context_settings = {}
- #: an optional dictionary with defaults passed to the context.
- self.context_settings = context_settings
-
- def get_usage(self, ctx):
- raise NotImplementedError('Base commands cannot get usage')
-
- def get_help(self, ctx):
- raise NotImplementedError('Base commands cannot get help')
-
- def make_context(self, info_name, args, parent=None, **extra):
- """This function when given an info name and arguments will kick
- off the parsing and create a new :class:`Context`. It does not
- invoke the actual command callback though.
-
- :param info_name: the info name for this invokation. Generally this
- is the most descriptive name for the script or
- command. For the toplevel script it's usually
- the name of the script, for commands below it it's
- the name of the script.
- :param args: the arguments to parse as list of strings.
- :param parent: the parent context if available.
- :param extra: extra keyword arguments forwarded to the context
- constructor.
- """
- for key, value in iteritems(self.context_settings):
- if key not in extra:
- extra[key] = value
- ctx = Context(self, info_name=info_name, parent=parent, **extra)
- with ctx.scope(cleanup=False):
- self.parse_args(ctx, args)
- return ctx
-
- def parse_args(self, ctx, args):
- """Given a context and a list of arguments this creates the parser
- and parses the arguments, then modifies the context as necessary.
- This is automatically invoked by :meth:`make_context`.
- """
- raise NotImplementedError('Base commands do not know how to parse '
- 'arguments.')
-
- def invoke(self, ctx):
- """Given a context, this invokes the command. The default
- implementation is raising a not implemented error.
- """
- raise NotImplementedError('Base commands are not invokable by default')
-
- def main(self, args=None, prog_name=None, complete_var=None,
- standalone_mode=True, **extra):
- """This is the way to invoke a script with all the bells and
- whistles as a command line application. This will always terminate
- the application after a call. If this is not wanted, ``SystemExit``
- needs to be caught.
-
- This method is also available by directly calling the instance of
- a :class:`Command`.
-
- .. versionadded:: 3.0
- Added the `standalone_mode` flag to control the standalone mode.
-
- :param args: the arguments that should be used for parsing. If not
- provided, ``sys.argv[1:]`` is used.
- :param prog_name: the program name that should be used. By default
- the program name is constructed by taking the file
- name from ``sys.argv[0]``.
- :param complete_var: the environment variable that controls the
- bash completion support. The default is
- ``"__COMPLETE"`` with prog_name in
- uppercase.
- :param standalone_mode: the default behavior is to invoke the script
- in standalone mode. Click will then
- handle exceptions and convert them into
- error messages and the function will never
- return but shut down the interpreter. If
- this is set to `False` they will be
- propagated to the caller and the return
- value of this function is the return value
- of :meth:`invoke`.
- :param extra: extra keyword arguments are forwarded to the context
- constructor. See :class:`Context` for more information.
- """
- # If we are in Python 3, we will verify that the environment is
- # sane at this point or reject further execution to avoid a
- # broken script.
- if not PY2:
- _verify_python3_env()
- else:
- _check_for_unicode_literals()
-
- if args is None:
- args = get_os_args()
- else:
- args = list(args)
-
- if prog_name is None:
- prog_name = make_str(os.path.basename(
- sys.argv and sys.argv[0] or __file__))
-
- # Hook for the Bash completion. This only activates if the Bash
- # completion is actually enabled, otherwise this is quite a fast
- # noop.
- _bashcomplete(self, prog_name, complete_var)
-
- try:
- try:
- with self.make_context(prog_name, args, **extra) as ctx:
- rv = self.invoke(ctx)
- if not standalone_mode:
- return rv
- # it's not safe to `ctx.exit(rv)` here!
- # note that `rv` may actually contain data like "1" which
- # has obvious effects
- # more subtle case: `rv=[None, None]` can come out of
- # chained commands which all returned `None` -- so it's not
- # even always obvious that `rv` indicates success/failure
- # by its truthiness/falsiness
- ctx.exit()
- except (EOFError, KeyboardInterrupt):
- echo(file=sys.stderr)
- raise Abort()
- except ClickException as e:
- if not standalone_mode:
- raise
- e.show()
- sys.exit(e.exit_code)
- except IOError as e:
- if e.errno == errno.EPIPE:
- sys.stdout = PacifyFlushWrapper(sys.stdout)
- sys.stderr = PacifyFlushWrapper(sys.stderr)
- sys.exit(1)
- else:
- raise
- except Exit as e:
- if standalone_mode:
- sys.exit(e.exit_code)
- else:
- # in non-standalone mode, return the exit code
- # note that this is only reached if `self.invoke` above raises
- # an Exit explicitly -- thus bypassing the check there which
- # would return its result
- # the results of non-standalone execution may therefore be
- # somewhat ambiguous: if there are codepaths which lead to
- # `ctx.exit(1)` and to `return 1`, the caller won't be able to
- # tell the difference between the two
- return e.exit_code
- except Abort:
- if not standalone_mode:
- raise
- echo('Aborted!', file=sys.stderr)
- sys.exit(1)
-
- def __call__(self, *args, **kwargs):
- """Alias for :meth:`main`."""
- return self.main(*args, **kwargs)
-
-
-class Command(BaseCommand):
- """Commands are the basic building block of command line interfaces in
- Click. A basic command handles command line parsing and might dispatch
- more parsing to commands nested below it.
-
- .. versionchanged:: 2.0
- Added the `context_settings` parameter.
-
- :param name: the name of the command to use unless a group overrides it.
- :param context_settings: an optional dictionary with defaults that are
- passed to the context object.
- :param callback: the callback to invoke. This is optional.
- :param params: the parameters to register with this command. This can
- be either :class:`Option` or :class:`Argument` objects.
- :param help: the help string to use for this command.
- :param epilog: like the help string but it's printed at the end of the
- help page after everything else.
- :param short_help: the short help to use for this command. This is
- shown on the command listing of the parent command.
- :param add_help_option: by default each command registers a ``--help``
- option. This can be disabled by this parameter.
- :param hidden: hide this command from help outputs.
-
- :param deprecated: issues a message indicating that
- the command is deprecated.
- """
-
- def __init__(self, name, context_settings=None, callback=None,
- params=None, help=None, epilog=None, short_help=None,
- options_metavar='[OPTIONS]', add_help_option=True,
- hidden=False, deprecated=False):
- BaseCommand.__init__(self, name, context_settings)
- #: the callback to execute when the command fires. This might be
- #: `None` in which case nothing happens.
- self.callback = callback
- #: the list of parameters for this command in the order they
- #: should show up in the help page and execute. Eager parameters
- #: will automatically be handled before non eager ones.
- self.params = params or []
- # if a form feed (page break) is found in the help text, truncate help
- # text to the content preceding the first form feed
- if help and '\f' in help:
- help = help.split('\f', 1)[0]
- self.help = help
- self.epilog = epilog
- self.options_metavar = options_metavar
- self.short_help = short_help
- self.add_help_option = add_help_option
- self.hidden = hidden
- self.deprecated = deprecated
-
- def get_usage(self, ctx):
- formatter = ctx.make_formatter()
- self.format_usage(ctx, formatter)
- return formatter.getvalue().rstrip('\n')
-
- def get_params(self, ctx):
- rv = self.params
- help_option = self.get_help_option(ctx)
- if help_option is not None:
- rv = rv + [help_option]
- return rv
-
- def format_usage(self, ctx, formatter):
- """Writes the usage line into the formatter."""
- pieces = self.collect_usage_pieces(ctx)
- formatter.write_usage(ctx.command_path, ' '.join(pieces))
-
- def collect_usage_pieces(self, ctx):
- """Returns all the pieces that go into the usage line and returns
- it as a list of strings.
- """
- rv = [self.options_metavar]
- for param in self.get_params(ctx):
- rv.extend(param.get_usage_pieces(ctx))
- return rv
-
- def get_help_option_names(self, ctx):
- """Returns the names for the help option."""
- all_names = set(ctx.help_option_names)
- for param in self.params:
- all_names.difference_update(param.opts)
- all_names.difference_update(param.secondary_opts)
- return all_names
-
- def get_help_option(self, ctx):
- """Returns the help option object."""
- help_options = self.get_help_option_names(ctx)
- if not help_options or not self.add_help_option:
- return
-
- def show_help(ctx, param, value):
- if value and not ctx.resilient_parsing:
- echo(ctx.get_help(), color=ctx.color)
- ctx.exit()
- return Option(help_options, is_flag=True,
- is_eager=True, expose_value=False,
- callback=show_help,
- help='Show this message and exit.')
-
- def make_parser(self, ctx):
- """Creates the underlying option parser for this command."""
- parser = OptionParser(ctx)
- for param in self.get_params(ctx):
- param.add_to_parser(parser, ctx)
- return parser
-
- def get_help(self, ctx):
- """Formats the help into a string and returns it. This creates a
- formatter and will call into the following formatting methods:
- """
- formatter = ctx.make_formatter()
- self.format_help(ctx, formatter)
- return formatter.getvalue().rstrip('\n')
-
- def get_short_help_str(self, limit=45):
- """Gets short help for the command or makes it by shortening the long help string."""
- return self.short_help or self.help and make_default_short_help(self.help, limit) or ''
-
- def format_help(self, ctx, formatter):
- """Writes the help into the formatter if it exists.
-
- This calls into the following methods:
-
- - :meth:`format_usage`
- - :meth:`format_help_text`
- - :meth:`format_options`
- - :meth:`format_epilog`
- """
- self.format_usage(ctx, formatter)
- self.format_help_text(ctx, formatter)
- self.format_options(ctx, formatter)
- self.format_epilog(ctx, formatter)
-
- def format_help_text(self, ctx, formatter):
- """Writes the help text to the formatter if it exists."""
- if self.help:
- formatter.write_paragraph()
- with formatter.indentation():
- help_text = self.help
- if self.deprecated:
- help_text += DEPRECATED_HELP_NOTICE
- formatter.write_text(help_text)
- elif self.deprecated:
- formatter.write_paragraph()
- with formatter.indentation():
- formatter.write_text(DEPRECATED_HELP_NOTICE)
-
- def format_options(self, ctx, formatter):
- """Writes all the options into the formatter if they exist."""
- opts = []
- for param in self.get_params(ctx):
- rv = param.get_help_record(ctx)
- if rv is not None:
- opts.append(rv)
-
- if opts:
- with formatter.section('Options'):
- formatter.write_dl(opts)
-
- def format_epilog(self, ctx, formatter):
- """Writes the epilog into the formatter if it exists."""
- if self.epilog:
- formatter.write_paragraph()
- with formatter.indentation():
- formatter.write_text(self.epilog)
-
- def parse_args(self, ctx, args):
- parser = self.make_parser(ctx)
- opts, args, param_order = parser.parse_args(args=args)
-
- for param in iter_params_for_processing(
- param_order, self.get_params(ctx)):
- value, args = param.handle_parse_result(ctx, opts, args)
-
- if args and not ctx.allow_extra_args and not ctx.resilient_parsing:
- ctx.fail('Got unexpected extra argument%s (%s)'
- % (len(args) != 1 and 's' or '',
- ' '.join(map(make_str, args))))
-
- ctx.args = args
- return args
-
- def invoke(self, ctx):
- """Given a context, this invokes the attached callback (if it exists)
- in the right way.
- """
- _maybe_show_deprecated_notice(self)
- if self.callback is not None:
- return ctx.invoke(self.callback, **ctx.params)
-
-
-class MultiCommand(Command):
- """A multi command is the basic implementation of a command that
- dispatches to subcommands. The most common version is the
- :class:`Group`.
-
- :param invoke_without_command: this controls how the multi command itself
- is invoked. By default it's only invoked
- if a subcommand is provided.
- :param no_args_is_help: this controls what happens if no arguments are
- provided. This option is enabled by default if
- `invoke_without_command` is disabled or disabled
- if it's enabled. If enabled this will add
- ``--help`` as argument if no arguments are
- passed.
- :param subcommand_metavar: the string that is used in the documentation
- to indicate the subcommand place.
- :param chain: if this is set to `True` chaining of multiple subcommands
- is enabled. This restricts the form of commands in that
- they cannot have optional arguments but it allows
- multiple commands to be chained together.
- :param result_callback: the result callback to attach to this multi
- command.
- """
- allow_extra_args = True
- allow_interspersed_args = False
-
- def __init__(self, name=None, invoke_without_command=False,
- no_args_is_help=None, subcommand_metavar=None,
- chain=False, result_callback=None, **attrs):
- Command.__init__(self, name, **attrs)
- if no_args_is_help is None:
- no_args_is_help = not invoke_without_command
- self.no_args_is_help = no_args_is_help
- self.invoke_without_command = invoke_without_command
- if subcommand_metavar is None:
- if chain:
- subcommand_metavar = SUBCOMMANDS_METAVAR
- else:
- subcommand_metavar = SUBCOMMAND_METAVAR
- self.subcommand_metavar = subcommand_metavar
- self.chain = chain
- #: The result callback that is stored. This can be set or
- #: overridden with the :func:`resultcallback` decorator.
- self.result_callback = result_callback
-
- if self.chain:
- for param in self.params:
- if isinstance(param, Argument) and not param.required:
- raise RuntimeError('Multi commands in chain mode cannot '
- 'have optional arguments.')
-
- def collect_usage_pieces(self, ctx):
- rv = Command.collect_usage_pieces(self, ctx)
- rv.append(self.subcommand_metavar)
- return rv
-
- def format_options(self, ctx, formatter):
- Command.format_options(self, ctx, formatter)
- self.format_commands(ctx, formatter)
-
- def resultcallback(self, replace=False):
- """Adds a result callback to the chain command. By default if a
- result callback is already registered this will chain them but
- this can be disabled with the `replace` parameter. The result
- callback is invoked with the return value of the subcommand
- (or the list of return values from all subcommands if chaining
- is enabled) as well as the parameters as they would be passed
- to the main callback.
-
- Example::
-
- @click.group()
- @click.option('-i', '--input', default=23)
- def cli(input):
- return 42
-
- @cli.resultcallback()
- def process_result(result, input):
- return result + input
-
- .. versionadded:: 3.0
-
- :param replace: if set to `True` an already existing result
- callback will be removed.
- """
- def decorator(f):
- old_callback = self.result_callback
- if old_callback is None or replace:
- self.result_callback = f
- return f
- def function(__value, *args, **kwargs):
- return f(old_callback(__value, *args, **kwargs),
- *args, **kwargs)
- self.result_callback = rv = update_wrapper(function, f)
- return rv
- return decorator
-
- def format_commands(self, ctx, formatter):
- """Extra format methods for multi methods that adds all the commands
- after the options.
- """
- commands = []
- for subcommand in self.list_commands(ctx):
- cmd = self.get_command(ctx, subcommand)
- # What is this, the tool lied about a command. Ignore it
- if cmd is None:
- continue
- if cmd.hidden:
- continue
-
- commands.append((subcommand, cmd))
-
- # allow for 3 times the default spacing
- if len(commands):
- limit = formatter.width - 6 - max(len(cmd[0]) for cmd in commands)
-
- rows = []
- for subcommand, cmd in commands:
- help = cmd.get_short_help_str(limit)
- rows.append((subcommand, help))
-
- if rows:
- with formatter.section('Commands'):
- formatter.write_dl(rows)
-
- def parse_args(self, ctx, args):
- if not args and self.no_args_is_help and not ctx.resilient_parsing:
- echo(ctx.get_help(), color=ctx.color)
- ctx.exit()
-
- rest = Command.parse_args(self, ctx, args)
- if self.chain:
- ctx.protected_args = rest
- ctx.args = []
- elif rest:
- ctx.protected_args, ctx.args = rest[:1], rest[1:]
-
- return ctx.args
-
- def invoke(self, ctx):
- def _process_result(value):
- if self.result_callback is not None:
- value = ctx.invoke(self.result_callback, value,
- **ctx.params)
- return value
-
- if not ctx.protected_args:
- # If we are invoked without command the chain flag controls
- # how this happens. If we are not in chain mode, the return
- # value here is the return value of the command.
- # If however we are in chain mode, the return value is the
- # return value of the result processor invoked with an empty
- # list (which means that no subcommand actually was executed).
- if self.invoke_without_command:
- if not self.chain:
- return Command.invoke(self, ctx)
- with ctx:
- Command.invoke(self, ctx)
- return _process_result([])
- ctx.fail('Missing command.')
-
- # Fetch args back out
- args = ctx.protected_args + ctx.args
- ctx.args = []
- ctx.protected_args = []
-
- # If we're not in chain mode, we only allow the invocation of a
- # single command but we also inform the current context about the
- # name of the command to invoke.
- if not self.chain:
- # Make sure the context is entered so we do not clean up
- # resources until the result processor has worked.
- with ctx:
- cmd_name, cmd, args = self.resolve_command(ctx, args)
- ctx.invoked_subcommand = cmd_name
- Command.invoke(self, ctx)
- sub_ctx = cmd.make_context(cmd_name, args, parent=ctx)
- with sub_ctx:
- return _process_result(sub_ctx.command.invoke(sub_ctx))
-
- # In chain mode we create the contexts step by step, but after the
- # base command has been invoked. Because at that point we do not
- # know the subcommands yet, the invoked subcommand attribute is
- # set to ``*`` to inform the command that subcommands are executed
- # but nothing else.
- with ctx:
- ctx.invoked_subcommand = args and '*' or None
- Command.invoke(self, ctx)
-
- # Otherwise we make every single context and invoke them in a
- # chain. In that case the return value to the result processor
- # is the list of all invoked subcommand's results.
- contexts = []
- while args:
- cmd_name, cmd, args = self.resolve_command(ctx, args)
- sub_ctx = cmd.make_context(cmd_name, args, parent=ctx,
- allow_extra_args=True,
- allow_interspersed_args=False)
- contexts.append(sub_ctx)
- args, sub_ctx.args = sub_ctx.args, []
-
- rv = []
- for sub_ctx in contexts:
- with sub_ctx:
- rv.append(sub_ctx.command.invoke(sub_ctx))
- return _process_result(rv)
-
- def resolve_command(self, ctx, args):
- cmd_name = make_str(args[0])
- original_cmd_name = cmd_name
-
- # Get the command
- cmd = self.get_command(ctx, cmd_name)
-
- # If we can't find the command but there is a normalization
- # function available, we try with that one.
- if cmd is None and ctx.token_normalize_func is not None:
- cmd_name = ctx.token_normalize_func(cmd_name)
- cmd = self.get_command(ctx, cmd_name)
-
- # If we don't find the command we want to show an error message
- # to the user that it was not provided. However, there is
- # something else we should do: if the first argument looks like
- # an option we want to kick off parsing again for arguments to
- # resolve things like --help which now should go to the main
- # place.
- if cmd is None and not ctx.resilient_parsing:
- if split_opt(cmd_name)[0]:
- self.parse_args(ctx, ctx.args)
- ctx.fail('No such command "%s".' % original_cmd_name)
-
- return cmd_name, cmd, args[1:]
-
- def get_command(self, ctx, cmd_name):
- """Given a context and a command name, this returns a
- :class:`Command` object if it exists or returns `None`.
- """
- raise NotImplementedError()
-
- def list_commands(self, ctx):
- """Returns a list of subcommand names in the order they should
- appear.
- """
- return []
-
-
-class Group(MultiCommand):
- """A group allows a command to have subcommands attached. This is the
- most common way to implement nesting in Click.
-
- :param commands: a dictionary of commands.
- """
-
- def __init__(self, name=None, commands=None, **attrs):
- MultiCommand.__init__(self, name, **attrs)
- #: the registered subcommands by their exported names.
- self.commands = commands or {}
-
- def add_command(self, cmd, name=None):
- """Registers another :class:`Command` with this group. If the name
- is not provided, the name of the command is used.
- """
- name = name or cmd.name
- if name is None:
- raise TypeError('Command has no name.')
- _check_multicommand(self, name, cmd, register=True)
- self.commands[name] = cmd
-
- def command(self, *args, **kwargs):
- """A shortcut decorator for declaring and attaching a command to
- the group. This takes the same arguments as :func:`command` but
- immediately registers the created command with this instance by
- calling into :meth:`add_command`.
- """
- def decorator(f):
- cmd = command(*args, **kwargs)(f)
- self.add_command(cmd)
- return cmd
- return decorator
-
- def group(self, *args, **kwargs):
- """A shortcut decorator for declaring and attaching a group to
- the group. This takes the same arguments as :func:`group` but
- immediately registers the created command with this instance by
- calling into :meth:`add_command`.
- """
- def decorator(f):
- cmd = group(*args, **kwargs)(f)
- self.add_command(cmd)
- return cmd
- return decorator
-
- def get_command(self, ctx, cmd_name):
- return self.commands.get(cmd_name)
-
- def list_commands(self, ctx):
- return sorted(self.commands)
-
-
-class CommandCollection(MultiCommand):
- """A command collection is a multi command that merges multiple multi
- commands together into one. This is a straightforward implementation
- that accepts a list of different multi commands as sources and
- provides all the commands for each of them.
- """
-
- def __init__(self, name=None, sources=None, **attrs):
- MultiCommand.__init__(self, name, **attrs)
- #: The list of registered multi commands.
- self.sources = sources or []
-
- def add_source(self, multi_cmd):
- """Adds a new multi command to the chain dispatcher."""
- self.sources.append(multi_cmd)
-
- def get_command(self, ctx, cmd_name):
- for source in self.sources:
- rv = source.get_command(ctx, cmd_name)
- if rv is not None:
- if self.chain:
- _check_multicommand(self, cmd_name, rv)
- return rv
-
- def list_commands(self, ctx):
- rv = set()
- for source in self.sources:
- rv.update(source.list_commands(ctx))
- return sorted(rv)
-
-
-class Parameter(object):
- r"""A parameter to a command comes in two versions: they are either
- :class:`Option`\s or :class:`Argument`\s. Other subclasses are currently
- not supported by design as some of the internals for parsing are
- intentionally not finalized.
-
- Some settings are supported by both options and arguments.
-
- .. versionchanged:: 2.0
- Changed signature for parameter callback to also be passed the
- parameter. In Click 2.0, the old callback format will still work,
- but it will raise a warning to give you change to migrate the
- code easier.
-
- :param param_decls: the parameter declarations for this option or
- argument. This is a list of flags or argument
- names.
- :param type: the type that should be used. Either a :class:`ParamType`
- or a Python type. The later is converted into the former
- automatically if supported.
- :param required: controls if this is optional or not.
- :param default: the default value if omitted. This can also be a callable,
- in which case it's invoked when the default is needed
- without any arguments.
- :param callback: a callback that should be executed after the parameter
- was matched. This is called as ``fn(ctx, param,
- value)`` and needs to return the value. Before Click
- 2.0, the signature was ``(ctx, value)``.
- :param nargs: the number of arguments to match. If not ``1`` the return
- value is a tuple instead of single value. The default for
- nargs is ``1`` (except if the type is a tuple, then it's
- the arity of the tuple).
- :param metavar: how the value is represented in the help page.
- :param expose_value: if this is `True` then the value is passed onwards
- to the command callback and stored on the context,
- otherwise it's skipped.
- :param is_eager: eager values are processed before non eager ones. This
- should not be set for arguments or it will inverse the
- order of processing.
- :param envvar: a string or list of strings that are environment variables
- that should be checked.
- """
- param_type_name = 'parameter'
-
- def __init__(self, param_decls=None, type=None, required=False,
- default=None, callback=None, nargs=None, metavar=None,
- expose_value=True, is_eager=False, envvar=None,
- autocompletion=None):
- self.name, self.opts, self.secondary_opts = \
- self._parse_decls(param_decls or (), expose_value)
-
- self.type = convert_type(type, default)
-
- # Default nargs to what the type tells us if we have that
- # information available.
- if nargs is None:
- if self.type.is_composite:
- nargs = self.type.arity
- else:
- nargs = 1
-
- self.required = required
- self.callback = callback
- self.nargs = nargs
- self.multiple = False
- self.expose_value = expose_value
- self.default = default
- self.is_eager = is_eager
- self.metavar = metavar
- self.envvar = envvar
- self.autocompletion = autocompletion
-
- @property
- def human_readable_name(self):
- """Returns the human readable name of this parameter. This is the
- same as the name for options, but the metavar for arguments.
- """
- return self.name
-
- def make_metavar(self):
- if self.metavar is not None:
- return self.metavar
- metavar = self.type.get_metavar(self)
- if metavar is None:
- metavar = self.type.name.upper()
- if self.nargs != 1:
- metavar += '...'
- return metavar
-
- def get_default(self, ctx):
- """Given a context variable this calculates the default value."""
- # Otherwise go with the regular default.
- if callable(self.default):
- rv = self.default()
- else:
- rv = self.default
- return self.type_cast_value(ctx, rv)
-
- def add_to_parser(self, parser, ctx):
- pass
-
- def consume_value(self, ctx, opts):
- value = opts.get(self.name)
- if value is None:
- value = self.value_from_envvar(ctx)
- if value is None:
- value = ctx.lookup_default(self.name)
- return value
-
- def type_cast_value(self, ctx, value):
- """Given a value this runs it properly through the type system.
- This automatically handles things like `nargs` and `multiple` as
- well as composite types.
- """
- if self.type.is_composite:
- if self.nargs <= 1:
- raise TypeError('Attempted to invoke composite type '
- 'but nargs has been set to %s. This is '
- 'not supported; nargs needs to be set to '
- 'a fixed value > 1.' % self.nargs)
- if self.multiple:
- return tuple(self.type(x or (), self, ctx) for x in value or ())
- return self.type(value or (), self, ctx)
-
- def _convert(value, level):
- if level == 0:
- return self.type(value, self, ctx)
- return tuple(_convert(x, level - 1) for x in value or ())
- return _convert(value, (self.nargs != 1) + bool(self.multiple))
-
- def process_value(self, ctx, value):
- """Given a value and context this runs the logic to convert the
- value as necessary.
- """
- # If the value we were given is None we do nothing. This way
- # code that calls this can easily figure out if something was
- # not provided. Otherwise it would be converted into an empty
- # tuple for multiple invocations which is inconvenient.
- if value is not None:
- return self.type_cast_value(ctx, value)
-
- def value_is_missing(self, value):
- if value is None:
- return True
- if (self.nargs != 1 or self.multiple) and value == ():
- return True
- return False
-
- def full_process_value(self, ctx, value):
- value = self.process_value(ctx, value)
-
- if value is None and not ctx.resilient_parsing:
- value = self.get_default(ctx)
-
- if self.required and self.value_is_missing(value):
- raise MissingParameter(ctx=ctx, param=self)
-
- return value
-
- def resolve_envvar_value(self, ctx):
- if self.envvar is None:
- return
- if isinstance(self.envvar, (tuple, list)):
- for envvar in self.envvar:
- rv = os.environ.get(envvar)
- if rv is not None:
- return rv
- else:
- return os.environ.get(self.envvar)
-
- def value_from_envvar(self, ctx):
- rv = self.resolve_envvar_value(ctx)
- if rv is not None and self.nargs != 1:
- rv = self.type.split_envvar_value(rv)
- return rv
-
- def handle_parse_result(self, ctx, opts, args):
- with augment_usage_errors(ctx, param=self):
- value = self.consume_value(ctx, opts)
- try:
- value = self.full_process_value(ctx, value)
- except Exception:
- if not ctx.resilient_parsing:
- raise
- value = None
- if self.callback is not None:
- try:
- value = invoke_param_callback(
- self.callback, ctx, self, value)
- except Exception:
- if not ctx.resilient_parsing:
- raise
-
- if self.expose_value:
- ctx.params[self.name] = value
- return value, args
-
- def get_help_record(self, ctx):
- pass
-
- def get_usage_pieces(self, ctx):
- return []
-
- def get_error_hint(self, ctx):
- """Get a stringified version of the param for use in error messages to
- indicate which param caused the error.
- """
- hint_list = self.opts or [self.human_readable_name]
- return ' / '.join('"%s"' % x for x in hint_list)
-
-
-class Option(Parameter):
- """Options are usually optional values on the command line and
- have some extra features that arguments don't have.
-
- All other parameters are passed onwards to the parameter constructor.
-
- :param show_default: controls if the default value should be shown on the
- help page. Normally, defaults are not shown. If this
- value is a string, it shows the string instead of the
- value. This is particularly useful for dynamic options.
- :param show_envvar: controls if an environment variable should be shown on
- the help page. Normally, environment variables
- are not shown.
- :param prompt: if set to `True` or a non empty string then the user will be
- prompted for input. If set to `True` the prompt will be the
- option name capitalized.
- :param confirmation_prompt: if set then the value will need to be confirmed
- if it was prompted for.
- :param hide_input: if this is `True` then the input on the prompt will be
- hidden from the user. This is useful for password
- input.
- :param is_flag: forces this option to act as a flag. The default is
- auto detection.
- :param flag_value: which value should be used for this flag if it's
- enabled. This is set to a boolean automatically if
- the option string contains a slash to mark two options.
- :param multiple: if this is set to `True` then the argument is accepted
- multiple times and recorded. This is similar to ``nargs``
- in how it works but supports arbitrary number of
- arguments.
- :param count: this flag makes an option increment an integer.
- :param allow_from_autoenv: if this is enabled then the value of this
- parameter will be pulled from an environment
- variable in case a prefix is defined on the
- context.
- :param help: the help string.
- :param hidden: hide this option from help outputs.
- """
- param_type_name = 'option'
-
- def __init__(self, param_decls=None, show_default=False,
- prompt=False, confirmation_prompt=False,
- hide_input=False, is_flag=None, flag_value=None,
- multiple=False, count=False, allow_from_autoenv=True,
- type=None, help=None, hidden=False, show_choices=True,
- show_envvar=False, **attrs):
- default_is_missing = attrs.get('default', _missing) is _missing
- Parameter.__init__(self, param_decls, type=type, **attrs)
-
- if prompt is True:
- prompt_text = self.name.replace('_', ' ').capitalize()
- elif prompt is False:
- prompt_text = None
- else:
- prompt_text = prompt
- self.prompt = prompt_text
- self.confirmation_prompt = confirmation_prompt
- self.hide_input = hide_input
- self.hidden = hidden
-
- # Flags
- if is_flag is None:
- if flag_value is not None:
- is_flag = True
- else:
- is_flag = bool(self.secondary_opts)
- if is_flag and default_is_missing:
- self.default = False
- if flag_value is None:
- flag_value = not self.default
- self.is_flag = is_flag
- self.flag_value = flag_value
- if self.is_flag and isinstance(self.flag_value, bool) \
- and type is None:
- self.type = BOOL
- self.is_bool_flag = True
- else:
- self.is_bool_flag = False
-
- # Counting
- self.count = count
- if count:
- if type is None:
- self.type = IntRange(min=0)
- if default_is_missing:
- self.default = 0
-
- self.multiple = multiple
- self.allow_from_autoenv = allow_from_autoenv
- self.help = help
- self.show_default = show_default
- self.show_choices = show_choices
- self.show_envvar = show_envvar
-
- # Sanity check for stuff we don't support
- if __debug__:
- if self.nargs < 0:
- raise TypeError('Options cannot have nargs < 0')
- if self.prompt and self.is_flag and not self.is_bool_flag:
- raise TypeError('Cannot prompt for flags that are not bools.')
- if not self.is_bool_flag and self.secondary_opts:
- raise TypeError('Got secondary option for non boolean flag.')
- if self.is_bool_flag and self.hide_input \
- and self.prompt is not None:
- raise TypeError('Hidden input does not work with boolean '
- 'flag prompts.')
- if self.count:
- if self.multiple:
- raise TypeError('Options cannot be multiple and count '
- 'at the same time.')
- elif self.is_flag:
- raise TypeError('Options cannot be count and flags at '
- 'the same time.')
-
- def _parse_decls(self, decls, expose_value):
- opts = []
- secondary_opts = []
- name = None
- possible_names = []
-
- for decl in decls:
- if isidentifier(decl):
- if name is not None:
- raise TypeError('Name defined twice')
- name = decl
- else:
- split_char = decl[:1] == '/' and ';' or '/'
- if split_char in decl:
- first, second = decl.split(split_char, 1)
- first = first.rstrip()
- if first:
- possible_names.append(split_opt(first))
- opts.append(first)
- second = second.lstrip()
- if second:
- secondary_opts.append(second.lstrip())
- else:
- possible_names.append(split_opt(decl))
- opts.append(decl)
-
- if name is None and possible_names:
- possible_names.sort(key=lambda x: -len(x[0])) # group long options first
- name = possible_names[0][1].replace('-', '_').lower()
- if not isidentifier(name):
- name = None
-
- if name is None:
- if not expose_value:
- return None, opts, secondary_opts
- raise TypeError('Could not determine name for option')
-
- if not opts and not secondary_opts:
- raise TypeError('No options defined but a name was passed (%s). '
- 'Did you mean to declare an argument instead '
- 'of an option?' % name)
-
- return name, opts, secondary_opts
-
- def add_to_parser(self, parser, ctx):
- kwargs = {
- 'dest': self.name,
- 'nargs': self.nargs,
- 'obj': self,
- }
-
- if self.multiple:
- action = 'append'
- elif self.count:
- action = 'count'
- else:
- action = 'store'
-
- if self.is_flag:
- kwargs.pop('nargs', None)
- if self.is_bool_flag and self.secondary_opts:
- parser.add_option(self.opts, action=action + '_const',
- const=True, **kwargs)
- parser.add_option(self.secondary_opts, action=action +
- '_const', const=False, **kwargs)
- else:
- parser.add_option(self.opts, action=action + '_const',
- const=self.flag_value,
- **kwargs)
- else:
- kwargs['action'] = action
- parser.add_option(self.opts, **kwargs)
-
- def get_help_record(self, ctx):
- if self.hidden:
- return
- any_prefix_is_slash = []
-
- def _write_opts(opts):
- rv, any_slashes = join_options(opts)
- if any_slashes:
- any_prefix_is_slash[:] = [True]
- if not self.is_flag and not self.count:
- rv += ' ' + self.make_metavar()
- return rv
-
- rv = [_write_opts(self.opts)]
- if self.secondary_opts:
- rv.append(_write_opts(self.secondary_opts))
-
- help = self.help or ''
- extra = []
- if self.show_envvar:
- envvar = self.envvar
- if envvar is None:
- if self.allow_from_autoenv and \
- ctx.auto_envvar_prefix is not None:
- envvar = '%s_%s' % (ctx.auto_envvar_prefix, self.name.upper())
- if envvar is not None:
- extra.append('env var: %s' % (
- ', '.join('%s' % d for d in envvar)
- if isinstance(envvar, (list, tuple))
- else envvar, ))
- if self.default is not None and self.show_default:
- if isinstance(self.show_default, string_types):
- default_string = '({})'.format(self.show_default)
- elif isinstance(self.default, (list, tuple)):
- default_string = ', '.join('%s' % d for d in self.default)
- elif inspect.isfunction(self.default):
- default_string = "(dynamic)"
- else:
- default_string = self.default
- extra.append('default: {}'.format(default_string))
-
- if self.required:
- extra.append('required')
- if extra:
- help = '%s[%s]' % (help and help + ' ' or '', '; '.join(extra))
-
- return ((any_prefix_is_slash and '; ' or ' / ').join(rv), help)
-
- def get_default(self, ctx):
- # If we're a non boolean flag out default is more complex because
- # we need to look at all flags in the same group to figure out
- # if we're the the default one in which case we return the flag
- # value as default.
- if self.is_flag and not self.is_bool_flag:
- for param in ctx.command.params:
- if param.name == self.name and param.default:
- return param.flag_value
- return None
- return Parameter.get_default(self, ctx)
-
- def prompt_for_value(self, ctx):
- """This is an alternative flow that can be activated in the full
- value processing if a value does not exist. It will prompt the
- user until a valid value exists and then returns the processed
- value as result.
- """
- # Calculate the default before prompting anything to be stable.
- default = self.get_default(ctx)
-
- # If this is a prompt for a flag we need to handle this
- # differently.
- if self.is_bool_flag:
- return confirm(self.prompt, default)
-
- return prompt(self.prompt, default=default, type=self.type,
- hide_input=self.hide_input, show_choices=self.show_choices,
- confirmation_prompt=self.confirmation_prompt,
- value_proc=lambda x: self.process_value(ctx, x))
-
- def resolve_envvar_value(self, ctx):
- rv = Parameter.resolve_envvar_value(self, ctx)
- if rv is not None:
- return rv
- if self.allow_from_autoenv and \
- ctx.auto_envvar_prefix is not None:
- envvar = '%s_%s' % (ctx.auto_envvar_prefix, self.name.upper())
- return os.environ.get(envvar)
-
- def value_from_envvar(self, ctx):
- rv = self.resolve_envvar_value(ctx)
- if rv is None:
- return None
- value_depth = (self.nargs != 1) + bool(self.multiple)
- if value_depth > 0 and rv is not None:
- rv = self.type.split_envvar_value(rv)
- if self.multiple and self.nargs != 1:
- rv = batch(rv, self.nargs)
- return rv
-
- def full_process_value(self, ctx, value):
- if value is None and self.prompt is not None \
- and not ctx.resilient_parsing:
- return self.prompt_for_value(ctx)
- return Parameter.full_process_value(self, ctx, value)
-
-
-class Argument(Parameter):
- """Arguments are positional parameters to a command. They generally
- provide fewer features than options but can have infinite ``nargs``
- and are required by default.
-
- All parameters are passed onwards to the parameter constructor.
- """
- param_type_name = 'argument'
-
- def __init__(self, param_decls, required=None, **attrs):
- if required is None:
- if attrs.get('default') is not None:
- required = False
- else:
- required = attrs.get('nargs', 1) > 0
- Parameter.__init__(self, param_decls, required=required, **attrs)
- if self.default is not None and self.nargs < 0:
- raise TypeError('nargs=-1 in combination with a default value '
- 'is not supported.')
-
- @property
- def human_readable_name(self):
- if self.metavar is not None:
- return self.metavar
- return self.name.upper()
-
- def make_metavar(self):
- if self.metavar is not None:
- return self.metavar
- var = self.type.get_metavar(self)
- if not var:
- var = self.name.upper()
- if not self.required:
- var = '[%s]' % var
- if self.nargs != 1:
- var += '...'
- return var
-
- def _parse_decls(self, decls, expose_value):
- if not decls:
- if not expose_value:
- return None, [], []
- raise TypeError('Could not determine name for argument')
- if len(decls) == 1:
- name = arg = decls[0]
- name = name.replace('-', '_').lower()
- else:
- raise TypeError('Arguments take exactly one '
- 'parameter declaration, got %d' % len(decls))
- return name, [arg], []
-
- def get_usage_pieces(self, ctx):
- return [self.make_metavar()]
-
- def get_error_hint(self, ctx):
- return '"%s"' % self.make_metavar()
-
- def add_to_parser(self, parser, ctx):
- parser.add_argument(dest=self.name, nargs=self.nargs,
- obj=self)
-
-
-# Circular dependency between decorators and core
-from .decorators import command, group
diff --git a/lib/click/decorators.py b/lib/click/decorators.py
deleted file mode 100644
index c57c530861..0000000000
--- a/lib/click/decorators.py
+++ /dev/null
@@ -1,311 +0,0 @@
-import sys
-import inspect
-
-from functools import update_wrapper
-
-from ._compat import iteritems
-from ._unicodefun import _check_for_unicode_literals
-from .utils import echo
-from .globals import get_current_context
-
-
-def pass_context(f):
- """Marks a callback as wanting to receive the current context
- object as first argument.
- """
- def new_func(*args, **kwargs):
- return f(get_current_context(), *args, **kwargs)
- return update_wrapper(new_func, f)
-
-
-def pass_obj(f):
- """Similar to :func:`pass_context`, but only pass the object on the
- context onwards (:attr:`Context.obj`). This is useful if that object
- represents the state of a nested system.
- """
- def new_func(*args, **kwargs):
- return f(get_current_context().obj, *args, **kwargs)
- return update_wrapper(new_func, f)
-
-
-def make_pass_decorator(object_type, ensure=False):
- """Given an object type this creates a decorator that will work
- similar to :func:`pass_obj` but instead of passing the object of the
- current context, it will find the innermost context of type
- :func:`object_type`.
-
- This generates a decorator that works roughly like this::
-
- from functools import update_wrapper
-
- def decorator(f):
- @pass_context
- def new_func(ctx, *args, **kwargs):
- obj = ctx.find_object(object_type)
- return ctx.invoke(f, obj, *args, **kwargs)
- return update_wrapper(new_func, f)
- return decorator
-
- :param object_type: the type of the object to pass.
- :param ensure: if set to `True`, a new object will be created and
- remembered on the context if it's not there yet.
- """
- def decorator(f):
- def new_func(*args, **kwargs):
- ctx = get_current_context()
- if ensure:
- obj = ctx.ensure_object(object_type)
- else:
- obj = ctx.find_object(object_type)
- if obj is None:
- raise RuntimeError('Managed to invoke callback without a '
- 'context object of type %r existing'
- % object_type.__name__)
- return ctx.invoke(f, obj, *args, **kwargs)
- return update_wrapper(new_func, f)
- return decorator
-
-
-def _make_command(f, name, attrs, cls):
- if isinstance(f, Command):
- raise TypeError('Attempted to convert a callback into a '
- 'command twice.')
- try:
- params = f.__click_params__
- params.reverse()
- del f.__click_params__
- except AttributeError:
- params = []
- help = attrs.get('help')
- if help is None:
- help = inspect.getdoc(f)
- if isinstance(help, bytes):
- help = help.decode('utf-8')
- else:
- help = inspect.cleandoc(help)
- attrs['help'] = help
- _check_for_unicode_literals()
- return cls(name=name or f.__name__.lower().replace('_', '-'),
- callback=f, params=params, **attrs)
-
-
-def command(name=None, cls=None, **attrs):
- r"""Creates a new :class:`Command` and uses the decorated function as
- callback. This will also automatically attach all decorated
- :func:`option`\s and :func:`argument`\s as parameters to the command.
-
- The name of the command defaults to the name of the function. If you
- want to change that, you can pass the intended name as the first
- argument.
-
- All keyword arguments are forwarded to the underlying command class.
-
- Once decorated the function turns into a :class:`Command` instance
- that can be invoked as a command line utility or be attached to a
- command :class:`Group`.
-
- :param name: the name of the command. This defaults to the function
- name with underscores replaced by dashes.
- :param cls: the command class to instantiate. This defaults to
- :class:`Command`.
- """
- if cls is None:
- cls = Command
- def decorator(f):
- cmd = _make_command(f, name, attrs, cls)
- cmd.__doc__ = f.__doc__
- return cmd
- return decorator
-
-
-def group(name=None, **attrs):
- """Creates a new :class:`Group` with a function as callback. This
- works otherwise the same as :func:`command` just that the `cls`
- parameter is set to :class:`Group`.
- """
- attrs.setdefault('cls', Group)
- return command(name, **attrs)
-
-
-def _param_memo(f, param):
- if isinstance(f, Command):
- f.params.append(param)
- else:
- if not hasattr(f, '__click_params__'):
- f.__click_params__ = []
- f.__click_params__.append(param)
-
-
-def argument(*param_decls, **attrs):
- """Attaches an argument to the command. All positional arguments are
- passed as parameter declarations to :class:`Argument`; all keyword
- arguments are forwarded unchanged (except ``cls``).
- This is equivalent to creating an :class:`Argument` instance manually
- and attaching it to the :attr:`Command.params` list.
-
- :param cls: the argument class to instantiate. This defaults to
- :class:`Argument`.
- """
- def decorator(f):
- ArgumentClass = attrs.pop('cls', Argument)
- _param_memo(f, ArgumentClass(param_decls, **attrs))
- return f
- return decorator
-
-
-def option(*param_decls, **attrs):
- """Attaches an option to the command. All positional arguments are
- passed as parameter declarations to :class:`Option`; all keyword
- arguments are forwarded unchanged (except ``cls``).
- This is equivalent to creating an :class:`Option` instance manually
- and attaching it to the :attr:`Command.params` list.
-
- :param cls: the option class to instantiate. This defaults to
- :class:`Option`.
- """
- def decorator(f):
- # Issue 926, copy attrs, so pre-defined options can re-use the same cls=
- option_attrs = attrs.copy()
-
- if 'help' in option_attrs:
- option_attrs['help'] = inspect.cleandoc(option_attrs['help'])
- OptionClass = option_attrs.pop('cls', Option)
- _param_memo(f, OptionClass(param_decls, **option_attrs))
- return f
- return decorator
-
-
-def confirmation_option(*param_decls, **attrs):
- """Shortcut for confirmation prompts that can be ignored by passing
- ``--yes`` as parameter.
-
- This is equivalent to decorating a function with :func:`option` with
- the following parameters::
-
- def callback(ctx, param, value):
- if not value:
- ctx.abort()
-
- @click.command()
- @click.option('--yes', is_flag=True, callback=callback,
- expose_value=False, prompt='Do you want to continue?')
- def dropdb():
- pass
- """
- def decorator(f):
- def callback(ctx, param, value):
- if not value:
- ctx.abort()
- attrs.setdefault('is_flag', True)
- attrs.setdefault('callback', callback)
- attrs.setdefault('expose_value', False)
- attrs.setdefault('prompt', 'Do you want to continue?')
- attrs.setdefault('help', 'Confirm the action without prompting.')
- return option(*(param_decls or ('--yes',)), **attrs)(f)
- return decorator
-
-
-def password_option(*param_decls, **attrs):
- """Shortcut for password prompts.
-
- This is equivalent to decorating a function with :func:`option` with
- the following parameters::
-
- @click.command()
- @click.option('--password', prompt=True, confirmation_prompt=True,
- hide_input=True)
- def changeadmin(password):
- pass
- """
- def decorator(f):
- attrs.setdefault('prompt', True)
- attrs.setdefault('confirmation_prompt', True)
- attrs.setdefault('hide_input', True)
- return option(*(param_decls or ('--password',)), **attrs)(f)
- return decorator
-
-
-def version_option(version=None, *param_decls, **attrs):
- """Adds a ``--version`` option which immediately ends the program
- printing out the version number. This is implemented as an eager
- option that prints the version and exits the program in the callback.
-
- :param version: the version number to show. If not provided Click
- attempts an auto discovery via setuptools.
- :param prog_name: the name of the program (defaults to autodetection)
- :param message: custom message to show instead of the default
- (``'%(prog)s, version %(version)s'``)
- :param others: everything else is forwarded to :func:`option`.
- """
- if version is None:
- if hasattr(sys, '_getframe'):
- module = sys._getframe(1).f_globals.get('__name__')
- else:
- module = ''
-
- def decorator(f):
- prog_name = attrs.pop('prog_name', None)
- message = attrs.pop('message', '%(prog)s, version %(version)s')
-
- def callback(ctx, param, value):
- if not value or ctx.resilient_parsing:
- return
- prog = prog_name
- if prog is None:
- prog = ctx.find_root().info_name
- ver = version
- if ver is None:
- try:
- import pkg_resources
- except ImportError:
- pass
- else:
- for dist in pkg_resources.working_set:
- scripts = dist.get_entry_map().get('console_scripts') or {}
- for script_name, entry_point in iteritems(scripts):
- if entry_point.module_name == module:
- ver = dist.version
- break
- if ver is None:
- raise RuntimeError('Could not determine version')
- echo(message % {
- 'prog': prog,
- 'version': ver,
- }, color=ctx.color)
- ctx.exit()
-
- attrs.setdefault('is_flag', True)
- attrs.setdefault('expose_value', False)
- attrs.setdefault('is_eager', True)
- attrs.setdefault('help', 'Show the version and exit.')
- attrs['callback'] = callback
- return option(*(param_decls or ('--version',)), **attrs)(f)
- return decorator
-
-
-def help_option(*param_decls, **attrs):
- """Adds a ``--help`` option which immediately ends the program
- printing out the help page. This is usually unnecessary to add as
- this is added by default to all commands unless suppressed.
-
- Like :func:`version_option`, this is implemented as eager option that
- prints in the callback and exits.
-
- All arguments are forwarded to :func:`option`.
- """
- def decorator(f):
- def callback(ctx, param, value):
- if value and not ctx.resilient_parsing:
- echo(ctx.get_help(), color=ctx.color)
- ctx.exit()
- attrs.setdefault('is_flag', True)
- attrs.setdefault('expose_value', False)
- attrs.setdefault('help', 'Show this message and exit.')
- attrs.setdefault('is_eager', True)
- attrs['callback'] = callback
- return option(*(param_decls or ('--help',)), **attrs)(f)
- return decorator
-
-
-# Circular dependencies between core and decorators
-from .core import Command, Group, Argument, Option
diff --git a/lib/click/exceptions.py b/lib/click/exceptions.py
deleted file mode 100644
index 6fa17658cb..0000000000
--- a/lib/click/exceptions.py
+++ /dev/null
@@ -1,235 +0,0 @@
-from ._compat import PY2, filename_to_ui, get_text_stderr
-from .utils import echo
-
-
-def _join_param_hints(param_hint):
- if isinstance(param_hint, (tuple, list)):
- return ' / '.join('"%s"' % x for x in param_hint)
- return param_hint
-
-
-class ClickException(Exception):
- """An exception that Click can handle and show to the user."""
-
- #: The exit code for this exception
- exit_code = 1
-
- def __init__(self, message):
- ctor_msg = message
- if PY2:
- if ctor_msg is not None:
- ctor_msg = ctor_msg.encode('utf-8')
- Exception.__init__(self, ctor_msg)
- self.message = message
-
- def format_message(self):
- return self.message
-
- def __str__(self):
- return self.message
-
- if PY2:
- __unicode__ = __str__
-
- def __str__(self):
- return self.message.encode('utf-8')
-
- def show(self, file=None):
- if file is None:
- file = get_text_stderr()
- echo('Error: %s' % self.format_message(), file=file)
-
-
-class UsageError(ClickException):
- """An internal exception that signals a usage error. This typically
- aborts any further handling.
-
- :param message: the error message to display.
- :param ctx: optionally the context that caused this error. Click will
- fill in the context automatically in some situations.
- """
- exit_code = 2
-
- def __init__(self, message, ctx=None):
- ClickException.__init__(self, message)
- self.ctx = ctx
- self.cmd = self.ctx and self.ctx.command or None
-
- def show(self, file=None):
- if file is None:
- file = get_text_stderr()
- color = None
- hint = ''
- if (self.cmd is not None and
- self.cmd.get_help_option(self.ctx) is not None):
- hint = ('Try "%s %s" for help.\n'
- % (self.ctx.command_path, self.ctx.help_option_names[0]))
- if self.ctx is not None:
- color = self.ctx.color
- echo(self.ctx.get_usage() + '\n%s' % hint, file=file, color=color)
- echo('Error: %s' % self.format_message(), file=file, color=color)
-
-
-class BadParameter(UsageError):
- """An exception that formats out a standardized error message for a
- bad parameter. This is useful when thrown from a callback or type as
- Click will attach contextual information to it (for instance, which
- parameter it is).
-
- .. versionadded:: 2.0
-
- :param param: the parameter object that caused this error. This can
- be left out, and Click will attach this info itself
- if possible.
- :param param_hint: a string that shows up as parameter name. This
- can be used as alternative to `param` in cases
- where custom validation should happen. If it is
- a string it's used as such, if it's a list then
- each item is quoted and separated.
- """
-
- def __init__(self, message, ctx=None, param=None,
- param_hint=None):
- UsageError.__init__(self, message, ctx)
- self.param = param
- self.param_hint = param_hint
-
- def format_message(self):
- if self.param_hint is not None:
- param_hint = self.param_hint
- elif self.param is not None:
- param_hint = self.param.get_error_hint(self.ctx)
- else:
- return 'Invalid value: %s' % self.message
- param_hint = _join_param_hints(param_hint)
-
- return 'Invalid value for %s: %s' % (param_hint, self.message)
-
-
-class MissingParameter(BadParameter):
- """Raised if click required an option or argument but it was not
- provided when invoking the script.
-
- .. versionadded:: 4.0
-
- :param param_type: a string that indicates the type of the parameter.
- The default is to inherit the parameter type from
- the given `param`. Valid values are ``'parameter'``,
- ``'option'`` or ``'argument'``.
- """
-
- def __init__(self, message=None, ctx=None, param=None,
- param_hint=None, param_type=None):
- BadParameter.__init__(self, message, ctx, param, param_hint)
- self.param_type = param_type
-
- def format_message(self):
- if self.param_hint is not None:
- param_hint = self.param_hint
- elif self.param is not None:
- param_hint = self.param.get_error_hint(self.ctx)
- else:
- param_hint = None
- param_hint = _join_param_hints(param_hint)
-
- param_type = self.param_type
- if param_type is None and self.param is not None:
- param_type = self.param.param_type_name
-
- msg = self.message
- if self.param is not None:
- msg_extra = self.param.type.get_missing_message(self.param)
- if msg_extra:
- if msg:
- msg += '. ' + msg_extra
- else:
- msg = msg_extra
-
- return 'Missing %s%s%s%s' % (
- param_type,
- param_hint and ' %s' % param_hint or '',
- msg and '. ' or '.',
- msg or '',
- )
-
-
-class NoSuchOption(UsageError):
- """Raised if click attempted to handle an option that does not
- exist.
-
- .. versionadded:: 4.0
- """
-
- def __init__(self, option_name, message=None, possibilities=None,
- ctx=None):
- if message is None:
- message = 'no such option: %s' % option_name
- UsageError.__init__(self, message, ctx)
- self.option_name = option_name
- self.possibilities = possibilities
-
- def format_message(self):
- bits = [self.message]
- if self.possibilities:
- if len(self.possibilities) == 1:
- bits.append('Did you mean %s?' % self.possibilities[0])
- else:
- possibilities = sorted(self.possibilities)
- bits.append('(Possible options: %s)' % ', '.join(possibilities))
- return ' '.join(bits)
-
-
-class BadOptionUsage(UsageError):
- """Raised if an option is generally supplied but the use of the option
- was incorrect. This is for instance raised if the number of arguments
- for an option is not correct.
-
- .. versionadded:: 4.0
-
- :param option_name: the name of the option being used incorrectly.
- """
-
- def __init__(self, option_name, message, ctx=None):
- UsageError.__init__(self, message, ctx)
- self.option_name = option_name
-
-
-class BadArgumentUsage(UsageError):
- """Raised if an argument is generally supplied but the use of the argument
- was incorrect. This is for instance raised if the number of values
- for an argument is not correct.
-
- .. versionadded:: 6.0
- """
-
- def __init__(self, message, ctx=None):
- UsageError.__init__(self, message, ctx)
-
-
-class FileError(ClickException):
- """Raised if a file cannot be opened."""
-
- def __init__(self, filename, hint=None):
- ui_filename = filename_to_ui(filename)
- if hint is None:
- hint = 'unknown error'
- ClickException.__init__(self, hint)
- self.ui_filename = ui_filename
- self.filename = filename
-
- def format_message(self):
- return 'Could not open file %s: %s' % (self.ui_filename, self.message)
-
-
-class Abort(RuntimeError):
- """An internal signalling exception that signals Click to abort."""
-
-
-class Exit(RuntimeError):
- """An exception that indicates that the application should exit with some
- status code.
-
- :param code: the status code to exit with.
- """
- def __init__(self, code=0):
- self.exit_code = code
diff --git a/lib/click/formatting.py b/lib/click/formatting.py
deleted file mode 100644
index a3d6a4d389..0000000000
--- a/lib/click/formatting.py
+++ /dev/null
@@ -1,256 +0,0 @@
-from contextlib import contextmanager
-from .termui import get_terminal_size
-from .parser import split_opt
-from ._compat import term_len
-
-
-# Can force a width. This is used by the test system
-FORCED_WIDTH = None
-
-
-def measure_table(rows):
- widths = {}
- for row in rows:
- for idx, col in enumerate(row):
- widths[idx] = max(widths.get(idx, 0), term_len(col))
- return tuple(y for x, y in sorted(widths.items()))
-
-
-def iter_rows(rows, col_count):
- for row in rows:
- row = tuple(row)
- yield row + ('',) * (col_count - len(row))
-
-
-def wrap_text(text, width=78, initial_indent='', subsequent_indent='',
- preserve_paragraphs=False):
- """A helper function that intelligently wraps text. By default, it
- assumes that it operates on a single paragraph of text but if the
- `preserve_paragraphs` parameter is provided it will intelligently
- handle paragraphs (defined by two empty lines).
-
- If paragraphs are handled, a paragraph can be prefixed with an empty
- line containing the ``\\b`` character (``\\x08``) to indicate that
- no rewrapping should happen in that block.
-
- :param text: the text that should be rewrapped.
- :param width: the maximum width for the text.
- :param initial_indent: the initial indent that should be placed on the
- first line as a string.
- :param subsequent_indent: the indent string that should be placed on
- each consecutive line.
- :param preserve_paragraphs: if this flag is set then the wrapping will
- intelligently handle paragraphs.
- """
- from ._textwrap import TextWrapper
- text = text.expandtabs()
- wrapper = TextWrapper(width, initial_indent=initial_indent,
- subsequent_indent=subsequent_indent,
- replace_whitespace=False)
- if not preserve_paragraphs:
- return wrapper.fill(text)
-
- p = []
- buf = []
- indent = None
-
- def _flush_par():
- if not buf:
- return
- if buf[0].strip() == '\b':
- p.append((indent or 0, True, '\n'.join(buf[1:])))
- else:
- p.append((indent or 0, False, ' '.join(buf)))
- del buf[:]
-
- for line in text.splitlines():
- if not line:
- _flush_par()
- indent = None
- else:
- if indent is None:
- orig_len = term_len(line)
- line = line.lstrip()
- indent = orig_len - term_len(line)
- buf.append(line)
- _flush_par()
-
- rv = []
- for indent, raw, text in p:
- with wrapper.extra_indent(' ' * indent):
- if raw:
- rv.append(wrapper.indent_only(text))
- else:
- rv.append(wrapper.fill(text))
-
- return '\n\n'.join(rv)
-
-
-class HelpFormatter(object):
- """This class helps with formatting text-based help pages. It's
- usually just needed for very special internal cases, but it's also
- exposed so that developers can write their own fancy outputs.
-
- At present, it always writes into memory.
-
- :param indent_increment: the additional increment for each level.
- :param width: the width for the text. This defaults to the terminal
- width clamped to a maximum of 78.
- """
-
- def __init__(self, indent_increment=2, width=None, max_width=None):
- self.indent_increment = indent_increment
- if max_width is None:
- max_width = 80
- if width is None:
- width = FORCED_WIDTH
- if width is None:
- width = max(min(get_terminal_size()[0], max_width) - 2, 50)
- self.width = width
- self.current_indent = 0
- self.buffer = []
-
- def write(self, string):
- """Writes a unicode string into the internal buffer."""
- self.buffer.append(string)
-
- def indent(self):
- """Increases the indentation."""
- self.current_indent += self.indent_increment
-
- def dedent(self):
- """Decreases the indentation."""
- self.current_indent -= self.indent_increment
-
- def write_usage(self, prog, args='', prefix='Usage: '):
- """Writes a usage line into the buffer.
-
- :param prog: the program name.
- :param args: whitespace separated list of arguments.
- :param prefix: the prefix for the first line.
- """
- usage_prefix = '%*s%s ' % (self.current_indent, prefix, prog)
- text_width = self.width - self.current_indent
-
- if text_width >= (term_len(usage_prefix) + 20):
- # The arguments will fit to the right of the prefix.
- indent = ' ' * term_len(usage_prefix)
- self.write(wrap_text(args, text_width,
- initial_indent=usage_prefix,
- subsequent_indent=indent))
- else:
- # The prefix is too long, put the arguments on the next line.
- self.write(usage_prefix)
- self.write('\n')
- indent = ' ' * (max(self.current_indent, term_len(prefix)) + 4)
- self.write(wrap_text(args, text_width,
- initial_indent=indent,
- subsequent_indent=indent))
-
- self.write('\n')
-
- def write_heading(self, heading):
- """Writes a heading into the buffer."""
- self.write('%*s%s:\n' % (self.current_indent, '', heading))
-
- def write_paragraph(self):
- """Writes a paragraph into the buffer."""
- if self.buffer:
- self.write('\n')
-
- def write_text(self, text):
- """Writes re-indented text into the buffer. This rewraps and
- preserves paragraphs.
- """
- text_width = max(self.width - self.current_indent, 11)
- indent = ' ' * self.current_indent
- self.write(wrap_text(text, text_width,
- initial_indent=indent,
- subsequent_indent=indent,
- preserve_paragraphs=True))
- self.write('\n')
-
- def write_dl(self, rows, col_max=30, col_spacing=2):
- """Writes a definition list into the buffer. This is how options
- and commands are usually formatted.
-
- :param rows: a list of two item tuples for the terms and values.
- :param col_max: the maximum width of the first column.
- :param col_spacing: the number of spaces between the first and
- second column.
- """
- rows = list(rows)
- widths = measure_table(rows)
- if len(widths) != 2:
- raise TypeError('Expected two columns for definition list')
-
- first_col = min(widths[0], col_max) + col_spacing
-
- for first, second in iter_rows(rows, len(widths)):
- self.write('%*s%s' % (self.current_indent, '', first))
- if not second:
- self.write('\n')
- continue
- if term_len(first) <= first_col - col_spacing:
- self.write(' ' * (first_col - term_len(first)))
- else:
- self.write('\n')
- self.write(' ' * (first_col + self.current_indent))
-
- text_width = max(self.width - first_col - 2, 10)
- lines = iter(wrap_text(second, text_width).splitlines())
- if lines:
- self.write(next(lines) + '\n')
- for line in lines:
- self.write('%*s%s\n' % (
- first_col + self.current_indent, '', line))
- else:
- self.write('\n')
-
- @contextmanager
- def section(self, name):
- """Helpful context manager that writes a paragraph, a heading,
- and the indents.
-
- :param name: the section name that is written as heading.
- """
- self.write_paragraph()
- self.write_heading(name)
- self.indent()
- try:
- yield
- finally:
- self.dedent()
-
- @contextmanager
- def indentation(self):
- """A context manager that increases the indentation."""
- self.indent()
- try:
- yield
- finally:
- self.dedent()
-
- def getvalue(self):
- """Returns the buffer contents."""
- return ''.join(self.buffer)
-
-
-def join_options(options):
- """Given a list of option strings this joins them in the most appropriate
- way and returns them in the form ``(formatted_string,
- any_prefix_is_slash)`` where the second item in the tuple is a flag that
- indicates if any of the option prefixes was a slash.
- """
- rv = []
- any_prefix_is_slash = False
- for opt in options:
- prefix = split_opt(opt)[0]
- if prefix == '/':
- any_prefix_is_slash = True
- rv.append((len(prefix), opt))
-
- rv.sort(key=lambda x: x[0])
-
- rv = ', '.join(x[1] for x in rv)
- return rv, any_prefix_is_slash
diff --git a/lib/click/globals.py b/lib/click/globals.py
deleted file mode 100644
index 843b594abe..0000000000
--- a/lib/click/globals.py
+++ /dev/null
@@ -1,48 +0,0 @@
-from threading import local
-
-
-_local = local()
-
-
-def get_current_context(silent=False):
- """Returns the current click context. This can be used as a way to
- access the current context object from anywhere. This is a more implicit
- alternative to the :func:`pass_context` decorator. This function is
- primarily useful for helpers such as :func:`echo` which might be
- interested in changing its behavior based on the current context.
-
- To push the current context, :meth:`Context.scope` can be used.
-
- .. versionadded:: 5.0
-
- :param silent: is set to `True` the return value is `None` if no context
- is available. The default behavior is to raise a
- :exc:`RuntimeError`.
- """
- try:
- return getattr(_local, 'stack')[-1]
- except (AttributeError, IndexError):
- if not silent:
- raise RuntimeError('There is no active click context.')
-
-
-def push_context(ctx):
- """Pushes a new context to the current stack."""
- _local.__dict__.setdefault('stack', []).append(ctx)
-
-
-def pop_context():
- """Removes the top level from the stack."""
- _local.stack.pop()
-
-
-def resolve_color_default(color=None):
- """"Internal helper to get the default value of the color flag. If a
- value is passed it's returned unchanged, otherwise it's looked up from
- the current context.
- """
- if color is not None:
- return color
- ctx = get_current_context(silent=True)
- if ctx is not None:
- return ctx.color
diff --git a/lib/click/parser.py b/lib/click/parser.py
deleted file mode 100644
index 1c3ae9c8ef..0000000000
--- a/lib/click/parser.py
+++ /dev/null
@@ -1,427 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
-click.parser
-~~~~~~~~~~~~
-
-This module started out as largely a copy paste from the stdlib's
-optparse module with the features removed that we do not need from
-optparse because we implement them in Click on a higher level (for
-instance type handling, help formatting and a lot more).
-
-The plan is to remove more and more from here over time.
-
-The reason this is a different module and not optparse from the stdlib
-is that there are differences in 2.x and 3.x about the error messages
-generated and optparse in the stdlib uses gettext for no good reason
-and might cause us issues.
-"""
-
-import re
-from collections import deque
-from .exceptions import UsageError, NoSuchOption, BadOptionUsage, \
- BadArgumentUsage
-
-
-def _unpack_args(args, nargs_spec):
- """Given an iterable of arguments and an iterable of nargs specifications,
- it returns a tuple with all the unpacked arguments at the first index
- and all remaining arguments as the second.
-
- The nargs specification is the number of arguments that should be consumed
- or `-1` to indicate that this position should eat up all the remainders.
-
- Missing items are filled with `None`.
- """
- args = deque(args)
- nargs_spec = deque(nargs_spec)
- rv = []
- spos = None
-
- def _fetch(c):
- try:
- if spos is None:
- return c.popleft()
- else:
- return c.pop()
- except IndexError:
- return None
-
- while nargs_spec:
- nargs = _fetch(nargs_spec)
- if nargs == 1:
- rv.append(_fetch(args))
- elif nargs > 1:
- x = [_fetch(args) for _ in range(nargs)]
- # If we're reversed, we're pulling in the arguments in reverse,
- # so we need to turn them around.
- if spos is not None:
- x.reverse()
- rv.append(tuple(x))
- elif nargs < 0:
- if spos is not None:
- raise TypeError('Cannot have two nargs < 0')
- spos = len(rv)
- rv.append(None)
-
- # spos is the position of the wildcard (star). If it's not `None`,
- # we fill it with the remainder.
- if spos is not None:
- rv[spos] = tuple(args)
- args = []
- rv[spos + 1:] = reversed(rv[spos + 1:])
-
- return tuple(rv), list(args)
-
-
-def _error_opt_args(nargs, opt):
- if nargs == 1:
- raise BadOptionUsage(opt, '%s option requires an argument' % opt)
- raise BadOptionUsage(opt, '%s option requires %d arguments' % (opt, nargs))
-
-
-def split_opt(opt):
- first = opt[:1]
- if first.isalnum():
- return '', opt
- if opt[1:2] == first:
- return opt[:2], opt[2:]
- return first, opt[1:]
-
-
-def normalize_opt(opt, ctx):
- if ctx is None or ctx.token_normalize_func is None:
- return opt
- prefix, opt = split_opt(opt)
- return prefix + ctx.token_normalize_func(opt)
-
-
-def split_arg_string(string):
- """Given an argument string this attempts to split it into small parts."""
- rv = []
- for match in re.finditer(r"('([^'\\]*(?:\\.[^'\\]*)*)'"
- r'|"([^"\\]*(?:\\.[^"\\]*)*)"'
- r'|\S+)\s*', string, re.S):
- arg = match.group().strip()
- if arg[:1] == arg[-1:] and arg[:1] in '"\'':
- arg = arg[1:-1].encode('ascii', 'backslashreplace') \
- .decode('unicode-escape')
- try:
- arg = type(string)(arg)
- except UnicodeError:
- pass
- rv.append(arg)
- return rv
-
-
-class Option(object):
-
- def __init__(self, opts, dest, action=None, nargs=1, const=None, obj=None):
- self._short_opts = []
- self._long_opts = []
- self.prefixes = set()
-
- for opt in opts:
- prefix, value = split_opt(opt)
- if not prefix:
- raise ValueError('Invalid start character for option (%s)'
- % opt)
- self.prefixes.add(prefix[0])
- if len(prefix) == 1 and len(value) == 1:
- self._short_opts.append(opt)
- else:
- self._long_opts.append(opt)
- self.prefixes.add(prefix)
-
- if action is None:
- action = 'store'
-
- self.dest = dest
- self.action = action
- self.nargs = nargs
- self.const = const
- self.obj = obj
-
- @property
- def takes_value(self):
- return self.action in ('store', 'append')
-
- def process(self, value, state):
- if self.action == 'store':
- state.opts[self.dest] = value
- elif self.action == 'store_const':
- state.opts[self.dest] = self.const
- elif self.action == 'append':
- state.opts.setdefault(self.dest, []).append(value)
- elif self.action == 'append_const':
- state.opts.setdefault(self.dest, []).append(self.const)
- elif self.action == 'count':
- state.opts[self.dest] = state.opts.get(self.dest, 0) + 1
- else:
- raise ValueError('unknown action %r' % self.action)
- state.order.append(self.obj)
-
-
-class Argument(object):
-
- def __init__(self, dest, nargs=1, obj=None):
- self.dest = dest
- self.nargs = nargs
- self.obj = obj
-
- def process(self, value, state):
- if self.nargs > 1:
- holes = sum(1 for x in value if x is None)
- if holes == len(value):
- value = None
- elif holes != 0:
- raise BadArgumentUsage('argument %s takes %d values'
- % (self.dest, self.nargs))
- state.opts[self.dest] = value
- state.order.append(self.obj)
-
-
-class ParsingState(object):
-
- def __init__(self, rargs):
- self.opts = {}
- self.largs = []
- self.rargs = rargs
- self.order = []
-
-
-class OptionParser(object):
- """The option parser is an internal class that is ultimately used to
- parse options and arguments. It's modelled after optparse and brings
- a similar but vastly simplified API. It should generally not be used
- directly as the high level Click classes wrap it for you.
-
- It's not nearly as extensible as optparse or argparse as it does not
- implement features that are implemented on a higher level (such as
- types or defaults).
-
- :param ctx: optionally the :class:`~click.Context` where this parser
- should go with.
- """
-
- def __init__(self, ctx=None):
- #: The :class:`~click.Context` for this parser. This might be
- #: `None` for some advanced use cases.
- self.ctx = ctx
- #: This controls how the parser deals with interspersed arguments.
- #: If this is set to `False`, the parser will stop on the first
- #: non-option. Click uses this to implement nested subcommands
- #: safely.
- self.allow_interspersed_args = True
- #: This tells the parser how to deal with unknown options. By
- #: default it will error out (which is sensible), but there is a
- #: second mode where it will ignore it and continue processing
- #: after shifting all the unknown options into the resulting args.
- self.ignore_unknown_options = False
- if ctx is not None:
- self.allow_interspersed_args = ctx.allow_interspersed_args
- self.ignore_unknown_options = ctx.ignore_unknown_options
- self._short_opt = {}
- self._long_opt = {}
- self._opt_prefixes = set(['-', '--'])
- self._args = []
-
- def add_option(self, opts, dest, action=None, nargs=1, const=None,
- obj=None):
- """Adds a new option named `dest` to the parser. The destination
- is not inferred (unlike with optparse) and needs to be explicitly
- provided. Action can be any of ``store``, ``store_const``,
- ``append``, ``appnd_const`` or ``count``.
-
- The `obj` can be used to identify the option in the order list
- that is returned from the parser.
- """
- if obj is None:
- obj = dest
- opts = [normalize_opt(opt, self.ctx) for opt in opts]
- option = Option(opts, dest, action=action, nargs=nargs,
- const=const, obj=obj)
- self._opt_prefixes.update(option.prefixes)
- for opt in option._short_opts:
- self._short_opt[opt] = option
- for opt in option._long_opts:
- self._long_opt[opt] = option
-
- def add_argument(self, dest, nargs=1, obj=None):
- """Adds a positional argument named `dest` to the parser.
-
- The `obj` can be used to identify the option in the order list
- that is returned from the parser.
- """
- if obj is None:
- obj = dest
- self._args.append(Argument(dest=dest, nargs=nargs, obj=obj))
-
- def parse_args(self, args):
- """Parses positional arguments and returns ``(values, args, order)``
- for the parsed options and arguments as well as the leftover
- arguments if there are any. The order is a list of objects as they
- appear on the command line. If arguments appear multiple times they
- will be memorized multiple times as well.
- """
- state = ParsingState(args)
- try:
- self._process_args_for_options(state)
- self._process_args_for_args(state)
- except UsageError:
- if self.ctx is None or not self.ctx.resilient_parsing:
- raise
- return state.opts, state.largs, state.order
-
- def _process_args_for_args(self, state):
- pargs, args = _unpack_args(state.largs + state.rargs,
- [x.nargs for x in self._args])
-
- for idx, arg in enumerate(self._args):
- arg.process(pargs[idx], state)
-
- state.largs = args
- state.rargs = []
-
- def _process_args_for_options(self, state):
- while state.rargs:
- arg = state.rargs.pop(0)
- arglen = len(arg)
- # Double dashes always handled explicitly regardless of what
- # prefixes are valid.
- if arg == '--':
- return
- elif arg[:1] in self._opt_prefixes and arglen > 1:
- self._process_opts(arg, state)
- elif self.allow_interspersed_args:
- state.largs.append(arg)
- else:
- state.rargs.insert(0, arg)
- return
-
- # Say this is the original argument list:
- # [arg0, arg1, ..., arg(i-1), arg(i), arg(i+1), ..., arg(N-1)]
- # ^
- # (we are about to process arg(i)).
- #
- # Then rargs is [arg(i), ..., arg(N-1)] and largs is a *subset* of
- # [arg0, ..., arg(i-1)] (any options and their arguments will have
- # been removed from largs).
- #
- # The while loop will usually consume 1 or more arguments per pass.
- # If it consumes 1 (eg. arg is an option that takes no arguments),
- # then after _process_arg() is done the situation is:
- #
- # largs = subset of [arg0, ..., arg(i)]
- # rargs = [arg(i+1), ..., arg(N-1)]
- #
- # If allow_interspersed_args is false, largs will always be
- # *empty* -- still a subset of [arg0, ..., arg(i-1)], but
- # not a very interesting subset!
-
- def _match_long_opt(self, opt, explicit_value, state):
- if opt not in self._long_opt:
- possibilities = [word for word in self._long_opt
- if word.startswith(opt)]
- raise NoSuchOption(opt, possibilities=possibilities, ctx=self.ctx)
-
- option = self._long_opt[opt]
- if option.takes_value:
- # At this point it's safe to modify rargs by injecting the
- # explicit value, because no exception is raised in this
- # branch. This means that the inserted value will be fully
- # consumed.
- if explicit_value is not None:
- state.rargs.insert(0, explicit_value)
-
- nargs = option.nargs
- if len(state.rargs) < nargs:
- _error_opt_args(nargs, opt)
- elif nargs == 1:
- value = state.rargs.pop(0)
- else:
- value = tuple(state.rargs[:nargs])
- del state.rargs[:nargs]
-
- elif explicit_value is not None:
- raise BadOptionUsage(opt, '%s option does not take a value' % opt)
-
- else:
- value = None
-
- option.process(value, state)
-
- def _match_short_opt(self, arg, state):
- stop = False
- i = 1
- prefix = arg[0]
- unknown_options = []
-
- for ch in arg[1:]:
- opt = normalize_opt(prefix + ch, self.ctx)
- option = self._short_opt.get(opt)
- i += 1
-
- if not option:
- if self.ignore_unknown_options:
- unknown_options.append(ch)
- continue
- raise NoSuchOption(opt, ctx=self.ctx)
- if option.takes_value:
- # Any characters left in arg? Pretend they're the
- # next arg, and stop consuming characters of arg.
- if i < len(arg):
- state.rargs.insert(0, arg[i:])
- stop = True
-
- nargs = option.nargs
- if len(state.rargs) < nargs:
- _error_opt_args(nargs, opt)
- elif nargs == 1:
- value = state.rargs.pop(0)
- else:
- value = tuple(state.rargs[:nargs])
- del state.rargs[:nargs]
-
- else:
- value = None
-
- option.process(value, state)
-
- if stop:
- break
-
- # If we got any unknown options we re-combinate the string of the
- # remaining options and re-attach the prefix, then report that
- # to the state as new larg. This way there is basic combinatorics
- # that can be achieved while still ignoring unknown arguments.
- if self.ignore_unknown_options and unknown_options:
- state.largs.append(prefix + ''.join(unknown_options))
-
- def _process_opts(self, arg, state):
- explicit_value = None
- # Long option handling happens in two parts. The first part is
- # supporting explicitly attached values. In any case, we will try
- # to long match the option first.
- if '=' in arg:
- long_opt, explicit_value = arg.split('=', 1)
- else:
- long_opt = arg
- norm_long_opt = normalize_opt(long_opt, self.ctx)
-
- # At this point we will match the (assumed) long option through
- # the long option matching code. Note that this allows options
- # like "-foo" to be matched as long options.
- try:
- self._match_long_opt(norm_long_opt, explicit_value, state)
- except NoSuchOption:
- # At this point the long option matching failed, and we need
- # to try with short options. However there is a special rule
- # which says, that if we have a two character options prefix
- # (applies to "--foo" for instance), we do not dispatch to the
- # short option code and will instead raise the no option
- # error.
- if arg[:2] not in self._opt_prefixes:
- return self._match_short_opt(arg, state)
- if not self.ignore_unknown_options:
- raise
- state.largs.append(arg)
diff --git a/lib/click/termui.py b/lib/click/termui.py
deleted file mode 100644
index bf9a3aa163..0000000000
--- a/lib/click/termui.py
+++ /dev/null
@@ -1,606 +0,0 @@
-import os
-import sys
-import struct
-import inspect
-import itertools
-
-from ._compat import raw_input, text_type, string_types, \
- isatty, strip_ansi, get_winterm_size, DEFAULT_COLUMNS, WIN
-from .utils import echo
-from .exceptions import Abort, UsageError
-from .types import convert_type, Choice, Path
-from .globals import resolve_color_default
-
-
-# The prompt functions to use. The doc tools currently override these
-# functions to customize how they work.
-visible_prompt_func = raw_input
-
-_ansi_colors = {
- 'black': 30,
- 'red': 31,
- 'green': 32,
- 'yellow': 33,
- 'blue': 34,
- 'magenta': 35,
- 'cyan': 36,
- 'white': 37,
- 'reset': 39,
- 'bright_black': 90,
- 'bright_red': 91,
- 'bright_green': 92,
- 'bright_yellow': 93,
- 'bright_blue': 94,
- 'bright_magenta': 95,
- 'bright_cyan': 96,
- 'bright_white': 97,
-}
-_ansi_reset_all = '\033[0m'
-
-
-def hidden_prompt_func(prompt):
- import getpass
- return getpass.getpass(prompt)
-
-
-def _build_prompt(text, suffix, show_default=False, default=None, show_choices=True, type=None):
- prompt = text
- if type is not None and show_choices and isinstance(type, Choice):
- prompt += ' (' + ", ".join(map(str, type.choices)) + ')'
- if default is not None and show_default:
- prompt = '%s [%s]' % (prompt, default)
- return prompt + suffix
-
-
-def prompt(text, default=None, hide_input=False, confirmation_prompt=False,
- type=None, value_proc=None, prompt_suffix=': ', show_default=True,
- err=False, show_choices=True):
- """Prompts a user for input. This is a convenience function that can
- be used to prompt a user for input later.
-
- If the user aborts the input by sending a interrupt signal, this
- function will catch it and raise a :exc:`Abort` exception.
-
- .. versionadded:: 7.0
- Added the show_choices parameter.
-
- .. versionadded:: 6.0
- Added unicode support for cmd.exe on Windows.
-
- .. versionadded:: 4.0
- Added the `err` parameter.
-
- :param text: the text to show for the prompt.
- :param default: the default value to use if no input happens. If this
- is not given it will prompt until it's aborted.
- :param hide_input: if this is set to true then the input value will
- be hidden.
- :param confirmation_prompt: asks for confirmation for the value.
- :param type: the type to use to check the value against.
- :param value_proc: if this parameter is provided it's a function that
- is invoked instead of the type conversion to
- convert a value.
- :param prompt_suffix: a suffix that should be added to the prompt.
- :param show_default: shows or hides the default value in the prompt.
- :param err: if set to true the file defaults to ``stderr`` instead of
- ``stdout``, the same as with echo.
- :param show_choices: Show or hide choices if the passed type is a Choice.
- For example if type is a Choice of either day or week,
- show_choices is true and text is "Group by" then the
- prompt will be "Group by (day, week): ".
- """
- result = None
-
- def prompt_func(text):
- f = hide_input and hidden_prompt_func or visible_prompt_func
- try:
- # Write the prompt separately so that we get nice
- # coloring through colorama on Windows
- echo(text, nl=False, err=err)
- return f('')
- except (KeyboardInterrupt, EOFError):
- # getpass doesn't print a newline if the user aborts input with ^C.
- # Allegedly this behavior is inherited from getpass(3).
- # A doc bug has been filed at https://bugs.python.org/issue24711
- if hide_input:
- echo(None, err=err)
- raise Abort()
-
- if value_proc is None:
- value_proc = convert_type(type, default)
-
- prompt = _build_prompt(text, prompt_suffix, show_default, default, show_choices, type)
-
- while 1:
- while 1:
- value = prompt_func(prompt)
- if value:
- break
- elif default is not None:
- if isinstance(value_proc, Path):
- # validate Path default value(exists, dir_okay etc.)
- value = default
- break
- return default
- try:
- result = value_proc(value)
- except UsageError as e:
- echo('Error: %s' % e.message, err=err)
- continue
- if not confirmation_prompt:
- return result
- while 1:
- value2 = prompt_func('Repeat for confirmation: ')
- if value2:
- break
- if value == value2:
- return result
- echo('Error: the two entered values do not match', err=err)
-
-
-def confirm(text, default=False, abort=False, prompt_suffix=': ',
- show_default=True, err=False):
- """Prompts for confirmation (yes/no question).
-
- If the user aborts the input by sending a interrupt signal this
- function will catch it and raise a :exc:`Abort` exception.
-
- .. versionadded:: 4.0
- Added the `err` parameter.
-
- :param text: the question to ask.
- :param default: the default for the prompt.
- :param abort: if this is set to `True` a negative answer aborts the
- exception by raising :exc:`Abort`.
- :param prompt_suffix: a suffix that should be added to the prompt.
- :param show_default: shows or hides the default value in the prompt.
- :param err: if set to true the file defaults to ``stderr`` instead of
- ``stdout``, the same as with echo.
- """
- prompt = _build_prompt(text, prompt_suffix, show_default,
- default and 'Y/n' or 'y/N')
- while 1:
- try:
- # Write the prompt separately so that we get nice
- # coloring through colorama on Windows
- echo(prompt, nl=False, err=err)
- value = visible_prompt_func('').lower().strip()
- except (KeyboardInterrupt, EOFError):
- raise Abort()
- if value in ('y', 'yes'):
- rv = True
- elif value in ('n', 'no'):
- rv = False
- elif value == '':
- rv = default
- else:
- echo('Error: invalid input', err=err)
- continue
- break
- if abort and not rv:
- raise Abort()
- return rv
-
-
-def get_terminal_size():
- """Returns the current size of the terminal as tuple in the form
- ``(width, height)`` in columns and rows.
- """
- # If shutil has get_terminal_size() (Python 3.3 and later) use that
- if sys.version_info >= (3, 3):
- import shutil
- shutil_get_terminal_size = getattr(shutil, 'get_terminal_size', None)
- if shutil_get_terminal_size:
- sz = shutil_get_terminal_size()
- return sz.columns, sz.lines
-
- # We provide a sensible default for get_winterm_size() when being invoked
- # inside a subprocess. Without this, it would not provide a useful input.
- if get_winterm_size is not None:
- size = get_winterm_size()
- if size == (0, 0):
- return (79, 24)
- else:
- return size
-
- def ioctl_gwinsz(fd):
- try:
- import fcntl
- import termios
- cr = struct.unpack(
- 'hh', fcntl.ioctl(fd, termios.TIOCGWINSZ, '1234'))
- except Exception:
- return
- return cr
-
- cr = ioctl_gwinsz(0) or ioctl_gwinsz(1) or ioctl_gwinsz(2)
- if not cr:
- try:
- fd = os.open(os.ctermid(), os.O_RDONLY)
- try:
- cr = ioctl_gwinsz(fd)
- finally:
- os.close(fd)
- except Exception:
- pass
- if not cr or not cr[0] or not cr[1]:
- cr = (os.environ.get('LINES', 25),
- os.environ.get('COLUMNS', DEFAULT_COLUMNS))
- return int(cr[1]), int(cr[0])
-
-
-def echo_via_pager(text_or_generator, color=None):
- """This function takes a text and shows it via an environment specific
- pager on stdout.
-
- .. versionchanged:: 3.0
- Added the `color` flag.
-
- :param text_or_generator: the text to page, or alternatively, a
- generator emitting the text to page.
- :param color: controls if the pager supports ANSI colors or not. The
- default is autodetection.
- """
- color = resolve_color_default(color)
-
- if inspect.isgeneratorfunction(text_or_generator):
- i = text_or_generator()
- elif isinstance(text_or_generator, string_types):
- i = [text_or_generator]
- else:
- i = iter(text_or_generator)
-
- # convert every element of i to a text type if necessary
- text_generator = (el if isinstance(el, string_types) else text_type(el)
- for el in i)
-
- from ._termui_impl import pager
- return pager(itertools.chain(text_generator, "\n"), color)
-
-
-def progressbar(iterable=None, length=None, label=None, show_eta=True,
- show_percent=None, show_pos=False,
- item_show_func=None, fill_char='#', empty_char='-',
- bar_template='%(label)s [%(bar)s] %(info)s',
- info_sep=' ', width=36, file=None, color=None):
- """This function creates an iterable context manager that can be used
- to iterate over something while showing a progress bar. It will
- either iterate over the `iterable` or `length` items (that are counted
- up). While iteration happens, this function will print a rendered
- progress bar to the given `file` (defaults to stdout) and will attempt
- to calculate remaining time and more. By default, this progress bar
- will not be rendered if the file is not a terminal.
-
- The context manager creates the progress bar. When the context
- manager is entered the progress bar is already displayed. With every
- iteration over the progress bar, the iterable passed to the bar is
- advanced and the bar is updated. When the context manager exits,
- a newline is printed and the progress bar is finalized on screen.
-
- No printing must happen or the progress bar will be unintentionally
- destroyed.
-
- Example usage::
-
- with progressbar(items) as bar:
- for item in bar:
- do_something_with(item)
-
- Alternatively, if no iterable is specified, one can manually update the
- progress bar through the `update()` method instead of directly
- iterating over the progress bar. The update method accepts the number
- of steps to increment the bar with::
-
- with progressbar(length=chunks.total_bytes) as bar:
- for chunk in chunks:
- process_chunk(chunk)
- bar.update(chunks.bytes)
-
- .. versionadded:: 2.0
-
- .. versionadded:: 4.0
- Added the `color` parameter. Added a `update` method to the
- progressbar object.
-
- :param iterable: an iterable to iterate over. If not provided the length
- is required.
- :param length: the number of items to iterate over. By default the
- progressbar will attempt to ask the iterator about its
- length, which might or might not work. If an iterable is
- also provided this parameter can be used to override the
- length. If an iterable is not provided the progress bar
- will iterate over a range of that length.
- :param label: the label to show next to the progress bar.
- :param show_eta: enables or disables the estimated time display. This is
- automatically disabled if the length cannot be
- determined.
- :param show_percent: enables or disables the percentage display. The
- default is `True` if the iterable has a length or
- `False` if not.
- :param show_pos: enables or disables the absolute position display. The
- default is `False`.
- :param item_show_func: a function called with the current item which
- can return a string to show the current item
- next to the progress bar. Note that the current
- item can be `None`!
- :param fill_char: the character to use to show the filled part of the
- progress bar.
- :param empty_char: the character to use to show the non-filled part of
- the progress bar.
- :param bar_template: the format string to use as template for the bar.
- The parameters in it are ``label`` for the label,
- ``bar`` for the progress bar and ``info`` for the
- info section.
- :param info_sep: the separator between multiple info items (eta etc.)
- :param width: the width of the progress bar in characters, 0 means full
- terminal width
- :param file: the file to write to. If this is not a terminal then
- only the label is printed.
- :param color: controls if the terminal supports ANSI colors or not. The
- default is autodetection. This is only needed if ANSI
- codes are included anywhere in the progress bar output
- which is not the case by default.
- """
- from ._termui_impl import ProgressBar
- color = resolve_color_default(color)
- return ProgressBar(iterable=iterable, length=length, show_eta=show_eta,
- show_percent=show_percent, show_pos=show_pos,
- item_show_func=item_show_func, fill_char=fill_char,
- empty_char=empty_char, bar_template=bar_template,
- info_sep=info_sep, file=file, label=label,
- width=width, color=color)
-
-
-def clear():
- """Clears the terminal screen. This will have the effect of clearing
- the whole visible space of the terminal and moving the cursor to the
- top left. This does not do anything if not connected to a terminal.
-
- .. versionadded:: 2.0
- """
- if not isatty(sys.stdout):
- return
- # If we're on Windows and we don't have colorama available, then we
- # clear the screen by shelling out. Otherwise we can use an escape
- # sequence.
- if WIN:
- os.system('cls')
- else:
- sys.stdout.write('\033[2J\033[1;1H')
-
-
-def style(text, fg=None, bg=None, bold=None, dim=None, underline=None,
- blink=None, reverse=None, reset=True):
- """Styles a text with ANSI styles and returns the new string. By
- default the styling is self contained which means that at the end
- of the string a reset code is issued. This can be prevented by
- passing ``reset=False``.
-
- Examples::
-
- click.echo(click.style('Hello World!', fg='green'))
- click.echo(click.style('ATTENTION!', blink=True))
- click.echo(click.style('Some things', reverse=True, fg='cyan'))
-
- Supported color names:
-
- * ``black`` (might be a gray)
- * ``red``
- * ``green``
- * ``yellow`` (might be an orange)
- * ``blue``
- * ``magenta``
- * ``cyan``
- * ``white`` (might be light gray)
- * ``bright_black``
- * ``bright_red``
- * ``bright_green``
- * ``bright_yellow``
- * ``bright_blue``
- * ``bright_magenta``
- * ``bright_cyan``
- * ``bright_white``
- * ``reset`` (reset the color code only)
-
- .. versionadded:: 2.0
-
- .. versionadded:: 7.0
- Added support for bright colors.
-
- :param text: the string to style with ansi codes.
- :param fg: if provided this will become the foreground color.
- :param bg: if provided this will become the background color.
- :param bold: if provided this will enable or disable bold mode.
- :param dim: if provided this will enable or disable dim mode. This is
- badly supported.
- :param underline: if provided this will enable or disable underline.
- :param blink: if provided this will enable or disable blinking.
- :param reverse: if provided this will enable or disable inverse
- rendering (foreground becomes background and the
- other way round).
- :param reset: by default a reset-all code is added at the end of the
- string which means that styles do not carry over. This
- can be disabled to compose styles.
- """
- bits = []
- if fg:
- try:
- bits.append('\033[%dm' % (_ansi_colors[fg]))
- except KeyError:
- raise TypeError('Unknown color %r' % fg)
- if bg:
- try:
- bits.append('\033[%dm' % (_ansi_colors[bg] + 10))
- except KeyError:
- raise TypeError('Unknown color %r' % bg)
- if bold is not None:
- bits.append('\033[%dm' % (1 if bold else 22))
- if dim is not None:
- bits.append('\033[%dm' % (2 if dim else 22))
- if underline is not None:
- bits.append('\033[%dm' % (4 if underline else 24))
- if blink is not None:
- bits.append('\033[%dm' % (5 if blink else 25))
- if reverse is not None:
- bits.append('\033[%dm' % (7 if reverse else 27))
- bits.append(text)
- if reset:
- bits.append(_ansi_reset_all)
- return ''.join(bits)
-
-
-def unstyle(text):
- """Removes ANSI styling information from a string. Usually it's not
- necessary to use this function as Click's echo function will
- automatically remove styling if necessary.
-
- .. versionadded:: 2.0
-
- :param text: the text to remove style information from.
- """
- return strip_ansi(text)
-
-
-def secho(message=None, file=None, nl=True, err=False, color=None, **styles):
- """This function combines :func:`echo` and :func:`style` into one
- call. As such the following two calls are the same::
-
- click.secho('Hello World!', fg='green')
- click.echo(click.style('Hello World!', fg='green'))
-
- All keyword arguments are forwarded to the underlying functions
- depending on which one they go with.
-
- .. versionadded:: 2.0
- """
- if message is not None:
- message = style(message, **styles)
- return echo(message, file=file, nl=nl, err=err, color=color)
-
-
-def edit(text=None, editor=None, env=None, require_save=True,
- extension='.txt', filename=None):
- r"""Edits the given text in the defined editor. If an editor is given
- (should be the full path to the executable but the regular operating
- system search path is used for finding the executable) it overrides
- the detected editor. Optionally, some environment variables can be
- used. If the editor is closed without changes, `None` is returned. In
- case a file is edited directly the return value is always `None` and
- `require_save` and `extension` are ignored.
-
- If the editor cannot be opened a :exc:`UsageError` is raised.
-
- Note for Windows: to simplify cross-platform usage, the newlines are
- automatically converted from POSIX to Windows and vice versa. As such,
- the message here will have ``\n`` as newline markers.
-
- :param text: the text to edit.
- :param editor: optionally the editor to use. Defaults to automatic
- detection.
- :param env: environment variables to forward to the editor.
- :param require_save: if this is true, then not saving in the editor
- will make the return value become `None`.
- :param extension: the extension to tell the editor about. This defaults
- to `.txt` but changing this might change syntax
- highlighting.
- :param filename: if provided it will edit this file instead of the
- provided text contents. It will not use a temporary
- file as an indirection in that case.
- """
- from ._termui_impl import Editor
- editor = Editor(editor=editor, env=env, require_save=require_save,
- extension=extension)
- if filename is None:
- return editor.edit(text)
- editor.edit_file(filename)
-
-
-def launch(url, wait=False, locate=False):
- """This function launches the given URL (or filename) in the default
- viewer application for this file type. If this is an executable, it
- might launch the executable in a new session. The return value is
- the exit code of the launched application. Usually, ``0`` indicates
- success.
-
- Examples::
-
- click.launch('https://click.palletsprojects.com/')
- click.launch('/my/downloaded/file', locate=True)
-
- .. versionadded:: 2.0
-
- :param url: URL or filename of the thing to launch.
- :param wait: waits for the program to stop.
- :param locate: if this is set to `True` then instead of launching the
- application associated with the URL it will attempt to
- launch a file manager with the file located. This
- might have weird effects if the URL does not point to
- the filesystem.
- """
- from ._termui_impl import open_url
- return open_url(url, wait=wait, locate=locate)
-
-
-# If this is provided, getchar() calls into this instead. This is used
-# for unittesting purposes.
-_getchar = None
-
-
-def getchar(echo=False):
- """Fetches a single character from the terminal and returns it. This
- will always return a unicode character and under certain rare
- circumstances this might return more than one character. The
- situations which more than one character is returned is when for
- whatever reason multiple characters end up in the terminal buffer or
- standard input was not actually a terminal.
-
- Note that this will always read from the terminal, even if something
- is piped into the standard input.
-
- Note for Windows: in rare cases when typing non-ASCII characters, this
- function might wait for a second character and then return both at once.
- This is because certain Unicode characters look like special-key markers.
-
- .. versionadded:: 2.0
-
- :param echo: if set to `True`, the character read will also show up on
- the terminal. The default is to not show it.
- """
- f = _getchar
- if f is None:
- from ._termui_impl import getchar as f
- return f(echo)
-
-
-def raw_terminal():
- from ._termui_impl import raw_terminal as f
- return f()
-
-
-def pause(info='Press any key to continue ...', err=False):
- """This command stops execution and waits for the user to press any
- key to continue. This is similar to the Windows batch "pause"
- command. If the program is not run through a terminal, this command
- will instead do nothing.
-
- .. versionadded:: 2.0
-
- .. versionadded:: 4.0
- Added the `err` parameter.
-
- :param info: the info string to print before pausing.
- :param err: if set to message goes to ``stderr`` instead of
- ``stdout``, the same as with echo.
- """
- if not isatty(sys.stdin) or not isatty(sys.stdout):
- return
- try:
- if info:
- echo(info, nl=False, err=err)
- try:
- getchar()
- except (KeyboardInterrupt, EOFError):
- pass
- finally:
- if info:
- echo(err=err)
diff --git a/lib/click/testing.py b/lib/click/testing.py
deleted file mode 100644
index 1b2924e0b1..0000000000
--- a/lib/click/testing.py
+++ /dev/null
@@ -1,374 +0,0 @@
-import os
-import sys
-import shutil
-import tempfile
-import contextlib
-import shlex
-
-from ._compat import iteritems, PY2, string_types
-
-
-# If someone wants to vendor click, we want to ensure the
-# correct package is discovered. Ideally we could use a
-# relative import here but unfortunately Python does not
-# support that.
-clickpkg = sys.modules[__name__.rsplit('.', 1)[0]]
-
-
-if PY2:
- from cStringIO import StringIO
-else:
- import io
- from ._compat import _find_binary_reader
-
-
-class EchoingStdin(object):
-
- def __init__(self, input, output):
- self._input = input
- self._output = output
-
- def __getattr__(self, x):
- return getattr(self._input, x)
-
- def _echo(self, rv):
- self._output.write(rv)
- return rv
-
- def read(self, n=-1):
- return self._echo(self._input.read(n))
-
- def readline(self, n=-1):
- return self._echo(self._input.readline(n))
-
- def readlines(self):
- return [self._echo(x) for x in self._input.readlines()]
-
- def __iter__(self):
- return iter(self._echo(x) for x in self._input)
-
- def __repr__(self):
- return repr(self._input)
-
-
-def make_input_stream(input, charset):
- # Is already an input stream.
- if hasattr(input, 'read'):
- if PY2:
- return input
- rv = _find_binary_reader(input)
- if rv is not None:
- return rv
- raise TypeError('Could not find binary reader for input stream.')
-
- if input is None:
- input = b''
- elif not isinstance(input, bytes):
- input = input.encode(charset)
- if PY2:
- return StringIO(input)
- return io.BytesIO(input)
-
-
-class Result(object):
- """Holds the captured result of an invoked CLI script."""
-
- def __init__(self, runner, stdout_bytes, stderr_bytes, exit_code,
- exception, exc_info=None):
- #: The runner that created the result
- self.runner = runner
- #: The standard output as bytes.
- self.stdout_bytes = stdout_bytes
- #: The standard error as bytes, or False(y) if not available
- self.stderr_bytes = stderr_bytes
- #: The exit code as integer.
- self.exit_code = exit_code
- #: The exception that happened if one did.
- self.exception = exception
- #: The traceback
- self.exc_info = exc_info
-
- @property
- def output(self):
- """The (standard) output as unicode string."""
- return self.stdout
-
- @property
- def stdout(self):
- """The standard output as unicode string."""
- return self.stdout_bytes.decode(self.runner.charset, 'replace') \
- .replace('\r\n', '\n')
-
- @property
- def stderr(self):
- """The standard error as unicode string."""
- if not self.stderr_bytes:
- raise ValueError("stderr not separately captured")
- return self.stderr_bytes.decode(self.runner.charset, 'replace') \
- .replace('\r\n', '\n')
-
-
- def __repr__(self):
- return '<%s %s>' % (
- type(self).__name__,
- self.exception and repr(self.exception) or 'okay',
- )
-
-
-class CliRunner(object):
- """The CLI runner provides functionality to invoke a Click command line
- script for unittesting purposes in a isolated environment. This only
- works in single-threaded systems without any concurrency as it changes the
- global interpreter state.
-
- :param charset: the character set for the input and output data. This is
- UTF-8 by default and should not be changed currently as
- the reporting to Click only works in Python 2 properly.
- :param env: a dictionary with environment variables for overriding.
- :param echo_stdin: if this is set to `True`, then reading from stdin writes
- to stdout. This is useful for showing examples in
- some circumstances. Note that regular prompts
- will automatically echo the input.
- :param mix_stderr: if this is set to `False`, then stdout and stderr are
- preserved as independent streams. This is useful for
- Unix-philosophy apps that have predictable stdout and
- noisy stderr, such that each may be measured
- independently
- """
-
- def __init__(self, charset=None, env=None, echo_stdin=False,
- mix_stderr=True):
- if charset is None:
- charset = 'utf-8'
- self.charset = charset
- self.env = env or {}
- self.echo_stdin = echo_stdin
- self.mix_stderr = mix_stderr
-
- def get_default_prog_name(self, cli):
- """Given a command object it will return the default program name
- for it. The default is the `name` attribute or ``"root"`` if not
- set.
- """
- return cli.name or 'root'
-
- def make_env(self, overrides=None):
- """Returns the environment overrides for invoking a script."""
- rv = dict(self.env)
- if overrides:
- rv.update(overrides)
- return rv
-
- @contextlib.contextmanager
- def isolation(self, input=None, env=None, color=False):
- """A context manager that sets up the isolation for invoking of a
- command line tool. This sets up stdin with the given input data
- and `os.environ` with the overrides from the given dictionary.
- This also rebinds some internals in Click to be mocked (like the
- prompt functionality).
-
- This is automatically done in the :meth:`invoke` method.
-
- .. versionadded:: 4.0
- The ``color`` parameter was added.
-
- :param input: the input stream to put into sys.stdin.
- :param env: the environment overrides as dictionary.
- :param color: whether the output should contain color codes. The
- application can still override this explicitly.
- """
- input = make_input_stream(input, self.charset)
-
- old_stdin = sys.stdin
- old_stdout = sys.stdout
- old_stderr = sys.stderr
- old_forced_width = clickpkg.formatting.FORCED_WIDTH
- clickpkg.formatting.FORCED_WIDTH = 80
-
- env = self.make_env(env)
-
- if PY2:
- bytes_output = StringIO()
- if self.echo_stdin:
- input = EchoingStdin(input, bytes_output)
- sys.stdout = bytes_output
- if not self.mix_stderr:
- bytes_error = StringIO()
- sys.stderr = bytes_error
- else:
- bytes_output = io.BytesIO()
- if self.echo_stdin:
- input = EchoingStdin(input, bytes_output)
- input = io.TextIOWrapper(input, encoding=self.charset)
- sys.stdout = io.TextIOWrapper(
- bytes_output, encoding=self.charset)
- if not self.mix_stderr:
- bytes_error = io.BytesIO()
- sys.stderr = io.TextIOWrapper(
- bytes_error, encoding=self.charset)
-
- if self.mix_stderr:
- sys.stderr = sys.stdout
-
- sys.stdin = input
-
- def visible_input(prompt=None):
- sys.stdout.write(prompt or '')
- val = input.readline().rstrip('\r\n')
- sys.stdout.write(val + '\n')
- sys.stdout.flush()
- return val
-
- def hidden_input(prompt=None):
- sys.stdout.write((prompt or '') + '\n')
- sys.stdout.flush()
- return input.readline().rstrip('\r\n')
-
- def _getchar(echo):
- char = sys.stdin.read(1)
- if echo:
- sys.stdout.write(char)
- sys.stdout.flush()
- return char
-
- default_color = color
-
- def should_strip_ansi(stream=None, color=None):
- if color is None:
- return not default_color
- return not color
-
- old_visible_prompt_func = clickpkg.termui.visible_prompt_func
- old_hidden_prompt_func = clickpkg.termui.hidden_prompt_func
- old__getchar_func = clickpkg.termui._getchar
- old_should_strip_ansi = clickpkg.utils.should_strip_ansi
- clickpkg.termui.visible_prompt_func = visible_input
- clickpkg.termui.hidden_prompt_func = hidden_input
- clickpkg.termui._getchar = _getchar
- clickpkg.utils.should_strip_ansi = should_strip_ansi
-
- old_env = {}
- try:
- for key, value in iteritems(env):
- old_env[key] = os.environ.get(key)
- if value is None:
- try:
- del os.environ[key]
- except Exception:
- pass
- else:
- os.environ[key] = value
- yield (bytes_output, not self.mix_stderr and bytes_error)
- finally:
- for key, value in iteritems(old_env):
- if value is None:
- try:
- del os.environ[key]
- except Exception:
- pass
- else:
- os.environ[key] = value
- sys.stdout = old_stdout
- sys.stderr = old_stderr
- sys.stdin = old_stdin
- clickpkg.termui.visible_prompt_func = old_visible_prompt_func
- clickpkg.termui.hidden_prompt_func = old_hidden_prompt_func
- clickpkg.termui._getchar = old__getchar_func
- clickpkg.utils.should_strip_ansi = old_should_strip_ansi
- clickpkg.formatting.FORCED_WIDTH = old_forced_width
-
- def invoke(self, cli, args=None, input=None, env=None,
- catch_exceptions=True, color=False, mix_stderr=False, **extra):
- """Invokes a command in an isolated environment. The arguments are
- forwarded directly to the command line script, the `extra` keyword
- arguments are passed to the :meth:`~clickpkg.Command.main` function of
- the command.
-
- This returns a :class:`Result` object.
-
- .. versionadded:: 3.0
- The ``catch_exceptions`` parameter was added.
-
- .. versionchanged:: 3.0
- The result object now has an `exc_info` attribute with the
- traceback if available.
-
- .. versionadded:: 4.0
- The ``color`` parameter was added.
-
- :param cli: the command to invoke
- :param args: the arguments to invoke. It may be given as an iterable
- or a string. When given as string it will be interpreted
- as a Unix shell command. More details at
- :func:`shlex.split`.
- :param input: the input data for `sys.stdin`.
- :param env: the environment overrides.
- :param catch_exceptions: Whether to catch any other exceptions than
- ``SystemExit``.
- :param extra: the keyword arguments to pass to :meth:`main`.
- :param color: whether the output should contain color codes. The
- application can still override this explicitly.
- """
- exc_info = None
- with self.isolation(input=input, env=env, color=color) as outstreams:
- exception = None
- exit_code = 0
-
- if isinstance(args, string_types):
- args = shlex.split(args)
-
- try:
- prog_name = extra.pop("prog_name")
- except KeyError:
- prog_name = self.get_default_prog_name(cli)
-
- try:
- cli.main(args=args or (), prog_name=prog_name, **extra)
- except SystemExit as e:
- exc_info = sys.exc_info()
- exit_code = e.code
- if exit_code is None:
- exit_code = 0
-
- if exit_code != 0:
- exception = e
-
- if not isinstance(exit_code, int):
- sys.stdout.write(str(exit_code))
- sys.stdout.write('\n')
- exit_code = 1
-
- except Exception as e:
- if not catch_exceptions:
- raise
- exception = e
- exit_code = 1
- exc_info = sys.exc_info()
- finally:
- sys.stdout.flush()
- stdout = outstreams[0].getvalue()
- stderr = outstreams[1] and outstreams[1].getvalue()
-
- return Result(runner=self,
- stdout_bytes=stdout,
- stderr_bytes=stderr,
- exit_code=exit_code,
- exception=exception,
- exc_info=exc_info)
-
- @contextlib.contextmanager
- def isolated_filesystem(self):
- """A context manager that creates a temporary folder and changes
- the current working directory to it for isolated filesystem tests.
- """
- cwd = os.getcwd()
- t = tempfile.mkdtemp()
- os.chdir(t)
- try:
- yield t
- finally:
- os.chdir(cwd)
- try:
- shutil.rmtree(t)
- except (OSError, IOError):
- pass
diff --git a/lib/click/types.py b/lib/click/types.py
deleted file mode 100644
index 1f88032f54..0000000000
--- a/lib/click/types.py
+++ /dev/null
@@ -1,668 +0,0 @@
-import os
-import stat
-from datetime import datetime
-
-from ._compat import open_stream, text_type, filename_to_ui, \
- get_filesystem_encoding, get_streerror, _get_argv_encoding, PY2
-from .exceptions import BadParameter
-from .utils import safecall, LazyFile
-
-
-class ParamType(object):
- """Helper for converting values through types. The following is
- necessary for a valid type:
-
- * it needs a name
- * it needs to pass through None unchanged
- * it needs to convert from a string
- * it needs to convert its result type through unchanged
- (eg: needs to be idempotent)
- * it needs to be able to deal with param and context being `None`.
- This can be the case when the object is used with prompt
- inputs.
- """
- is_composite = False
-
- #: the descriptive name of this type
- name = None
-
- #: if a list of this type is expected and the value is pulled from a
- #: string environment variable, this is what splits it up. `None`
- #: means any whitespace. For all parameters the general rule is that
- #: whitespace splits them up. The exception are paths and files which
- #: are split by ``os.path.pathsep`` by default (":" on Unix and ";" on
- #: Windows).
- envvar_list_splitter = None
-
- def __call__(self, value, param=None, ctx=None):
- if value is not None:
- return self.convert(value, param, ctx)
-
- def get_metavar(self, param):
- """Returns the metavar default for this param if it provides one."""
-
- def get_missing_message(self, param):
- """Optionally might return extra information about a missing
- parameter.
-
- .. versionadded:: 2.0
- """
-
- def convert(self, value, param, ctx):
- """Converts the value. This is not invoked for values that are
- `None` (the missing value).
- """
- return value
-
- def split_envvar_value(self, rv):
- """Given a value from an environment variable this splits it up
- into small chunks depending on the defined envvar list splitter.
-
- If the splitter is set to `None`, which means that whitespace splits,
- then leading and trailing whitespace is ignored. Otherwise, leading
- and trailing splitters usually lead to empty items being included.
- """
- return (rv or '').split(self.envvar_list_splitter)
-
- def fail(self, message, param=None, ctx=None):
- """Helper method to fail with an invalid value message."""
- raise BadParameter(message, ctx=ctx, param=param)
-
-
-class CompositeParamType(ParamType):
- is_composite = True
-
- @property
- def arity(self):
- raise NotImplementedError()
-
-
-class FuncParamType(ParamType):
-
- def __init__(self, func):
- self.name = func.__name__
- self.func = func
-
- def convert(self, value, param, ctx):
- try:
- return self.func(value)
- except ValueError:
- try:
- value = text_type(value)
- except UnicodeError:
- value = str(value).decode('utf-8', 'replace')
- self.fail(value, param, ctx)
-
-
-class UnprocessedParamType(ParamType):
- name = 'text'
-
- def convert(self, value, param, ctx):
- return value
-
- def __repr__(self):
- return 'UNPROCESSED'
-
-
-class StringParamType(ParamType):
- name = 'text'
-
- def convert(self, value, param, ctx):
- if isinstance(value, bytes):
- enc = _get_argv_encoding()
- try:
- value = value.decode(enc)
- except UnicodeError:
- fs_enc = get_filesystem_encoding()
- if fs_enc != enc:
- try:
- value = value.decode(fs_enc)
- except UnicodeError:
- value = value.decode('utf-8', 'replace')
- return value
- return value
-
- def __repr__(self):
- return 'STRING'
-
-
-class Choice(ParamType):
- """The choice type allows a value to be checked against a fixed set
- of supported values. All of these values have to be strings.
-
- You should only pass a list or tuple of choices. Other iterables
- (like generators) may lead to surprising results.
-
- See :ref:`choice-opts` for an example.
-
- :param case_sensitive: Set to false to make choices case
- insensitive. Defaults to true.
- """
-
- name = 'choice'
-
- def __init__(self, choices, case_sensitive=True):
- self.choices = choices
- self.case_sensitive = case_sensitive
-
- def get_metavar(self, param):
- return '[%s]' % '|'.join(self.choices)
-
- def get_missing_message(self, param):
- return 'Choose from:\n\t%s.' % ',\n\t'.join(self.choices)
-
- def convert(self, value, param, ctx):
- # Exact match
- if value in self.choices:
- return value
-
- # Match through normalization and case sensitivity
- # first do token_normalize_func, then lowercase
- # preserve original `value` to produce an accurate message in
- # `self.fail`
- normed_value = value
- normed_choices = self.choices
-
- if ctx is not None and \
- ctx.token_normalize_func is not None:
- normed_value = ctx.token_normalize_func(value)
- normed_choices = [ctx.token_normalize_func(choice) for choice in
- self.choices]
-
- if not self.case_sensitive:
- normed_value = normed_value.lower()
- normed_choices = [choice.lower() for choice in normed_choices]
-
- if normed_value in normed_choices:
- return normed_value
-
- self.fail('invalid choice: %s. (choose from %s)' %
- (value, ', '.join(self.choices)), param, ctx)
-
- def __repr__(self):
- return 'Choice(%r)' % list(self.choices)
-
-
-class DateTime(ParamType):
- """The DateTime type converts date strings into `datetime` objects.
-
- The format strings which are checked are configurable, but default to some
- common (non-timezone aware) ISO 8601 formats.
-
- When specifying *DateTime* formats, you should only pass a list or a tuple.
- Other iterables, like generators, may lead to surprising results.
-
- The format strings are processed using ``datetime.strptime``, and this
- consequently defines the format strings which are allowed.
-
- Parsing is tried using each format, in order, and the first format which
- parses successfully is used.
-
- :param formats: A list or tuple of date format strings, in the order in
- which they should be tried. Defaults to
- ``'%Y-%m-%d'``, ``'%Y-%m-%dT%H:%M:%S'``,
- ``'%Y-%m-%d %H:%M:%S'``.
- """
- name = 'datetime'
-
- def __init__(self, formats=None):
- self.formats = formats or [
- '%Y-%m-%d',
- '%Y-%m-%dT%H:%M:%S',
- '%Y-%m-%d %H:%M:%S'
- ]
-
- def get_metavar(self, param):
- return '[{}]'.format('|'.join(self.formats))
-
- def _try_to_convert_date(self, value, format):
- try:
- return datetime.strptime(value, format)
- except ValueError:
- return None
-
- def convert(self, value, param, ctx):
- # Exact match
- for format in self.formats:
- dtime = self._try_to_convert_date(value, format)
- if dtime:
- return dtime
-
- self.fail(
- 'invalid datetime format: {}. (choose from {})'.format(
- value, ', '.join(self.formats)))
-
- def __repr__(self):
- return 'DateTime'
-
-
-class IntParamType(ParamType):
- name = 'integer'
-
- def convert(self, value, param, ctx):
- try:
- return int(value)
- except (ValueError, UnicodeError):
- self.fail('%s is not a valid integer' % value, param, ctx)
-
- def __repr__(self):
- return 'INT'
-
-
-class IntRange(IntParamType):
- """A parameter that works similar to :data:`click.INT` but restricts
- the value to fit into a range. The default behavior is to fail if the
- value falls outside the range, but it can also be silently clamped
- between the two edges.
-
- See :ref:`ranges` for an example.
- """
- name = 'integer range'
-
- def __init__(self, min=None, max=None, clamp=False):
- self.min = min
- self.max = max
- self.clamp = clamp
-
- def convert(self, value, param, ctx):
- rv = IntParamType.convert(self, value, param, ctx)
- if self.clamp:
- if self.min is not None and rv < self.min:
- return self.min
- if self.max is not None and rv > self.max:
- return self.max
- if self.min is not None and rv < self.min or \
- self.max is not None and rv > self.max:
- if self.min is None:
- self.fail('%s is bigger than the maximum valid value '
- '%s.' % (rv, self.max), param, ctx)
- elif self.max is None:
- self.fail('%s is smaller than the minimum valid value '
- '%s.' % (rv, self.min), param, ctx)
- else:
- self.fail('%s is not in the valid range of %s to %s.'
- % (rv, self.min, self.max), param, ctx)
- return rv
-
- def __repr__(self):
- return 'IntRange(%r, %r)' % (self.min, self.max)
-
-
-class FloatParamType(ParamType):
- name = 'float'
-
- def convert(self, value, param, ctx):
- try:
- return float(value)
- except (UnicodeError, ValueError):
- self.fail('%s is not a valid floating point value' %
- value, param, ctx)
-
- def __repr__(self):
- return 'FLOAT'
-
-
-class FloatRange(FloatParamType):
- """A parameter that works similar to :data:`click.FLOAT` but restricts
- the value to fit into a range. The default behavior is to fail if the
- value falls outside the range, but it can also be silently clamped
- between the two edges.
-
- See :ref:`ranges` for an example.
- """
- name = 'float range'
-
- def __init__(self, min=None, max=None, clamp=False):
- self.min = min
- self.max = max
- self.clamp = clamp
-
- def convert(self, value, param, ctx):
- rv = FloatParamType.convert(self, value, param, ctx)
- if self.clamp:
- if self.min is not None and rv < self.min:
- return self.min
- if self.max is not None and rv > self.max:
- return self.max
- if self.min is not None and rv < self.min or \
- self.max is not None and rv > self.max:
- if self.min is None:
- self.fail('%s is bigger than the maximum valid value '
- '%s.' % (rv, self.max), param, ctx)
- elif self.max is None:
- self.fail('%s is smaller than the minimum valid value '
- '%s.' % (rv, self.min), param, ctx)
- else:
- self.fail('%s is not in the valid range of %s to %s.'
- % (rv, self.min, self.max), param, ctx)
- return rv
-
- def __repr__(self):
- return 'FloatRange(%r, %r)' % (self.min, self.max)
-
-
-class BoolParamType(ParamType):
- name = 'boolean'
-
- def convert(self, value, param, ctx):
- if isinstance(value, bool):
- return bool(value)
- value = value.lower()
- if value in ('true', 't', '1', 'yes', 'y'):
- return True
- elif value in ('false', 'f', '0', 'no', 'n'):
- return False
- self.fail('%s is not a valid boolean' % value, param, ctx)
-
- def __repr__(self):
- return 'BOOL'
-
-
-class UUIDParameterType(ParamType):
- name = 'uuid'
-
- def convert(self, value, param, ctx):
- import uuid
- try:
- if PY2 and isinstance(value, text_type):
- value = value.encode('ascii')
- return uuid.UUID(value)
- except (UnicodeError, ValueError):
- self.fail('%s is not a valid UUID value' % value, param, ctx)
-
- def __repr__(self):
- return 'UUID'
-
-
-class File(ParamType):
- """Declares a parameter to be a file for reading or writing. The file
- is automatically closed once the context tears down (after the command
- finished working).
-
- Files can be opened for reading or writing. The special value ``-``
- indicates stdin or stdout depending on the mode.
-
- By default, the file is opened for reading text data, but it can also be
- opened in binary mode or for writing. The encoding parameter can be used
- to force a specific encoding.
-
- The `lazy` flag controls if the file should be opened immediately or upon
- first IO. The default is to be non-lazy for standard input and output
- streams as well as files opened for reading, `lazy` otherwise. When opening a
- file lazily for reading, it is still opened temporarily for validation, but
- will not be held open until first IO. lazy is mainly useful when opening
- for writing to avoid creating the file until it is needed.
-
- Starting with Click 2.0, files can also be opened atomically in which
- case all writes go into a separate file in the same folder and upon
- completion the file will be moved over to the original location. This
- is useful if a file regularly read by other users is modified.
-
- See :ref:`file-args` for more information.
- """
- name = 'filename'
- envvar_list_splitter = os.path.pathsep
-
- def __init__(self, mode='r', encoding=None, errors='strict', lazy=None,
- atomic=False):
- self.mode = mode
- self.encoding = encoding
- self.errors = errors
- self.lazy = lazy
- self.atomic = atomic
-
- def resolve_lazy_flag(self, value):
- if self.lazy is not None:
- return self.lazy
- if value == '-':
- return False
- elif 'w' in self.mode:
- return True
- return False
-
- def convert(self, value, param, ctx):
- try:
- if hasattr(value, 'read') or hasattr(value, 'write'):
- return value
-
- lazy = self.resolve_lazy_flag(value)
-
- if lazy:
- f = LazyFile(value, self.mode, self.encoding, self.errors,
- atomic=self.atomic)
- if ctx is not None:
- ctx.call_on_close(f.close_intelligently)
- return f
-
- f, should_close = open_stream(value, self.mode,
- self.encoding, self.errors,
- atomic=self.atomic)
- # If a context is provided, we automatically close the file
- # at the end of the context execution (or flush out). If a
- # context does not exist, it's the caller's responsibility to
- # properly close the file. This for instance happens when the
- # type is used with prompts.
- if ctx is not None:
- if should_close:
- ctx.call_on_close(safecall(f.close))
- else:
- ctx.call_on_close(safecall(f.flush))
- return f
- except (IOError, OSError) as e:
- self.fail('Could not open file: %s: %s' % (
- filename_to_ui(value),
- get_streerror(e),
- ), param, ctx)
-
-
-class Path(ParamType):
- """The path type is similar to the :class:`File` type but it performs
- different checks. First of all, instead of returning an open file
- handle it returns just the filename. Secondly, it can perform various
- basic checks about what the file or directory should be.
-
- .. versionchanged:: 6.0
- `allow_dash` was added.
-
- :param exists: if set to true, the file or directory needs to exist for
- this value to be valid. If this is not required and a
- file does indeed not exist, then all further checks are
- silently skipped.
- :param file_okay: controls if a file is a possible value.
- :param dir_okay: controls if a directory is a possible value.
- :param writable: if true, a writable check is performed.
- :param readable: if true, a readable check is performed.
- :param resolve_path: if this is true, then the path is fully resolved
- before the value is passed onwards. This means
- that it's absolute and symlinks are resolved. It
- will not expand a tilde-prefix, as this is
- supposed to be done by the shell only.
- :param allow_dash: If this is set to `True`, a single dash to indicate
- standard streams is permitted.
- :param path_type: optionally a string type that should be used to
- represent the path. The default is `None` which
- means the return value will be either bytes or
- unicode depending on what makes most sense given the
- input data Click deals with.
- """
- envvar_list_splitter = os.path.pathsep
-
- def __init__(self, exists=False, file_okay=True, dir_okay=True,
- writable=False, readable=True, resolve_path=False,
- allow_dash=False, path_type=None):
- self.exists = exists
- self.file_okay = file_okay
- self.dir_okay = dir_okay
- self.writable = writable
- self.readable = readable
- self.resolve_path = resolve_path
- self.allow_dash = allow_dash
- self.type = path_type
-
- if self.file_okay and not self.dir_okay:
- self.name = 'file'
- self.path_type = 'File'
- elif self.dir_okay and not self.file_okay:
- self.name = 'directory'
- self.path_type = 'Directory'
- else:
- self.name = 'path'
- self.path_type = 'Path'
-
- def coerce_path_result(self, rv):
- if self.type is not None and not isinstance(rv, self.type):
- if self.type is text_type:
- rv = rv.decode(get_filesystem_encoding())
- else:
- rv = rv.encode(get_filesystem_encoding())
- return rv
-
- def convert(self, value, param, ctx):
- rv = value
-
- is_dash = self.file_okay and self.allow_dash and rv in (b'-', '-')
-
- if not is_dash:
- if self.resolve_path:
- rv = os.path.realpath(rv)
-
- try:
- st = os.stat(rv)
- except OSError:
- if not self.exists:
- return self.coerce_path_result(rv)
- self.fail('%s "%s" does not exist.' % (
- self.path_type,
- filename_to_ui(value)
- ), param, ctx)
-
- if not self.file_okay and stat.S_ISREG(st.st_mode):
- self.fail('%s "%s" is a file.' % (
- self.path_type,
- filename_to_ui(value)
- ), param, ctx)
- if not self.dir_okay and stat.S_ISDIR(st.st_mode):
- self.fail('%s "%s" is a directory.' % (
- self.path_type,
- filename_to_ui(value)
- ), param, ctx)
- if self.writable and not os.access(value, os.W_OK):
- self.fail('%s "%s" is not writable.' % (
- self.path_type,
- filename_to_ui(value)
- ), param, ctx)
- if self.readable and not os.access(value, os.R_OK):
- self.fail('%s "%s" is not readable.' % (
- self.path_type,
- filename_to_ui(value)
- ), param, ctx)
-
- return self.coerce_path_result(rv)
-
-
-class Tuple(CompositeParamType):
- """The default behavior of Click is to apply a type on a value directly.
- This works well in most cases, except for when `nargs` is set to a fixed
- count and different types should be used for different items. In this
- case the :class:`Tuple` type can be used. This type can only be used
- if `nargs` is set to a fixed number.
-
- For more information see :ref:`tuple-type`.
-
- This can be selected by using a Python tuple literal as a type.
-
- :param types: a list of types that should be used for the tuple items.
- """
-
- def __init__(self, types):
- self.types = [convert_type(ty) for ty in types]
-
- @property
- def name(self):
- return "<" + " ".join(ty.name for ty in self.types) + ">"
-
- @property
- def arity(self):
- return len(self.types)
-
- def convert(self, value, param, ctx):
- if len(value) != len(self.types):
- raise TypeError('It would appear that nargs is set to conflict '
- 'with the composite type arity.')
- return tuple(ty(x, param, ctx) for ty, x in zip(self.types, value))
-
-
-def convert_type(ty, default=None):
- """Converts a callable or python ty into the most appropriate param
- ty.
- """
- guessed_type = False
- if ty is None and default is not None:
- if isinstance(default, tuple):
- ty = tuple(map(type, default))
- else:
- ty = type(default)
- guessed_type = True
-
- if isinstance(ty, tuple):
- return Tuple(ty)
- if isinstance(ty, ParamType):
- return ty
- if ty is text_type or ty is str or ty is None:
- return STRING
- if ty is int:
- return INT
- # Booleans are only okay if not guessed. This is done because for
- # flags the default value is actually a bit of a lie in that it
- # indicates which of the flags is the one we want. See get_default()
- # for more information.
- if ty is bool and not guessed_type:
- return BOOL
- if ty is float:
- return FLOAT
- if guessed_type:
- return STRING
-
- # Catch a common mistake
- if __debug__:
- try:
- if issubclass(ty, ParamType):
- raise AssertionError('Attempted to use an uninstantiated '
- 'parameter type (%s).' % ty)
- except TypeError:
- pass
- return FuncParamType(ty)
-
-
-#: A dummy parameter type that just does nothing. From a user's
-#: perspective this appears to just be the same as `STRING` but internally
-#: no string conversion takes place. This is necessary to achieve the
-#: same bytes/unicode behavior on Python 2/3 in situations where you want
-#: to not convert argument types. This is usually useful when working
-#: with file paths as they can appear in bytes and unicode.
-#:
-#: For path related uses the :class:`Path` type is a better choice but
-#: there are situations where an unprocessed type is useful which is why
-#: it is is provided.
-#:
-#: .. versionadded:: 4.0
-UNPROCESSED = UnprocessedParamType()
-
-#: A unicode string parameter type which is the implicit default. This
-#: can also be selected by using ``str`` as type.
-STRING = StringParamType()
-
-#: An integer parameter. This can also be selected by using ``int`` as
-#: type.
-INT = IntParamType()
-
-#: A floating point value parameter. This can also be selected by using
-#: ``float`` as type.
-FLOAT = FloatParamType()
-
-#: A boolean parameter. This is the default for boolean flags. This can
-#: also be selected by using ``bool`` as a type.
-BOOL = BoolParamType()
-
-#: A UUID parameter.
-UUID = UUIDParameterType()
diff --git a/lib/click/utils.py b/lib/click/utils.py
deleted file mode 100644
index fc84369fc9..0000000000
--- a/lib/click/utils.py
+++ /dev/null
@@ -1,440 +0,0 @@
-import os
-import sys
-
-from .globals import resolve_color_default
-
-from ._compat import text_type, open_stream, get_filesystem_encoding, \
- get_streerror, string_types, PY2, binary_streams, text_streams, \
- filename_to_ui, auto_wrap_for_ansi, strip_ansi, should_strip_ansi, \
- _default_text_stdout, _default_text_stderr, is_bytes, WIN
-
-if not PY2:
- from ._compat import _find_binary_writer
-elif WIN:
- from ._winconsole import _get_windows_argv, \
- _hash_py_argv, _initial_argv_hash
-
-
-echo_native_types = string_types + (bytes, bytearray)
-
-
-def _posixify(name):
- return '-'.join(name.split()).lower()
-
-
-def safecall(func):
- """Wraps a function so that it swallows exceptions."""
- def wrapper(*args, **kwargs):
- try:
- return func(*args, **kwargs)
- except Exception:
- pass
- return wrapper
-
-
-def make_str(value):
- """Converts a value into a valid string."""
- if isinstance(value, bytes):
- try:
- return value.decode(get_filesystem_encoding())
- except UnicodeError:
- return value.decode('utf-8', 'replace')
- return text_type(value)
-
-
-def make_default_short_help(help, max_length=45):
- """Return a condensed version of help string."""
- words = help.split()
- total_length = 0
- result = []
- done = False
-
- for word in words:
- if word[-1:] == '.':
- done = True
- new_length = result and 1 + len(word) or len(word)
- if total_length + new_length > max_length:
- result.append('...')
- done = True
- else:
- if result:
- result.append(' ')
- result.append(word)
- if done:
- break
- total_length += new_length
-
- return ''.join(result)
-
-
-class LazyFile(object):
- """A lazy file works like a regular file but it does not fully open
- the file but it does perform some basic checks early to see if the
- filename parameter does make sense. This is useful for safely opening
- files for writing.
- """
-
- def __init__(self, filename, mode='r', encoding=None, errors='strict',
- atomic=False):
- self.name = filename
- self.mode = mode
- self.encoding = encoding
- self.errors = errors
- self.atomic = atomic
-
- if filename == '-':
- self._f, self.should_close = open_stream(filename, mode,
- encoding, errors)
- else:
- if 'r' in mode:
- # Open and close the file in case we're opening it for
- # reading so that we can catch at least some errors in
- # some cases early.
- open(filename, mode).close()
- self._f = None
- self.should_close = True
-
- def __getattr__(self, name):
- return getattr(self.open(), name)
-
- def __repr__(self):
- if self._f is not None:
- return repr(self._f)
- return '' % (self.name, self.mode)
-
- def open(self):
- """Opens the file if it's not yet open. This call might fail with
- a :exc:`FileError`. Not handling this error will produce an error
- that Click shows.
- """
- if self._f is not None:
- return self._f
- try:
- rv, self.should_close = open_stream(self.name, self.mode,
- self.encoding,
- self.errors,
- atomic=self.atomic)
- except (IOError, OSError) as e:
- from .exceptions import FileError
- raise FileError(self.name, hint=get_streerror(e))
- self._f = rv
- return rv
-
- def close(self):
- """Closes the underlying file, no matter what."""
- if self._f is not None:
- self._f.close()
-
- def close_intelligently(self):
- """This function only closes the file if it was opened by the lazy
- file wrapper. For instance this will never close stdin.
- """
- if self.should_close:
- self.close()
-
- def __enter__(self):
- return self
-
- def __exit__(self, exc_type, exc_value, tb):
- self.close_intelligently()
-
- def __iter__(self):
- self.open()
- return iter(self._f)
-
-
-class KeepOpenFile(object):
-
- def __init__(self, file):
- self._file = file
-
- def __getattr__(self, name):
- return getattr(self._file, name)
-
- def __enter__(self):
- return self
-
- def __exit__(self, exc_type, exc_value, tb):
- pass
-
- def __repr__(self):
- return repr(self._file)
-
- def __iter__(self):
- return iter(self._file)
-
-
-def echo(message=None, file=None, nl=True, err=False, color=None):
- """Prints a message plus a newline to the given file or stdout. On
- first sight, this looks like the print function, but it has improved
- support for handling Unicode and binary data that does not fail no
- matter how badly configured the system is.
-
- Primarily it means that you can print binary data as well as Unicode
- data on both 2.x and 3.x to the given file in the most appropriate way
- possible. This is a very carefree function in that it will try its
- best to not fail. As of Click 6.0 this includes support for unicode
- output on the Windows console.
-
- In addition to that, if `colorama`_ is installed, the echo function will
- also support clever handling of ANSI codes. Essentially it will then
- do the following:
-
- - add transparent handling of ANSI color codes on Windows.
- - hide ANSI codes automatically if the destination file is not a
- terminal.
-
- .. _colorama: https://pypi.org/project/colorama/
-
- .. versionchanged:: 6.0
- As of Click 6.0 the echo function will properly support unicode
- output on the windows console. Not that click does not modify
- the interpreter in any way which means that `sys.stdout` or the
- print statement or function will still not provide unicode support.
-
- .. versionchanged:: 2.0
- Starting with version 2.0 of Click, the echo function will work
- with colorama if it's installed.
-
- .. versionadded:: 3.0
- The `err` parameter was added.
-
- .. versionchanged:: 4.0
- Added the `color` flag.
-
- :param message: the message to print
- :param file: the file to write to (defaults to ``stdout``)
- :param err: if set to true the file defaults to ``stderr`` instead of
- ``stdout``. This is faster and easier than calling
- :func:`get_text_stderr` yourself.
- :param nl: if set to `True` (the default) a newline is printed afterwards.
- :param color: controls if the terminal supports ANSI colors or not. The
- default is autodetection.
- """
- if file is None:
- if err:
- file = _default_text_stderr()
- else:
- file = _default_text_stdout()
-
- # Convert non bytes/text into the native string type.
- if message is not None and not isinstance(message, echo_native_types):
- message = text_type(message)
-
- if nl:
- message = message or u''
- if isinstance(message, text_type):
- message += u'\n'
- else:
- message += b'\n'
-
- # If there is a message, and we're in Python 3, and the value looks
- # like bytes, we manually need to find the binary stream and write the
- # message in there. This is done separately so that most stream
- # types will work as you would expect. Eg: you can write to StringIO
- # for other cases.
- if message and not PY2 and is_bytes(message):
- binary_file = _find_binary_writer(file)
- if binary_file is not None:
- file.flush()
- binary_file.write(message)
- binary_file.flush()
- return
-
- # ANSI-style support. If there is no message or we are dealing with
- # bytes nothing is happening. If we are connected to a file we want
- # to strip colors. If we are on windows we either wrap the stream
- # to strip the color or we use the colorama support to translate the
- # ansi codes to API calls.
- if message and not is_bytes(message):
- color = resolve_color_default(color)
- if should_strip_ansi(file, color):
- message = strip_ansi(message)
- elif WIN:
- if auto_wrap_for_ansi is not None:
- file = auto_wrap_for_ansi(file)
- elif not color:
- message = strip_ansi(message)
-
- if message:
- file.write(message)
- file.flush()
-
-
-def get_binary_stream(name):
- """Returns a system stream for byte processing. This essentially
- returns the stream from the sys module with the given name but it
- solves some compatibility issues between different Python versions.
- Primarily this function is necessary for getting binary streams on
- Python 3.
-
- :param name: the name of the stream to open. Valid names are ``'stdin'``,
- ``'stdout'`` and ``'stderr'``
- """
- opener = binary_streams.get(name)
- if opener is None:
- raise TypeError('Unknown standard stream %r' % name)
- return opener()
-
-
-def get_text_stream(name, encoding=None, errors='strict'):
- """Returns a system stream for text processing. This usually returns
- a wrapped stream around a binary stream returned from
- :func:`get_binary_stream` but it also can take shortcuts on Python 3
- for already correctly configured streams.
-
- :param name: the name of the stream to open. Valid names are ``'stdin'``,
- ``'stdout'`` and ``'stderr'``
- :param encoding: overrides the detected default encoding.
- :param errors: overrides the default error mode.
- """
- opener = text_streams.get(name)
- if opener is None:
- raise TypeError('Unknown standard stream %r' % name)
- return opener(encoding, errors)
-
-
-def open_file(filename, mode='r', encoding=None, errors='strict',
- lazy=False, atomic=False):
- """This is similar to how the :class:`File` works but for manual
- usage. Files are opened non lazy by default. This can open regular
- files as well as stdin/stdout if ``'-'`` is passed.
-
- If stdin/stdout is returned the stream is wrapped so that the context
- manager will not close the stream accidentally. This makes it possible
- to always use the function like this without having to worry to
- accidentally close a standard stream::
-
- with open_file(filename) as f:
- ...
-
- .. versionadded:: 3.0
-
- :param filename: the name of the file to open (or ``'-'`` for stdin/stdout).
- :param mode: the mode in which to open the file.
- :param encoding: the encoding to use.
- :param errors: the error handling for this file.
- :param lazy: can be flipped to true to open the file lazily.
- :param atomic: in atomic mode writes go into a temporary file and it's
- moved on close.
- """
- if lazy:
- return LazyFile(filename, mode, encoding, errors, atomic=atomic)
- f, should_close = open_stream(filename, mode, encoding, errors,
- atomic=atomic)
- if not should_close:
- f = KeepOpenFile(f)
- return f
-
-
-def get_os_args():
- """This returns the argument part of sys.argv in the most appropriate
- form for processing. What this means is that this return value is in
- a format that works for Click to process but does not necessarily
- correspond well to what's actually standard for the interpreter.
-
- On most environments the return value is ``sys.argv[:1]`` unchanged.
- However if you are on Windows and running Python 2 the return value
- will actually be a list of unicode strings instead because the
- default behavior on that platform otherwise will not be able to
- carry all possible values that sys.argv can have.
-
- .. versionadded:: 6.0
- """
- # We can only extract the unicode argv if sys.argv has not been
- # changed since the startup of the application.
- if PY2 and WIN and _initial_argv_hash == _hash_py_argv():
- return _get_windows_argv()
- return sys.argv[1:]
-
-
-def format_filename(filename, shorten=False):
- """Formats a filename for user display. The main purpose of this
- function is to ensure that the filename can be displayed at all. This
- will decode the filename to unicode if necessary in a way that it will
- not fail. Optionally, it can shorten the filename to not include the
- full path to the filename.
-
- :param filename: formats a filename for UI display. This will also convert
- the filename into unicode without failing.
- :param shorten: this optionally shortens the filename to strip of the
- path that leads up to it.
- """
- if shorten:
- filename = os.path.basename(filename)
- return filename_to_ui(filename)
-
-
-def get_app_dir(app_name, roaming=True, force_posix=False):
- r"""Returns the config folder for the application. The default behavior
- is to return whatever is most appropriate for the operating system.
-
- To give you an idea, for an app called ``"Foo Bar"``, something like
- the following folders could be returned:
-
- Mac OS X:
- ``~/Library/Application Support/Foo Bar``
- Mac OS X (POSIX):
- ``~/.foo-bar``
- Unix:
- ``~/.config/foo-bar``
- Unix (POSIX):
- ``~/.foo-bar``
- Win XP (roaming):
- ``C:\Documents and Settings\\Local Settings\Application Data\Foo Bar``
- Win XP (not roaming):
- ``C:\Documents and Settings\\Application Data\Foo Bar``
- Win 7 (roaming):
- ``C:\Users\\AppData\Roaming\Foo Bar``
- Win 7 (not roaming):
- ``C:\Users\\AppData\Local\Foo Bar``
-
- .. versionadded:: 2.0
-
- :param app_name: the application name. This should be properly capitalized
- and can contain whitespace.
- :param roaming: controls if the folder should be roaming or not on Windows.
- Has no affect otherwise.
- :param force_posix: if this is set to `True` then on any POSIX system the
- folder will be stored in the home folder with a leading
- dot instead of the XDG config home or darwin's
- application support folder.
- """
- if WIN:
- key = roaming and 'APPDATA' or 'LOCALAPPDATA'
- folder = os.environ.get(key)
- if folder is None:
- folder = os.path.expanduser('~')
- return os.path.join(folder, app_name)
- if force_posix:
- return os.path.join(os.path.expanduser('~/.' + _posixify(app_name)))
- if sys.platform == 'darwin':
- return os.path.join(os.path.expanduser(
- '~/Library/Application Support'), app_name)
- return os.path.join(
- os.environ.get('XDG_CONFIG_HOME', os.path.expanduser('~/.config')),
- _posixify(app_name))
-
-
-class PacifyFlushWrapper(object):
- """This wrapper is used to catch and suppress BrokenPipeErrors resulting
- from ``.flush()`` being called on broken pipe during the shutdown/final-GC
- of the Python interpreter. Notably ``.flush()`` is always called on
- ``sys.stdout`` and ``sys.stderr``. So as to have minimal impact on any
- other cleanup code, and the case where the underlying file is not a broken
- pipe, all calls and attributes are proxied.
- """
-
- def __init__(self, wrapped):
- self.wrapped = wrapped
-
- def flush(self):
- try:
- self.wrapped.flush()
- except IOError as e:
- import errno
- if e.errno != errno.EPIPE:
- raise
-
- def __getattr__(self, attr):
- return getattr(self.wrapped, attr)
diff --git a/lib/cryptography-2.4.2.dist-info/AUTHORS.rst b/lib/cryptography-2.4.2.dist-info/AUTHORS.rst
deleted file mode 100644
index ed9ac84ed3..0000000000
--- a/lib/cryptography-2.4.2.dist-info/AUTHORS.rst
+++ /dev/null
@@ -1,43 +0,0 @@
-AUTHORS
-=======
-
-PGP key fingerprints are enclosed in parentheses.
-
-* Alex Gaynor (E27D 4AA0 1651 72CB C5D2 AF2B 125F 5C67 DFE9 4084)
-* Hynek Schlawack (C2A0 4F86 ACE2 8ADC F817 DBB7 AE25 3622 7F69 F181)
-* Donald Stufft
-* Laurens Van Houtven <_@lvh.io> (D9DC 4315 772F 8E91 DD22 B153 DFD1 3DF7 A8DD 569B)
-* Christian Heimes
-* Paul Kehrer (05FD 9FA1 6CF7 5735 0D91 A560 235A E5F1 29F9 ED98)
-* Jarret Raim
-* Alex Stapleton (A1C7 E50B 66DE 39ED C847 9665 8E3C 20D1 9BD9 5C4C)
-* David Reid (0F83 CC87 B32F 482B C726 B58A 9FBF D8F4 DA89 6D74)
-* Matthew Lefkowitz (06AB F638 E878 CD29 1264 18AB 7EC2 8125 0FBC 4A07)
-* Konstantinos Koukopoulos (D6BD 52B6 8C99 A91C E2C8 934D 3300 566B 3A46 726E)
-* Stephen Holsapple
-* Terry Chia
-* Matthew Iversen (2F04 3DCC D6E6 D5AC D262 2E0B C046 E8A8 7452 2973)
-* Mohammed Attia
-* Michael Hart
-* Mark Adams (A18A 7DD3 283C CF2A B0CE FE0E C7A0 5E3F C972 098C)
-* Gregory Haynes (6FB6 44BF 9FD0 EBA2 1CE9 471F B08F 42F9 0DC6 599F)
-* Chelsea Winfree
-* Steven Buss (1FB9 2EC1 CF93 DFD6 B47F F583 B1A5 6C22 290D A4C3)
-* Andre Caron
-* Jiangge Zhang (BBEC 782B 015F 71B1 5FF7 EACA 1A8C AA98 255F 5000)
-* Major Hayden (1BF9 9264 9596 0033 698C 252B 7370 51E0 C101 1FB1)
-* Phoebe Queen (10D4 7741 AB65 50F4 B264 3888 DA40 201A 072B C1FA)
-* Google Inc.
-* Amaury Forgeot d'Arc
-* Dirkjan Ochtman (25BB BAC1 13C1 BFD5 AA59 4A4C 9F96 B929 3038 0381)
-* Maximilian Hils
-* Simo Sorce
-* Thomas Sileo
-* Fraser Tweedale
-* Ofek Lev (FFB6 B92B 30B1 7848 546E 9912 972F E913 DAD5 A46E)
-* Erik Daguerre
-* Aviv Palivoda
-* Chris Wolfe
-* Jeremy Lainé
-* Denis Gladkikh
-* John Pacific (2CF6 0381 B5EF 29B7 D48C 2020 7BB9 71A0 E891 44D9)
diff --git a/lib/cryptography-2.4.2.dist-info/INSTALLER b/lib/cryptography-2.4.2.dist-info/INSTALLER
deleted file mode 100644
index a1b589e38a..0000000000
--- a/lib/cryptography-2.4.2.dist-info/INSTALLER
+++ /dev/null
@@ -1 +0,0 @@
-pip
diff --git a/lib/cryptography-2.4.2.dist-info/LICENSE b/lib/cryptography-2.4.2.dist-info/LICENSE
deleted file mode 100644
index fe5af51408..0000000000
--- a/lib/cryptography-2.4.2.dist-info/LICENSE
+++ /dev/null
@@ -1,6 +0,0 @@
-This software is made available under the terms of *either* of the licenses
-found in LICENSE.APACHE or LICENSE.BSD. Contributions to cryptography are made
-under the terms of *both* these licenses.
-
-The code used in the OpenSSL locking callback and OS random engine is derived
-from CPython, and is licensed under the terms of the PSF License Agreement.
diff --git a/lib/cryptography-2.4.2.dist-info/LICENSE.APACHE b/lib/cryptography-2.4.2.dist-info/LICENSE.APACHE
deleted file mode 100644
index d645695673..0000000000
--- a/lib/cryptography-2.4.2.dist-info/LICENSE.APACHE
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/lib/cryptography-2.4.2.dist-info/LICENSE.BSD b/lib/cryptography-2.4.2.dist-info/LICENSE.BSD
deleted file mode 100644
index ec1a29d34d..0000000000
--- a/lib/cryptography-2.4.2.dist-info/LICENSE.BSD
+++ /dev/null
@@ -1,27 +0,0 @@
-Copyright (c) Individual contributors.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- 3. Neither the name of PyCA Cryptography nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/lib/cryptography-2.4.2.dist-info/METADATA b/lib/cryptography-2.4.2.dist-info/METADATA
deleted file mode 100644
index a065fd439c..0000000000
--- a/lib/cryptography-2.4.2.dist-info/METADATA
+++ /dev/null
@@ -1,130 +0,0 @@
-Metadata-Version: 2.1
-Name: cryptography
-Version: 2.4.2
-Summary: cryptography is a package which provides cryptographic recipes and primitives to Python developers.
-Home-page: https://github.com/pyca/cryptography
-Author: The cryptography developers
-Author-email: cryptography-dev@python.org
-License: BSD or Apache License, Version 2.0
-Platform: UNKNOWN
-Classifier: Development Status :: 5 - Production/Stable
-Classifier: Intended Audience :: Developers
-Classifier: License :: OSI Approved :: Apache Software License
-Classifier: License :: OSI Approved :: BSD License
-Classifier: Natural Language :: English
-Classifier: Operating System :: MacOS :: MacOS X
-Classifier: Operating System :: POSIX
-Classifier: Operating System :: POSIX :: BSD
-Classifier: Operating System :: POSIX :: Linux
-Classifier: Operating System :: Microsoft :: Windows
-Classifier: Programming Language :: Python
-Classifier: Programming Language :: Python :: 2
-Classifier: Programming Language :: Python :: 2.7
-Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.4
-Classifier: Programming Language :: Python :: 3.5
-Classifier: Programming Language :: Python :: 3.6
-Classifier: Programming Language :: Python :: 3.7
-Classifier: Programming Language :: Python :: Implementation :: CPython
-Classifier: Programming Language :: Python :: Implementation :: PyPy
-Classifier: Topic :: Security :: Cryptography
-Requires-Python: >=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*
-Requires-Dist: idna (>=2.1)
-Requires-Dist: asn1crypto (>=0.21.0)
-Requires-Dist: six (>=1.4.1)
-Requires-Dist: cffi (!=1.11.3,>=1.7)
-Requires-Dist: enum34 ; python_version < '3'
-Requires-Dist: ipaddress ; python_version < '3'
-Provides-Extra: docs
-Requires-Dist: sphinx (!=1.8.0,>=1.6.5) ; extra == 'docs'
-Requires-Dist: sphinx-rtd-theme ; extra == 'docs'
-Provides-Extra: docstest
-Requires-Dist: doc8 ; extra == 'docstest'
-Requires-Dist: pyenchant (>=1.6.11) ; extra == 'docstest'
-Requires-Dist: readme-renderer (>=16.0) ; extra == 'docstest'
-Requires-Dist: sphinxcontrib-spelling (>=4.0.1) ; extra == 'docstest'
-Provides-Extra: pep8test
-Requires-Dist: flake8 ; extra == 'pep8test'
-Requires-Dist: flake8-import-order ; extra == 'pep8test'
-Requires-Dist: pep8-naming ; extra == 'pep8test'
-Provides-Extra: test
-Requires-Dist: pytest (!=3.9.0,!=3.9.1,!=3.9.2,>=3.6.0) ; extra == 'test'
-Requires-Dist: pretend ; extra == 'test'
-Requires-Dist: iso8601 ; extra == 'test'
-Requires-Dist: pytz ; extra == 'test'
-Requires-Dist: hypothesis (!=3.79.2,>=1.11.4) ; extra == 'test'
-Requires-Dist: cryptography-vectors (==2.4.2) ; extra == 'test'
-
-pyca/cryptography
-=================
-
-.. image:: https://img.shields.io/pypi/v/cryptography.svg
- :target: https://pypi.org/project/cryptography/
- :alt: Latest Version
-
-.. image:: https://readthedocs.org/projects/cryptography/badge/?version=latest
- :target: https://cryptography.io
- :alt: Latest Docs
-
-.. image:: https://travis-ci.org/pyca/cryptography.svg?branch=master
- :target: https://travis-ci.org/pyca/cryptography
-
-.. image:: https://codecov.io/github/pyca/cryptography/coverage.svg?branch=master
- :target: https://codecov.io/github/pyca/cryptography?branch=master
-
-
-``cryptography`` is a package which provides cryptographic recipes and
-primitives to Python developers. Our goal is for it to be your "cryptographic
-standard library". It supports Python 2.7, Python 3.4+, and PyPy 5.3+.
-
-``cryptography`` includes both high level recipes and low level interfaces to
-common cryptographic algorithms such as symmetric ciphers, message digests, and
-key derivation functions. For example, to encrypt something with
-``cryptography``'s high level symmetric encryption recipe:
-
-.. code-block:: pycon
-
- >>> from cryptography.fernet import Fernet
- >>> # Put this somewhere safe!
- >>> key = Fernet.generate_key()
- >>> f = Fernet(key)
- >>> token = f.encrypt(b"A really secret message. Not for prying eyes.")
- >>> token
- '...'
- >>> f.decrypt(token)
- 'A really secret message. Not for prying eyes.'
-
-You can find more information in the `documentation`_.
-
-You can install ``cryptography`` with:
-
-.. code-block:: console
-
- $ pip install cryptography
-
-For full details see `the installation documentation`_.
-
-Discussion
-~~~~~~~~~~
-
-If you run into bugs, you can file them in our `issue tracker`_.
-
-We maintain a `cryptography-dev`_ mailing list for development discussion.
-
-You can also join ``#cryptography-dev`` on Freenode to ask questions or get
-involved.
-
-Security
-~~~~~~~~
-
-Need to report a security issue? Please consult our `security reporting`_
-documentation.
-
-
-.. _`documentation`: https://cryptography.io/
-.. _`the installation documentation`: https://cryptography.io/en/latest/installation/
-.. _`issue tracker`: https://github.com/pyca/cryptography/issues
-.. _`cryptography-dev`: https://mail.python.org/mailman/listinfo/cryptography-dev
-.. _`security reporting`: https://cryptography.io/en/latest/security/
-
-
diff --git a/lib/cryptography-2.4.2.dist-info/RECORD b/lib/cryptography-2.4.2.dist-info/RECORD
deleted file mode 100644
index 8eddf9bd76..0000000000
--- a/lib/cryptography-2.4.2.dist-info/RECORD
+++ /dev/null
@@ -1,154 +0,0 @@
-cryptography-2.4.2.dist-info/AUTHORS.rst,sha256=s-DKTxHGR_qzuQq47GsfSTCARph63T66nqk2apqIcsU,2440
-cryptography-2.4.2.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
-cryptography-2.4.2.dist-info/LICENSE,sha256=NUUrVX-rDvsegNftucTlEYuThAgq2qBR3eNCECy53o0,352
-cryptography-2.4.2.dist-info/LICENSE.APACHE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
-cryptography-2.4.2.dist-info/LICENSE.BSD,sha256=YCxMdILeZHndLpeTzaJ15eY9dz2s0eymiSMqtwCPtPs,1532
-cryptography-2.4.2.dist-info/METADATA,sha256=UzDKhmdG1Nn_NIU6j2JkTWq2dascJcX8O5aACYv9gP4,4960
-cryptography-2.4.2.dist-info/RECORD,,
-cryptography-2.4.2.dist-info/WHEEL,sha256=EDR0C9b6ad0FGokyn7DrBYwUNSTEcaX4WukRFKYAdj4,109
-cryptography-2.4.2.dist-info/top_level.txt,sha256=QCkYQE4HJBpqIr-aBqbOZ70NlfbejKnDE6ODbNgUwwg,46
-cryptography/__about__.py,sha256=LeMTuVbCqJBS7xz9MhpJb4N6RE-Kpx_DRSk8E3YX5zs,817
-cryptography/__about__.pyc,,
-cryptography/__init__.py,sha256=M7mQrfCHYuk7TpEPpfYxkhc95comqxOt41xYjLa5wiA,527
-cryptography/__init__.pyc,,
-cryptography/exceptions.py,sha256=3DJSu6GT5l5yVqu8SHKODGZp_s66s_nZokxAgPyws-0,1234
-cryptography/exceptions.pyc,,
-cryptography/fernet.py,sha256=BmY5HBTeIQ24HmT9b10C0xY_-BZBMphFVx6S1QP6gyI,5290
-cryptography/fernet.pyc,,
-cryptography/hazmat/__init__.py,sha256=hEPNQw8dgjIPIn42qaLwXNRLCyTGNZeSvkQb57DPhbs,483
-cryptography/hazmat/__init__.pyc,,
-cryptography/hazmat/_oid.py,sha256=EXutYYTrKoHWN09RZ7H7R9lcjjm9JGc3uGxuSPCHI9g,2180
-cryptography/hazmat/_oid.pyc,,
-cryptography/hazmat/backends/__init__.py,sha256=92UZdmqTyQPOYA2ui17tksyjxBnTmj1XDsxDCChLvxE,496
-cryptography/hazmat/backends/__init__.pyc,,
-cryptography/hazmat/backends/interfaces.py,sha256=b8zZ92ehVJje6SbvsI4Mwn5OpUJujhIk4MFImmwMlr4,10789
-cryptography/hazmat/backends/interfaces.pyc,,
-cryptography/hazmat/backends/openssl/__init__.py,sha256=k4DMe228_hTuB2kY3Lwk62JdI3EmCd7VkV01zJm57ps,336
-cryptography/hazmat/backends/openssl/__init__.pyc,,
-cryptography/hazmat/backends/openssl/aead.py,sha256=NkmmYAgCjGdVMoRIzFLV2RkbhZ2WbVtNb5CqK1TlnKM,5581
-cryptography/hazmat/backends/openssl/aead.pyc,,
-cryptography/hazmat/backends/openssl/backend.py,sha256=MDXL5VJ_S4r9MBOBjEOsw75F3Gv9wqXD6r-oZI04-Q0,81134
-cryptography/hazmat/backends/openssl/backend.pyc,,
-cryptography/hazmat/backends/openssl/ciphers.py,sha256=wo1A55VCqS7PR7AqTI1Lz3hb210QoDosgibpgNRc1I8,8904
-cryptography/hazmat/backends/openssl/ciphers.pyc,,
-cryptography/hazmat/backends/openssl/cmac.py,sha256=AyKXShU3tMHEeGlHm_s_SAhyJwklcbWuFikj9IP-Z2k,2840
-cryptography/hazmat/backends/openssl/cmac.pyc,,
-cryptography/hazmat/backends/openssl/decode_asn1.py,sha256=F44GkkROKz8WlZJKFeFxLqIcDoMOgBqH7GcWyd7a8I8,31866
-cryptography/hazmat/backends/openssl/decode_asn1.pyc,,
-cryptography/hazmat/backends/openssl/dh.py,sha256=kXH0LXLsgo7FLNan6V5BiidS30zVkWNwaWuVZ-n6Uog,10814
-cryptography/hazmat/backends/openssl/dh.pyc,,
-cryptography/hazmat/backends/openssl/dsa.py,sha256=JGcNfoAByLPKhfQp0Q-eW2P4hOKRos8-MJ3nIDKxbWE,10278
-cryptography/hazmat/backends/openssl/dsa.pyc,,
-cryptography/hazmat/backends/openssl/ec.py,sha256=j_DHfNTHBPT4JcnPpVjT1SHPMwFfcfwhesf79uQR1Z8,10286
-cryptography/hazmat/backends/openssl/ec.pyc,,
-cryptography/hazmat/backends/openssl/encode_asn1.py,sha256=M583nLdps5a-IUdRrgkw8IM9j8b2cfPr2QZu_MZW7ec,22473
-cryptography/hazmat/backends/openssl/encode_asn1.pyc,,
-cryptography/hazmat/backends/openssl/hashes.py,sha256=fZYOLim061ZGM0ovFnrNVLS5s8UkmI4_BgXrYhAepMo,2473
-cryptography/hazmat/backends/openssl/hashes.pyc,,
-cryptography/hazmat/backends/openssl/hmac.py,sha256=Npmb70DW25jlMULrc7aAtMNYeGRWr6A0zbq9n5pxdvk,2924
-cryptography/hazmat/backends/openssl/hmac.pyc,,
-cryptography/hazmat/backends/openssl/ocsp.py,sha256=0YbfKtUsbKCgWl9ovaCDz7E1kCvdUYsOiPtIltLrThE,13311
-cryptography/hazmat/backends/openssl/ocsp.pyc,,
-cryptography/hazmat/backends/openssl/rsa.py,sha256=TG0J6Xk03wrxpeDp9YvusieCe2Zk8MliDiobCnOzKN0,17999
-cryptography/hazmat/backends/openssl/rsa.pyc,,
-cryptography/hazmat/backends/openssl/utils.py,sha256=WQl9SXQnyuigjhYsgPX4qQPlpAAVS5vOzIrDYX9E-EQ,1399
-cryptography/hazmat/backends/openssl/utils.pyc,,
-cryptography/hazmat/backends/openssl/x25519.py,sha256=XYQOG36AxW1y1iy5anFTxWiZnIjk4HjkAqw18IZM2us,3064
-cryptography/hazmat/backends/openssl/x25519.pyc,,
-cryptography/hazmat/backends/openssl/x509.py,sha256=Loo1CtRFxhQjjTR1gsMt1oeo5hSUgS-vpwnD09wGHww,20365
-cryptography/hazmat/backends/openssl/x509.pyc,,
-cryptography/hazmat/bindings/__init__.py,sha256=0wGw2OF9R7fHX7NWENCmrsYigbXHU2ojgn-N4Rkjs9U,246
-cryptography/hazmat/bindings/__init__.pyc,,
-cryptography/hazmat/bindings/_constant_time.so,sha256=IDvEnN8g5uQ5igDTlDSFfAcsixI8_wnJ_sIbpwOnho8,22708
-cryptography/hazmat/bindings/_openssl.so,sha256=dxP1MqTpRynAqmfKyM33fsH47VSeCERr-k4n6Dcw4BE,3338748
-cryptography/hazmat/bindings/_padding.so,sha256=BwoHVh6fnJ0FKesu8z5JWcaLVYmRRChZarkSVNKums0,27268
-cryptography/hazmat/bindings/openssl/__init__.py,sha256=0wGw2OF9R7fHX7NWENCmrsYigbXHU2ojgn-N4Rkjs9U,246
-cryptography/hazmat/bindings/openssl/__init__.pyc,,
-cryptography/hazmat/bindings/openssl/_conditional.py,sha256=mdw7Kwuz2qGS5-aB5N6JmVdeoRv7w5e5H583uJRbD8Y,9457
-cryptography/hazmat/bindings/openssl/_conditional.pyc,,
-cryptography/hazmat/bindings/openssl/binding.py,sha256=23Sxv52S_2ef7t6Bp1CSxbUjTLT2WFH8x7J9Z9t8xds,6037
-cryptography/hazmat/bindings/openssl/binding.pyc,,
-cryptography/hazmat/primitives/__init__.py,sha256=0wGw2OF9R7fHX7NWENCmrsYigbXHU2ojgn-N4Rkjs9U,246
-cryptography/hazmat/primitives/__init__.pyc,,
-cryptography/hazmat/primitives/asymmetric/__init__.py,sha256=WhUn3tGxoLAxGAsZHElJ2aOILXSh55AZi04MBudYmQA,1020
-cryptography/hazmat/primitives/asymmetric/__init__.pyc,,
-cryptography/hazmat/primitives/asymmetric/dh.py,sha256=6Xl01bjTVHFCcdJr3Ph2cQ7hxkYYedqm-SekZpxnntY,5454
-cryptography/hazmat/primitives/asymmetric/dh.pyc,,
-cryptography/hazmat/primitives/asymmetric/dsa.py,sha256=uzK7qpe0BtqHkgVLSrNGtska1w3JSUN_uZp6XAA5LMY,6891
-cryptography/hazmat/primitives/asymmetric/dsa.pyc,,
-cryptography/hazmat/primitives/asymmetric/ec.py,sha256=5a2IzMTUEu271oLaefaH-8_7PybPhnp9yb2G9_hzNeU,10699
-cryptography/hazmat/primitives/asymmetric/ec.pyc,,
-cryptography/hazmat/primitives/asymmetric/padding.py,sha256=aCZatU5-q_WW5vazBWeKPF8ZZa0AI8hWzbJaVRN3RWI,2261
-cryptography/hazmat/primitives/asymmetric/padding.pyc,,
-cryptography/hazmat/primitives/asymmetric/rsa.py,sha256=V7MKK29BpNGF2f3uWEs3HPYbGuL3YtDFujvjFQrle0Q,10317
-cryptography/hazmat/primitives/asymmetric/rsa.pyc,,
-cryptography/hazmat/primitives/asymmetric/utils.py,sha256=x7bcX3L_wLkZqdcOfUdDI70SdvUSrPolLv_6kRtFajk,1720
-cryptography/hazmat/primitives/asymmetric/utils.pyc,,
-cryptography/hazmat/primitives/asymmetric/x25519.py,sha256=f4Tif1_sqmTRC9uByZ2eibijI5aHFZGUQ1jgQG5bqmo,1652
-cryptography/hazmat/primitives/asymmetric/x25519.pyc,,
-cryptography/hazmat/primitives/ciphers/__init__.py,sha256=QxaxejeFfz6CPhI1c4iNq_7DsiB41Y_Q-uLfzOx7fv8,626
-cryptography/hazmat/primitives/ciphers/__init__.pyc,,
-cryptography/hazmat/primitives/ciphers/aead.py,sha256=auFZvqghypWwbaCSVjOQqu0ShqctdKADcPIscksjcEM,6413
-cryptography/hazmat/primitives/ciphers/aead.pyc,,
-cryptography/hazmat/primitives/ciphers/algorithms.py,sha256=akJFiPdwDT1OMIyhlMWbCVqs0ktaBzE5l4dT2iG-LJc,4233
-cryptography/hazmat/primitives/ciphers/algorithms.pyc,,
-cryptography/hazmat/primitives/ciphers/base.py,sha256=KOMTiI7-TPf9ENs_0IHuZ_kBkHz1wimdDG_xkfbdnAY,7148
-cryptography/hazmat/primitives/ciphers/base.pyc,,
-cryptography/hazmat/primitives/ciphers/modes.py,sha256=WipP7JtIogVaruguxxNj0FUi7GIjgV1crW_ybilsTF8,7027
-cryptography/hazmat/primitives/ciphers/modes.pyc,,
-cryptography/hazmat/primitives/cmac.py,sha256=jXv_7KmaCek2LNOAbXXp0bzA3Mts6ff_oWBFnFVXluo,2221
-cryptography/hazmat/primitives/cmac.pyc,,
-cryptography/hazmat/primitives/constant_time.py,sha256=2-OvdvG0rvaRT0Spt5vi5rmqBUJYz89VuK32cmS2GNA,1124
-cryptography/hazmat/primitives/constant_time.pyc,,
-cryptography/hazmat/primitives/hashes.py,sha256=NKhCtNpSbSMLYjo7mQjbQLTBRQF0wL3HTY-BqJSqQS8,4676
-cryptography/hazmat/primitives/hashes.pyc,,
-cryptography/hazmat/primitives/hmac.py,sha256=88sNgH3-t6kKVAILsx1SvjHBlYuz6_i34hLf2Z5U84s,2339
-cryptography/hazmat/primitives/hmac.pyc,,
-cryptography/hazmat/primitives/kdf/__init__.py,sha256=nod5HjPswjZr8wFp6Tsu6en9blHYF3khgXI5R0zIcnM,771
-cryptography/hazmat/primitives/kdf/__init__.pyc,,
-cryptography/hazmat/primitives/kdf/concatkdf.py,sha256=WTooWTAkHUCtaMAUouAluNbg71qXxPj_AHLyuRnPDR8,4109
-cryptography/hazmat/primitives/kdf/concatkdf.pyc,,
-cryptography/hazmat/primitives/kdf/hkdf.py,sha256=SlAKFKFS6jowkfO8wMu27wa268RPekYVQpedq2b3iJk,3660
-cryptography/hazmat/primitives/kdf/hkdf.pyc,,
-cryptography/hazmat/primitives/kdf/kbkdf.py,sha256=SvuAqrv1ZZT-AG-pimTXZH4TtP42535tXaQbockFq_0,5025
-cryptography/hazmat/primitives/kdf/kbkdf.pyc,,
-cryptography/hazmat/primitives/kdf/pbkdf2.py,sha256=YiFNDI4CbGRH0OQXDMXG8DfYap32vtjvA-Zo-n_oAE4,2185
-cryptography/hazmat/primitives/kdf/pbkdf2.pyc,,
-cryptography/hazmat/primitives/kdf/scrypt.py,sha256=aZVkYFw9XqPCInjAadnzlYfPw3fi2COGDe7ubuYjReg,2252
-cryptography/hazmat/primitives/kdf/scrypt.pyc,,
-cryptography/hazmat/primitives/kdf/x963kdf.py,sha256=yOK2qAlWTHABVIvwT55jl_B6UR5ELyLFlcVtH16HxGc,2363
-cryptography/hazmat/primitives/kdf/x963kdf.pyc,,
-cryptography/hazmat/primitives/keywrap.py,sha256=LqjkVIs7ub5I5gwmYSb9Ia0VdXMqWWHmnKSdQ7HOGEA,5462
-cryptography/hazmat/primitives/keywrap.pyc,,
-cryptography/hazmat/primitives/mac.py,sha256=dgLoN6PdA_QqowwB_RzSeEqJjIPnAqTUTxio-8CFP-8,884
-cryptography/hazmat/primitives/mac.pyc,,
-cryptography/hazmat/primitives/padding.py,sha256=joCFMwVI8MnHT75GcUaInox1rYeLqjd4DtZLEBhYBlY,5736
-cryptography/hazmat/primitives/padding.pyc,,
-cryptography/hazmat/primitives/serialization.py,sha256=q0A61qepY1cCjArCmZHdEdetoGloR4SzzQ-IaadH8xA,5513
-cryptography/hazmat/primitives/serialization.pyc,,
-cryptography/hazmat/primitives/twofactor/__init__.py,sha256=BWrm3DKDoAa281E7U_nzz8v44OmAiXmlIycFcsehwfE,288
-cryptography/hazmat/primitives/twofactor/__init__.pyc,,
-cryptography/hazmat/primitives/twofactor/hotp.py,sha256=6_EnKl-zRs0yCXuHxQhs2TEkHaprWxZnfJGrQjs5RIg,2589
-cryptography/hazmat/primitives/twofactor/hotp.pyc,,
-cryptography/hazmat/primitives/twofactor/totp.py,sha256=KL3A4bjpqaqynQYd9hfPVkvs5vYVqf1JVpucEX7_ddM,1594
-cryptography/hazmat/primitives/twofactor/totp.pyc,,
-cryptography/hazmat/primitives/twofactor/utils.py,sha256=71gX1bJeP9TQa-HbSPzeUUJwVY78ALYQNvuusknUO4U,954
-cryptography/hazmat/primitives/twofactor/utils.pyc,,
-cryptography/utils.py,sha256=UuySj9oOoTCM4NKUjSkeLCKt9pVyG8Cxi_ZgaUN5Hrk,4798
-cryptography/utils.pyc,,
-cryptography/x509/__init__.py,sha256=ocfchBOuE-H3uty7taf9ZJW-qq9uRg0t2C8OHdOmeLs,7247
-cryptography/x509/__init__.pyc,,
-cryptography/x509/base.py,sha256=Fb-9NwK6uVNZYf2anOCAIAeBxqmntEQ955dVpYm02iU,23756
-cryptography/x509/base.pyc,,
-cryptography/x509/certificate_transparency.py,sha256=eJ9lrITdyMn4XsrcVdrTaFVI_RR7mX_VzMZyiaEpbps,1000
-cryptography/x509/certificate_transparency.pyc,,
-cryptography/x509/extensions.py,sha256=kwsiAsHRzehyRaU8VjOcxAtA9iaGCW3-sgxOAVHXg7g,44877
-cryptography/x509/extensions.pyc,,
-cryptography/x509/general_name.py,sha256=uXAt7I-5ZR3Ut8EEl4CVVTPx9OjkOcYp3m6EY0-LNe4,9887
-cryptography/x509/general_name.pyc,,
-cryptography/x509/name.py,sha256=QSZUwfxGIkKqqKKgRmaHyLR_uB9M0kJ3jRaQWb6i-w8,5878
-cryptography/x509/name.pyc,,
-cryptography/x509/ocsp.py,sha256=nKyxnyZ0lQAqlGcZJibZlE5-3pDhScxrATfkluHBkK0,12788
-cryptography/x509/ocsp.pyc,,
-cryptography/x509/oid.py,sha256=9Ouo_P7dr5gkKoQEOMj4PTx4axWa8U5LNYumBBYO07A,10632
-cryptography/x509/oid.pyc,,
diff --git a/lib/cryptography-2.4.2.dist-info/WHEEL b/lib/cryptography-2.4.2.dist-info/WHEEL
deleted file mode 100644
index 10c1b46350..0000000000
--- a/lib/cryptography-2.4.2.dist-info/WHEEL
+++ /dev/null
@@ -1,5 +0,0 @@
-Wheel-Version: 1.0
-Generator: bdist_wheel (0.32.3)
-Root-Is-Purelib: false
-Tag: cp27-cp27m-macosx_10_6_intel
-
diff --git a/lib/cryptography-2.4.2.dist-info/top_level.txt b/lib/cryptography-2.4.2.dist-info/top_level.txt
deleted file mode 100644
index e32461e0e7..0000000000
--- a/lib/cryptography-2.4.2.dist-info/top_level.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-_constant_time
-_openssl
-_padding
-cryptography
diff --git a/lib/cryptography/__about__.py b/lib/cryptography/__about__.py
deleted file mode 100644
index ac18bb4b77..0000000000
--- a/lib/cryptography/__about__.py
+++ /dev/null
@@ -1,23 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-__all__ = [
- "__title__", "__summary__", "__uri__", "__version__", "__author__",
- "__email__", "__license__", "__copyright__",
-]
-
-__title__ = "cryptography"
-__summary__ = ("cryptography is a package which provides cryptographic recipes"
- " and primitives to Python developers.")
-__uri__ = "https://github.com/pyca/cryptography"
-
-__version__ = "2.4.2"
-
-__author__ = "The cryptography developers"
-__email__ = "cryptography-dev@python.org"
-
-__license__ = "BSD or Apache License, Version 2.0"
-__copyright__ = "Copyright 2013-2017 {0}".format(__author__)
diff --git a/lib/cryptography/__init__.py b/lib/cryptography/__init__.py
deleted file mode 100644
index 6da0b3830d..0000000000
--- a/lib/cryptography/__init__.py
+++ /dev/null
@@ -1,16 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-from cryptography.__about__ import (
- __author__, __copyright__, __email__, __license__, __summary__, __title__,
- __uri__, __version__
-)
-
-
-__all__ = [
- "__title__", "__summary__", "__uri__", "__version__", "__author__",
- "__email__", "__license__", "__copyright__",
-]
diff --git a/lib/cryptography/exceptions.py b/lib/cryptography/exceptions.py
deleted file mode 100644
index 648cf9dfe6..0000000000
--- a/lib/cryptography/exceptions.py
+++ /dev/null
@@ -1,57 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-from enum import Enum
-
-
-class _Reasons(Enum):
- BACKEND_MISSING_INTERFACE = 0
- UNSUPPORTED_HASH = 1
- UNSUPPORTED_CIPHER = 2
- UNSUPPORTED_PADDING = 3
- UNSUPPORTED_MGF = 4
- UNSUPPORTED_PUBLIC_KEY_ALGORITHM = 5
- UNSUPPORTED_ELLIPTIC_CURVE = 6
- UNSUPPORTED_SERIALIZATION = 7
- UNSUPPORTED_X509 = 8
- UNSUPPORTED_EXCHANGE_ALGORITHM = 9
- UNSUPPORTED_DIFFIE_HELLMAN = 10
-
-
-class UnsupportedAlgorithm(Exception):
- def __init__(self, message, reason=None):
- super(UnsupportedAlgorithm, self).__init__(message)
- self._reason = reason
-
-
-class AlreadyFinalized(Exception):
- pass
-
-
-class AlreadyUpdated(Exception):
- pass
-
-
-class NotYetFinalized(Exception):
- pass
-
-
-class InvalidTag(Exception):
- pass
-
-
-class InvalidSignature(Exception):
- pass
-
-
-class InternalError(Exception):
- def __init__(self, msg, err_code):
- super(InternalError, self).__init__(msg)
- self.err_code = err_code
-
-
-class InvalidKey(Exception):
- pass
diff --git a/lib/cryptography/fernet.py b/lib/cryptography/fernet.py
deleted file mode 100644
index ac2dd0b635..0000000000
--- a/lib/cryptography/fernet.py
+++ /dev/null
@@ -1,173 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import base64
-import binascii
-import os
-import struct
-import time
-
-import six
-
-from cryptography.exceptions import InvalidSignature
-from cryptography.hazmat.backends import default_backend
-from cryptography.hazmat.primitives import hashes, padding
-from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
-from cryptography.hazmat.primitives.hmac import HMAC
-
-
-class InvalidToken(Exception):
- pass
-
-
-_MAX_CLOCK_SKEW = 60
-
-
-class Fernet(object):
- def __init__(self, key, backend=None):
- if backend is None:
- backend = default_backend()
-
- key = base64.urlsafe_b64decode(key)
- if len(key) != 32:
- raise ValueError(
- "Fernet key must be 32 url-safe base64-encoded bytes."
- )
-
- self._signing_key = key[:16]
- self._encryption_key = key[16:]
- self._backend = backend
-
- @classmethod
- def generate_key(cls):
- return base64.urlsafe_b64encode(os.urandom(32))
-
- def encrypt(self, data):
- current_time = int(time.time())
- iv = os.urandom(16)
- return self._encrypt_from_parts(data, current_time, iv)
-
- def _encrypt_from_parts(self, data, current_time, iv):
- if not isinstance(data, bytes):
- raise TypeError("data must be bytes.")
-
- padder = padding.PKCS7(algorithms.AES.block_size).padder()
- padded_data = padder.update(data) + padder.finalize()
- encryptor = Cipher(
- algorithms.AES(self._encryption_key), modes.CBC(iv), self._backend
- ).encryptor()
- ciphertext = encryptor.update(padded_data) + encryptor.finalize()
-
- basic_parts = (
- b"\x80" + struct.pack(">Q", current_time) + iv + ciphertext
- )
-
- h = HMAC(self._signing_key, hashes.SHA256(), backend=self._backend)
- h.update(basic_parts)
- hmac = h.finalize()
- return base64.urlsafe_b64encode(basic_parts + hmac)
-
- def decrypt(self, token, ttl=None):
- timestamp, data = Fernet._get_unverified_token_data(token)
- return self._decrypt_data(data, timestamp, ttl)
-
- def extract_timestamp(self, token):
- timestamp, data = Fernet._get_unverified_token_data(token)
- # Verify the token was not tampered with.
- self._verify_signature(data)
- return timestamp
-
- @staticmethod
- def _get_unverified_token_data(token):
- if not isinstance(token, bytes):
- raise TypeError("token must be bytes.")
-
- try:
- data = base64.urlsafe_b64decode(token)
- except (TypeError, binascii.Error):
- raise InvalidToken
-
- if not data or six.indexbytes(data, 0) != 0x80:
- raise InvalidToken
-
- try:
- timestamp, = struct.unpack(">Q", data[1:9])
- except struct.error:
- raise InvalidToken
- return timestamp, data
-
- def _verify_signature(self, data):
- h = HMAC(self._signing_key, hashes.SHA256(), backend=self._backend)
- h.update(data[:-32])
- try:
- h.verify(data[-32:])
- except InvalidSignature:
- raise InvalidToken
-
- def _decrypt_data(self, data, timestamp, ttl):
- current_time = int(time.time())
- if ttl is not None:
- if timestamp + ttl < current_time:
- raise InvalidToken
-
- if current_time + _MAX_CLOCK_SKEW < timestamp:
- raise InvalidToken
-
- self._verify_signature(data)
-
- iv = data[9:25]
- ciphertext = data[25:-32]
- decryptor = Cipher(
- algorithms.AES(self._encryption_key), modes.CBC(iv), self._backend
- ).decryptor()
- plaintext_padded = decryptor.update(ciphertext)
- try:
- plaintext_padded += decryptor.finalize()
- except ValueError:
- raise InvalidToken
- unpadder = padding.PKCS7(algorithms.AES.block_size).unpadder()
-
- unpadded = unpadder.update(plaintext_padded)
- try:
- unpadded += unpadder.finalize()
- except ValueError:
- raise InvalidToken
- return unpadded
-
-
-class MultiFernet(object):
- def __init__(self, fernets):
- fernets = list(fernets)
- if not fernets:
- raise ValueError(
- "MultiFernet requires at least one Fernet instance"
- )
- self._fernets = fernets
-
- def encrypt(self, msg):
- return self._fernets[0].encrypt(msg)
-
- def rotate(self, msg):
- timestamp, data = Fernet._get_unverified_token_data(msg)
- for f in self._fernets:
- try:
- p = f._decrypt_data(data, timestamp, None)
- break
- except InvalidToken:
- pass
- else:
- raise InvalidToken
-
- iv = os.urandom(16)
- return self._fernets[0]._encrypt_from_parts(p, timestamp, iv)
-
- def decrypt(self, msg, ttl=None):
- for f in self._fernets:
- try:
- return f.decrypt(msg, ttl)
- except InvalidToken:
- pass
- raise InvalidToken
diff --git a/lib/cryptography/hazmat/__init__.py b/lib/cryptography/hazmat/__init__.py
deleted file mode 100644
index 9f06a9949a..0000000000
--- a/lib/cryptography/hazmat/__init__.py
+++ /dev/null
@@ -1,11 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-"""
-Hazardous Materials
-
-This is a "Hazardous Materials" module. You should ONLY use it if you're
-100% absolutely sure that you know what you're doing because this module
-is full of land mines, dragons, and dinosaurs with laser guns.
-"""
-from __future__ import absolute_import, division, print_function
diff --git a/lib/cryptography/hazmat/_oid.py b/lib/cryptography/hazmat/_oid.py
deleted file mode 100644
index cfe906cd3e..0000000000
--- a/lib/cryptography/hazmat/_oid.py
+++ /dev/null
@@ -1,67 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-from cryptography import utils
-
-
-class ObjectIdentifier(object):
- def __init__(self, dotted_string):
- self._dotted_string = dotted_string
-
- nodes = self._dotted_string.split(".")
- intnodes = []
-
- # There must be at least 2 nodes, the first node must be 0..2, and
- # if less than 2, the second node cannot have a value outside the
- # range 0..39. All nodes must be integers.
- for node in nodes:
- try:
- intnodes.append(int(node, 0))
- except ValueError:
- raise ValueError(
- "Malformed OID: %s (non-integer nodes)" % (
- self._dotted_string))
-
- if len(nodes) < 2:
- raise ValueError(
- "Malformed OID: %s (insufficient number of nodes)" % (
- self._dotted_string))
-
- if intnodes[0] > 2:
- raise ValueError(
- "Malformed OID: %s (first node outside valid range)" % (
- self._dotted_string))
-
- if intnodes[0] < 2 and intnodes[1] >= 40:
- raise ValueError(
- "Malformed OID: %s (second node outside valid range)" % (
- self._dotted_string))
-
- def __eq__(self, other):
- if not isinstance(other, ObjectIdentifier):
- return NotImplemented
-
- return self.dotted_string == other.dotted_string
-
- def __ne__(self, other):
- return not self == other
-
- def __repr__(self):
- return "".format(
- self.dotted_string,
- self._name
- )
-
- def __hash__(self):
- return hash(self.dotted_string)
-
- @property
- def _name(self):
- # Lazy import to avoid an import cycle
- from cryptography.x509.oid import _OID_NAMES
- return _OID_NAMES.get(self, "Unknown OID")
-
- dotted_string = utils.read_only_property("_dotted_string")
diff --git a/lib/cryptography/hazmat/backends/__init__.py b/lib/cryptography/hazmat/backends/__init__.py
deleted file mode 100644
index 565bde788b..0000000000
--- a/lib/cryptography/hazmat/backends/__init__.py
+++ /dev/null
@@ -1,18 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-
-_default_backend = None
-
-
-def default_backend():
- global _default_backend
-
- if _default_backend is None:
- from cryptography.hazmat.backends.openssl.backend import backend
- _default_backend = backend
-
- return _default_backend
diff --git a/lib/cryptography/hazmat/backends/interfaces.py b/lib/cryptography/hazmat/backends/interfaces.py
deleted file mode 100644
index 0a476b991c..0000000000
--- a/lib/cryptography/hazmat/backends/interfaces.py
+++ /dev/null
@@ -1,395 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import abc
-
-import six
-
-
-@six.add_metaclass(abc.ABCMeta)
-class CipherBackend(object):
- @abc.abstractmethod
- def cipher_supported(self, cipher, mode):
- """
- Return True if the given cipher and mode are supported.
- """
-
- @abc.abstractmethod
- def create_symmetric_encryption_ctx(self, cipher, mode):
- """
- Get a CipherContext that can be used for encryption.
- """
-
- @abc.abstractmethod
- def create_symmetric_decryption_ctx(self, cipher, mode):
- """
- Get a CipherContext that can be used for decryption.
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class HashBackend(object):
- @abc.abstractmethod
- def hash_supported(self, algorithm):
- """
- Return True if the hash algorithm is supported by this backend.
- """
-
- @abc.abstractmethod
- def create_hash_ctx(self, algorithm):
- """
- Create a HashContext for calculating a message digest.
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class HMACBackend(object):
- @abc.abstractmethod
- def hmac_supported(self, algorithm):
- """
- Return True if the hash algorithm is supported for HMAC by this
- backend.
- """
-
- @abc.abstractmethod
- def create_hmac_ctx(self, key, algorithm):
- """
- Create a MACContext for calculating a message authentication code.
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class CMACBackend(object):
- @abc.abstractmethod
- def cmac_algorithm_supported(self, algorithm):
- """
- Returns True if the block cipher is supported for CMAC by this backend
- """
-
- @abc.abstractmethod
- def create_cmac_ctx(self, algorithm):
- """
- Create a MACContext for calculating a message authentication code.
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class PBKDF2HMACBackend(object):
- @abc.abstractmethod
- def pbkdf2_hmac_supported(self, algorithm):
- """
- Return True if the hash algorithm is supported for PBKDF2 by this
- backend.
- """
-
- @abc.abstractmethod
- def derive_pbkdf2_hmac(self, algorithm, length, salt, iterations,
- key_material):
- """
- Return length bytes derived from provided PBKDF2 parameters.
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class RSABackend(object):
- @abc.abstractmethod
- def generate_rsa_private_key(self, public_exponent, key_size):
- """
- Generate an RSAPrivateKey instance with public_exponent and a modulus
- of key_size bits.
- """
-
- @abc.abstractmethod
- def rsa_padding_supported(self, padding):
- """
- Returns True if the backend supports the given padding options.
- """
-
- @abc.abstractmethod
- def generate_rsa_parameters_supported(self, public_exponent, key_size):
- """
- Returns True if the backend supports the given parameters for key
- generation.
- """
-
- @abc.abstractmethod
- def load_rsa_private_numbers(self, numbers):
- """
- Returns an RSAPrivateKey provider.
- """
-
- @abc.abstractmethod
- def load_rsa_public_numbers(self, numbers):
- """
- Returns an RSAPublicKey provider.
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class DSABackend(object):
- @abc.abstractmethod
- def generate_dsa_parameters(self, key_size):
- """
- Generate a DSAParameters instance with a modulus of key_size bits.
- """
-
- @abc.abstractmethod
- def generate_dsa_private_key(self, parameters):
- """
- Generate a DSAPrivateKey instance with parameters as a DSAParameters
- object.
- """
-
- @abc.abstractmethod
- def generate_dsa_private_key_and_parameters(self, key_size):
- """
- Generate a DSAPrivateKey instance using key size only.
- """
-
- @abc.abstractmethod
- def dsa_hash_supported(self, algorithm):
- """
- Return True if the hash algorithm is supported by the backend for DSA.
- """
-
- @abc.abstractmethod
- def dsa_parameters_supported(self, p, q, g):
- """
- Return True if the parameters are supported by the backend for DSA.
- """
-
- @abc.abstractmethod
- def load_dsa_private_numbers(self, numbers):
- """
- Returns a DSAPrivateKey provider.
- """
-
- @abc.abstractmethod
- def load_dsa_public_numbers(self, numbers):
- """
- Returns a DSAPublicKey provider.
- """
-
- @abc.abstractmethod
- def load_dsa_parameter_numbers(self, numbers):
- """
- Returns a DSAParameters provider.
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class EllipticCurveBackend(object):
- @abc.abstractmethod
- def elliptic_curve_signature_algorithm_supported(
- self, signature_algorithm, curve
- ):
- """
- Returns True if the backend supports the named elliptic curve with the
- specified signature algorithm.
- """
-
- @abc.abstractmethod
- def elliptic_curve_supported(self, curve):
- """
- Returns True if the backend supports the named elliptic curve.
- """
-
- @abc.abstractmethod
- def generate_elliptic_curve_private_key(self, curve):
- """
- Return an object conforming to the EllipticCurvePrivateKey interface.
- """
-
- @abc.abstractmethod
- def load_elliptic_curve_public_numbers(self, numbers):
- """
- Return an EllipticCurvePublicKey provider using the given numbers.
- """
-
- @abc.abstractmethod
- def load_elliptic_curve_private_numbers(self, numbers):
- """
- Return an EllipticCurvePrivateKey provider using the given numbers.
- """
-
- @abc.abstractmethod
- def elliptic_curve_exchange_algorithm_supported(self, algorithm, curve):
- """
- Returns whether the exchange algorithm is supported by this backend.
- """
-
- @abc.abstractmethod
- def derive_elliptic_curve_private_key(self, private_value, curve):
- """
- Compute the private key given the private value and curve.
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class PEMSerializationBackend(object):
- @abc.abstractmethod
- def load_pem_private_key(self, data, password):
- """
- Loads a private key from PEM encoded data, using the provided password
- if the data is encrypted.
- """
-
- @abc.abstractmethod
- def load_pem_public_key(self, data):
- """
- Loads a public key from PEM encoded data.
- """
-
- @abc.abstractmethod
- def load_pem_parameters(self, data):
- """
- Load encryption parameters from PEM encoded data.
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class DERSerializationBackend(object):
- @abc.abstractmethod
- def load_der_private_key(self, data, password):
- """
- Loads a private key from DER encoded data. Uses the provided password
- if the data is encrypted.
- """
-
- @abc.abstractmethod
- def load_der_public_key(self, data):
- """
- Loads a public key from DER encoded data.
- """
-
- @abc.abstractmethod
- def load_der_parameters(self, data):
- """
- Load encryption parameters from DER encoded data.
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class X509Backend(object):
- @abc.abstractmethod
- def load_pem_x509_certificate(self, data):
- """
- Load an X.509 certificate from PEM encoded data.
- """
-
- @abc.abstractmethod
- def load_der_x509_certificate(self, data):
- """
- Load an X.509 certificate from DER encoded data.
- """
-
- @abc.abstractmethod
- def load_der_x509_csr(self, data):
- """
- Load an X.509 CSR from DER encoded data.
- """
-
- @abc.abstractmethod
- def load_pem_x509_csr(self, data):
- """
- Load an X.509 CSR from PEM encoded data.
- """
-
- @abc.abstractmethod
- def create_x509_csr(self, builder, private_key, algorithm):
- """
- Create and sign an X.509 CSR from a CSR builder object.
- """
-
- @abc.abstractmethod
- def create_x509_certificate(self, builder, private_key, algorithm):
- """
- Create and sign an X.509 certificate from a CertificateBuilder object.
- """
-
- @abc.abstractmethod
- def create_x509_crl(self, builder, private_key, algorithm):
- """
- Create and sign an X.509 CertificateRevocationList from a
- CertificateRevocationListBuilder object.
- """
-
- @abc.abstractmethod
- def create_x509_revoked_certificate(self, builder):
- """
- Create a RevokedCertificate object from a RevokedCertificateBuilder
- object.
- """
-
- @abc.abstractmethod
- def x509_name_bytes(self, name):
- """
- Compute the DER encoded bytes of an X509 Name object.
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class DHBackend(object):
- @abc.abstractmethod
- def generate_dh_parameters(self, generator, key_size):
- """
- Generate a DHParameters instance with a modulus of key_size bits.
- Using the given generator. Often 2 or 5.
- """
-
- @abc.abstractmethod
- def generate_dh_private_key(self, parameters):
- """
- Generate a DHPrivateKey instance with parameters as a DHParameters
- object.
- """
-
- @abc.abstractmethod
- def generate_dh_private_key_and_parameters(self, generator, key_size):
- """
- Generate a DHPrivateKey instance using key size only.
- Using the given generator. Often 2 or 5.
- """
-
- @abc.abstractmethod
- def load_dh_private_numbers(self, numbers):
- """
- Load a DHPrivateKey from DHPrivateNumbers
- """
-
- @abc.abstractmethod
- def load_dh_public_numbers(self, numbers):
- """
- Load a DHPublicKey from DHPublicNumbers.
- """
-
- @abc.abstractmethod
- def load_dh_parameter_numbers(self, numbers):
- """
- Load DHParameters from DHParameterNumbers.
- """
-
- @abc.abstractmethod
- def dh_parameters_supported(self, p, g, q=None):
- """
- Returns whether the backend supports DH with these parameter values.
- """
-
- @abc.abstractmethod
- def dh_x942_serialization_supported(self):
- """
- Returns True if the backend supports the serialization of DH objects
- with subgroup order (q).
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class ScryptBackend(object):
- @abc.abstractmethod
- def derive_scrypt(self, key_material, salt, length, n, r, p):
- """
- Return bytes derived from provided Scrypt parameters.
- """
diff --git a/lib/cryptography/hazmat/backends/openssl/__init__.py b/lib/cryptography/hazmat/backends/openssl/__init__.py
deleted file mode 100644
index 8eadeb6e18..0000000000
--- a/lib/cryptography/hazmat/backends/openssl/__init__.py
+++ /dev/null
@@ -1,10 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-from cryptography.hazmat.backends.openssl.backend import backend
-
-
-__all__ = ["backend"]
diff --git a/lib/cryptography/hazmat/backends/openssl/aead.py b/lib/cryptography/hazmat/backends/openssl/aead.py
deleted file mode 100644
index 9cec3e23b3..0000000000
--- a/lib/cryptography/hazmat/backends/openssl/aead.py
+++ /dev/null
@@ -1,159 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-from cryptography.exceptions import InvalidTag
-
-
-_ENCRYPT = 1
-_DECRYPT = 0
-
-
-def _aead_cipher_name(cipher):
- from cryptography.hazmat.primitives.ciphers.aead import (
- AESCCM, AESGCM, ChaCha20Poly1305
- )
- if isinstance(cipher, ChaCha20Poly1305):
- return b"chacha20-poly1305"
- elif isinstance(cipher, AESCCM):
- return "aes-{0}-ccm".format(len(cipher._key) * 8).encode("ascii")
- else:
- assert isinstance(cipher, AESGCM)
- return "aes-{0}-gcm".format(len(cipher._key) * 8).encode("ascii")
-
-
-def _aead_setup(backend, cipher_name, key, nonce, tag, tag_len, operation):
- evp_cipher = backend._lib.EVP_get_cipherbyname(cipher_name)
- backend.openssl_assert(evp_cipher != backend._ffi.NULL)
- ctx = backend._lib.EVP_CIPHER_CTX_new()
- ctx = backend._ffi.gc(ctx, backend._lib.EVP_CIPHER_CTX_free)
- res = backend._lib.EVP_CipherInit_ex(
- ctx, evp_cipher,
- backend._ffi.NULL,
- backend._ffi.NULL,
- backend._ffi.NULL,
- int(operation == _ENCRYPT)
- )
- backend.openssl_assert(res != 0)
- res = backend._lib.EVP_CIPHER_CTX_set_key_length(ctx, len(key))
- backend.openssl_assert(res != 0)
- res = backend._lib.EVP_CIPHER_CTX_ctrl(
- ctx, backend._lib.EVP_CTRL_AEAD_SET_IVLEN, len(nonce),
- backend._ffi.NULL
- )
- backend.openssl_assert(res != 0)
- if operation == _DECRYPT:
- res = backend._lib.EVP_CIPHER_CTX_ctrl(
- ctx, backend._lib.EVP_CTRL_AEAD_SET_TAG, len(tag), tag
- )
- backend.openssl_assert(res != 0)
- else:
- res = backend._lib.EVP_CIPHER_CTX_ctrl(
- ctx, backend._lib.EVP_CTRL_AEAD_SET_TAG, tag_len, backend._ffi.NULL
- )
-
- res = backend._lib.EVP_CipherInit_ex(
- ctx,
- backend._ffi.NULL,
- backend._ffi.NULL,
- key,
- nonce,
- int(operation == _ENCRYPT)
- )
- backend.openssl_assert(res != 0)
- return ctx
-
-
-def _set_length(backend, ctx, data_len):
- intptr = backend._ffi.new("int *")
- res = backend._lib.EVP_CipherUpdate(
- ctx,
- backend._ffi.NULL,
- intptr,
- backend._ffi.NULL,
- data_len
- )
- backend.openssl_assert(res != 0)
-
-
-def _process_aad(backend, ctx, associated_data):
- outlen = backend._ffi.new("int *")
- res = backend._lib.EVP_CipherUpdate(
- ctx, backend._ffi.NULL, outlen, associated_data, len(associated_data)
- )
- backend.openssl_assert(res != 0)
-
-
-def _process_data(backend, ctx, data):
- outlen = backend._ffi.new("int *")
- buf = backend._ffi.new("unsigned char[]", len(data))
- res = backend._lib.EVP_CipherUpdate(ctx, buf, outlen, data, len(data))
- backend.openssl_assert(res != 0)
- return backend._ffi.buffer(buf, outlen[0])[:]
-
-
-def _encrypt(backend, cipher, nonce, data, associated_data, tag_length):
- from cryptography.hazmat.primitives.ciphers.aead import AESCCM
- cipher_name = _aead_cipher_name(cipher)
- ctx = _aead_setup(
- backend, cipher_name, cipher._key, nonce, None, tag_length, _ENCRYPT
- )
- # CCM requires us to pass the length of the data before processing anything
- # However calling this with any other AEAD results in an error
- if isinstance(cipher, AESCCM):
- _set_length(backend, ctx, len(data))
-
- _process_aad(backend, ctx, associated_data)
- processed_data = _process_data(backend, ctx, data)
- outlen = backend._ffi.new("int *")
- res = backend._lib.EVP_CipherFinal_ex(ctx, backend._ffi.NULL, outlen)
- backend.openssl_assert(res != 0)
- backend.openssl_assert(outlen[0] == 0)
- tag_buf = backend._ffi.new("unsigned char[]", tag_length)
- res = backend._lib.EVP_CIPHER_CTX_ctrl(
- ctx, backend._lib.EVP_CTRL_AEAD_GET_TAG, tag_length, tag_buf
- )
- backend.openssl_assert(res != 0)
- tag = backend._ffi.buffer(tag_buf)[:]
-
- return processed_data + tag
-
-
-def _decrypt(backend, cipher, nonce, data, associated_data, tag_length):
- from cryptography.hazmat.primitives.ciphers.aead import AESCCM
- if len(data) < tag_length:
- raise InvalidTag
- tag = data[-tag_length:]
- data = data[:-tag_length]
- cipher_name = _aead_cipher_name(cipher)
- ctx = _aead_setup(
- backend, cipher_name, cipher._key, nonce, tag, tag_length, _DECRYPT
- )
- # CCM requires us to pass the length of the data before processing anything
- # However calling this with any other AEAD results in an error
- if isinstance(cipher, AESCCM):
- _set_length(backend, ctx, len(data))
-
- _process_aad(backend, ctx, associated_data)
- # CCM has a different error path if the tag doesn't match. Errors are
- # raised in Update and Final is irrelevant.
- if isinstance(cipher, AESCCM):
- outlen = backend._ffi.new("int *")
- buf = backend._ffi.new("unsigned char[]", len(data))
- res = backend._lib.EVP_CipherUpdate(ctx, buf, outlen, data, len(data))
- if res != 1:
- backend._consume_errors()
- raise InvalidTag
-
- processed_data = backend._ffi.buffer(buf, outlen[0])[:]
- else:
- processed_data = _process_data(backend, ctx, data)
- outlen = backend._ffi.new("int *")
- res = backend._lib.EVP_CipherFinal_ex(ctx, backend._ffi.NULL, outlen)
- if res == 0:
- backend._consume_errors()
- raise InvalidTag
-
- return processed_data
diff --git a/lib/cryptography/hazmat/backends/openssl/backend.py b/lib/cryptography/hazmat/backends/openssl/backend.py
deleted file mode 100644
index 19734a54c5..0000000000
--- a/lib/cryptography/hazmat/backends/openssl/backend.py
+++ /dev/null
@@ -1,2113 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import base64
-import calendar
-import collections
-import contextlib
-import itertools
-from contextlib import contextmanager
-
-import asn1crypto.core
-
-import six
-
-from cryptography import utils, x509
-from cryptography.exceptions import UnsupportedAlgorithm, _Reasons
-from cryptography.hazmat.backends.interfaces import (
- CMACBackend, CipherBackend, DERSerializationBackend, DHBackend, DSABackend,
- EllipticCurveBackend, HMACBackend, HashBackend, PBKDF2HMACBackend,
- PEMSerializationBackend, RSABackend, ScryptBackend, X509Backend
-)
-from cryptography.hazmat.backends.openssl import aead
-from cryptography.hazmat.backends.openssl.ciphers import _CipherContext
-from cryptography.hazmat.backends.openssl.cmac import _CMACContext
-from cryptography.hazmat.backends.openssl.decode_asn1 import (
- _CRL_ENTRY_REASON_ENUM_TO_CODE, _Integers
-)
-from cryptography.hazmat.backends.openssl.dh import (
- _DHParameters, _DHPrivateKey, _DHPublicKey, _dh_params_dup
-)
-from cryptography.hazmat.backends.openssl.dsa import (
- _DSAParameters, _DSAPrivateKey, _DSAPublicKey
-)
-from cryptography.hazmat.backends.openssl.ec import (
- _EllipticCurvePrivateKey, _EllipticCurvePublicKey
-)
-from cryptography.hazmat.backends.openssl.encode_asn1 import (
- _CRL_ENTRY_EXTENSION_ENCODE_HANDLERS,
- _CRL_EXTENSION_ENCODE_HANDLERS, _EXTENSION_ENCODE_HANDLERS,
- _OCSP_BASICRESP_EXTENSION_ENCODE_HANDLERS,
- _OCSP_REQUEST_EXTENSION_ENCODE_HANDLERS,
- _encode_asn1_int_gc, _encode_asn1_str_gc, _encode_name_gc, _txt2obj_gc,
-)
-from cryptography.hazmat.backends.openssl.hashes import _HashContext
-from cryptography.hazmat.backends.openssl.hmac import _HMACContext
-from cryptography.hazmat.backends.openssl.ocsp import (
- _OCSPRequest, _OCSPResponse
-)
-from cryptography.hazmat.backends.openssl.rsa import (
- _RSAPrivateKey, _RSAPublicKey
-)
-from cryptography.hazmat.backends.openssl.x25519 import (
- _X25519PrivateKey, _X25519PublicKey
-)
-from cryptography.hazmat.backends.openssl.x509 import (
- _Certificate, _CertificateRevocationList,
- _CertificateSigningRequest, _RevokedCertificate
-)
-from cryptography.hazmat.bindings.openssl import binding
-from cryptography.hazmat.primitives import hashes, serialization
-from cryptography.hazmat.primitives.asymmetric import dsa, ec, rsa
-from cryptography.hazmat.primitives.asymmetric.padding import (
- MGF1, OAEP, PKCS1v15, PSS
-)
-from cryptography.hazmat.primitives.ciphers.algorithms import (
- AES, ARC4, Blowfish, CAST5, Camellia, ChaCha20, IDEA, SEED, TripleDES
-)
-from cryptography.hazmat.primitives.ciphers.modes import (
- CBC, CFB, CFB8, CTR, ECB, GCM, OFB, XTS
-)
-from cryptography.hazmat.primitives.kdf import scrypt
-from cryptography.x509 import ocsp
-
-
-_MemoryBIO = collections.namedtuple("_MemoryBIO", ["bio", "char_ptr"])
-
-
-@utils.register_interface(CipherBackend)
-@utils.register_interface(CMACBackend)
-@utils.register_interface(DERSerializationBackend)
-@utils.register_interface(DHBackend)
-@utils.register_interface(DSABackend)
-@utils.register_interface(EllipticCurveBackend)
-@utils.register_interface(HashBackend)
-@utils.register_interface(HMACBackend)
-@utils.register_interface(PBKDF2HMACBackend)
-@utils.register_interface(RSABackend)
-@utils.register_interface(PEMSerializationBackend)
-@utils.register_interface(X509Backend)
-@utils.register_interface_if(
- binding.Binding().lib.Cryptography_HAS_SCRYPT, ScryptBackend
-)
-class Backend(object):
- """
- OpenSSL API binding interfaces.
- """
- name = "openssl"
-
- def __init__(self):
- self._binding = binding.Binding()
- self._ffi = self._binding.ffi
- self._lib = self._binding.lib
-
- self._cipher_registry = {}
- self._register_default_ciphers()
- self.activate_osrandom_engine()
- self._dh_types = [self._lib.EVP_PKEY_DH]
- if self._lib.Cryptography_HAS_EVP_PKEY_DHX:
- self._dh_types.append(self._lib.EVP_PKEY_DHX)
-
- def openssl_assert(self, ok):
- return binding._openssl_assert(self._lib, ok)
-
- def activate_builtin_random(self):
- # Obtain a new structural reference.
- e = self._lib.ENGINE_get_default_RAND()
- if e != self._ffi.NULL:
- self._lib.ENGINE_unregister_RAND(e)
- # Reset the RNG to use the new engine.
- self._lib.RAND_cleanup()
- # decrement the structural reference from get_default_RAND
- res = self._lib.ENGINE_finish(e)
- self.openssl_assert(res == 1)
-
- @contextlib.contextmanager
- def _get_osurandom_engine(self):
- # Fetches an engine by id and returns it. This creates a structural
- # reference.
- e = self._lib.ENGINE_by_id(self._binding._osrandom_engine_id)
- self.openssl_assert(e != self._ffi.NULL)
- # Initialize the engine for use. This adds a functional reference.
- res = self._lib.ENGINE_init(e)
- self.openssl_assert(res == 1)
-
- try:
- yield e
- finally:
- # Decrement the structural ref incremented by ENGINE_by_id.
- res = self._lib.ENGINE_free(e)
- self.openssl_assert(res == 1)
- # Decrement the functional ref incremented by ENGINE_init.
- res = self._lib.ENGINE_finish(e)
- self.openssl_assert(res == 1)
-
- def activate_osrandom_engine(self):
- # Unregister and free the current engine.
- self.activate_builtin_random()
- with self._get_osurandom_engine() as e:
- # Set the engine as the default RAND provider.
- res = self._lib.ENGINE_set_default_RAND(e)
- self.openssl_assert(res == 1)
- # Reset the RNG to use the new engine.
- self._lib.RAND_cleanup()
-
- def osrandom_engine_implementation(self):
- buf = self._ffi.new("char[]", 64)
- with self._get_osurandom_engine() as e:
- res = self._lib.ENGINE_ctrl_cmd(e, b"get_implementation",
- len(buf), buf,
- self._ffi.NULL, 0)
- self.openssl_assert(res > 0)
- return self._ffi.string(buf).decode('ascii')
-
- def openssl_version_text(self):
- """
- Friendly string name of the loaded OpenSSL library. This is not
- necessarily the same version as it was compiled against.
-
- Example: OpenSSL 1.0.1e 11 Feb 2013
- """
- return self._ffi.string(
- self._lib.OpenSSL_version(self._lib.OPENSSL_VERSION)
- ).decode("ascii")
-
- def openssl_version_number(self):
- return self._lib.OpenSSL_version_num()
-
- def create_hmac_ctx(self, key, algorithm):
- return _HMACContext(self, key, algorithm)
-
- def _evp_md_from_algorithm(self, algorithm):
- if algorithm.name == "blake2b" or algorithm.name == "blake2s":
- alg = "{0}{1}".format(
- algorithm.name, algorithm.digest_size * 8
- ).encode("ascii")
- else:
- alg = algorithm.name.encode("ascii")
-
- evp_md = self._lib.EVP_get_digestbyname(alg)
- return evp_md
-
- def _evp_md_non_null_from_algorithm(self, algorithm):
- evp_md = self._evp_md_from_algorithm(algorithm)
- self.openssl_assert(evp_md != self._ffi.NULL)
- return evp_md
-
- def hash_supported(self, algorithm):
- evp_md = self._evp_md_from_algorithm(algorithm)
- return evp_md != self._ffi.NULL
-
- def hmac_supported(self, algorithm):
- return self.hash_supported(algorithm)
-
- def create_hash_ctx(self, algorithm):
- return _HashContext(self, algorithm)
-
- def cipher_supported(self, cipher, mode):
- try:
- adapter = self._cipher_registry[type(cipher), type(mode)]
- except KeyError:
- return False
- evp_cipher = adapter(self, cipher, mode)
- return self._ffi.NULL != evp_cipher
-
- def register_cipher_adapter(self, cipher_cls, mode_cls, adapter):
- if (cipher_cls, mode_cls) in self._cipher_registry:
- raise ValueError("Duplicate registration for: {0} {1}.".format(
- cipher_cls, mode_cls)
- )
- self._cipher_registry[cipher_cls, mode_cls] = adapter
-
- def _register_default_ciphers(self):
- for mode_cls in [CBC, CTR, ECB, OFB, CFB, CFB8, GCM]:
- self.register_cipher_adapter(
- AES,
- mode_cls,
- GetCipherByName("{cipher.name}-{cipher.key_size}-{mode.name}")
- )
- for mode_cls in [CBC, CTR, ECB, OFB, CFB]:
- self.register_cipher_adapter(
- Camellia,
- mode_cls,
- GetCipherByName("{cipher.name}-{cipher.key_size}-{mode.name}")
- )
- for mode_cls in [CBC, CFB, CFB8, OFB]:
- self.register_cipher_adapter(
- TripleDES,
- mode_cls,
- GetCipherByName("des-ede3-{mode.name}")
- )
- self.register_cipher_adapter(
- TripleDES,
- ECB,
- GetCipherByName("des-ede3")
- )
- for mode_cls in [CBC, CFB, OFB, ECB]:
- self.register_cipher_adapter(
- Blowfish,
- mode_cls,
- GetCipherByName("bf-{mode.name}")
- )
- for mode_cls in [CBC, CFB, OFB, ECB]:
- self.register_cipher_adapter(
- SEED,
- mode_cls,
- GetCipherByName("seed-{mode.name}")
- )
- for cipher_cls, mode_cls in itertools.product(
- [CAST5, IDEA],
- [CBC, OFB, CFB, ECB],
- ):
- self.register_cipher_adapter(
- cipher_cls,
- mode_cls,
- GetCipherByName("{cipher.name}-{mode.name}")
- )
- self.register_cipher_adapter(
- ARC4,
- type(None),
- GetCipherByName("rc4")
- )
- self.register_cipher_adapter(
- ChaCha20,
- type(None),
- GetCipherByName("chacha20")
- )
- self.register_cipher_adapter(AES, XTS, _get_xts_cipher)
-
- def create_symmetric_encryption_ctx(self, cipher, mode):
- return _CipherContext(self, cipher, mode, _CipherContext._ENCRYPT)
-
- def create_symmetric_decryption_ctx(self, cipher, mode):
- return _CipherContext(self, cipher, mode, _CipherContext._DECRYPT)
-
- def pbkdf2_hmac_supported(self, algorithm):
- return self.hmac_supported(algorithm)
-
- def derive_pbkdf2_hmac(self, algorithm, length, salt, iterations,
- key_material):
- buf = self._ffi.new("unsigned char[]", length)
- evp_md = self._evp_md_non_null_from_algorithm(algorithm)
- res = self._lib.PKCS5_PBKDF2_HMAC(
- key_material,
- len(key_material),
- salt,
- len(salt),
- iterations,
- evp_md,
- length,
- buf
- )
- self.openssl_assert(res == 1)
- return self._ffi.buffer(buf)[:]
-
- def _consume_errors(self):
- return binding._consume_errors(self._lib)
-
- def _bn_to_int(self, bn):
- assert bn != self._ffi.NULL
-
- if not six.PY2:
- # Python 3 has constant time from_bytes, so use that.
- bn_num_bytes = self._lib.BN_num_bytes(bn)
- bin_ptr = self._ffi.new("unsigned char[]", bn_num_bytes)
- bin_len = self._lib.BN_bn2bin(bn, bin_ptr)
- # A zero length means the BN has value 0
- self.openssl_assert(bin_len >= 0)
- return int.from_bytes(self._ffi.buffer(bin_ptr)[:bin_len], "big")
- else:
- # Under Python 2 the best we can do is hex()
- hex_cdata = self._lib.BN_bn2hex(bn)
- self.openssl_assert(hex_cdata != self._ffi.NULL)
- hex_str = self._ffi.string(hex_cdata)
- self._lib.OPENSSL_free(hex_cdata)
- return int(hex_str, 16)
-
- def _int_to_bn(self, num, bn=None):
- """
- Converts a python integer to a BIGNUM. The returned BIGNUM will not
- be garbage collected (to support adding them to structs that take
- ownership of the object). Be sure to register it for GC if it will
- be discarded after use.
- """
- assert bn is None or bn != self._ffi.NULL
-
- if bn is None:
- bn = self._ffi.NULL
-
- if not six.PY2:
- # Python 3 has constant time to_bytes, so use that.
-
- binary = num.to_bytes(int(num.bit_length() / 8.0 + 1), "big")
- bn_ptr = self._lib.BN_bin2bn(binary, len(binary), bn)
- self.openssl_assert(bn_ptr != self._ffi.NULL)
- return bn_ptr
-
- else:
- # Under Python 2 the best we can do is hex(), [2:] removes the 0x
- # prefix.
- hex_num = hex(num).rstrip("L")[2:].encode("ascii")
- bn_ptr = self._ffi.new("BIGNUM **")
- bn_ptr[0] = bn
- res = self._lib.BN_hex2bn(bn_ptr, hex_num)
- self.openssl_assert(res != 0)
- self.openssl_assert(bn_ptr[0] != self._ffi.NULL)
- return bn_ptr[0]
-
- def generate_rsa_private_key(self, public_exponent, key_size):
- rsa._verify_rsa_parameters(public_exponent, key_size)
-
- rsa_cdata = self._lib.RSA_new()
- self.openssl_assert(rsa_cdata != self._ffi.NULL)
- rsa_cdata = self._ffi.gc(rsa_cdata, self._lib.RSA_free)
-
- bn = self._int_to_bn(public_exponent)
- bn = self._ffi.gc(bn, self._lib.BN_free)
-
- res = self._lib.RSA_generate_key_ex(
- rsa_cdata, key_size, bn, self._ffi.NULL
- )
- self.openssl_assert(res == 1)
- evp_pkey = self._rsa_cdata_to_evp_pkey(rsa_cdata)
-
- return _RSAPrivateKey(self, rsa_cdata, evp_pkey)
-
- def generate_rsa_parameters_supported(self, public_exponent, key_size):
- return (public_exponent >= 3 and public_exponent & 1 != 0 and
- key_size >= 512)
-
- def load_rsa_private_numbers(self, numbers):
- rsa._check_private_key_components(
- numbers.p,
- numbers.q,
- numbers.d,
- numbers.dmp1,
- numbers.dmq1,
- numbers.iqmp,
- numbers.public_numbers.e,
- numbers.public_numbers.n
- )
- rsa_cdata = self._lib.RSA_new()
- self.openssl_assert(rsa_cdata != self._ffi.NULL)
- rsa_cdata = self._ffi.gc(rsa_cdata, self._lib.RSA_free)
- p = self._int_to_bn(numbers.p)
- q = self._int_to_bn(numbers.q)
- d = self._int_to_bn(numbers.d)
- dmp1 = self._int_to_bn(numbers.dmp1)
- dmq1 = self._int_to_bn(numbers.dmq1)
- iqmp = self._int_to_bn(numbers.iqmp)
- e = self._int_to_bn(numbers.public_numbers.e)
- n = self._int_to_bn(numbers.public_numbers.n)
- res = self._lib.RSA_set0_factors(rsa_cdata, p, q)
- self.openssl_assert(res == 1)
- res = self._lib.RSA_set0_key(rsa_cdata, n, e, d)
- self.openssl_assert(res == 1)
- res = self._lib.RSA_set0_crt_params(rsa_cdata, dmp1, dmq1, iqmp)
- self.openssl_assert(res == 1)
- res = self._lib.RSA_blinding_on(rsa_cdata, self._ffi.NULL)
- self.openssl_assert(res == 1)
- evp_pkey = self._rsa_cdata_to_evp_pkey(rsa_cdata)
-
- return _RSAPrivateKey(self, rsa_cdata, evp_pkey)
-
- def load_rsa_public_numbers(self, numbers):
- rsa._check_public_key_components(numbers.e, numbers.n)
- rsa_cdata = self._lib.RSA_new()
- self.openssl_assert(rsa_cdata != self._ffi.NULL)
- rsa_cdata = self._ffi.gc(rsa_cdata, self._lib.RSA_free)
- e = self._int_to_bn(numbers.e)
- n = self._int_to_bn(numbers.n)
- res = self._lib.RSA_set0_key(rsa_cdata, n, e, self._ffi.NULL)
- self.openssl_assert(res == 1)
- evp_pkey = self._rsa_cdata_to_evp_pkey(rsa_cdata)
-
- return _RSAPublicKey(self, rsa_cdata, evp_pkey)
-
- def _create_evp_pkey_gc(self):
- evp_pkey = self._lib.EVP_PKEY_new()
- self.openssl_assert(evp_pkey != self._ffi.NULL)
- evp_pkey = self._ffi.gc(evp_pkey, self._lib.EVP_PKEY_free)
- return evp_pkey
-
- def _rsa_cdata_to_evp_pkey(self, rsa_cdata):
- evp_pkey = self._create_evp_pkey_gc()
- res = self._lib.EVP_PKEY_set1_RSA(evp_pkey, rsa_cdata)
- self.openssl_assert(res == 1)
- return evp_pkey
-
- def _bytes_to_bio(self, data):
- """
- Return a _MemoryBIO namedtuple of (BIO, char*).
-
- The char* is the storage for the BIO and it must stay alive until the
- BIO is finished with.
- """
- data_char_p = self._ffi.new("char[]", data)
- bio = self._lib.BIO_new_mem_buf(
- data_char_p, len(data)
- )
- self.openssl_assert(bio != self._ffi.NULL)
-
- return _MemoryBIO(self._ffi.gc(bio, self._lib.BIO_free), data_char_p)
-
- def _create_mem_bio_gc(self):
- """
- Creates an empty memory BIO.
- """
- bio_method = self._lib.BIO_s_mem()
- self.openssl_assert(bio_method != self._ffi.NULL)
- bio = self._lib.BIO_new(bio_method)
- self.openssl_assert(bio != self._ffi.NULL)
- bio = self._ffi.gc(bio, self._lib.BIO_free)
- return bio
-
- def _read_mem_bio(self, bio):
- """
- Reads a memory BIO. This only works on memory BIOs.
- """
- buf = self._ffi.new("char **")
- buf_len = self._lib.BIO_get_mem_data(bio, buf)
- self.openssl_assert(buf_len > 0)
- self.openssl_assert(buf[0] != self._ffi.NULL)
- bio_data = self._ffi.buffer(buf[0], buf_len)[:]
- return bio_data
-
- def _evp_pkey_to_private_key(self, evp_pkey):
- """
- Return the appropriate type of PrivateKey given an evp_pkey cdata
- pointer.
- """
-
- key_type = self._lib.EVP_PKEY_id(evp_pkey)
-
- if key_type == self._lib.EVP_PKEY_RSA:
- rsa_cdata = self._lib.EVP_PKEY_get1_RSA(evp_pkey)
- self.openssl_assert(rsa_cdata != self._ffi.NULL)
- rsa_cdata = self._ffi.gc(rsa_cdata, self._lib.RSA_free)
- return _RSAPrivateKey(self, rsa_cdata, evp_pkey)
- elif key_type == self._lib.EVP_PKEY_DSA:
- dsa_cdata = self._lib.EVP_PKEY_get1_DSA(evp_pkey)
- self.openssl_assert(dsa_cdata != self._ffi.NULL)
- dsa_cdata = self._ffi.gc(dsa_cdata, self._lib.DSA_free)
- return _DSAPrivateKey(self, dsa_cdata, evp_pkey)
- elif key_type == self._lib.EVP_PKEY_EC:
- ec_cdata = self._lib.EVP_PKEY_get1_EC_KEY(evp_pkey)
- self.openssl_assert(ec_cdata != self._ffi.NULL)
- ec_cdata = self._ffi.gc(ec_cdata, self._lib.EC_KEY_free)
- return _EllipticCurvePrivateKey(self, ec_cdata, evp_pkey)
- elif key_type in self._dh_types:
- dh_cdata = self._lib.EVP_PKEY_get1_DH(evp_pkey)
- self.openssl_assert(dh_cdata != self._ffi.NULL)
- dh_cdata = self._ffi.gc(dh_cdata, self._lib.DH_free)
- return _DHPrivateKey(self, dh_cdata, evp_pkey)
- else:
- raise UnsupportedAlgorithm("Unsupported key type.")
-
- def _evp_pkey_to_public_key(self, evp_pkey):
- """
- Return the appropriate type of PublicKey given an evp_pkey cdata
- pointer.
- """
-
- key_type = self._lib.EVP_PKEY_id(evp_pkey)
-
- if key_type == self._lib.EVP_PKEY_RSA:
- rsa_cdata = self._lib.EVP_PKEY_get1_RSA(evp_pkey)
- self.openssl_assert(rsa_cdata != self._ffi.NULL)
- rsa_cdata = self._ffi.gc(rsa_cdata, self._lib.RSA_free)
- return _RSAPublicKey(self, rsa_cdata, evp_pkey)
- elif key_type == self._lib.EVP_PKEY_DSA:
- dsa_cdata = self._lib.EVP_PKEY_get1_DSA(evp_pkey)
- self.openssl_assert(dsa_cdata != self._ffi.NULL)
- dsa_cdata = self._ffi.gc(dsa_cdata, self._lib.DSA_free)
- return _DSAPublicKey(self, dsa_cdata, evp_pkey)
- elif key_type == self._lib.EVP_PKEY_EC:
- ec_cdata = self._lib.EVP_PKEY_get1_EC_KEY(evp_pkey)
- self.openssl_assert(ec_cdata != self._ffi.NULL)
- ec_cdata = self._ffi.gc(ec_cdata, self._lib.EC_KEY_free)
- return _EllipticCurvePublicKey(self, ec_cdata, evp_pkey)
- elif key_type in self._dh_types:
- dh_cdata = self._lib.EVP_PKEY_get1_DH(evp_pkey)
- self.openssl_assert(dh_cdata != self._ffi.NULL)
- dh_cdata = self._ffi.gc(dh_cdata, self._lib.DH_free)
- return _DHPublicKey(self, dh_cdata, evp_pkey)
- else:
- raise UnsupportedAlgorithm("Unsupported key type.")
-
- def _oaep_hash_supported(self, algorithm):
- if self._lib.Cryptography_HAS_RSA_OAEP_MD:
- return isinstance(
- algorithm, (
- hashes.SHA1,
- hashes.SHA224,
- hashes.SHA256,
- hashes.SHA384,
- hashes.SHA512,
- )
- )
- else:
- return isinstance(algorithm, hashes.SHA1)
-
- def rsa_padding_supported(self, padding):
- if isinstance(padding, PKCS1v15):
- return True
- elif isinstance(padding, PSS) and isinstance(padding._mgf, MGF1):
- return self.hash_supported(padding._mgf._algorithm)
- elif isinstance(padding, OAEP) and isinstance(padding._mgf, MGF1):
- return (
- self._oaep_hash_supported(padding._mgf._algorithm) and
- self._oaep_hash_supported(padding._algorithm) and
- (
- (padding._label is None or len(padding._label) == 0) or
- self._lib.Cryptography_HAS_RSA_OAEP_LABEL == 1
- )
- )
- else:
- return False
-
- def generate_dsa_parameters(self, key_size):
- if key_size not in (1024, 2048, 3072):
- raise ValueError("Key size must be 1024 or 2048 or 3072 bits.")
-
- ctx = self._lib.DSA_new()
- self.openssl_assert(ctx != self._ffi.NULL)
- ctx = self._ffi.gc(ctx, self._lib.DSA_free)
-
- res = self._lib.DSA_generate_parameters_ex(
- ctx, key_size, self._ffi.NULL, 0,
- self._ffi.NULL, self._ffi.NULL, self._ffi.NULL
- )
-
- self.openssl_assert(res == 1)
-
- return _DSAParameters(self, ctx)
-
- def generate_dsa_private_key(self, parameters):
- ctx = self._lib.DSAparams_dup(parameters._dsa_cdata)
- self.openssl_assert(ctx != self._ffi.NULL)
- ctx = self._ffi.gc(ctx, self._lib.DSA_free)
- self._lib.DSA_generate_key(ctx)
- evp_pkey = self._dsa_cdata_to_evp_pkey(ctx)
-
- return _DSAPrivateKey(self, ctx, evp_pkey)
-
- def generate_dsa_private_key_and_parameters(self, key_size):
- parameters = self.generate_dsa_parameters(key_size)
- return self.generate_dsa_private_key(parameters)
-
- def _dsa_cdata_set_values(self, dsa_cdata, p, q, g, pub_key, priv_key):
- res = self._lib.DSA_set0_pqg(dsa_cdata, p, q, g)
- self.openssl_assert(res == 1)
- res = self._lib.DSA_set0_key(dsa_cdata, pub_key, priv_key)
- self.openssl_assert(res == 1)
-
- def load_dsa_private_numbers(self, numbers):
- dsa._check_dsa_private_numbers(numbers)
- parameter_numbers = numbers.public_numbers.parameter_numbers
-
- dsa_cdata = self._lib.DSA_new()
- self.openssl_assert(dsa_cdata != self._ffi.NULL)
- dsa_cdata = self._ffi.gc(dsa_cdata, self._lib.DSA_free)
-
- p = self._int_to_bn(parameter_numbers.p)
- q = self._int_to_bn(parameter_numbers.q)
- g = self._int_to_bn(parameter_numbers.g)
- pub_key = self._int_to_bn(numbers.public_numbers.y)
- priv_key = self._int_to_bn(numbers.x)
- self._dsa_cdata_set_values(dsa_cdata, p, q, g, pub_key, priv_key)
-
- evp_pkey = self._dsa_cdata_to_evp_pkey(dsa_cdata)
-
- return _DSAPrivateKey(self, dsa_cdata, evp_pkey)
-
- def load_dsa_public_numbers(self, numbers):
- dsa._check_dsa_parameters(numbers.parameter_numbers)
- dsa_cdata = self._lib.DSA_new()
- self.openssl_assert(dsa_cdata != self._ffi.NULL)
- dsa_cdata = self._ffi.gc(dsa_cdata, self._lib.DSA_free)
-
- p = self._int_to_bn(numbers.parameter_numbers.p)
- q = self._int_to_bn(numbers.parameter_numbers.q)
- g = self._int_to_bn(numbers.parameter_numbers.g)
- pub_key = self._int_to_bn(numbers.y)
- priv_key = self._ffi.NULL
- self._dsa_cdata_set_values(dsa_cdata, p, q, g, pub_key, priv_key)
-
- evp_pkey = self._dsa_cdata_to_evp_pkey(dsa_cdata)
-
- return _DSAPublicKey(self, dsa_cdata, evp_pkey)
-
- def load_dsa_parameter_numbers(self, numbers):
- dsa._check_dsa_parameters(numbers)
- dsa_cdata = self._lib.DSA_new()
- self.openssl_assert(dsa_cdata != self._ffi.NULL)
- dsa_cdata = self._ffi.gc(dsa_cdata, self._lib.DSA_free)
-
- p = self._int_to_bn(numbers.p)
- q = self._int_to_bn(numbers.q)
- g = self._int_to_bn(numbers.g)
- res = self._lib.DSA_set0_pqg(dsa_cdata, p, q, g)
- self.openssl_assert(res == 1)
-
- return _DSAParameters(self, dsa_cdata)
-
- def _dsa_cdata_to_evp_pkey(self, dsa_cdata):
- evp_pkey = self._create_evp_pkey_gc()
- res = self._lib.EVP_PKEY_set1_DSA(evp_pkey, dsa_cdata)
- self.openssl_assert(res == 1)
- return evp_pkey
-
- def dsa_hash_supported(self, algorithm):
- return self.hash_supported(algorithm)
-
- def dsa_parameters_supported(self, p, q, g):
- return True
-
- def cmac_algorithm_supported(self, algorithm):
- return self.cipher_supported(
- algorithm, CBC(b"\x00" * algorithm.block_size)
- )
-
- def create_cmac_ctx(self, algorithm):
- return _CMACContext(self, algorithm)
-
- def create_x509_csr(self, builder, private_key, algorithm):
- if not isinstance(algorithm, hashes.HashAlgorithm):
- raise TypeError('Algorithm must be a registered hash algorithm.')
-
- if (
- isinstance(algorithm, hashes.MD5) and not
- isinstance(private_key, rsa.RSAPrivateKey)
- ):
- raise ValueError(
- "MD5 is not a supported hash algorithm for EC/DSA CSRs"
- )
-
- # Resolve the signature algorithm.
- evp_md = self._evp_md_non_null_from_algorithm(algorithm)
-
- # Create an empty request.
- x509_req = self._lib.X509_REQ_new()
- self.openssl_assert(x509_req != self._ffi.NULL)
- x509_req = self._ffi.gc(x509_req, self._lib.X509_REQ_free)
-
- # Set x509 version.
- res = self._lib.X509_REQ_set_version(x509_req, x509.Version.v1.value)
- self.openssl_assert(res == 1)
-
- # Set subject name.
- res = self._lib.X509_REQ_set_subject_name(
- x509_req, _encode_name_gc(self, builder._subject_name)
- )
- self.openssl_assert(res == 1)
-
- # Set subject public key.
- public_key = private_key.public_key()
- res = self._lib.X509_REQ_set_pubkey(
- x509_req, public_key._evp_pkey
- )
- self.openssl_assert(res == 1)
-
- # Add extensions.
- sk_extension = self._lib.sk_X509_EXTENSION_new_null()
- self.openssl_assert(sk_extension != self._ffi.NULL)
- sk_extension = self._ffi.gc(
- sk_extension,
- lambda x: self._lib.sk_X509_EXTENSION_pop_free(
- x, self._ffi.addressof(
- self._lib._original_lib, "X509_EXTENSION_free"
- )
- )
- )
- # Don't GC individual extensions because the memory is owned by
- # sk_extensions and will be freed along with it.
- self._create_x509_extensions(
- extensions=builder._extensions,
- handlers=_EXTENSION_ENCODE_HANDLERS,
- x509_obj=sk_extension,
- add_func=self._lib.sk_X509_EXTENSION_insert,
- gc=False
- )
- res = self._lib.X509_REQ_add_extensions(x509_req, sk_extension)
- self.openssl_assert(res == 1)
-
- # Sign the request using the requester's private key.
- res = self._lib.X509_REQ_sign(
- x509_req, private_key._evp_pkey, evp_md
- )
- if res == 0:
- errors = self._consume_errors()
- self.openssl_assert(
- errors[0]._lib_reason_match(
- self._lib.ERR_LIB_RSA,
- self._lib.RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY
- )
- )
-
- raise ValueError("Digest too big for RSA key")
-
- return _CertificateSigningRequest(self, x509_req)
-
- def create_x509_certificate(self, builder, private_key, algorithm):
- if not isinstance(builder, x509.CertificateBuilder):
- raise TypeError('Builder type mismatch.')
- if not isinstance(algorithm, hashes.HashAlgorithm):
- raise TypeError('Algorithm must be a registered hash algorithm.')
-
- if (
- isinstance(algorithm, hashes.MD5) and not
- isinstance(private_key, rsa.RSAPrivateKey)
- ):
- raise ValueError(
- "MD5 is not a supported hash algorithm for EC/DSA certificates"
- )
-
- # Resolve the signature algorithm.
- evp_md = self._evp_md_non_null_from_algorithm(algorithm)
-
- # Create an empty certificate.
- x509_cert = self._lib.X509_new()
- x509_cert = self._ffi.gc(x509_cert, backend._lib.X509_free)
-
- # Set the x509 version.
- res = self._lib.X509_set_version(x509_cert, builder._version.value)
- self.openssl_assert(res == 1)
-
- # Set the subject's name.
- res = self._lib.X509_set_subject_name(
- x509_cert, _encode_name_gc(self, builder._subject_name)
- )
- self.openssl_assert(res == 1)
-
- # Set the subject's public key.
- res = self._lib.X509_set_pubkey(
- x509_cert, builder._public_key._evp_pkey
- )
- self.openssl_assert(res == 1)
-
- # Set the certificate serial number.
- serial_number = _encode_asn1_int_gc(self, builder._serial_number)
- res = self._lib.X509_set_serialNumber(x509_cert, serial_number)
- self.openssl_assert(res == 1)
-
- # Set the "not before" time.
- self._set_asn1_time(
- self._lib.X509_get_notBefore(x509_cert), builder._not_valid_before
- )
-
- # Set the "not after" time.
- self._set_asn1_time(
- self._lib.X509_get_notAfter(x509_cert), builder._not_valid_after
- )
-
- # Add extensions.
- self._create_x509_extensions(
- extensions=builder._extensions,
- handlers=_EXTENSION_ENCODE_HANDLERS,
- x509_obj=x509_cert,
- add_func=self._lib.X509_add_ext,
- gc=True
- )
-
- # Set the issuer name.
- res = self._lib.X509_set_issuer_name(
- x509_cert, _encode_name_gc(self, builder._issuer_name)
- )
- self.openssl_assert(res == 1)
-
- # Sign the certificate with the issuer's private key.
- res = self._lib.X509_sign(
- x509_cert, private_key._evp_pkey, evp_md
- )
- if res == 0:
- errors = self._consume_errors()
- self.openssl_assert(
- errors[0]._lib_reason_match(
- self._lib.ERR_LIB_RSA,
- self._lib.RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY
- )
- )
- raise ValueError("Digest too big for RSA key")
-
- return _Certificate(self, x509_cert)
-
- def _set_asn1_time(self, asn1_time, time):
- timestamp = calendar.timegm(time.timetuple())
- res = self._lib.ASN1_TIME_set(asn1_time, timestamp)
- if res == self._ffi.NULL:
- errors = self._consume_errors()
- self.openssl_assert(
- errors[0]._lib_reason_match(
- self._lib.ERR_LIB_ASN1,
- self._lib.ASN1_R_ERROR_GETTING_TIME
- )
- )
- raise ValueError(
- "Invalid time. This error can occur if you set a time too far "
- "in the future on Windows."
- )
-
- def _create_asn1_time(self, time):
- asn1_time = self._lib.ASN1_TIME_new()
- self.openssl_assert(asn1_time != self._ffi.NULL)
- asn1_time = self._ffi.gc(asn1_time, self._lib.ASN1_TIME_free)
- self._set_asn1_time(asn1_time, time)
- return asn1_time
-
- def create_x509_crl(self, builder, private_key, algorithm):
- if not isinstance(builder, x509.CertificateRevocationListBuilder):
- raise TypeError('Builder type mismatch.')
- if not isinstance(algorithm, hashes.HashAlgorithm):
- raise TypeError('Algorithm must be a registered hash algorithm.')
-
- if (
- isinstance(algorithm, hashes.MD5) and not
- isinstance(private_key, rsa.RSAPrivateKey)
- ):
- raise ValueError(
- "MD5 is not a supported hash algorithm for EC/DSA CRLs"
- )
-
- evp_md = self._evp_md_non_null_from_algorithm(algorithm)
-
- # Create an empty CRL.
- x509_crl = self._lib.X509_CRL_new()
- x509_crl = self._ffi.gc(x509_crl, backend._lib.X509_CRL_free)
-
- # Set the x509 CRL version. We only support v2 (integer value 1).
- res = self._lib.X509_CRL_set_version(x509_crl, 1)
- self.openssl_assert(res == 1)
-
- # Set the issuer name.
- res = self._lib.X509_CRL_set_issuer_name(
- x509_crl, _encode_name_gc(self, builder._issuer_name)
- )
- self.openssl_assert(res == 1)
-
- # Set the last update time.
- last_update = self._create_asn1_time(builder._last_update)
- res = self._lib.X509_CRL_set_lastUpdate(x509_crl, last_update)
- self.openssl_assert(res == 1)
-
- # Set the next update time.
- next_update = self._create_asn1_time(builder._next_update)
- res = self._lib.X509_CRL_set_nextUpdate(x509_crl, next_update)
- self.openssl_assert(res == 1)
-
- # Add extensions.
- self._create_x509_extensions(
- extensions=builder._extensions,
- handlers=_CRL_EXTENSION_ENCODE_HANDLERS,
- x509_obj=x509_crl,
- add_func=self._lib.X509_CRL_add_ext,
- gc=True
- )
-
- # add revoked certificates
- for revoked_cert in builder._revoked_certificates:
- # Duplicating because the X509_CRL takes ownership and will free
- # this memory when X509_CRL_free is called.
- revoked = self._lib.Cryptography_X509_REVOKED_dup(
- revoked_cert._x509_revoked
- )
- self.openssl_assert(revoked != self._ffi.NULL)
- res = self._lib.X509_CRL_add0_revoked(x509_crl, revoked)
- self.openssl_assert(res == 1)
-
- res = self._lib.X509_CRL_sign(
- x509_crl, private_key._evp_pkey, evp_md
- )
- if res == 0:
- errors = self._consume_errors()
- self.openssl_assert(
- errors[0]._lib_reason_match(
- self._lib.ERR_LIB_RSA,
- self._lib.RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY
- )
- )
- raise ValueError("Digest too big for RSA key")
-
- return _CertificateRevocationList(self, x509_crl)
-
- def _create_x509_extensions(self, extensions, handlers, x509_obj,
- add_func, gc):
- for i, extension in enumerate(extensions):
- x509_extension = self._create_x509_extension(
- handlers, extension
- )
- self.openssl_assert(x509_extension != self._ffi.NULL)
-
- if gc:
- x509_extension = self._ffi.gc(
- x509_extension, self._lib.X509_EXTENSION_free
- )
- res = add_func(x509_obj, x509_extension, i)
- self.openssl_assert(res >= 1)
-
- def _create_raw_x509_extension(self, extension, value):
- obj = _txt2obj_gc(self, extension.oid.dotted_string)
- return self._lib.X509_EXTENSION_create_by_OBJ(
- self._ffi.NULL, obj, 1 if extension.critical else 0, value
- )
-
- def _create_x509_extension(self, handlers, extension):
- if isinstance(extension.value, x509.UnrecognizedExtension):
- value = _encode_asn1_str_gc(self, extension.value.value)
- return self._create_raw_x509_extension(extension, value)
- elif isinstance(extension.value, x509.TLSFeature):
- asn1 = _Integers([x.value for x in extension.value]).dump()
- value = _encode_asn1_str_gc(self, asn1)
- return self._create_raw_x509_extension(extension, value)
- elif isinstance(extension.value, x509.PrecertPoison):
- asn1 = asn1crypto.core.Null().dump()
- value = _encode_asn1_str_gc(self, asn1)
- return self._create_raw_x509_extension(extension, value)
- else:
- try:
- encode = handlers[extension.oid]
- except KeyError:
- raise NotImplementedError(
- 'Extension not supported: {0}'.format(extension.oid)
- )
-
- ext_struct = encode(self, extension.value)
- nid = self._lib.OBJ_txt2nid(
- extension.oid.dotted_string.encode("ascii")
- )
- backend.openssl_assert(nid != self._lib.NID_undef)
- return self._lib.X509V3_EXT_i2d(
- nid, 1 if extension.critical else 0, ext_struct
- )
-
- def create_x509_revoked_certificate(self, builder):
- if not isinstance(builder, x509.RevokedCertificateBuilder):
- raise TypeError('Builder type mismatch.')
-
- x509_revoked = self._lib.X509_REVOKED_new()
- self.openssl_assert(x509_revoked != self._ffi.NULL)
- x509_revoked = self._ffi.gc(x509_revoked, self._lib.X509_REVOKED_free)
- serial_number = _encode_asn1_int_gc(self, builder._serial_number)
- res = self._lib.X509_REVOKED_set_serialNumber(
- x509_revoked, serial_number
- )
- self.openssl_assert(res == 1)
- rev_date = self._create_asn1_time(builder._revocation_date)
- res = self._lib.X509_REVOKED_set_revocationDate(x509_revoked, rev_date)
- self.openssl_assert(res == 1)
- # add CRL entry extensions
- self._create_x509_extensions(
- extensions=builder._extensions,
- handlers=_CRL_ENTRY_EXTENSION_ENCODE_HANDLERS,
- x509_obj=x509_revoked,
- add_func=self._lib.X509_REVOKED_add_ext,
- gc=True
- )
- return _RevokedCertificate(self, None, x509_revoked)
-
- def load_pem_private_key(self, data, password):
- return self._load_key(
- self._lib.PEM_read_bio_PrivateKey,
- self._evp_pkey_to_private_key,
- data,
- password,
- )
-
- def load_pem_public_key(self, data):
- mem_bio = self._bytes_to_bio(data)
- evp_pkey = self._lib.PEM_read_bio_PUBKEY(
- mem_bio.bio, self._ffi.NULL, self._ffi.NULL, self._ffi.NULL
- )
- if evp_pkey != self._ffi.NULL:
- evp_pkey = self._ffi.gc(evp_pkey, self._lib.EVP_PKEY_free)
- return self._evp_pkey_to_public_key(evp_pkey)
- else:
- # It's not a (RSA/DSA/ECDSA) subjectPublicKeyInfo, but we still
- # need to check to see if it is a pure PKCS1 RSA public key (not
- # embedded in a subjectPublicKeyInfo)
- self._consume_errors()
- res = self._lib.BIO_reset(mem_bio.bio)
- self.openssl_assert(res == 1)
- rsa_cdata = self._lib.PEM_read_bio_RSAPublicKey(
- mem_bio.bio, self._ffi.NULL, self._ffi.NULL, self._ffi.NULL
- )
- if rsa_cdata != self._ffi.NULL:
- rsa_cdata = self._ffi.gc(rsa_cdata, self._lib.RSA_free)
- evp_pkey = self._rsa_cdata_to_evp_pkey(rsa_cdata)
- return _RSAPublicKey(self, rsa_cdata, evp_pkey)
- else:
- self._handle_key_loading_error()
-
- def load_pem_parameters(self, data):
- mem_bio = self._bytes_to_bio(data)
- # only DH is supported currently
- dh_cdata = self._lib.PEM_read_bio_DHparams(
- mem_bio.bio, self._ffi.NULL, self._ffi.NULL, self._ffi.NULL)
- if dh_cdata != self._ffi.NULL:
- dh_cdata = self._ffi.gc(dh_cdata, self._lib.DH_free)
- return _DHParameters(self, dh_cdata)
- else:
- self._handle_key_loading_error()
-
- def load_der_private_key(self, data, password):
- # OpenSSL has a function called d2i_AutoPrivateKey that in theory
- # handles this automatically, however it doesn't handle encrypted
- # private keys. Instead we try to load the key two different ways.
- # First we'll try to load it as a traditional key.
- bio_data = self._bytes_to_bio(data)
- key = self._evp_pkey_from_der_traditional_key(bio_data, password)
- if key:
- return self._evp_pkey_to_private_key(key)
- else:
- # Finally we try to load it with the method that handles encrypted
- # PKCS8 properly.
- return self._load_key(
- self._lib.d2i_PKCS8PrivateKey_bio,
- self._evp_pkey_to_private_key,
- data,
- password,
- )
-
- def _evp_pkey_from_der_traditional_key(self, bio_data, password):
- key = self._lib.d2i_PrivateKey_bio(bio_data.bio, self._ffi.NULL)
- if key != self._ffi.NULL:
- key = self._ffi.gc(key, self._lib.EVP_PKEY_free)
- if password is not None:
- raise TypeError(
- "Password was given but private key is not encrypted."
- )
-
- return key
- else:
- self._consume_errors()
- return None
-
- def load_der_public_key(self, data):
- mem_bio = self._bytes_to_bio(data)
- evp_pkey = self._lib.d2i_PUBKEY_bio(mem_bio.bio, self._ffi.NULL)
- if evp_pkey != self._ffi.NULL:
- evp_pkey = self._ffi.gc(evp_pkey, self._lib.EVP_PKEY_free)
- return self._evp_pkey_to_public_key(evp_pkey)
- else:
- # It's not a (RSA/DSA/ECDSA) subjectPublicKeyInfo, but we still
- # need to check to see if it is a pure PKCS1 RSA public key (not
- # embedded in a subjectPublicKeyInfo)
- self._consume_errors()
- res = self._lib.BIO_reset(mem_bio.bio)
- self.openssl_assert(res == 1)
- rsa_cdata = self._lib.d2i_RSAPublicKey_bio(
- mem_bio.bio, self._ffi.NULL
- )
- if rsa_cdata != self._ffi.NULL:
- rsa_cdata = self._ffi.gc(rsa_cdata, self._lib.RSA_free)
- evp_pkey = self._rsa_cdata_to_evp_pkey(rsa_cdata)
- return _RSAPublicKey(self, rsa_cdata, evp_pkey)
- else:
- self._handle_key_loading_error()
-
- def load_der_parameters(self, data):
- mem_bio = self._bytes_to_bio(data)
- dh_cdata = self._lib.d2i_DHparams_bio(
- mem_bio.bio, self._ffi.NULL
- )
- if dh_cdata != self._ffi.NULL:
- dh_cdata = self._ffi.gc(dh_cdata, self._lib.DH_free)
- return _DHParameters(self, dh_cdata)
- elif self._lib.Cryptography_HAS_EVP_PKEY_DHX:
- # We check to see if the is dhx.
- self._consume_errors()
- res = self._lib.BIO_reset(mem_bio.bio)
- self.openssl_assert(res == 1)
- dh_cdata = self._lib.Cryptography_d2i_DHxparams_bio(
- mem_bio.bio, self._ffi.NULL
- )
- if dh_cdata != self._ffi.NULL:
- dh_cdata = self._ffi.gc(dh_cdata, self._lib.DH_free)
- return _DHParameters(self, dh_cdata)
-
- self._handle_key_loading_error()
-
- def load_pem_x509_certificate(self, data):
- mem_bio = self._bytes_to_bio(data)
- x509 = self._lib.PEM_read_bio_X509(
- mem_bio.bio, self._ffi.NULL, self._ffi.NULL, self._ffi.NULL
- )
- if x509 == self._ffi.NULL:
- self._consume_errors()
- raise ValueError("Unable to load certificate")
-
- x509 = self._ffi.gc(x509, self._lib.X509_free)
- return _Certificate(self, x509)
-
- def load_der_x509_certificate(self, data):
- mem_bio = self._bytes_to_bio(data)
- x509 = self._lib.d2i_X509_bio(mem_bio.bio, self._ffi.NULL)
- if x509 == self._ffi.NULL:
- self._consume_errors()
- raise ValueError("Unable to load certificate")
-
- x509 = self._ffi.gc(x509, self._lib.X509_free)
- return _Certificate(self, x509)
-
- def load_pem_x509_crl(self, data):
- mem_bio = self._bytes_to_bio(data)
- x509_crl = self._lib.PEM_read_bio_X509_CRL(
- mem_bio.bio, self._ffi.NULL, self._ffi.NULL, self._ffi.NULL
- )
- if x509_crl == self._ffi.NULL:
- self._consume_errors()
- raise ValueError("Unable to load CRL")
-
- x509_crl = self._ffi.gc(x509_crl, self._lib.X509_CRL_free)
- return _CertificateRevocationList(self, x509_crl)
-
- def load_der_x509_crl(self, data):
- mem_bio = self._bytes_to_bio(data)
- x509_crl = self._lib.d2i_X509_CRL_bio(mem_bio.bio, self._ffi.NULL)
- if x509_crl == self._ffi.NULL:
- self._consume_errors()
- raise ValueError("Unable to load CRL")
-
- x509_crl = self._ffi.gc(x509_crl, self._lib.X509_CRL_free)
- return _CertificateRevocationList(self, x509_crl)
-
- def load_pem_x509_csr(self, data):
- mem_bio = self._bytes_to_bio(data)
- x509_req = self._lib.PEM_read_bio_X509_REQ(
- mem_bio.bio, self._ffi.NULL, self._ffi.NULL, self._ffi.NULL
- )
- if x509_req == self._ffi.NULL:
- self._consume_errors()
- raise ValueError("Unable to load request")
-
- x509_req = self._ffi.gc(x509_req, self._lib.X509_REQ_free)
- return _CertificateSigningRequest(self, x509_req)
-
- def load_der_x509_csr(self, data):
- mem_bio = self._bytes_to_bio(data)
- x509_req = self._lib.d2i_X509_REQ_bio(mem_bio.bio, self._ffi.NULL)
- if x509_req == self._ffi.NULL:
- self._consume_errors()
- raise ValueError("Unable to load request")
-
- x509_req = self._ffi.gc(x509_req, self._lib.X509_REQ_free)
- return _CertificateSigningRequest(self, x509_req)
-
- def _load_key(self, openssl_read_func, convert_func, data, password):
- mem_bio = self._bytes_to_bio(data)
-
- if password is not None and not isinstance(password, bytes):
- raise TypeError("Password must be bytes")
-
- userdata = self._ffi.new("CRYPTOGRAPHY_PASSWORD_DATA *")
- if password is not None:
- password_buf = self._ffi.new("char []", password)
- userdata.password = password_buf
- userdata.length = len(password)
-
- evp_pkey = openssl_read_func(
- mem_bio.bio,
- self._ffi.NULL,
- self._ffi.addressof(
- self._lib._original_lib, "Cryptography_pem_password_cb"
- ),
- userdata,
- )
-
- if evp_pkey == self._ffi.NULL:
- if userdata.error != 0:
- errors = self._consume_errors()
- self.openssl_assert(errors)
- if userdata.error == -1:
- raise TypeError(
- "Password was not given but private key is encrypted"
- )
- else:
- assert userdata.error == -2
- raise ValueError(
- "Passwords longer than {0} bytes are not supported "
- "by this backend.".format(userdata.maxsize - 1)
- )
- else:
- self._handle_key_loading_error()
-
- evp_pkey = self._ffi.gc(evp_pkey, self._lib.EVP_PKEY_free)
-
- if password is not None and userdata.called == 0:
- raise TypeError(
- "Password was given but private key is not encrypted.")
-
- assert (
- (password is not None and userdata.called == 1) or
- password is None
- )
-
- return convert_func(evp_pkey)
-
- def _handle_key_loading_error(self):
- errors = self._consume_errors()
-
- if not errors:
- raise ValueError("Could not deserialize key data.")
-
- elif (
- errors[0]._lib_reason_match(
- self._lib.ERR_LIB_EVP, self._lib.EVP_R_BAD_DECRYPT
- ) or errors[0]._lib_reason_match(
- self._lib.ERR_LIB_PKCS12,
- self._lib.PKCS12_R_PKCS12_CIPHERFINAL_ERROR
- )
- ):
- raise ValueError("Bad decrypt. Incorrect password?")
-
- elif (
- errors[0]._lib_reason_match(
- self._lib.ERR_LIB_EVP, self._lib.EVP_R_UNKNOWN_PBE_ALGORITHM
- ) or errors[0]._lib_reason_match(
- self._lib.ERR_LIB_PEM, self._lib.PEM_R_UNSUPPORTED_ENCRYPTION
- )
- ):
- raise UnsupportedAlgorithm(
- "PEM data is encrypted with an unsupported cipher",
- _Reasons.UNSUPPORTED_CIPHER
- )
-
- elif any(
- error._lib_reason_match(
- self._lib.ERR_LIB_EVP,
- self._lib.EVP_R_UNSUPPORTED_PRIVATE_KEY_ALGORITHM
- )
- for error in errors
- ):
- raise ValueError("Unsupported public key algorithm.")
-
- else:
- assert errors[0].lib in (
- self._lib.ERR_LIB_EVP,
- self._lib.ERR_LIB_PEM,
- self._lib.ERR_LIB_ASN1,
- )
- raise ValueError("Could not deserialize key data.")
-
- def elliptic_curve_supported(self, curve):
- try:
- curve_nid = self._elliptic_curve_to_nid(curve)
- except UnsupportedAlgorithm:
- curve_nid = self._lib.NID_undef
-
- group = self._lib.EC_GROUP_new_by_curve_name(curve_nid)
-
- if group == self._ffi.NULL:
- errors = self._consume_errors()
- self.openssl_assert(
- curve_nid == self._lib.NID_undef or
- errors[0]._lib_reason_match(
- self._lib.ERR_LIB_EC,
- self._lib.EC_R_UNKNOWN_GROUP
- )
- )
- return False
- else:
- self.openssl_assert(curve_nid != self._lib.NID_undef)
- self._lib.EC_GROUP_free(group)
- return True
-
- def elliptic_curve_signature_algorithm_supported(
- self, signature_algorithm, curve
- ):
- # We only support ECDSA right now.
- if not isinstance(signature_algorithm, ec.ECDSA):
- return False
-
- return self.elliptic_curve_supported(curve)
-
- def generate_elliptic_curve_private_key(self, curve):
- """
- Generate a new private key on the named curve.
- """
-
- if self.elliptic_curve_supported(curve):
- curve_nid = self._elliptic_curve_to_nid(curve)
-
- ec_cdata = self._lib.EC_KEY_new_by_curve_name(curve_nid)
- self.openssl_assert(ec_cdata != self._ffi.NULL)
- ec_cdata = self._ffi.gc(ec_cdata, self._lib.EC_KEY_free)
-
- res = self._lib.EC_KEY_generate_key(ec_cdata)
- self.openssl_assert(res == 1)
-
- evp_pkey = self._ec_cdata_to_evp_pkey(ec_cdata)
-
- return _EllipticCurvePrivateKey(self, ec_cdata, evp_pkey)
- else:
- raise UnsupportedAlgorithm(
- "Backend object does not support {0}.".format(curve.name),
- _Reasons.UNSUPPORTED_ELLIPTIC_CURVE
- )
-
- def load_elliptic_curve_private_numbers(self, numbers):
- public = numbers.public_numbers
-
- curve_nid = self._elliptic_curve_to_nid(public.curve)
-
- ec_cdata = self._lib.EC_KEY_new_by_curve_name(curve_nid)
- self.openssl_assert(ec_cdata != self._ffi.NULL)
- ec_cdata = self._ffi.gc(ec_cdata, self._lib.EC_KEY_free)
-
- private_value = self._ffi.gc(
- self._int_to_bn(numbers.private_value), self._lib.BN_clear_free
- )
- res = self._lib.EC_KEY_set_private_key(ec_cdata, private_value)
- self.openssl_assert(res == 1)
-
- ec_cdata = self._ec_key_set_public_key_affine_coordinates(
- ec_cdata, public.x, public.y)
-
- evp_pkey = self._ec_cdata_to_evp_pkey(ec_cdata)
-
- return _EllipticCurvePrivateKey(self, ec_cdata, evp_pkey)
-
- def load_elliptic_curve_public_numbers(self, numbers):
- curve_nid = self._elliptic_curve_to_nid(numbers.curve)
-
- ec_cdata = self._lib.EC_KEY_new_by_curve_name(curve_nid)
- self.openssl_assert(ec_cdata != self._ffi.NULL)
- ec_cdata = self._ffi.gc(ec_cdata, self._lib.EC_KEY_free)
-
- ec_cdata = self._ec_key_set_public_key_affine_coordinates(
- ec_cdata, numbers.x, numbers.y)
- evp_pkey = self._ec_cdata_to_evp_pkey(ec_cdata)
-
- return _EllipticCurvePublicKey(self, ec_cdata, evp_pkey)
-
- def derive_elliptic_curve_private_key(self, private_value, curve):
- curve_nid = self._elliptic_curve_to_nid(curve)
-
- ec_cdata = self._lib.EC_KEY_new_by_curve_name(curve_nid)
- self.openssl_assert(ec_cdata != self._ffi.NULL)
- ec_cdata = self._ffi.gc(ec_cdata, self._lib.EC_KEY_free)
-
- get_func, group = self._ec_key_determine_group_get_func(ec_cdata)
-
- point = self._lib.EC_POINT_new(group)
- self.openssl_assert(point != self._ffi.NULL)
- point = self._ffi.gc(point, self._lib.EC_POINT_free)
-
- value = self._int_to_bn(private_value)
- value = self._ffi.gc(value, self._lib.BN_clear_free)
-
- with self._tmp_bn_ctx() as bn_ctx:
- res = self._lib.EC_POINT_mul(group, point, value, self._ffi.NULL,
- self._ffi.NULL, bn_ctx)
- self.openssl_assert(res == 1)
-
- bn_x = self._lib.BN_CTX_get(bn_ctx)
- bn_y = self._lib.BN_CTX_get(bn_ctx)
-
- res = get_func(group, point, bn_x, bn_y, bn_ctx)
- self.openssl_assert(res == 1)
-
- res = self._lib.EC_KEY_set_public_key(ec_cdata, point)
- self.openssl_assert(res == 1)
- private = self._int_to_bn(private_value)
- private = self._ffi.gc(private, self._lib.BN_clear_free)
- res = self._lib.EC_KEY_set_private_key(ec_cdata, private)
- self.openssl_assert(res == 1)
-
- evp_pkey = self._ec_cdata_to_evp_pkey(ec_cdata)
-
- return _EllipticCurvePrivateKey(self, ec_cdata, evp_pkey)
-
- def load_der_ocsp_request(self, data):
- mem_bio = self._bytes_to_bio(data)
- request = self._lib.d2i_OCSP_REQUEST_bio(mem_bio.bio, self._ffi.NULL)
- if request == self._ffi.NULL:
- self._consume_errors()
- raise ValueError("Unable to load OCSP request")
-
- request = self._ffi.gc(request, self._lib.OCSP_REQUEST_free)
- return _OCSPRequest(self, request)
-
- def load_der_ocsp_response(self, data):
- mem_bio = self._bytes_to_bio(data)
- response = self._lib.d2i_OCSP_RESPONSE_bio(mem_bio.bio, self._ffi.NULL)
- if response == self._ffi.NULL:
- self._consume_errors()
- raise ValueError("Unable to load OCSP response")
-
- response = self._ffi.gc(response, self._lib.OCSP_RESPONSE_free)
- return _OCSPResponse(self, response)
-
- def create_ocsp_request(self, builder):
- ocsp_req = self._lib.OCSP_REQUEST_new()
- self.openssl_assert(ocsp_req != self._ffi.NULL)
- ocsp_req = self._ffi.gc(ocsp_req, self._lib.OCSP_REQUEST_free)
- cert, issuer, algorithm = builder._request
- evp_md = self._evp_md_non_null_from_algorithm(algorithm)
- certid = self._lib.OCSP_cert_to_id(
- evp_md, cert._x509, issuer._x509
- )
- self.openssl_assert(certid != self._ffi.NULL)
- onereq = self._lib.OCSP_request_add0_id(ocsp_req, certid)
- self.openssl_assert(onereq != self._ffi.NULL)
- self._create_x509_extensions(
- extensions=builder._extensions,
- handlers=_OCSP_REQUEST_EXTENSION_ENCODE_HANDLERS,
- x509_obj=ocsp_req,
- add_func=self._lib.OCSP_REQUEST_add_ext,
- gc=True,
- )
- return _OCSPRequest(self, ocsp_req)
-
- def _create_ocsp_basic_response(self, builder, private_key, algorithm):
- basic = self._lib.OCSP_BASICRESP_new()
- self.openssl_assert(basic != self._ffi.NULL)
- basic = self._ffi.gc(basic, self._lib.OCSP_BASICRESP_free)
- evp_md = self._evp_md_non_null_from_algorithm(
- builder._response._algorithm
- )
- certid = self._lib.OCSP_cert_to_id(
- evp_md, builder._response._cert._x509,
- builder._response._issuer._x509
- )
- self.openssl_assert(certid != self._ffi.NULL)
- certid = self._ffi.gc(certid, self._lib.OCSP_CERTID_free)
- if builder._response._revocation_reason is None:
- reason = -1
- else:
- reason = _CRL_ENTRY_REASON_ENUM_TO_CODE[
- builder._response._revocation_reason
- ]
- if builder._response._revocation_time is None:
- rev_time = self._ffi.NULL
- else:
- rev_time = self._create_asn1_time(
- builder._response._revocation_time
- )
-
- next_update = self._ffi.NULL
- if builder._response._next_update is not None:
- next_update = self._create_asn1_time(
- builder._response._next_update
- )
-
- this_update = self._create_asn1_time(builder._response._this_update)
-
- res = self._lib.OCSP_basic_add1_status(
- basic,
- certid,
- builder._response._cert_status.value,
- reason,
- rev_time,
- this_update,
- next_update
- )
- self.openssl_assert(res != self._ffi.NULL)
- # okay, now sign the basic structure
- evp_md = self._evp_md_non_null_from_algorithm(algorithm)
- responder_cert, responder_encoding = builder._responder_id
- flags = self._lib.OCSP_NOCERTS
- if responder_encoding is ocsp.OCSPResponderEncoding.HASH:
- flags |= self._lib.OCSP_RESPID_KEY
-
- if builder._certs is not None:
- for cert in builder._certs:
- res = self._lib.OCSP_basic_add1_cert(basic, cert._x509)
- self.openssl_assert(res == 1)
-
- self._create_x509_extensions(
- extensions=builder._extensions,
- handlers=_OCSP_BASICRESP_EXTENSION_ENCODE_HANDLERS,
- x509_obj=basic,
- add_func=self._lib.OCSP_BASICRESP_add_ext,
- gc=True,
- )
-
- res = self._lib.OCSP_basic_sign(
- basic, responder_cert._x509, private_key._evp_pkey,
- evp_md, self._ffi.NULL, flags
- )
- if res != 1:
- errors = self._consume_errors()
- self.openssl_assert(
- errors[0]._lib_reason_match(
- self._lib.ERR_LIB_X509,
- self._lib.X509_R_KEY_VALUES_MISMATCH
- )
- )
- raise ValueError("responder_cert must be signed by private_key")
-
- return basic
-
- def create_ocsp_response(self, response_status, builder, private_key,
- algorithm):
- if response_status is ocsp.OCSPResponseStatus.SUCCESSFUL:
- basic = self._create_ocsp_basic_response(
- builder, private_key, algorithm
- )
- else:
- basic = self._ffi.NULL
-
- ocsp_resp = self._lib.OCSP_response_create(
- response_status.value, basic
- )
- self.openssl_assert(ocsp_resp != self._ffi.NULL)
- ocsp_resp = self._ffi.gc(ocsp_resp, self._lib.OCSP_RESPONSE_free)
- return _OCSPResponse(self, ocsp_resp)
-
- def elliptic_curve_exchange_algorithm_supported(self, algorithm, curve):
- return (
- self.elliptic_curve_supported(curve) and
- isinstance(algorithm, ec.ECDH)
- )
-
- def _ec_cdata_to_evp_pkey(self, ec_cdata):
- evp_pkey = self._create_evp_pkey_gc()
- res = self._lib.EVP_PKEY_set1_EC_KEY(evp_pkey, ec_cdata)
- self.openssl_assert(res == 1)
- return evp_pkey
-
- def _elliptic_curve_to_nid(self, curve):
- """
- Get the NID for a curve name.
- """
-
- curve_aliases = {
- "secp192r1": "prime192v1",
- "secp256r1": "prime256v1"
- }
-
- curve_name = curve_aliases.get(curve.name, curve.name)
-
- curve_nid = self._lib.OBJ_sn2nid(curve_name.encode())
- if curve_nid == self._lib.NID_undef:
- raise UnsupportedAlgorithm(
- "{0} is not a supported elliptic curve".format(curve.name),
- _Reasons.UNSUPPORTED_ELLIPTIC_CURVE
- )
- return curve_nid
-
- @contextmanager
- def _tmp_bn_ctx(self):
- bn_ctx = self._lib.BN_CTX_new()
- self.openssl_assert(bn_ctx != self._ffi.NULL)
- bn_ctx = self._ffi.gc(bn_ctx, self._lib.BN_CTX_free)
- self._lib.BN_CTX_start(bn_ctx)
- try:
- yield bn_ctx
- finally:
- self._lib.BN_CTX_end(bn_ctx)
-
- def _ec_key_determine_group_get_func(self, ctx):
- """
- Given an EC_KEY determine the group and what function is required to
- get point coordinates.
- """
- self.openssl_assert(ctx != self._ffi.NULL)
-
- nid_two_field = self._lib.OBJ_sn2nid(b"characteristic-two-field")
- self.openssl_assert(nid_two_field != self._lib.NID_undef)
-
- group = self._lib.EC_KEY_get0_group(ctx)
- self.openssl_assert(group != self._ffi.NULL)
-
- method = self._lib.EC_GROUP_method_of(group)
- self.openssl_assert(method != self._ffi.NULL)
-
- nid = self._lib.EC_METHOD_get_field_type(method)
- self.openssl_assert(nid != self._lib.NID_undef)
-
- if nid == nid_two_field and self._lib.Cryptography_HAS_EC2M:
- get_func = self._lib.EC_POINT_get_affine_coordinates_GF2m
- else:
- get_func = self._lib.EC_POINT_get_affine_coordinates_GFp
-
- assert get_func
-
- return get_func, group
-
- def _ec_key_set_public_key_affine_coordinates(self, ctx, x, y):
- """
- Sets the public key point in the EC_KEY context to the affine x and y
- values.
- """
-
- if x < 0 or y < 0:
- raise ValueError(
- "Invalid EC key. Both x and y must be non-negative."
- )
-
- x = self._ffi.gc(self._int_to_bn(x), self._lib.BN_free)
- y = self._ffi.gc(self._int_to_bn(y), self._lib.BN_free)
- res = self._lib.EC_KEY_set_public_key_affine_coordinates(ctx, x, y)
- if res != 1:
- self._consume_errors()
- raise ValueError("Invalid EC key.")
-
- return ctx
-
- def _private_key_bytes(self, encoding, format, encryption_algorithm,
- evp_pkey, cdata):
- if not isinstance(format, serialization.PrivateFormat):
- raise TypeError(
- "format must be an item from the PrivateFormat enum"
- )
-
- if not isinstance(encryption_algorithm,
- serialization.KeySerializationEncryption):
- raise TypeError(
- "Encryption algorithm must be a KeySerializationEncryption "
- "instance"
- )
-
- if isinstance(encryption_algorithm, serialization.NoEncryption):
- password = b""
- passlen = 0
- evp_cipher = self._ffi.NULL
- elif isinstance(encryption_algorithm,
- serialization.BestAvailableEncryption):
- # This is a curated value that we will update over time.
- evp_cipher = self._lib.EVP_get_cipherbyname(
- b"aes-256-cbc"
- )
- password = encryption_algorithm.password
- passlen = len(password)
- if passlen > 1023:
- raise ValueError(
- "Passwords longer than 1023 bytes are not supported by "
- "this backend"
- )
- else:
- raise ValueError("Unsupported encryption type")
-
- key_type = self._lib.EVP_PKEY_id(evp_pkey)
- if encoding is serialization.Encoding.PEM:
- if format is serialization.PrivateFormat.PKCS8:
- write_bio = self._lib.PEM_write_bio_PKCS8PrivateKey
- key = evp_pkey
- else:
- assert format is serialization.PrivateFormat.TraditionalOpenSSL
- if key_type == self._lib.EVP_PKEY_RSA:
- write_bio = self._lib.PEM_write_bio_RSAPrivateKey
- elif key_type == self._lib.EVP_PKEY_DSA:
- write_bio = self._lib.PEM_write_bio_DSAPrivateKey
- else:
- assert key_type == self._lib.EVP_PKEY_EC
- write_bio = self._lib.PEM_write_bio_ECPrivateKey
-
- key = cdata
- elif encoding is serialization.Encoding.DER:
- if format is serialization.PrivateFormat.TraditionalOpenSSL:
- if not isinstance(
- encryption_algorithm, serialization.NoEncryption
- ):
- raise ValueError(
- "Encryption is not supported for DER encoded "
- "traditional OpenSSL keys"
- )
-
- return self._private_key_bytes_traditional_der(key_type, cdata)
- else:
- assert format is serialization.PrivateFormat.PKCS8
- write_bio = self._lib.i2d_PKCS8PrivateKey_bio
- key = evp_pkey
- else:
- raise TypeError("encoding must be an item from the Encoding enum")
-
- bio = self._create_mem_bio_gc()
- res = write_bio(
- bio,
- key,
- evp_cipher,
- password,
- passlen,
- self._ffi.NULL,
- self._ffi.NULL
- )
- self.openssl_assert(res == 1)
- return self._read_mem_bio(bio)
-
- def _private_key_bytes_traditional_der(self, key_type, cdata):
- if key_type == self._lib.EVP_PKEY_RSA:
- write_bio = self._lib.i2d_RSAPrivateKey_bio
- elif key_type == self._lib.EVP_PKEY_EC:
- write_bio = self._lib.i2d_ECPrivateKey_bio
- else:
- self.openssl_assert(key_type == self._lib.EVP_PKEY_DSA)
- write_bio = self._lib.i2d_DSAPrivateKey_bio
-
- bio = self._create_mem_bio_gc()
- res = write_bio(bio, cdata)
- self.openssl_assert(res == 1)
- return self._read_mem_bio(bio)
-
- def _public_key_bytes(self, encoding, format, key, evp_pkey, cdata):
- if not isinstance(encoding, serialization.Encoding):
- raise TypeError("encoding must be an item from the Encoding enum")
-
- if (
- format is serialization.PublicFormat.OpenSSH or
- encoding is serialization.Encoding.OpenSSH
- ):
- if (
- format is not serialization.PublicFormat.OpenSSH or
- encoding is not serialization.Encoding.OpenSSH
- ):
- raise ValueError(
- "OpenSSH format must be used with OpenSSH encoding"
- )
- return self._openssh_public_key_bytes(key)
- elif format is serialization.PublicFormat.SubjectPublicKeyInfo:
- if encoding is serialization.Encoding.PEM:
- write_bio = self._lib.PEM_write_bio_PUBKEY
- else:
- assert encoding is serialization.Encoding.DER
- write_bio = self._lib.i2d_PUBKEY_bio
-
- key = evp_pkey
- elif format is serialization.PublicFormat.PKCS1:
- # Only RSA is supported here.
- assert self._lib.EVP_PKEY_id(evp_pkey) == self._lib.EVP_PKEY_RSA
- if encoding is serialization.Encoding.PEM:
- write_bio = self._lib.PEM_write_bio_RSAPublicKey
- else:
- assert encoding is serialization.Encoding.DER
- write_bio = self._lib.i2d_RSAPublicKey_bio
-
- key = cdata
- else:
- raise TypeError(
- "format must be an item from the PublicFormat enum"
- )
-
- bio = self._create_mem_bio_gc()
- res = write_bio(bio, key)
- self.openssl_assert(res == 1)
- return self._read_mem_bio(bio)
-
- def _openssh_public_key_bytes(self, key):
- if isinstance(key, rsa.RSAPublicKey):
- public_numbers = key.public_numbers()
- return b"ssh-rsa " + base64.b64encode(
- serialization._ssh_write_string(b"ssh-rsa") +
- serialization._ssh_write_mpint(public_numbers.e) +
- serialization._ssh_write_mpint(public_numbers.n)
- )
- elif isinstance(key, dsa.DSAPublicKey):
- public_numbers = key.public_numbers()
- parameter_numbers = public_numbers.parameter_numbers
- return b"ssh-dss " + base64.b64encode(
- serialization._ssh_write_string(b"ssh-dss") +
- serialization._ssh_write_mpint(parameter_numbers.p) +
- serialization._ssh_write_mpint(parameter_numbers.q) +
- serialization._ssh_write_mpint(parameter_numbers.g) +
- serialization._ssh_write_mpint(public_numbers.y)
- )
- else:
- assert isinstance(key, ec.EllipticCurvePublicKey)
- public_numbers = key.public_numbers()
- try:
- curve_name = {
- ec.SECP256R1: b"nistp256",
- ec.SECP384R1: b"nistp384",
- ec.SECP521R1: b"nistp521",
- }[type(public_numbers.curve)]
- except KeyError:
- raise ValueError(
- "Only SECP256R1, SECP384R1, and SECP521R1 curves are "
- "supported by the SSH public key format"
- )
- return b"ecdsa-sha2-" + curve_name + b" " + base64.b64encode(
- serialization._ssh_write_string(b"ecdsa-sha2-" + curve_name) +
- serialization._ssh_write_string(curve_name) +
- serialization._ssh_write_string(public_numbers.encode_point())
- )
-
- def _parameter_bytes(self, encoding, format, cdata):
- if encoding is serialization.Encoding.OpenSSH:
- raise TypeError(
- "OpenSSH encoding is not supported"
- )
-
- # Only DH is supported here currently.
- q = self._ffi.new("BIGNUM **")
- self._lib.DH_get0_pqg(cdata,
- self._ffi.NULL,
- q,
- self._ffi.NULL)
- if encoding is serialization.Encoding.PEM:
- if q[0] != self._ffi.NULL:
- write_bio = self._lib.PEM_write_bio_DHxparams
- else:
- write_bio = self._lib.PEM_write_bio_DHparams
- elif encoding is serialization.Encoding.DER:
- if q[0] != self._ffi.NULL:
- write_bio = self._lib.Cryptography_i2d_DHxparams_bio
- else:
- write_bio = self._lib.i2d_DHparams_bio
- else:
- raise TypeError("encoding must be an item from the Encoding enum")
-
- bio = self._create_mem_bio_gc()
- res = write_bio(bio, cdata)
- self.openssl_assert(res == 1)
- return self._read_mem_bio(bio)
-
- def generate_dh_parameters(self, generator, key_size):
- if key_size < 512:
- raise ValueError("DH key_size must be at least 512 bits")
-
- if generator not in (2, 5):
- raise ValueError("DH generator must be 2 or 5")
-
- dh_param_cdata = self._lib.DH_new()
- self.openssl_assert(dh_param_cdata != self._ffi.NULL)
- dh_param_cdata = self._ffi.gc(dh_param_cdata, self._lib.DH_free)
-
- res = self._lib.DH_generate_parameters_ex(
- dh_param_cdata,
- key_size,
- generator,
- self._ffi.NULL
- )
- self.openssl_assert(res == 1)
-
- return _DHParameters(self, dh_param_cdata)
-
- def _dh_cdata_to_evp_pkey(self, dh_cdata):
- evp_pkey = self._create_evp_pkey_gc()
- res = self._lib.EVP_PKEY_set1_DH(evp_pkey, dh_cdata)
- self.openssl_assert(res == 1)
- return evp_pkey
-
- def generate_dh_private_key(self, parameters):
- dh_key_cdata = _dh_params_dup(parameters._dh_cdata, self)
-
- res = self._lib.DH_generate_key(dh_key_cdata)
- self.openssl_assert(res == 1)
-
- evp_pkey = self._dh_cdata_to_evp_pkey(dh_key_cdata)
-
- return _DHPrivateKey(self, dh_key_cdata, evp_pkey)
-
- def generate_dh_private_key_and_parameters(self, generator, key_size):
- return self.generate_dh_private_key(
- self.generate_dh_parameters(generator, key_size))
-
- def load_dh_private_numbers(self, numbers):
- parameter_numbers = numbers.public_numbers.parameter_numbers
-
- dh_cdata = self._lib.DH_new()
- self.openssl_assert(dh_cdata != self._ffi.NULL)
- dh_cdata = self._ffi.gc(dh_cdata, self._lib.DH_free)
-
- p = self._int_to_bn(parameter_numbers.p)
- g = self._int_to_bn(parameter_numbers.g)
-
- if parameter_numbers.q is not None:
- q = self._int_to_bn(parameter_numbers.q)
- else:
- q = self._ffi.NULL
-
- pub_key = self._int_to_bn(numbers.public_numbers.y)
- priv_key = self._int_to_bn(numbers.x)
-
- res = self._lib.DH_set0_pqg(dh_cdata, p, q, g)
- self.openssl_assert(res == 1)
-
- res = self._lib.DH_set0_key(dh_cdata, pub_key, priv_key)
- self.openssl_assert(res == 1)
-
- codes = self._ffi.new("int[]", 1)
- res = self._lib.Cryptography_DH_check(dh_cdata, codes)
- self.openssl_assert(res == 1)
-
- # DH_check will return DH_NOT_SUITABLE_GENERATOR if p % 24 does not
- # equal 11 when the generator is 2 (a quadratic nonresidue).
- # We want to ignore that error because p % 24 == 23 is also fine.
- # Specifically, g is then a quadratic residue. Within the context of
- # Diffie-Hellman this means it can only generate half the possible
- # values. That sounds bad, but quadratic nonresidues leak a bit of
- # the key to the attacker in exchange for having the full key space
- # available. See: https://crypto.stackexchange.com/questions/12961
- if codes[0] != 0 and not (
- parameter_numbers.g == 2 and
- codes[0] ^ self._lib.DH_NOT_SUITABLE_GENERATOR == 0
- ):
- raise ValueError(
- "DH private numbers did not pass safety checks."
- )
-
- evp_pkey = self._dh_cdata_to_evp_pkey(dh_cdata)
-
- return _DHPrivateKey(self, dh_cdata, evp_pkey)
-
- def load_dh_public_numbers(self, numbers):
- dh_cdata = self._lib.DH_new()
- self.openssl_assert(dh_cdata != self._ffi.NULL)
- dh_cdata = self._ffi.gc(dh_cdata, self._lib.DH_free)
-
- parameter_numbers = numbers.parameter_numbers
-
- p = self._int_to_bn(parameter_numbers.p)
- g = self._int_to_bn(parameter_numbers.g)
-
- if parameter_numbers.q is not None:
- q = self._int_to_bn(parameter_numbers.q)
- else:
- q = self._ffi.NULL
-
- pub_key = self._int_to_bn(numbers.y)
-
- res = self._lib.DH_set0_pqg(dh_cdata, p, q, g)
- self.openssl_assert(res == 1)
-
- res = self._lib.DH_set0_key(dh_cdata, pub_key, self._ffi.NULL)
- self.openssl_assert(res == 1)
-
- evp_pkey = self._dh_cdata_to_evp_pkey(dh_cdata)
-
- return _DHPublicKey(self, dh_cdata, evp_pkey)
-
- def load_dh_parameter_numbers(self, numbers):
- dh_cdata = self._lib.DH_new()
- self.openssl_assert(dh_cdata != self._ffi.NULL)
- dh_cdata = self._ffi.gc(dh_cdata, self._lib.DH_free)
-
- p = self._int_to_bn(numbers.p)
- g = self._int_to_bn(numbers.g)
-
- if numbers.q is not None:
- q = self._int_to_bn(numbers.q)
- else:
- q = self._ffi.NULL
-
- res = self._lib.DH_set0_pqg(dh_cdata, p, q, g)
- self.openssl_assert(res == 1)
-
- return _DHParameters(self, dh_cdata)
-
- def dh_parameters_supported(self, p, g, q=None):
- dh_cdata = self._lib.DH_new()
- self.openssl_assert(dh_cdata != self._ffi.NULL)
- dh_cdata = self._ffi.gc(dh_cdata, self._lib.DH_free)
-
- p = self._int_to_bn(p)
- g = self._int_to_bn(g)
-
- if q is not None:
- q = self._int_to_bn(q)
- else:
- q = self._ffi.NULL
-
- res = self._lib.DH_set0_pqg(dh_cdata, p, q, g)
- self.openssl_assert(res == 1)
-
- codes = self._ffi.new("int[]", 1)
- res = self._lib.Cryptography_DH_check(dh_cdata, codes)
- self.openssl_assert(res == 1)
-
- return codes[0] == 0
-
- def dh_x942_serialization_supported(self):
- return self._lib.Cryptography_HAS_EVP_PKEY_DHX == 1
-
- def x509_name_bytes(self, name):
- x509_name = _encode_name_gc(self, name)
- pp = self._ffi.new("unsigned char **")
- res = self._lib.i2d_X509_NAME(x509_name, pp)
- self.openssl_assert(pp[0] != self._ffi.NULL)
- pp = self._ffi.gc(
- pp, lambda pointer: self._lib.OPENSSL_free(pointer[0])
- )
- self.openssl_assert(res > 0)
- return self._ffi.buffer(pp[0], res)[:]
-
- def x25519_load_public_bytes(self, data):
- evp_pkey = self._create_evp_pkey_gc()
- res = self._lib.EVP_PKEY_set_type(evp_pkey, self._lib.NID_X25519)
- backend.openssl_assert(res == 1)
- res = self._lib.EVP_PKEY_set1_tls_encodedpoint(
- evp_pkey, data, len(data)
- )
- backend.openssl_assert(res == 1)
- return _X25519PublicKey(self, evp_pkey)
-
- def x25519_load_private_bytes(self, data):
- # OpenSSL only has facilities for loading PKCS8 formatted private
- # keys using the algorithm identifiers specified in
- # https://tools.ietf.org/html/draft-ietf-curdle-pkix-09.
- # This is the standard PKCS8 prefix for a 32 byte X25519 key.
- # The form is:
- # 0:d=0 hl=2 l= 46 cons: SEQUENCE
- # 2:d=1 hl=2 l= 1 prim: INTEGER :00
- # 5:d=1 hl=2 l= 5 cons: SEQUENCE
- # 7:d=2 hl=2 l= 3 prim: OBJECT :1.3.101.110
- # 12:d=1 hl=2 l= 34 prim: OCTET STRING (the key)
- # Of course there's a bit more complexity. In reality OCTET STRING
- # contains an OCTET STRING of length 32! So the last two bytes here
- # are \x04\x20, which is an OCTET STRING of length 32.
- pkcs8_prefix = b'0.\x02\x01\x000\x05\x06\x03+en\x04"\x04 '
- bio = self._bytes_to_bio(pkcs8_prefix + data)
- evp_pkey = backend._lib.d2i_PrivateKey_bio(bio.bio, self._ffi.NULL)
- self.openssl_assert(evp_pkey != self._ffi.NULL)
- evp_pkey = self._ffi.gc(evp_pkey, self._lib.EVP_PKEY_free)
- self.openssl_assert(
- self._lib.EVP_PKEY_id(evp_pkey) == self._lib.EVP_PKEY_X25519
- )
- return _X25519PrivateKey(self, evp_pkey)
-
- def x25519_generate_key(self):
- evp_pkey_ctx = self._lib.EVP_PKEY_CTX_new_id(
- self._lib.NID_X25519, self._ffi.NULL
- )
- self.openssl_assert(evp_pkey_ctx != self._ffi.NULL)
- evp_pkey_ctx = self._ffi.gc(
- evp_pkey_ctx, self._lib.EVP_PKEY_CTX_free
- )
- res = self._lib.EVP_PKEY_keygen_init(evp_pkey_ctx)
- self.openssl_assert(res == 1)
- evp_ppkey = self._ffi.new("EVP_PKEY **")
- res = self._lib.EVP_PKEY_keygen(evp_pkey_ctx, evp_ppkey)
- self.openssl_assert(res == 1)
- self.openssl_assert(evp_ppkey[0] != self._ffi.NULL)
- evp_pkey = self._ffi.gc(evp_ppkey[0], self._lib.EVP_PKEY_free)
- return _X25519PrivateKey(self, evp_pkey)
-
- def x25519_supported(self):
- return self._lib.CRYPTOGRAPHY_OPENSSL_110_OR_GREATER
-
- def derive_scrypt(self, key_material, salt, length, n, r, p):
- buf = self._ffi.new("unsigned char[]", length)
- res = self._lib.EVP_PBE_scrypt(
- key_material, len(key_material), salt, len(salt), n, r, p,
- scrypt._MEM_LIMIT, buf, length
- )
- self.openssl_assert(res == 1)
- return self._ffi.buffer(buf)[:]
-
- def aead_cipher_supported(self, cipher):
- cipher_name = aead._aead_cipher_name(cipher)
- return (
- self._lib.EVP_get_cipherbyname(cipher_name) != self._ffi.NULL
- )
-
-
-class GetCipherByName(object):
- def __init__(self, fmt):
- self._fmt = fmt
-
- def __call__(self, backend, cipher, mode):
- cipher_name = self._fmt.format(cipher=cipher, mode=mode).lower()
- return backend._lib.EVP_get_cipherbyname(cipher_name.encode("ascii"))
-
-
-def _get_xts_cipher(backend, cipher, mode):
- cipher_name = "aes-{0}-xts".format(cipher.key_size // 2)
- return backend._lib.EVP_get_cipherbyname(cipher_name.encode("ascii"))
-
-
-backend = Backend()
diff --git a/lib/cryptography/hazmat/backends/openssl/ciphers.py b/lib/cryptography/hazmat/backends/openssl/ciphers.py
deleted file mode 100644
index e0ee06ee26..0000000000
--- a/lib/cryptography/hazmat/backends/openssl/ciphers.py
+++ /dev/null
@@ -1,222 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-from cryptography import utils
-from cryptography.exceptions import InvalidTag, UnsupportedAlgorithm, _Reasons
-from cryptography.hazmat.primitives import ciphers
-from cryptography.hazmat.primitives.ciphers import modes
-
-
-@utils.register_interface(ciphers.CipherContext)
-@utils.register_interface(ciphers.AEADCipherContext)
-@utils.register_interface(ciphers.AEADEncryptionContext)
-@utils.register_interface(ciphers.AEADDecryptionContext)
-class _CipherContext(object):
- _ENCRYPT = 1
- _DECRYPT = 0
-
- def __init__(self, backend, cipher, mode, operation):
- self._backend = backend
- self._cipher = cipher
- self._mode = mode
- self._operation = operation
- self._tag = None
-
- if isinstance(self._cipher, ciphers.BlockCipherAlgorithm):
- self._block_size_bytes = self._cipher.block_size // 8
- else:
- self._block_size_bytes = 1
-
- ctx = self._backend._lib.EVP_CIPHER_CTX_new()
- ctx = self._backend._ffi.gc(
- ctx, self._backend._lib.EVP_CIPHER_CTX_free
- )
-
- registry = self._backend._cipher_registry
- try:
- adapter = registry[type(cipher), type(mode)]
- except KeyError:
- raise UnsupportedAlgorithm(
- "cipher {0} in {1} mode is not supported "
- "by this backend.".format(
- cipher.name, mode.name if mode else mode),
- _Reasons.UNSUPPORTED_CIPHER
- )
-
- evp_cipher = adapter(self._backend, cipher, mode)
- if evp_cipher == self._backend._ffi.NULL:
- raise UnsupportedAlgorithm(
- "cipher {0} in {1} mode is not supported "
- "by this backend.".format(
- cipher.name, mode.name if mode else mode),
- _Reasons.UNSUPPORTED_CIPHER
- )
-
- if isinstance(mode, modes.ModeWithInitializationVector):
- iv_nonce = mode.initialization_vector
- elif isinstance(mode, modes.ModeWithTweak):
- iv_nonce = mode.tweak
- elif isinstance(mode, modes.ModeWithNonce):
- iv_nonce = mode.nonce
- elif isinstance(cipher, modes.ModeWithNonce):
- iv_nonce = cipher.nonce
- else:
- iv_nonce = self._backend._ffi.NULL
- # begin init with cipher and operation type
- res = self._backend._lib.EVP_CipherInit_ex(ctx, evp_cipher,
- self._backend._ffi.NULL,
- self._backend._ffi.NULL,
- self._backend._ffi.NULL,
- operation)
- self._backend.openssl_assert(res != 0)
- # set the key length to handle variable key ciphers
- res = self._backend._lib.EVP_CIPHER_CTX_set_key_length(
- ctx, len(cipher.key)
- )
- self._backend.openssl_assert(res != 0)
- if isinstance(mode, modes.GCM):
- res = self._backend._lib.EVP_CIPHER_CTX_ctrl(
- ctx, self._backend._lib.EVP_CTRL_AEAD_SET_IVLEN,
- len(iv_nonce), self._backend._ffi.NULL
- )
- self._backend.openssl_assert(res != 0)
- if mode.tag is not None:
- res = self._backend._lib.EVP_CIPHER_CTX_ctrl(
- ctx, self._backend._lib.EVP_CTRL_AEAD_SET_TAG,
- len(mode.tag), mode.tag
- )
- self._backend.openssl_assert(res != 0)
- self._tag = mode.tag
- elif (
- self._operation == self._DECRYPT and
- self._backend._lib.CRYPTOGRAPHY_OPENSSL_LESS_THAN_102 and
- not self._backend._lib.CRYPTOGRAPHY_IS_LIBRESSL
- ):
- raise NotImplementedError(
- "delayed passing of GCM tag requires OpenSSL >= 1.0.2."
- " To use this feature please update OpenSSL"
- )
-
- # pass key/iv
- res = self._backend._lib.EVP_CipherInit_ex(
- ctx,
- self._backend._ffi.NULL,
- self._backend._ffi.NULL,
- cipher.key,
- iv_nonce,
- operation
- )
- self._backend.openssl_assert(res != 0)
- # We purposely disable padding here as it's handled higher up in the
- # API.
- self._backend._lib.EVP_CIPHER_CTX_set_padding(ctx, 0)
- self._ctx = ctx
-
- def update(self, data):
- buf = bytearray(len(data) + self._block_size_bytes - 1)
- n = self.update_into(data, buf)
- return bytes(buf[:n])
-
- def update_into(self, data, buf):
- if len(buf) < (len(data) + self._block_size_bytes - 1):
- raise ValueError(
- "buffer must be at least {0} bytes for this "
- "payload".format(len(data) + self._block_size_bytes - 1)
- )
-
- buf = self._backend._ffi.cast(
- "unsigned char *", self._backend._ffi.from_buffer(buf)
- )
- outlen = self._backend._ffi.new("int *")
- res = self._backend._lib.EVP_CipherUpdate(self._ctx, buf, outlen,
- data, len(data))
- self._backend.openssl_assert(res != 0)
- return outlen[0]
-
- def finalize(self):
- # OpenSSL 1.0.1 on Ubuntu 12.04 (and possibly other distributions)
- # appears to have a bug where you must make at least one call to update
- # even if you are only using authenticate_additional_data or the
- # GCM tag will be wrong. An (empty) call to update resolves this
- # and is harmless for all other versions of OpenSSL.
- if isinstance(self._mode, modes.GCM):
- self.update(b"")
-
- if (
- self._operation == self._DECRYPT and
- isinstance(self._mode, modes.ModeWithAuthenticationTag) and
- self.tag is None
- ):
- raise ValueError(
- "Authentication tag must be provided when decrypting."
- )
-
- buf = self._backend._ffi.new("unsigned char[]", self._block_size_bytes)
- outlen = self._backend._ffi.new("int *")
- res = self._backend._lib.EVP_CipherFinal_ex(self._ctx, buf, outlen)
- if res == 0:
- errors = self._backend._consume_errors()
-
- if not errors and isinstance(self._mode, modes.GCM):
- raise InvalidTag
-
- self._backend.openssl_assert(
- errors[0]._lib_reason_match(
- self._backend._lib.ERR_LIB_EVP,
- self._backend._lib.EVP_R_DATA_NOT_MULTIPLE_OF_BLOCK_LENGTH
- )
- )
- raise ValueError(
- "The length of the provided data is not a multiple of "
- "the block length."
- )
-
- if (isinstance(self._mode, modes.GCM) and
- self._operation == self._ENCRYPT):
- tag_buf = self._backend._ffi.new(
- "unsigned char[]", self._block_size_bytes
- )
- res = self._backend._lib.EVP_CIPHER_CTX_ctrl(
- self._ctx, self._backend._lib.EVP_CTRL_AEAD_GET_TAG,
- self._block_size_bytes, tag_buf
- )
- self._backend.openssl_assert(res != 0)
- self._tag = self._backend._ffi.buffer(tag_buf)[:]
-
- res = self._backend._lib.EVP_CIPHER_CTX_cleanup(self._ctx)
- self._backend.openssl_assert(res == 1)
- return self._backend._ffi.buffer(buf)[:outlen[0]]
-
- def finalize_with_tag(self, tag):
- if (
- self._backend._lib.CRYPTOGRAPHY_OPENSSL_LESS_THAN_102 and
- not self._backend._lib.CRYPTOGRAPHY_IS_LIBRESSL
- ):
- raise NotImplementedError(
- "finalize_with_tag requires OpenSSL >= 1.0.2. To use this "
- "method please update OpenSSL"
- )
- if len(tag) < self._mode._min_tag_length:
- raise ValueError(
- "Authentication tag must be {0} bytes or longer.".format(
- self._mode._min_tag_length)
- )
- res = self._backend._lib.EVP_CIPHER_CTX_ctrl(
- self._ctx, self._backend._lib.EVP_CTRL_AEAD_SET_TAG,
- len(tag), tag
- )
- self._backend.openssl_assert(res != 0)
- self._tag = tag
- return self.finalize()
-
- def authenticate_additional_data(self, data):
- outlen = self._backend._ffi.new("int *")
- res = self._backend._lib.EVP_CipherUpdate(
- self._ctx, self._backend._ffi.NULL, outlen, data, len(data)
- )
- self._backend.openssl_assert(res != 0)
-
- tag = utils.read_only_property("_tag")
diff --git a/lib/cryptography/hazmat/backends/openssl/cmac.py b/lib/cryptography/hazmat/backends/openssl/cmac.py
deleted file mode 100644
index e20f66d3c5..0000000000
--- a/lib/cryptography/hazmat/backends/openssl/cmac.py
+++ /dev/null
@@ -1,81 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-
-from cryptography import utils
-from cryptography.exceptions import (
- InvalidSignature, UnsupportedAlgorithm, _Reasons
-)
-from cryptography.hazmat.primitives import constant_time, mac
-from cryptography.hazmat.primitives.ciphers.modes import CBC
-
-
-@utils.register_interface(mac.MACContext)
-class _CMACContext(object):
- def __init__(self, backend, algorithm, ctx=None):
- if not backend.cmac_algorithm_supported(algorithm):
- raise UnsupportedAlgorithm("This backend does not support CMAC.",
- _Reasons.UNSUPPORTED_CIPHER)
-
- self._backend = backend
- self._key = algorithm.key
- self._algorithm = algorithm
- self._output_length = algorithm.block_size // 8
-
- if ctx is None:
- registry = self._backend._cipher_registry
- adapter = registry[type(algorithm), CBC]
-
- evp_cipher = adapter(self._backend, algorithm, CBC)
-
- ctx = self._backend._lib.CMAC_CTX_new()
-
- self._backend.openssl_assert(ctx != self._backend._ffi.NULL)
- ctx = self._backend._ffi.gc(ctx, self._backend._lib.CMAC_CTX_free)
-
- res = self._backend._lib.CMAC_Init(
- ctx, self._key, len(self._key),
- evp_cipher, self._backend._ffi.NULL
- )
- self._backend.openssl_assert(res == 1)
-
- self._ctx = ctx
-
- algorithm = utils.read_only_property("_algorithm")
-
- def update(self, data):
- res = self._backend._lib.CMAC_Update(self._ctx, data, len(data))
- self._backend.openssl_assert(res == 1)
-
- def finalize(self):
- buf = self._backend._ffi.new("unsigned char[]", self._output_length)
- length = self._backend._ffi.new("size_t *", self._output_length)
- res = self._backend._lib.CMAC_Final(
- self._ctx, buf, length
- )
- self._backend.openssl_assert(res == 1)
-
- self._ctx = None
-
- return self._backend._ffi.buffer(buf)[:]
-
- def copy(self):
- copied_ctx = self._backend._lib.CMAC_CTX_new()
- copied_ctx = self._backend._ffi.gc(
- copied_ctx, self._backend._lib.CMAC_CTX_free
- )
- res = self._backend._lib.CMAC_CTX_copy(
- copied_ctx, self._ctx
- )
- self._backend.openssl_assert(res == 1)
- return _CMACContext(
- self._backend, self._algorithm, ctx=copied_ctx
- )
-
- def verify(self, signature):
- digest = self.finalize()
- if not constant_time.bytes_eq(digest, signature):
- raise InvalidSignature("Signature did not match digest.")
diff --git a/lib/cryptography/hazmat/backends/openssl/decode_asn1.py b/lib/cryptography/hazmat/backends/openssl/decode_asn1.py
deleted file mode 100644
index e06e8cd6d7..0000000000
--- a/lib/cryptography/hazmat/backends/openssl/decode_asn1.py
+++ /dev/null
@@ -1,867 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import datetime
-import ipaddress
-
-import asn1crypto.core
-
-import six
-
-from cryptography import x509
-from cryptography.x509.extensions import _TLS_FEATURE_TYPE_TO_ENUM
-from cryptography.x509.name import _ASN1_TYPE_TO_ENUM
-from cryptography.x509.oid import (
- CRLEntryExtensionOID, CertificatePoliciesOID, ExtensionOID,
- OCSPExtensionOID,
-)
-
-
-class _Integers(asn1crypto.core.SequenceOf):
- _child_spec = asn1crypto.core.Integer
-
-
-def _obj2txt(backend, obj):
- # Set to 80 on the recommendation of
- # https://www.openssl.org/docs/crypto/OBJ_nid2ln.html#return_values
- #
- # But OIDs longer than this occur in real life (e.g. Active
- # Directory makes some very long OIDs). So we need to detect
- # and properly handle the case where the default buffer is not
- # big enough.
- #
- buf_len = 80
- buf = backend._ffi.new("char[]", buf_len)
-
- # 'res' is the number of bytes that *would* be written if the
- # buffer is large enough. If 'res' > buf_len - 1, we need to
- # alloc a big-enough buffer and go again.
- res = backend._lib.OBJ_obj2txt(buf, buf_len, obj, 1)
- if res > buf_len - 1: # account for terminating null byte
- buf_len = res + 1
- buf = backend._ffi.new("char[]", buf_len)
- res = backend._lib.OBJ_obj2txt(buf, buf_len, obj, 1)
- backend.openssl_assert(res > 0)
- return backend._ffi.buffer(buf, res)[:].decode()
-
-
-def _decode_x509_name_entry(backend, x509_name_entry):
- obj = backend._lib.X509_NAME_ENTRY_get_object(x509_name_entry)
- backend.openssl_assert(obj != backend._ffi.NULL)
- data = backend._lib.X509_NAME_ENTRY_get_data(x509_name_entry)
- backend.openssl_assert(data != backend._ffi.NULL)
- value = _asn1_string_to_utf8(backend, data)
- oid = _obj2txt(backend, obj)
- type = _ASN1_TYPE_TO_ENUM[data.type]
-
- return x509.NameAttribute(x509.ObjectIdentifier(oid), value, type)
-
-
-def _decode_x509_name(backend, x509_name):
- count = backend._lib.X509_NAME_entry_count(x509_name)
- attributes = []
- prev_set_id = -1
- for x in range(count):
- entry = backend._lib.X509_NAME_get_entry(x509_name, x)
- attribute = _decode_x509_name_entry(backend, entry)
- set_id = backend._lib.Cryptography_X509_NAME_ENTRY_set(entry)
- if set_id != prev_set_id:
- attributes.append(set([attribute]))
- else:
- # is in the same RDN a previous entry
- attributes[-1].add(attribute)
- prev_set_id = set_id
-
- return x509.Name(x509.RelativeDistinguishedName(rdn) for rdn in attributes)
-
-
-def _decode_general_names(backend, gns):
- num = backend._lib.sk_GENERAL_NAME_num(gns)
- names = []
- for i in range(num):
- gn = backend._lib.sk_GENERAL_NAME_value(gns, i)
- backend.openssl_assert(gn != backend._ffi.NULL)
- names.append(_decode_general_name(backend, gn))
-
- return names
-
-
-def _decode_general_name(backend, gn):
- if gn.type == backend._lib.GEN_DNS:
- # Convert to bytes and then decode to utf8. We don't use
- # asn1_string_to_utf8 here because it doesn't properly convert
- # utf8 from ia5strings.
- data = _asn1_string_to_bytes(backend, gn.d.dNSName).decode("utf8")
- # We don't use the constructor for DNSName so we can bypass validation
- # This allows us to create DNSName objects that have unicode chars
- # when a certificate (against the RFC) contains them.
- return x509.DNSName._init_without_validation(data)
- elif gn.type == backend._lib.GEN_URI:
- # Convert to bytes and then decode to utf8. We don't use
- # asn1_string_to_utf8 here because it doesn't properly convert
- # utf8 from ia5strings.
- data = _asn1_string_to_bytes(
- backend, gn.d.uniformResourceIdentifier
- ).decode("utf8")
- # We don't use the constructor for URI so we can bypass validation
- # This allows us to create URI objects that have unicode chars
- # when a certificate (against the RFC) contains them.
- return x509.UniformResourceIdentifier._init_without_validation(data)
- elif gn.type == backend._lib.GEN_RID:
- oid = _obj2txt(backend, gn.d.registeredID)
- return x509.RegisteredID(x509.ObjectIdentifier(oid))
- elif gn.type == backend._lib.GEN_IPADD:
- data = _asn1_string_to_bytes(backend, gn.d.iPAddress)
- data_len = len(data)
- if data_len == 8 or data_len == 32:
- # This is an IPv4 or IPv6 Network and not a single IP. This
- # type of data appears in Name Constraints. Unfortunately,
- # ipaddress doesn't support packed bytes + netmask. Additionally,
- # IPv6Network can only handle CIDR rather than the full 16 byte
- # netmask. To handle this we convert the netmask to integer, then
- # find the first 0 bit, which will be the prefix. If another 1
- # bit is present after that the netmask is invalid.
- base = ipaddress.ip_address(data[:data_len // 2])
- netmask = ipaddress.ip_address(data[data_len // 2:])
- bits = bin(int(netmask))[2:]
- prefix = bits.find('0')
- # If no 0 bits are found it is a /32 or /128
- if prefix == -1:
- prefix = len(bits)
-
- if "1" in bits[prefix:]:
- raise ValueError("Invalid netmask")
-
- ip = ipaddress.ip_network(base.exploded + u"/{0}".format(prefix))
- else:
- ip = ipaddress.ip_address(data)
-
- return x509.IPAddress(ip)
- elif gn.type == backend._lib.GEN_DIRNAME:
- return x509.DirectoryName(
- _decode_x509_name(backend, gn.d.directoryName)
- )
- elif gn.type == backend._lib.GEN_EMAIL:
- # Convert to bytes and then decode to utf8. We don't use
- # asn1_string_to_utf8 here because it doesn't properly convert
- # utf8 from ia5strings.
- data = _asn1_string_to_bytes(backend, gn.d.rfc822Name).decode("utf8")
- # We don't use the constructor for RFC822Name so we can bypass
- # validation. This allows us to create RFC822Name objects that have
- # unicode chars when a certificate (against the RFC) contains them.
- return x509.RFC822Name._init_without_validation(data)
- elif gn.type == backend._lib.GEN_OTHERNAME:
- type_id = _obj2txt(backend, gn.d.otherName.type_id)
- value = _asn1_to_der(backend, gn.d.otherName.value)
- return x509.OtherName(x509.ObjectIdentifier(type_id), value)
- else:
- # x400Address or ediPartyName
- raise x509.UnsupportedGeneralNameType(
- "{0} is not a supported type".format(
- x509._GENERAL_NAMES.get(gn.type, gn.type)
- ),
- gn.type
- )
-
-
-def _decode_ocsp_no_check(backend, ext):
- return x509.OCSPNoCheck()
-
-
-def _decode_crl_number(backend, ext):
- asn1_int = backend._ffi.cast("ASN1_INTEGER *", ext)
- asn1_int = backend._ffi.gc(asn1_int, backend._lib.ASN1_INTEGER_free)
- return x509.CRLNumber(_asn1_integer_to_int(backend, asn1_int))
-
-
-def _decode_delta_crl_indicator(backend, ext):
- asn1_int = backend._ffi.cast("ASN1_INTEGER *", ext)
- asn1_int = backend._ffi.gc(asn1_int, backend._lib.ASN1_INTEGER_free)
- return x509.DeltaCRLIndicator(_asn1_integer_to_int(backend, asn1_int))
-
-
-class _X509ExtensionParser(object):
- def __init__(self, ext_count, get_ext, handlers):
- self.ext_count = ext_count
- self.get_ext = get_ext
- self.handlers = handlers
-
- def parse(self, backend, x509_obj):
- extensions = []
- seen_oids = set()
- for i in range(self.ext_count(backend, x509_obj)):
- ext = self.get_ext(backend, x509_obj, i)
- backend.openssl_assert(ext != backend._ffi.NULL)
- crit = backend._lib.X509_EXTENSION_get_critical(ext)
- critical = crit == 1
- oid = x509.ObjectIdentifier(
- _obj2txt(backend, backend._lib.X509_EXTENSION_get_object(ext))
- )
- if oid in seen_oids:
- raise x509.DuplicateExtension(
- "Duplicate {0} extension found".format(oid), oid
- )
-
- # These OIDs are only supported in OpenSSL 1.1.0+ but we want
- # to support them in all versions of OpenSSL so we decode them
- # ourselves.
- if oid == ExtensionOID.TLS_FEATURE:
- data = backend._lib.X509_EXTENSION_get_data(ext)
- parsed = _Integers.load(_asn1_string_to_bytes(backend, data))
- value = x509.TLSFeature(
- [_TLS_FEATURE_TYPE_TO_ENUM[x.native] for x in parsed]
- )
- extensions.append(x509.Extension(oid, critical, value))
- seen_oids.add(oid)
- continue
- elif oid == ExtensionOID.PRECERT_POISON:
- data = backend._lib.X509_EXTENSION_get_data(ext)
- parsed = asn1crypto.core.Null.load(
- _asn1_string_to_bytes(backend, data)
- )
- assert parsed == asn1crypto.core.Null()
- extensions.append(x509.Extension(
- oid, critical, x509.PrecertPoison()
- ))
- seen_oids.add(oid)
- continue
-
- try:
- handler = self.handlers[oid]
- except KeyError:
- # Dump the DER payload into an UnrecognizedExtension object
- data = backend._lib.X509_EXTENSION_get_data(ext)
- backend.openssl_assert(data != backend._ffi.NULL)
- der = backend._ffi.buffer(data.data, data.length)[:]
- unrecognized = x509.UnrecognizedExtension(oid, der)
- extensions.append(
- x509.Extension(oid, critical, unrecognized)
- )
- else:
- ext_data = backend._lib.X509V3_EXT_d2i(ext)
- if ext_data == backend._ffi.NULL:
- backend._consume_errors()
- raise ValueError(
- "The {0} extension is invalid and can't be "
- "parsed".format(oid)
- )
-
- value = handler(backend, ext_data)
- extensions.append(x509.Extension(oid, critical, value))
-
- seen_oids.add(oid)
-
- return x509.Extensions(extensions)
-
-
-def _decode_certificate_policies(backend, cp):
- cp = backend._ffi.cast("Cryptography_STACK_OF_POLICYINFO *", cp)
- cp = backend._ffi.gc(cp, backend._lib.CERTIFICATEPOLICIES_free)
-
- num = backend._lib.sk_POLICYINFO_num(cp)
- certificate_policies = []
- for i in range(num):
- qualifiers = None
- pi = backend._lib.sk_POLICYINFO_value(cp, i)
- oid = x509.ObjectIdentifier(_obj2txt(backend, pi.policyid))
- if pi.qualifiers != backend._ffi.NULL:
- qnum = backend._lib.sk_POLICYQUALINFO_num(pi.qualifiers)
- qualifiers = []
- for j in range(qnum):
- pqi = backend._lib.sk_POLICYQUALINFO_value(
- pi.qualifiers, j
- )
- pqualid = x509.ObjectIdentifier(
- _obj2txt(backend, pqi.pqualid)
- )
- if pqualid == CertificatePoliciesOID.CPS_QUALIFIER:
- cpsuri = backend._ffi.buffer(
- pqi.d.cpsuri.data, pqi.d.cpsuri.length
- )[:].decode('ascii')
- qualifiers.append(cpsuri)
- else:
- assert pqualid == CertificatePoliciesOID.CPS_USER_NOTICE
- user_notice = _decode_user_notice(
- backend, pqi.d.usernotice
- )
- qualifiers.append(user_notice)
-
- certificate_policies.append(
- x509.PolicyInformation(oid, qualifiers)
- )
-
- return x509.CertificatePolicies(certificate_policies)
-
-
-def _decode_user_notice(backend, un):
- explicit_text = None
- notice_reference = None
-
- if un.exptext != backend._ffi.NULL:
- explicit_text = _asn1_string_to_utf8(backend, un.exptext)
-
- if un.noticeref != backend._ffi.NULL:
- organization = _asn1_string_to_utf8(
- backend, un.noticeref.organization
- )
-
- num = backend._lib.sk_ASN1_INTEGER_num(
- un.noticeref.noticenos
- )
- notice_numbers = []
- for i in range(num):
- asn1_int = backend._lib.sk_ASN1_INTEGER_value(
- un.noticeref.noticenos, i
- )
- notice_num = _asn1_integer_to_int(backend, asn1_int)
- notice_numbers.append(notice_num)
-
- notice_reference = x509.NoticeReference(
- organization, notice_numbers
- )
-
- return x509.UserNotice(notice_reference, explicit_text)
-
-
-def _decode_basic_constraints(backend, bc_st):
- basic_constraints = backend._ffi.cast("BASIC_CONSTRAINTS *", bc_st)
- basic_constraints = backend._ffi.gc(
- basic_constraints, backend._lib.BASIC_CONSTRAINTS_free
- )
- # The byte representation of an ASN.1 boolean true is \xff. OpenSSL
- # chooses to just map this to its ordinal value, so true is 255 and
- # false is 0.
- ca = basic_constraints.ca == 255
- path_length = _asn1_integer_to_int_or_none(
- backend, basic_constraints.pathlen
- )
-
- return x509.BasicConstraints(ca, path_length)
-
-
-def _decode_subject_key_identifier(backend, asn1_string):
- asn1_string = backend._ffi.cast("ASN1_OCTET_STRING *", asn1_string)
- asn1_string = backend._ffi.gc(
- asn1_string, backend._lib.ASN1_OCTET_STRING_free
- )
- return x509.SubjectKeyIdentifier(
- backend._ffi.buffer(asn1_string.data, asn1_string.length)[:]
- )
-
-
-def _decode_authority_key_identifier(backend, akid):
- akid = backend._ffi.cast("AUTHORITY_KEYID *", akid)
- akid = backend._ffi.gc(akid, backend._lib.AUTHORITY_KEYID_free)
- key_identifier = None
- authority_cert_issuer = None
-
- if akid.keyid != backend._ffi.NULL:
- key_identifier = backend._ffi.buffer(
- akid.keyid.data, akid.keyid.length
- )[:]
-
- if akid.issuer != backend._ffi.NULL:
- authority_cert_issuer = _decode_general_names(
- backend, akid.issuer
- )
-
- authority_cert_serial_number = _asn1_integer_to_int_or_none(
- backend, akid.serial
- )
-
- return x509.AuthorityKeyIdentifier(
- key_identifier, authority_cert_issuer, authority_cert_serial_number
- )
-
-
-def _decode_authority_information_access(backend, aia):
- aia = backend._ffi.cast("Cryptography_STACK_OF_ACCESS_DESCRIPTION *", aia)
- aia = backend._ffi.gc(aia, backend._lib.sk_ACCESS_DESCRIPTION_free)
- num = backend._lib.sk_ACCESS_DESCRIPTION_num(aia)
- access_descriptions = []
- for i in range(num):
- ad = backend._lib.sk_ACCESS_DESCRIPTION_value(aia, i)
- backend.openssl_assert(ad.method != backend._ffi.NULL)
- oid = x509.ObjectIdentifier(_obj2txt(backend, ad.method))
- backend.openssl_assert(ad.location != backend._ffi.NULL)
- gn = _decode_general_name(backend, ad.location)
- access_descriptions.append(x509.AccessDescription(oid, gn))
-
- return x509.AuthorityInformationAccess(access_descriptions)
-
-
-def _decode_key_usage(backend, bit_string):
- bit_string = backend._ffi.cast("ASN1_BIT_STRING *", bit_string)
- bit_string = backend._ffi.gc(bit_string, backend._lib.ASN1_BIT_STRING_free)
- get_bit = backend._lib.ASN1_BIT_STRING_get_bit
- digital_signature = get_bit(bit_string, 0) == 1
- content_commitment = get_bit(bit_string, 1) == 1
- key_encipherment = get_bit(bit_string, 2) == 1
- data_encipherment = get_bit(bit_string, 3) == 1
- key_agreement = get_bit(bit_string, 4) == 1
- key_cert_sign = get_bit(bit_string, 5) == 1
- crl_sign = get_bit(bit_string, 6) == 1
- encipher_only = get_bit(bit_string, 7) == 1
- decipher_only = get_bit(bit_string, 8) == 1
- return x509.KeyUsage(
- digital_signature,
- content_commitment,
- key_encipherment,
- data_encipherment,
- key_agreement,
- key_cert_sign,
- crl_sign,
- encipher_only,
- decipher_only
- )
-
-
-def _decode_general_names_extension(backend, gns):
- gns = backend._ffi.cast("GENERAL_NAMES *", gns)
- gns = backend._ffi.gc(gns, backend._lib.GENERAL_NAMES_free)
- general_names = _decode_general_names(backend, gns)
- return general_names
-
-
-def _decode_subject_alt_name(backend, ext):
- return x509.SubjectAlternativeName(
- _decode_general_names_extension(backend, ext)
- )
-
-
-def _decode_issuer_alt_name(backend, ext):
- return x509.IssuerAlternativeName(
- _decode_general_names_extension(backend, ext)
- )
-
-
-def _decode_name_constraints(backend, nc):
- nc = backend._ffi.cast("NAME_CONSTRAINTS *", nc)
- nc = backend._ffi.gc(nc, backend._lib.NAME_CONSTRAINTS_free)
- permitted = _decode_general_subtrees(backend, nc.permittedSubtrees)
- excluded = _decode_general_subtrees(backend, nc.excludedSubtrees)
- return x509.NameConstraints(
- permitted_subtrees=permitted, excluded_subtrees=excluded
- )
-
-
-def _decode_general_subtrees(backend, stack_subtrees):
- if stack_subtrees == backend._ffi.NULL:
- return None
-
- num = backend._lib.sk_GENERAL_SUBTREE_num(stack_subtrees)
- subtrees = []
-
- for i in range(num):
- obj = backend._lib.sk_GENERAL_SUBTREE_value(stack_subtrees, i)
- backend.openssl_assert(obj != backend._ffi.NULL)
- name = _decode_general_name(backend, obj.base)
- subtrees.append(name)
-
- return subtrees
-
-
-def _decode_policy_constraints(backend, pc):
- pc = backend._ffi.cast("POLICY_CONSTRAINTS *", pc)
- pc = backend._ffi.gc(pc, backend._lib.POLICY_CONSTRAINTS_free)
-
- require_explicit_policy = _asn1_integer_to_int_or_none(
- backend, pc.requireExplicitPolicy
- )
- inhibit_policy_mapping = _asn1_integer_to_int_or_none(
- backend, pc.inhibitPolicyMapping
- )
-
- return x509.PolicyConstraints(
- require_explicit_policy, inhibit_policy_mapping
- )
-
-
-def _decode_extended_key_usage(backend, sk):
- sk = backend._ffi.cast("Cryptography_STACK_OF_ASN1_OBJECT *", sk)
- sk = backend._ffi.gc(sk, backend._lib.sk_ASN1_OBJECT_free)
- num = backend._lib.sk_ASN1_OBJECT_num(sk)
- ekus = []
-
- for i in range(num):
- obj = backend._lib.sk_ASN1_OBJECT_value(sk, i)
- backend.openssl_assert(obj != backend._ffi.NULL)
- oid = x509.ObjectIdentifier(_obj2txt(backend, obj))
- ekus.append(oid)
-
- return x509.ExtendedKeyUsage(ekus)
-
-
-_DISTPOINT_TYPE_FULLNAME = 0
-_DISTPOINT_TYPE_RELATIVENAME = 1
-
-
-def _decode_dist_points(backend, cdps):
- cdps = backend._ffi.cast("Cryptography_STACK_OF_DIST_POINT *", cdps)
- cdps = backend._ffi.gc(cdps, backend._lib.CRL_DIST_POINTS_free)
-
- num = backend._lib.sk_DIST_POINT_num(cdps)
- dist_points = []
- for i in range(num):
- full_name = None
- relative_name = None
- crl_issuer = None
- reasons = None
- cdp = backend._lib.sk_DIST_POINT_value(cdps, i)
- if cdp.reasons != backend._ffi.NULL:
- reasons = _decode_reasons(backend, cdp.reasons)
-
- if cdp.CRLissuer != backend._ffi.NULL:
- crl_issuer = _decode_general_names(backend, cdp.CRLissuer)
-
- # Certificates may have a crl_issuer/reasons and no distribution
- # point so make sure it's not null.
- if cdp.distpoint != backend._ffi.NULL:
- full_name, relative_name = _decode_distpoint(
- backend, cdp.distpoint
- )
-
- dist_points.append(
- x509.DistributionPoint(
- full_name, relative_name, reasons, crl_issuer
- )
- )
-
- return dist_points
-
-
-# ReasonFlags ::= BIT STRING {
-# unused (0),
-# keyCompromise (1),
-# cACompromise (2),
-# affiliationChanged (3),
-# superseded (4),
-# cessationOfOperation (5),
-# certificateHold (6),
-# privilegeWithdrawn (7),
-# aACompromise (8) }
-_REASON_BIT_MAPPING = {
- 1: x509.ReasonFlags.key_compromise,
- 2: x509.ReasonFlags.ca_compromise,
- 3: x509.ReasonFlags.affiliation_changed,
- 4: x509.ReasonFlags.superseded,
- 5: x509.ReasonFlags.cessation_of_operation,
- 6: x509.ReasonFlags.certificate_hold,
- 7: x509.ReasonFlags.privilege_withdrawn,
- 8: x509.ReasonFlags.aa_compromise,
-}
-
-
-def _decode_reasons(backend, reasons):
- # We will check each bit from RFC 5280
- enum_reasons = []
- for bit_position, reason in six.iteritems(_REASON_BIT_MAPPING):
- if backend._lib.ASN1_BIT_STRING_get_bit(reasons, bit_position):
- enum_reasons.append(reason)
-
- return frozenset(enum_reasons)
-
-
-def _decode_distpoint(backend, distpoint):
- if distpoint.type == _DISTPOINT_TYPE_FULLNAME:
- full_name = _decode_general_names(backend, distpoint.name.fullname)
- return full_name, None
-
- # OpenSSL code doesn't test for a specific type for
- # relativename, everything that isn't fullname is considered
- # relativename. Per RFC 5280:
- #
- # DistributionPointName ::= CHOICE {
- # fullName [0] GeneralNames,
- # nameRelativeToCRLIssuer [1] RelativeDistinguishedName }
- rns = distpoint.name.relativename
- rnum = backend._lib.sk_X509_NAME_ENTRY_num(rns)
- attributes = set()
- for i in range(rnum):
- rn = backend._lib.sk_X509_NAME_ENTRY_value(
- rns, i
- )
- backend.openssl_assert(rn != backend._ffi.NULL)
- attributes.add(
- _decode_x509_name_entry(backend, rn)
- )
-
- relative_name = x509.RelativeDistinguishedName(attributes)
-
- return None, relative_name
-
-
-def _decode_crl_distribution_points(backend, cdps):
- dist_points = _decode_dist_points(backend, cdps)
- return x509.CRLDistributionPoints(dist_points)
-
-
-def _decode_freshest_crl(backend, cdps):
- dist_points = _decode_dist_points(backend, cdps)
- return x509.FreshestCRL(dist_points)
-
-
-def _decode_inhibit_any_policy(backend, asn1_int):
- asn1_int = backend._ffi.cast("ASN1_INTEGER *", asn1_int)
- asn1_int = backend._ffi.gc(asn1_int, backend._lib.ASN1_INTEGER_free)
- skip_certs = _asn1_integer_to_int(backend, asn1_int)
- return x509.InhibitAnyPolicy(skip_certs)
-
-
-def _decode_precert_signed_certificate_timestamps(backend, asn1_scts):
- from cryptography.hazmat.backends.openssl.x509 import (
- _SignedCertificateTimestamp
- )
- asn1_scts = backend._ffi.cast("Cryptography_STACK_OF_SCT *", asn1_scts)
- asn1_scts = backend._ffi.gc(asn1_scts, backend._lib.SCT_LIST_free)
-
- scts = []
- for i in range(backend._lib.sk_SCT_num(asn1_scts)):
- sct = backend._lib.sk_SCT_value(asn1_scts, i)
-
- scts.append(_SignedCertificateTimestamp(backend, asn1_scts, sct))
- return x509.PrecertificateSignedCertificateTimestamps(scts)
-
-
-# CRLReason ::= ENUMERATED {
-# unspecified (0),
-# keyCompromise (1),
-# cACompromise (2),
-# affiliationChanged (3),
-# superseded (4),
-# cessationOfOperation (5),
-# certificateHold (6),
-# -- value 7 is not used
-# removeFromCRL (8),
-# privilegeWithdrawn (9),
-# aACompromise (10) }
-_CRL_ENTRY_REASON_CODE_TO_ENUM = {
- 0: x509.ReasonFlags.unspecified,
- 1: x509.ReasonFlags.key_compromise,
- 2: x509.ReasonFlags.ca_compromise,
- 3: x509.ReasonFlags.affiliation_changed,
- 4: x509.ReasonFlags.superseded,
- 5: x509.ReasonFlags.cessation_of_operation,
- 6: x509.ReasonFlags.certificate_hold,
- 8: x509.ReasonFlags.remove_from_crl,
- 9: x509.ReasonFlags.privilege_withdrawn,
- 10: x509.ReasonFlags.aa_compromise,
-}
-
-
-_CRL_ENTRY_REASON_ENUM_TO_CODE = {
- x509.ReasonFlags.unspecified: 0,
- x509.ReasonFlags.key_compromise: 1,
- x509.ReasonFlags.ca_compromise: 2,
- x509.ReasonFlags.affiliation_changed: 3,
- x509.ReasonFlags.superseded: 4,
- x509.ReasonFlags.cessation_of_operation: 5,
- x509.ReasonFlags.certificate_hold: 6,
- x509.ReasonFlags.remove_from_crl: 8,
- x509.ReasonFlags.privilege_withdrawn: 9,
- x509.ReasonFlags.aa_compromise: 10
-}
-
-
-def _decode_crl_reason(backend, enum):
- enum = backend._ffi.cast("ASN1_ENUMERATED *", enum)
- enum = backend._ffi.gc(enum, backend._lib.ASN1_ENUMERATED_free)
- code = backend._lib.ASN1_ENUMERATED_get(enum)
-
- try:
- return x509.CRLReason(_CRL_ENTRY_REASON_CODE_TO_ENUM[code])
- except KeyError:
- raise ValueError("Unsupported reason code: {0}".format(code))
-
-
-def _decode_invalidity_date(backend, inv_date):
- generalized_time = backend._ffi.cast(
- "ASN1_GENERALIZEDTIME *", inv_date
- )
- generalized_time = backend._ffi.gc(
- generalized_time, backend._lib.ASN1_GENERALIZEDTIME_free
- )
- return x509.InvalidityDate(
- _parse_asn1_generalized_time(backend, generalized_time)
- )
-
-
-def _decode_cert_issuer(backend, gns):
- gns = backend._ffi.cast("GENERAL_NAMES *", gns)
- gns = backend._ffi.gc(gns, backend._lib.GENERAL_NAMES_free)
- general_names = _decode_general_names(backend, gns)
- return x509.CertificateIssuer(general_names)
-
-
-def _asn1_to_der(backend, asn1_type):
- buf = backend._ffi.new("unsigned char **")
- res = backend._lib.i2d_ASN1_TYPE(asn1_type, buf)
- backend.openssl_assert(res >= 0)
- backend.openssl_assert(buf[0] != backend._ffi.NULL)
- buf = backend._ffi.gc(
- buf, lambda buffer: backend._lib.OPENSSL_free(buffer[0])
- )
- return backend._ffi.buffer(buf[0], res)[:]
-
-
-def _asn1_integer_to_int(backend, asn1_int):
- bn = backend._lib.ASN1_INTEGER_to_BN(asn1_int, backend._ffi.NULL)
- backend.openssl_assert(bn != backend._ffi.NULL)
- bn = backend._ffi.gc(bn, backend._lib.BN_free)
- return backend._bn_to_int(bn)
-
-
-def _asn1_integer_to_int_or_none(backend, asn1_int):
- if asn1_int == backend._ffi.NULL:
- return None
- else:
- return _asn1_integer_to_int(backend, asn1_int)
-
-
-def _asn1_string_to_bytes(backend, asn1_string):
- return backend._ffi.buffer(asn1_string.data, asn1_string.length)[:]
-
-
-def _asn1_string_to_ascii(backend, asn1_string):
- return _asn1_string_to_bytes(backend, asn1_string).decode("ascii")
-
-
-def _asn1_string_to_utf8(backend, asn1_string):
- buf = backend._ffi.new("unsigned char **")
- res = backend._lib.ASN1_STRING_to_UTF8(buf, asn1_string)
- if res == -1:
- raise ValueError(
- "Unsupported ASN1 string type. Type: {0}".format(asn1_string.type)
- )
-
- backend.openssl_assert(buf[0] != backend._ffi.NULL)
- buf = backend._ffi.gc(
- buf, lambda buffer: backend._lib.OPENSSL_free(buffer[0])
- )
- return backend._ffi.buffer(buf[0], res)[:].decode('utf8')
-
-
-def _parse_asn1_time(backend, asn1_time):
- backend.openssl_assert(asn1_time != backend._ffi.NULL)
- generalized_time = backend._lib.ASN1_TIME_to_generalizedtime(
- asn1_time, backend._ffi.NULL
- )
- if generalized_time == backend._ffi.NULL:
- raise ValueError(
- "Couldn't parse ASN.1 time as generalizedtime {!r}".format(
- _asn1_string_to_bytes(backend, asn1_time)
- )
- )
-
- generalized_time = backend._ffi.gc(
- generalized_time, backend._lib.ASN1_GENERALIZEDTIME_free
- )
- return _parse_asn1_generalized_time(backend, generalized_time)
-
-
-def _parse_asn1_generalized_time(backend, generalized_time):
- time = _asn1_string_to_ascii(
- backend, backend._ffi.cast("ASN1_STRING *", generalized_time)
- )
- return datetime.datetime.strptime(time, "%Y%m%d%H%M%SZ")
-
-
-def _decode_nonce(backend, nonce):
- nonce = backend._ffi.cast("ASN1_OCTET_STRING *", nonce)
- nonce = backend._ffi.gc(nonce, backend._lib.ASN1_OCTET_STRING_free)
- return x509.OCSPNonce(_asn1_string_to_bytes(backend, nonce))
-
-
-_EXTENSION_HANDLERS_NO_SCT = {
- ExtensionOID.BASIC_CONSTRAINTS: _decode_basic_constraints,
- ExtensionOID.SUBJECT_KEY_IDENTIFIER: _decode_subject_key_identifier,
- ExtensionOID.KEY_USAGE: _decode_key_usage,
- ExtensionOID.SUBJECT_ALTERNATIVE_NAME: _decode_subject_alt_name,
- ExtensionOID.EXTENDED_KEY_USAGE: _decode_extended_key_usage,
- ExtensionOID.AUTHORITY_KEY_IDENTIFIER: _decode_authority_key_identifier,
- ExtensionOID.AUTHORITY_INFORMATION_ACCESS: (
- _decode_authority_information_access
- ),
- ExtensionOID.CERTIFICATE_POLICIES: _decode_certificate_policies,
- ExtensionOID.CRL_DISTRIBUTION_POINTS: _decode_crl_distribution_points,
- ExtensionOID.FRESHEST_CRL: _decode_freshest_crl,
- ExtensionOID.OCSP_NO_CHECK: _decode_ocsp_no_check,
- ExtensionOID.INHIBIT_ANY_POLICY: _decode_inhibit_any_policy,
- ExtensionOID.ISSUER_ALTERNATIVE_NAME: _decode_issuer_alt_name,
- ExtensionOID.NAME_CONSTRAINTS: _decode_name_constraints,
- ExtensionOID.POLICY_CONSTRAINTS: _decode_policy_constraints,
-}
-_EXTENSION_HANDLERS = _EXTENSION_HANDLERS_NO_SCT.copy()
-_EXTENSION_HANDLERS[
- ExtensionOID.PRECERT_SIGNED_CERTIFICATE_TIMESTAMPS
-] = _decode_precert_signed_certificate_timestamps
-
-
-_REVOKED_EXTENSION_HANDLERS = {
- CRLEntryExtensionOID.CRL_REASON: _decode_crl_reason,
- CRLEntryExtensionOID.INVALIDITY_DATE: _decode_invalidity_date,
- CRLEntryExtensionOID.CERTIFICATE_ISSUER: _decode_cert_issuer,
-}
-
-_CRL_EXTENSION_HANDLERS = {
- ExtensionOID.CRL_NUMBER: _decode_crl_number,
- ExtensionOID.DELTA_CRL_INDICATOR: _decode_delta_crl_indicator,
- ExtensionOID.AUTHORITY_KEY_IDENTIFIER: _decode_authority_key_identifier,
- ExtensionOID.ISSUER_ALTERNATIVE_NAME: _decode_issuer_alt_name,
- ExtensionOID.AUTHORITY_INFORMATION_ACCESS: (
- _decode_authority_information_access
- ),
-}
-
-_OCSP_REQ_EXTENSION_HANDLERS = {
- OCSPExtensionOID.NONCE: _decode_nonce,
-}
-
-_OCSP_BASICRESP_EXTENSION_HANDLERS = {
- OCSPExtensionOID.NONCE: _decode_nonce,
-}
-
-_CERTIFICATE_EXTENSION_PARSER_NO_SCT = _X509ExtensionParser(
- ext_count=lambda backend, x: backend._lib.X509_get_ext_count(x),
- get_ext=lambda backend, x, i: backend._lib.X509_get_ext(x, i),
- handlers=_EXTENSION_HANDLERS_NO_SCT
-)
-
-_CERTIFICATE_EXTENSION_PARSER = _X509ExtensionParser(
- ext_count=lambda backend, x: backend._lib.X509_get_ext_count(x),
- get_ext=lambda backend, x, i: backend._lib.X509_get_ext(x, i),
- handlers=_EXTENSION_HANDLERS
-)
-
-_CSR_EXTENSION_PARSER = _X509ExtensionParser(
- ext_count=lambda backend, x: backend._lib.sk_X509_EXTENSION_num(x),
- get_ext=lambda backend, x, i: backend._lib.sk_X509_EXTENSION_value(x, i),
- handlers=_EXTENSION_HANDLERS
-)
-
-_REVOKED_CERTIFICATE_EXTENSION_PARSER = _X509ExtensionParser(
- ext_count=lambda backend, x: backend._lib.X509_REVOKED_get_ext_count(x),
- get_ext=lambda backend, x, i: backend._lib.X509_REVOKED_get_ext(x, i),
- handlers=_REVOKED_EXTENSION_HANDLERS,
-)
-
-_CRL_EXTENSION_PARSER = _X509ExtensionParser(
- ext_count=lambda backend, x: backend._lib.X509_CRL_get_ext_count(x),
- get_ext=lambda backend, x, i: backend._lib.X509_CRL_get_ext(x, i),
- handlers=_CRL_EXTENSION_HANDLERS,
-)
-
-_OCSP_REQ_EXT_PARSER = _X509ExtensionParser(
- ext_count=lambda backend, x: backend._lib.OCSP_REQUEST_get_ext_count(x),
- get_ext=lambda backend, x, i: backend._lib.OCSP_REQUEST_get_ext(x, i),
- handlers=_OCSP_REQ_EXTENSION_HANDLERS,
-)
-
-_OCSP_BASICRESP_EXT_PARSER = _X509ExtensionParser(
- ext_count=lambda backend, x: backend._lib.OCSP_BASICRESP_get_ext_count(x),
- get_ext=lambda backend, x, i: backend._lib.OCSP_BASICRESP_get_ext(x, i),
- handlers=_OCSP_BASICRESP_EXTENSION_HANDLERS,
-)
diff --git a/lib/cryptography/hazmat/backends/openssl/dh.py b/lib/cryptography/hazmat/backends/openssl/dh.py
deleted file mode 100644
index 095f062339..0000000000
--- a/lib/cryptography/hazmat/backends/openssl/dh.py
+++ /dev/null
@@ -1,280 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-from cryptography import utils
-from cryptography.exceptions import UnsupportedAlgorithm, _Reasons
-from cryptography.hazmat.primitives import serialization
-from cryptography.hazmat.primitives.asymmetric import dh
-
-
-def _dh_params_dup(dh_cdata, backend):
- lib = backend._lib
- ffi = backend._ffi
-
- param_cdata = lib.DHparams_dup(dh_cdata)
- backend.openssl_assert(param_cdata != ffi.NULL)
- param_cdata = ffi.gc(param_cdata, lib.DH_free)
- if lib.CRYPTOGRAPHY_OPENSSL_LESS_THAN_102:
- # In OpenSSL versions < 1.0.2 or libressl DHparams_dup don't copy q
- q = ffi.new("BIGNUM **")
- lib.DH_get0_pqg(dh_cdata, ffi.NULL, q, ffi.NULL)
- q_dup = lib.BN_dup(q[0])
- res = lib.DH_set0_pqg(param_cdata, ffi.NULL, q_dup, ffi.NULL)
- backend.openssl_assert(res == 1)
-
- return param_cdata
-
-
-def _dh_cdata_to_parameters(dh_cdata, backend):
- param_cdata = _dh_params_dup(dh_cdata, backend)
- return _DHParameters(backend, param_cdata)
-
-
-@utils.register_interface(dh.DHParametersWithSerialization)
-class _DHParameters(object):
- def __init__(self, backend, dh_cdata):
- self._backend = backend
- self._dh_cdata = dh_cdata
-
- def parameter_numbers(self):
- p = self._backend._ffi.new("BIGNUM **")
- g = self._backend._ffi.new("BIGNUM **")
- q = self._backend._ffi.new("BIGNUM **")
- self._backend._lib.DH_get0_pqg(self._dh_cdata, p, q, g)
- self._backend.openssl_assert(p[0] != self._backend._ffi.NULL)
- self._backend.openssl_assert(g[0] != self._backend._ffi.NULL)
- if q[0] == self._backend._ffi.NULL:
- q_val = None
- else:
- q_val = self._backend._bn_to_int(q[0])
- return dh.DHParameterNumbers(
- p=self._backend._bn_to_int(p[0]),
- g=self._backend._bn_to_int(g[0]),
- q=q_val
- )
-
- def generate_private_key(self):
- return self._backend.generate_dh_private_key(self)
-
- def parameter_bytes(self, encoding, format):
- if format is not serialization.ParameterFormat.PKCS3:
- raise ValueError(
- "Only PKCS3 serialization is supported"
- )
- if not self._backend._lib.Cryptography_HAS_EVP_PKEY_DHX:
- q = self._backend._ffi.new("BIGNUM **")
- self._backend._lib.DH_get0_pqg(self._dh_cdata,
- self._backend._ffi.NULL,
- q,
- self._backend._ffi.NULL)
- if q[0] != self._backend._ffi.NULL:
- raise UnsupportedAlgorithm(
- "DH X9.42 serialization is not supported",
- _Reasons.UNSUPPORTED_SERIALIZATION)
-
- return self._backend._parameter_bytes(
- encoding,
- format,
- self._dh_cdata
- )
-
-
-def _handle_dh_compute_key_error(errors, backend):
- lib = backend._lib
-
- backend.openssl_assert(
- errors[0]._lib_reason_match(
- lib.ERR_LIB_DH, lib.DH_R_INVALID_PUBKEY
- )
- )
-
- raise ValueError("Public key value is invalid for this exchange.")
-
-
-def _get_dh_num_bits(backend, dh_cdata):
- p = backend._ffi.new("BIGNUM **")
- backend._lib.DH_get0_pqg(dh_cdata, p,
- backend._ffi.NULL,
- backend._ffi.NULL)
- backend.openssl_assert(p[0] != backend._ffi.NULL)
- return backend._lib.BN_num_bits(p[0])
-
-
-@utils.register_interface(dh.DHPrivateKeyWithSerialization)
-class _DHPrivateKey(object):
- def __init__(self, backend, dh_cdata, evp_pkey):
- self._backend = backend
- self._dh_cdata = dh_cdata
- self._evp_pkey = evp_pkey
- self._key_size_bytes = self._backend._lib.DH_size(dh_cdata)
-
- @property
- def key_size(self):
- return _get_dh_num_bits(self._backend, self._dh_cdata)
-
- def private_numbers(self):
- p = self._backend._ffi.new("BIGNUM **")
- g = self._backend._ffi.new("BIGNUM **")
- q = self._backend._ffi.new("BIGNUM **")
- self._backend._lib.DH_get0_pqg(self._dh_cdata, p, q, g)
- self._backend.openssl_assert(p[0] != self._backend._ffi.NULL)
- self._backend.openssl_assert(g[0] != self._backend._ffi.NULL)
- if q[0] == self._backend._ffi.NULL:
- q_val = None
- else:
- q_val = self._backend._bn_to_int(q[0])
- pub_key = self._backend._ffi.new("BIGNUM **")
- priv_key = self._backend._ffi.new("BIGNUM **")
- self._backend._lib.DH_get0_key(self._dh_cdata, pub_key, priv_key)
- self._backend.openssl_assert(pub_key[0] != self._backend._ffi.NULL)
- self._backend.openssl_assert(priv_key[0] != self._backend._ffi.NULL)
- return dh.DHPrivateNumbers(
- public_numbers=dh.DHPublicNumbers(
- parameter_numbers=dh.DHParameterNumbers(
- p=self._backend._bn_to_int(p[0]),
- g=self._backend._bn_to_int(g[0]),
- q=q_val
- ),
- y=self._backend._bn_to_int(pub_key[0])
- ),
- x=self._backend._bn_to_int(priv_key[0])
- )
-
- def exchange(self, peer_public_key):
-
- buf = self._backend._ffi.new("unsigned char[]", self._key_size_bytes)
- pub_key = self._backend._ffi.new("BIGNUM **")
- self._backend._lib.DH_get0_key(peer_public_key._dh_cdata, pub_key,
- self._backend._ffi.NULL)
- self._backend.openssl_assert(pub_key[0] != self._backend._ffi.NULL)
- res = self._backend._lib.DH_compute_key(
- buf,
- pub_key[0],
- self._dh_cdata
- )
-
- if res == -1:
- errors = self._backend._consume_errors()
- return _handle_dh_compute_key_error(errors, self._backend)
- else:
- self._backend.openssl_assert(res >= 1)
-
- key = self._backend._ffi.buffer(buf)[:res]
- pad = self._key_size_bytes - len(key)
-
- if pad > 0:
- key = (b"\x00" * pad) + key
-
- return key
-
- def public_key(self):
- dh_cdata = _dh_params_dup(self._dh_cdata, self._backend)
- pub_key = self._backend._ffi.new("BIGNUM **")
- self._backend._lib.DH_get0_key(self._dh_cdata,
- pub_key, self._backend._ffi.NULL)
- self._backend.openssl_assert(pub_key[0] != self._backend._ffi.NULL)
- pub_key_dup = self._backend._lib.BN_dup(pub_key[0])
- self._backend.openssl_assert(pub_key_dup != self._backend._ffi.NULL)
-
- res = self._backend._lib.DH_set0_key(dh_cdata,
- pub_key_dup,
- self._backend._ffi.NULL)
- self._backend.openssl_assert(res == 1)
- evp_pkey = self._backend._dh_cdata_to_evp_pkey(dh_cdata)
- return _DHPublicKey(self._backend, dh_cdata, evp_pkey)
-
- def parameters(self):
- return _dh_cdata_to_parameters(self._dh_cdata, self._backend)
-
- def private_bytes(self, encoding, format, encryption_algorithm):
- if format is not serialization.PrivateFormat.PKCS8:
- raise ValueError(
- "DH private keys support only PKCS8 serialization"
- )
- if not self._backend._lib.Cryptography_HAS_EVP_PKEY_DHX:
- q = self._backend._ffi.new("BIGNUM **")
- self._backend._lib.DH_get0_pqg(self._dh_cdata,
- self._backend._ffi.NULL,
- q,
- self._backend._ffi.NULL)
- if q[0] != self._backend._ffi.NULL:
- raise UnsupportedAlgorithm(
- "DH X9.42 serialization is not supported",
- _Reasons.UNSUPPORTED_SERIALIZATION)
-
- return self._backend._private_key_bytes(
- encoding,
- format,
- encryption_algorithm,
- self._evp_pkey,
- self._dh_cdata
- )
-
-
-@utils.register_interface(dh.DHPublicKeyWithSerialization)
-class _DHPublicKey(object):
- def __init__(self, backend, dh_cdata, evp_pkey):
- self._backend = backend
- self._dh_cdata = dh_cdata
- self._evp_pkey = evp_pkey
- self._key_size_bits = _get_dh_num_bits(self._backend, self._dh_cdata)
-
- @property
- def key_size(self):
- return self._key_size_bits
-
- def public_numbers(self):
- p = self._backend._ffi.new("BIGNUM **")
- g = self._backend._ffi.new("BIGNUM **")
- q = self._backend._ffi.new("BIGNUM **")
- self._backend._lib.DH_get0_pqg(self._dh_cdata, p, q, g)
- self._backend.openssl_assert(p[0] != self._backend._ffi.NULL)
- self._backend.openssl_assert(g[0] != self._backend._ffi.NULL)
- if q[0] == self._backend._ffi.NULL:
- q_val = None
- else:
- q_val = self._backend._bn_to_int(q[0])
- pub_key = self._backend._ffi.new("BIGNUM **")
- self._backend._lib.DH_get0_key(self._dh_cdata,
- pub_key, self._backend._ffi.NULL)
- self._backend.openssl_assert(pub_key[0] != self._backend._ffi.NULL)
- return dh.DHPublicNumbers(
- parameter_numbers=dh.DHParameterNumbers(
- p=self._backend._bn_to_int(p[0]),
- g=self._backend._bn_to_int(g[0]),
- q=q_val
- ),
- y=self._backend._bn_to_int(pub_key[0])
- )
-
- def parameters(self):
- return _dh_cdata_to_parameters(self._dh_cdata, self._backend)
-
- def public_bytes(self, encoding, format):
- if format is not serialization.PublicFormat.SubjectPublicKeyInfo:
- raise ValueError(
- "DH public keys support only "
- "SubjectPublicKeyInfo serialization"
- )
-
- if not self._backend._lib.Cryptography_HAS_EVP_PKEY_DHX:
- q = self._backend._ffi.new("BIGNUM **")
- self._backend._lib.DH_get0_pqg(self._dh_cdata,
- self._backend._ffi.NULL,
- q,
- self._backend._ffi.NULL)
- if q[0] != self._backend._ffi.NULL:
- raise UnsupportedAlgorithm(
- "DH X9.42 serialization is not supported",
- _Reasons.UNSUPPORTED_SERIALIZATION)
-
- return self._backend._public_key_bytes(
- encoding,
- format,
- self,
- self._evp_pkey,
- None
- )
diff --git a/lib/cryptography/hazmat/backends/openssl/dsa.py b/lib/cryptography/hazmat/backends/openssl/dsa.py
deleted file mode 100644
index 48886e45df..0000000000
--- a/lib/cryptography/hazmat/backends/openssl/dsa.py
+++ /dev/null
@@ -1,269 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-from cryptography import utils
-from cryptography.exceptions import InvalidSignature
-from cryptography.hazmat.backends.openssl.utils import (
- _calculate_digest_and_algorithm, _check_not_prehashed,
- _warn_sign_verify_deprecated
-)
-from cryptography.hazmat.primitives import hashes, serialization
-from cryptography.hazmat.primitives.asymmetric import (
- AsymmetricSignatureContext, AsymmetricVerificationContext, dsa
-)
-
-
-def _dsa_sig_sign(backend, private_key, data):
- sig_buf_len = backend._lib.DSA_size(private_key._dsa_cdata)
- sig_buf = backend._ffi.new("unsigned char[]", sig_buf_len)
- buflen = backend._ffi.new("unsigned int *")
-
- # The first parameter passed to DSA_sign is unused by OpenSSL but
- # must be an integer.
- res = backend._lib.DSA_sign(
- 0, data, len(data), sig_buf, buflen, private_key._dsa_cdata
- )
- backend.openssl_assert(res == 1)
- backend.openssl_assert(buflen[0])
-
- return backend._ffi.buffer(sig_buf)[:buflen[0]]
-
-
-def _dsa_sig_verify(backend, public_key, signature, data):
- # The first parameter passed to DSA_verify is unused by OpenSSL but
- # must be an integer.
- res = backend._lib.DSA_verify(
- 0, data, len(data), signature, len(signature), public_key._dsa_cdata
- )
-
- if res != 1:
- backend._consume_errors()
- raise InvalidSignature
-
-
-@utils.register_interface(AsymmetricVerificationContext)
-class _DSAVerificationContext(object):
- def __init__(self, backend, public_key, signature, algorithm):
- self._backend = backend
- self._public_key = public_key
- self._signature = signature
- self._algorithm = algorithm
-
- self._hash_ctx = hashes.Hash(self._algorithm, self._backend)
-
- def update(self, data):
- self._hash_ctx.update(data)
-
- def verify(self):
- data_to_verify = self._hash_ctx.finalize()
-
- _dsa_sig_verify(
- self._backend, self._public_key, self._signature, data_to_verify
- )
-
-
-@utils.register_interface(AsymmetricSignatureContext)
-class _DSASignatureContext(object):
- def __init__(self, backend, private_key, algorithm):
- self._backend = backend
- self._private_key = private_key
- self._algorithm = algorithm
- self._hash_ctx = hashes.Hash(self._algorithm, self._backend)
-
- def update(self, data):
- self._hash_ctx.update(data)
-
- def finalize(self):
- data_to_sign = self._hash_ctx.finalize()
- return _dsa_sig_sign(self._backend, self._private_key, data_to_sign)
-
-
-@utils.register_interface(dsa.DSAParametersWithNumbers)
-class _DSAParameters(object):
- def __init__(self, backend, dsa_cdata):
- self._backend = backend
- self._dsa_cdata = dsa_cdata
-
- def parameter_numbers(self):
- p = self._backend._ffi.new("BIGNUM **")
- q = self._backend._ffi.new("BIGNUM **")
- g = self._backend._ffi.new("BIGNUM **")
- self._backend._lib.DSA_get0_pqg(self._dsa_cdata, p, q, g)
- self._backend.openssl_assert(p[0] != self._backend._ffi.NULL)
- self._backend.openssl_assert(q[0] != self._backend._ffi.NULL)
- self._backend.openssl_assert(g[0] != self._backend._ffi.NULL)
- return dsa.DSAParameterNumbers(
- p=self._backend._bn_to_int(p[0]),
- q=self._backend._bn_to_int(q[0]),
- g=self._backend._bn_to_int(g[0])
- )
-
- def generate_private_key(self):
- return self._backend.generate_dsa_private_key(self)
-
-
-@utils.register_interface(dsa.DSAPrivateKeyWithSerialization)
-class _DSAPrivateKey(object):
- def __init__(self, backend, dsa_cdata, evp_pkey):
- self._backend = backend
- self._dsa_cdata = dsa_cdata
- self._evp_pkey = evp_pkey
-
- p = self._backend._ffi.new("BIGNUM **")
- self._backend._lib.DSA_get0_pqg(
- dsa_cdata, p, self._backend._ffi.NULL, self._backend._ffi.NULL
- )
- self._backend.openssl_assert(p[0] != backend._ffi.NULL)
- self._key_size = self._backend._lib.BN_num_bits(p[0])
-
- key_size = utils.read_only_property("_key_size")
-
- def signer(self, signature_algorithm):
- _warn_sign_verify_deprecated()
- _check_not_prehashed(signature_algorithm)
- return _DSASignatureContext(self._backend, self, signature_algorithm)
-
- def private_numbers(self):
- p = self._backend._ffi.new("BIGNUM **")
- q = self._backend._ffi.new("BIGNUM **")
- g = self._backend._ffi.new("BIGNUM **")
- pub_key = self._backend._ffi.new("BIGNUM **")
- priv_key = self._backend._ffi.new("BIGNUM **")
- self._backend._lib.DSA_get0_pqg(self._dsa_cdata, p, q, g)
- self._backend.openssl_assert(p[0] != self._backend._ffi.NULL)
- self._backend.openssl_assert(q[0] != self._backend._ffi.NULL)
- self._backend.openssl_assert(g[0] != self._backend._ffi.NULL)
- self._backend._lib.DSA_get0_key(self._dsa_cdata, pub_key, priv_key)
- self._backend.openssl_assert(pub_key[0] != self._backend._ffi.NULL)
- self._backend.openssl_assert(priv_key[0] != self._backend._ffi.NULL)
- return dsa.DSAPrivateNumbers(
- public_numbers=dsa.DSAPublicNumbers(
- parameter_numbers=dsa.DSAParameterNumbers(
- p=self._backend._bn_to_int(p[0]),
- q=self._backend._bn_to_int(q[0]),
- g=self._backend._bn_to_int(g[0])
- ),
- y=self._backend._bn_to_int(pub_key[0])
- ),
- x=self._backend._bn_to_int(priv_key[0])
- )
-
- def public_key(self):
- dsa_cdata = self._backend._lib.DSAparams_dup(self._dsa_cdata)
- self._backend.openssl_assert(dsa_cdata != self._backend._ffi.NULL)
- dsa_cdata = self._backend._ffi.gc(
- dsa_cdata, self._backend._lib.DSA_free
- )
- pub_key = self._backend._ffi.new("BIGNUM **")
- self._backend._lib.DSA_get0_key(
- self._dsa_cdata, pub_key, self._backend._ffi.NULL
- )
- self._backend.openssl_assert(pub_key[0] != self._backend._ffi.NULL)
- pub_key_dup = self._backend._lib.BN_dup(pub_key[0])
- res = self._backend._lib.DSA_set0_key(
- dsa_cdata, pub_key_dup, self._backend._ffi.NULL
- )
- self._backend.openssl_assert(res == 1)
- evp_pkey = self._backend._dsa_cdata_to_evp_pkey(dsa_cdata)
- return _DSAPublicKey(self._backend, dsa_cdata, evp_pkey)
-
- def parameters(self):
- dsa_cdata = self._backend._lib.DSAparams_dup(self._dsa_cdata)
- self._backend.openssl_assert(dsa_cdata != self._backend._ffi.NULL)
- dsa_cdata = self._backend._ffi.gc(
- dsa_cdata, self._backend._lib.DSA_free
- )
- return _DSAParameters(self._backend, dsa_cdata)
-
- def private_bytes(self, encoding, format, encryption_algorithm):
- return self._backend._private_key_bytes(
- encoding,
- format,
- encryption_algorithm,
- self._evp_pkey,
- self._dsa_cdata
- )
-
- def sign(self, data, algorithm):
- data, algorithm = _calculate_digest_and_algorithm(
- self._backend, data, algorithm
- )
- return _dsa_sig_sign(self._backend, self, data)
-
-
-@utils.register_interface(dsa.DSAPublicKeyWithSerialization)
-class _DSAPublicKey(object):
- def __init__(self, backend, dsa_cdata, evp_pkey):
- self._backend = backend
- self._dsa_cdata = dsa_cdata
- self._evp_pkey = evp_pkey
- p = self._backend._ffi.new("BIGNUM **")
- self._backend._lib.DSA_get0_pqg(
- dsa_cdata, p, self._backend._ffi.NULL, self._backend._ffi.NULL
- )
- self._backend.openssl_assert(p[0] != backend._ffi.NULL)
- self._key_size = self._backend._lib.BN_num_bits(p[0])
-
- key_size = utils.read_only_property("_key_size")
-
- def verifier(self, signature, signature_algorithm):
- _warn_sign_verify_deprecated()
- if not isinstance(signature, bytes):
- raise TypeError("signature must be bytes.")
-
- _check_not_prehashed(signature_algorithm)
- return _DSAVerificationContext(
- self._backend, self, signature, signature_algorithm
- )
-
- def public_numbers(self):
- p = self._backend._ffi.new("BIGNUM **")
- q = self._backend._ffi.new("BIGNUM **")
- g = self._backend._ffi.new("BIGNUM **")
- pub_key = self._backend._ffi.new("BIGNUM **")
- self._backend._lib.DSA_get0_pqg(self._dsa_cdata, p, q, g)
- self._backend.openssl_assert(p[0] != self._backend._ffi.NULL)
- self._backend.openssl_assert(q[0] != self._backend._ffi.NULL)
- self._backend.openssl_assert(g[0] != self._backend._ffi.NULL)
- self._backend._lib.DSA_get0_key(
- self._dsa_cdata, pub_key, self._backend._ffi.NULL
- )
- self._backend.openssl_assert(pub_key[0] != self._backend._ffi.NULL)
- return dsa.DSAPublicNumbers(
- parameter_numbers=dsa.DSAParameterNumbers(
- p=self._backend._bn_to_int(p[0]),
- q=self._backend._bn_to_int(q[0]),
- g=self._backend._bn_to_int(g[0])
- ),
- y=self._backend._bn_to_int(pub_key[0])
- )
-
- def parameters(self):
- dsa_cdata = self._backend._lib.DSAparams_dup(self._dsa_cdata)
- dsa_cdata = self._backend._ffi.gc(
- dsa_cdata, self._backend._lib.DSA_free
- )
- return _DSAParameters(self._backend, dsa_cdata)
-
- def public_bytes(self, encoding, format):
- if format is serialization.PublicFormat.PKCS1:
- raise ValueError(
- "DSA public keys do not support PKCS1 serialization"
- )
-
- return self._backend._public_key_bytes(
- encoding,
- format,
- self,
- self._evp_pkey,
- None
- )
-
- def verify(self, signature, data, algorithm):
- data, algorithm = _calculate_digest_and_algorithm(
- self._backend, data, algorithm
- )
- return _dsa_sig_verify(self._backend, self, signature, data)
diff --git a/lib/cryptography/hazmat/backends/openssl/ec.py b/lib/cryptography/hazmat/backends/openssl/ec.py
deleted file mode 100644
index 69da2344e6..0000000000
--- a/lib/cryptography/hazmat/backends/openssl/ec.py
+++ /dev/null
@@ -1,298 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-from cryptography import utils
-from cryptography.exceptions import (
- InvalidSignature, UnsupportedAlgorithm, _Reasons
-)
-from cryptography.hazmat.backends.openssl.utils import (
- _calculate_digest_and_algorithm, _check_not_prehashed,
- _warn_sign_verify_deprecated
-)
-from cryptography.hazmat.primitives import hashes, serialization
-from cryptography.hazmat.primitives.asymmetric import (
- AsymmetricSignatureContext, AsymmetricVerificationContext, ec
-)
-
-
-def _check_signature_algorithm(signature_algorithm):
- if not isinstance(signature_algorithm, ec.ECDSA):
- raise UnsupportedAlgorithm(
- "Unsupported elliptic curve signature algorithm.",
- _Reasons.UNSUPPORTED_PUBLIC_KEY_ALGORITHM)
-
-
-def _ec_key_curve_sn(backend, ec_key):
- group = backend._lib.EC_KEY_get0_group(ec_key)
- backend.openssl_assert(group != backend._ffi.NULL)
-
- nid = backend._lib.EC_GROUP_get_curve_name(group)
- # The following check is to find EC keys with unnamed curves and raise
- # an error for now.
- if nid == backend._lib.NID_undef:
- raise NotImplementedError(
- "ECDSA certificates with unnamed curves are unsupported "
- "at this time"
- )
-
- curve_name = backend._lib.OBJ_nid2sn(nid)
- backend.openssl_assert(curve_name != backend._ffi.NULL)
-
- sn = backend._ffi.string(curve_name).decode('ascii')
- return sn
-
-
-def _mark_asn1_named_ec_curve(backend, ec_cdata):
- """
- Set the named curve flag on the EC_KEY. This causes OpenSSL to
- serialize EC keys along with their curve OID which makes
- deserialization easier.
- """
-
- backend._lib.EC_KEY_set_asn1_flag(
- ec_cdata, backend._lib.OPENSSL_EC_NAMED_CURVE
- )
-
-
-def _sn_to_elliptic_curve(backend, sn):
- try:
- return ec._CURVE_TYPES[sn]()
- except KeyError:
- raise UnsupportedAlgorithm(
- "{0} is not a supported elliptic curve".format(sn),
- _Reasons.UNSUPPORTED_ELLIPTIC_CURVE
- )
-
-
-def _ecdsa_sig_sign(backend, private_key, data):
- max_size = backend._lib.ECDSA_size(private_key._ec_key)
- backend.openssl_assert(max_size > 0)
-
- sigbuf = backend._ffi.new("unsigned char[]", max_size)
- siglen_ptr = backend._ffi.new("unsigned int[]", 1)
- res = backend._lib.ECDSA_sign(
- 0, data, len(data), sigbuf, siglen_ptr, private_key._ec_key
- )
- backend.openssl_assert(res == 1)
- return backend._ffi.buffer(sigbuf)[:siglen_ptr[0]]
-
-
-def _ecdsa_sig_verify(backend, public_key, signature, data):
- res = backend._lib.ECDSA_verify(
- 0, data, len(data), signature, len(signature), public_key._ec_key
- )
- if res != 1:
- backend._consume_errors()
- raise InvalidSignature
-
-
-@utils.register_interface(AsymmetricSignatureContext)
-class _ECDSASignatureContext(object):
- def __init__(self, backend, private_key, algorithm):
- self._backend = backend
- self._private_key = private_key
- self._digest = hashes.Hash(algorithm, backend)
-
- def update(self, data):
- self._digest.update(data)
-
- def finalize(self):
- digest = self._digest.finalize()
-
- return _ecdsa_sig_sign(self._backend, self._private_key, digest)
-
-
-@utils.register_interface(AsymmetricVerificationContext)
-class _ECDSAVerificationContext(object):
- def __init__(self, backend, public_key, signature, algorithm):
- self._backend = backend
- self._public_key = public_key
- self._signature = signature
- self._digest = hashes.Hash(algorithm, backend)
-
- def update(self, data):
- self._digest.update(data)
-
- def verify(self):
- digest = self._digest.finalize()
- _ecdsa_sig_verify(
- self._backend, self._public_key, self._signature, digest
- )
-
-
-@utils.register_interface(ec.EllipticCurvePrivateKeyWithSerialization)
-class _EllipticCurvePrivateKey(object):
- def __init__(self, backend, ec_key_cdata, evp_pkey):
- self._backend = backend
- _mark_asn1_named_ec_curve(backend, ec_key_cdata)
- self._ec_key = ec_key_cdata
- self._evp_pkey = evp_pkey
-
- sn = _ec_key_curve_sn(backend, ec_key_cdata)
- self._curve = _sn_to_elliptic_curve(backend, sn)
-
- curve = utils.read_only_property("_curve")
-
- @property
- def key_size(self):
- return self.curve.key_size
-
- def signer(self, signature_algorithm):
- _warn_sign_verify_deprecated()
- _check_signature_algorithm(signature_algorithm)
- _check_not_prehashed(signature_algorithm.algorithm)
- return _ECDSASignatureContext(
- self._backend, self, signature_algorithm.algorithm
- )
-
- def exchange(self, algorithm, peer_public_key):
- if not (
- self._backend.elliptic_curve_exchange_algorithm_supported(
- algorithm, self.curve
- )
- ):
- raise UnsupportedAlgorithm(
- "This backend does not support the ECDH algorithm.",
- _Reasons.UNSUPPORTED_EXCHANGE_ALGORITHM
- )
-
- if peer_public_key.curve.name != self.curve.name:
- raise ValueError(
- "peer_public_key and self are not on the same curve"
- )
-
- group = self._backend._lib.EC_KEY_get0_group(self._ec_key)
- z_len = (self._backend._lib.EC_GROUP_get_degree(group) + 7) // 8
- self._backend.openssl_assert(z_len > 0)
- z_buf = self._backend._ffi.new("uint8_t[]", z_len)
- peer_key = self._backend._lib.EC_KEY_get0_public_key(
- peer_public_key._ec_key
- )
-
- r = self._backend._lib.ECDH_compute_key(
- z_buf, z_len, peer_key, self._ec_key, self._backend._ffi.NULL
- )
- self._backend.openssl_assert(r > 0)
- return self._backend._ffi.buffer(z_buf)[:z_len]
-
- def public_key(self):
- group = self._backend._lib.EC_KEY_get0_group(self._ec_key)
- self._backend.openssl_assert(group != self._backend._ffi.NULL)
-
- curve_nid = self._backend._lib.EC_GROUP_get_curve_name(group)
-
- public_ec_key = self._backend._lib.EC_KEY_new_by_curve_name(curve_nid)
- self._backend.openssl_assert(public_ec_key != self._backend._ffi.NULL)
- public_ec_key = self._backend._ffi.gc(
- public_ec_key, self._backend._lib.EC_KEY_free
- )
-
- point = self._backend._lib.EC_KEY_get0_public_key(self._ec_key)
- self._backend.openssl_assert(point != self._backend._ffi.NULL)
-
- res = self._backend._lib.EC_KEY_set_public_key(public_ec_key, point)
- self._backend.openssl_assert(res == 1)
-
- evp_pkey = self._backend._ec_cdata_to_evp_pkey(public_ec_key)
-
- return _EllipticCurvePublicKey(self._backend, public_ec_key, evp_pkey)
-
- def private_numbers(self):
- bn = self._backend._lib.EC_KEY_get0_private_key(self._ec_key)
- private_value = self._backend._bn_to_int(bn)
- return ec.EllipticCurvePrivateNumbers(
- private_value=private_value,
- public_numbers=self.public_key().public_numbers()
- )
-
- def private_bytes(self, encoding, format, encryption_algorithm):
- return self._backend._private_key_bytes(
- encoding,
- format,
- encryption_algorithm,
- self._evp_pkey,
- self._ec_key
- )
-
- def sign(self, data, signature_algorithm):
- _check_signature_algorithm(signature_algorithm)
- data, algorithm = _calculate_digest_and_algorithm(
- self._backend, data, signature_algorithm._algorithm
- )
- return _ecdsa_sig_sign(self._backend, self, data)
-
-
-@utils.register_interface(ec.EllipticCurvePublicKeyWithSerialization)
-class _EllipticCurvePublicKey(object):
- def __init__(self, backend, ec_key_cdata, evp_pkey):
- self._backend = backend
- _mark_asn1_named_ec_curve(backend, ec_key_cdata)
- self._ec_key = ec_key_cdata
- self._evp_pkey = evp_pkey
-
- sn = _ec_key_curve_sn(backend, ec_key_cdata)
- self._curve = _sn_to_elliptic_curve(backend, sn)
-
- curve = utils.read_only_property("_curve")
-
- @property
- def key_size(self):
- return self.curve.key_size
-
- def verifier(self, signature, signature_algorithm):
- _warn_sign_verify_deprecated()
- if not isinstance(signature, bytes):
- raise TypeError("signature must be bytes.")
-
- _check_signature_algorithm(signature_algorithm)
- _check_not_prehashed(signature_algorithm.algorithm)
- return _ECDSAVerificationContext(
- self._backend, self, signature, signature_algorithm.algorithm
- )
-
- def public_numbers(self):
- get_func, group = (
- self._backend._ec_key_determine_group_get_func(self._ec_key)
- )
- point = self._backend._lib.EC_KEY_get0_public_key(self._ec_key)
- self._backend.openssl_assert(point != self._backend._ffi.NULL)
-
- with self._backend._tmp_bn_ctx() as bn_ctx:
- bn_x = self._backend._lib.BN_CTX_get(bn_ctx)
- bn_y = self._backend._lib.BN_CTX_get(bn_ctx)
-
- res = get_func(group, point, bn_x, bn_y, bn_ctx)
- self._backend.openssl_assert(res == 1)
-
- x = self._backend._bn_to_int(bn_x)
- y = self._backend._bn_to_int(bn_y)
-
- return ec.EllipticCurvePublicNumbers(
- x=x,
- y=y,
- curve=self._curve
- )
-
- def public_bytes(self, encoding, format):
- if format is serialization.PublicFormat.PKCS1:
- raise ValueError(
- "EC public keys do not support PKCS1 serialization"
- )
-
- return self._backend._public_key_bytes(
- encoding,
- format,
- self,
- self._evp_pkey,
- None
- )
-
- def verify(self, signature, data, signature_algorithm):
- _check_signature_algorithm(signature_algorithm)
- data, algorithm = _calculate_digest_and_algorithm(
- self._backend, data, signature_algorithm._algorithm
- )
- _ecdsa_sig_verify(self._backend, self, signature, data)
diff --git a/lib/cryptography/hazmat/backends/openssl/encode_asn1.py b/lib/cryptography/hazmat/backends/openssl/encode_asn1.py
deleted file mode 100644
index 6ff1a9a45a..0000000000
--- a/lib/cryptography/hazmat/backends/openssl/encode_asn1.py
+++ /dev/null
@@ -1,620 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import calendar
-import ipaddress
-
-import six
-
-from cryptography import utils, x509
-from cryptography.hazmat.backends.openssl.decode_asn1 import (
- _CRL_ENTRY_REASON_ENUM_TO_CODE, _DISTPOINT_TYPE_FULLNAME,
- _DISTPOINT_TYPE_RELATIVENAME
-)
-from cryptography.x509.name import _ASN1Type
-from cryptography.x509.oid import (
- CRLEntryExtensionOID, ExtensionOID, OCSPExtensionOID,
-)
-
-
-def _encode_asn1_int(backend, x):
- """
- Converts a python integer to an ASN1_INTEGER. The returned ASN1_INTEGER
- will not be garbage collected (to support adding them to structs that take
- ownership of the object). Be sure to register it for GC if it will be
- discarded after use.
-
- """
- # Convert Python integer to OpenSSL "bignum" in case value exceeds
- # machine's native integer limits (note: `int_to_bn` doesn't automatically
- # GC).
- i = backend._int_to_bn(x)
- i = backend._ffi.gc(i, backend._lib.BN_free)
-
- # Wrap in an ASN.1 integer. Don't GC -- as documented.
- i = backend._lib.BN_to_ASN1_INTEGER(i, backend._ffi.NULL)
- backend.openssl_assert(i != backend._ffi.NULL)
- return i
-
-
-def _encode_asn1_int_gc(backend, x):
- i = _encode_asn1_int(backend, x)
- i = backend._ffi.gc(i, backend._lib.ASN1_INTEGER_free)
- return i
-
-
-def _encode_asn1_str(backend, data):
- """
- Create an ASN1_OCTET_STRING from a Python byte string.
- """
- s = backend._lib.ASN1_OCTET_STRING_new()
- res = backend._lib.ASN1_OCTET_STRING_set(s, data, len(data))
- backend.openssl_assert(res == 1)
- return s
-
-
-def _encode_asn1_utf8_str(backend, string):
- """
- Create an ASN1_UTF8STRING from a Python unicode string.
- This object will be an ASN1_STRING with UTF8 type in OpenSSL and
- can be decoded with ASN1_STRING_to_UTF8.
- """
- s = backend._lib.ASN1_UTF8STRING_new()
- res = backend._lib.ASN1_STRING_set(
- s, string.encode("utf8"), len(string.encode("utf8"))
- )
- backend.openssl_assert(res == 1)
- return s
-
-
-def _encode_asn1_str_gc(backend, data):
- s = _encode_asn1_str(backend, data)
- s = backend._ffi.gc(s, backend._lib.ASN1_OCTET_STRING_free)
- return s
-
-
-def _encode_inhibit_any_policy(backend, inhibit_any_policy):
- return _encode_asn1_int_gc(backend, inhibit_any_policy.skip_certs)
-
-
-def _encode_name(backend, name):
- """
- The X509_NAME created will not be gc'd. Use _encode_name_gc if needed.
- """
- subject = backend._lib.X509_NAME_new()
- for rdn in name.rdns:
- set_flag = 0 # indicate whether to add to last RDN or create new RDN
- for attribute in rdn:
- name_entry = _encode_name_entry(backend, attribute)
- # X509_NAME_add_entry dups the object so we need to gc this copy
- name_entry = backend._ffi.gc(
- name_entry, backend._lib.X509_NAME_ENTRY_free
- )
- res = backend._lib.X509_NAME_add_entry(
- subject, name_entry, -1, set_flag)
- backend.openssl_assert(res == 1)
- set_flag = -1
- return subject
-
-
-def _encode_name_gc(backend, attributes):
- subject = _encode_name(backend, attributes)
- subject = backend._ffi.gc(subject, backend._lib.X509_NAME_free)
- return subject
-
-
-def _encode_sk_name_entry(backend, attributes):
- """
- The sk_X509_NAME_ENTRY created will not be gc'd.
- """
- stack = backend._lib.sk_X509_NAME_ENTRY_new_null()
- for attribute in attributes:
- name_entry = _encode_name_entry(backend, attribute)
- res = backend._lib.sk_X509_NAME_ENTRY_push(stack, name_entry)
- backend.openssl_assert(res == 1)
- return stack
-
-
-def _encode_name_entry(backend, attribute):
- if attribute._type is _ASN1Type.BMPString:
- value = attribute.value.encode('utf_16_be')
- else:
- value = attribute.value.encode('utf8')
-
- obj = _txt2obj_gc(backend, attribute.oid.dotted_string)
-
- name_entry = backend._lib.X509_NAME_ENTRY_create_by_OBJ(
- backend._ffi.NULL, obj, attribute._type.value, value, len(value)
- )
- return name_entry
-
-
-def _encode_crl_number_delta_crl_indicator(backend, ext):
- return _encode_asn1_int_gc(backend, ext.crl_number)
-
-
-def _encode_crl_reason(backend, crl_reason):
- asn1enum = backend._lib.ASN1_ENUMERATED_new()
- backend.openssl_assert(asn1enum != backend._ffi.NULL)
- asn1enum = backend._ffi.gc(asn1enum, backend._lib.ASN1_ENUMERATED_free)
- res = backend._lib.ASN1_ENUMERATED_set(
- asn1enum, _CRL_ENTRY_REASON_ENUM_TO_CODE[crl_reason.reason]
- )
- backend.openssl_assert(res == 1)
-
- return asn1enum
-
-
-def _encode_invalidity_date(backend, invalidity_date):
- time = backend._lib.ASN1_GENERALIZEDTIME_set(
- backend._ffi.NULL, calendar.timegm(
- invalidity_date.invalidity_date.timetuple()
- )
- )
- backend.openssl_assert(time != backend._ffi.NULL)
- time = backend._ffi.gc(time, backend._lib.ASN1_GENERALIZEDTIME_free)
-
- return time
-
-
-def _encode_certificate_policies(backend, certificate_policies):
- cp = backend._lib.sk_POLICYINFO_new_null()
- backend.openssl_assert(cp != backend._ffi.NULL)
- cp = backend._ffi.gc(cp, backend._lib.sk_POLICYINFO_free)
- for policy_info in certificate_policies:
- pi = backend._lib.POLICYINFO_new()
- backend.openssl_assert(pi != backend._ffi.NULL)
- res = backend._lib.sk_POLICYINFO_push(cp, pi)
- backend.openssl_assert(res >= 1)
- oid = _txt2obj(backend, policy_info.policy_identifier.dotted_string)
- pi.policyid = oid
- if policy_info.policy_qualifiers:
- pqis = backend._lib.sk_POLICYQUALINFO_new_null()
- backend.openssl_assert(pqis != backend._ffi.NULL)
- for qualifier in policy_info.policy_qualifiers:
- pqi = backend._lib.POLICYQUALINFO_new()
- backend.openssl_assert(pqi != backend._ffi.NULL)
- res = backend._lib.sk_POLICYQUALINFO_push(pqis, pqi)
- backend.openssl_assert(res >= 1)
- if isinstance(qualifier, six.text_type):
- pqi.pqualid = _txt2obj(
- backend, x509.OID_CPS_QUALIFIER.dotted_string
- )
- pqi.d.cpsuri = _encode_asn1_str(
- backend,
- qualifier.encode("ascii"),
- )
- else:
- assert isinstance(qualifier, x509.UserNotice)
- pqi.pqualid = _txt2obj(
- backend, x509.OID_CPS_USER_NOTICE.dotted_string
- )
- un = backend._lib.USERNOTICE_new()
- backend.openssl_assert(un != backend._ffi.NULL)
- pqi.d.usernotice = un
- if qualifier.explicit_text:
- un.exptext = _encode_asn1_utf8_str(
- backend, qualifier.explicit_text
- )
-
- un.noticeref = _encode_notice_reference(
- backend, qualifier.notice_reference
- )
-
- pi.qualifiers = pqis
-
- return cp
-
-
-def _encode_notice_reference(backend, notice):
- if notice is None:
- return backend._ffi.NULL
- else:
- nr = backend._lib.NOTICEREF_new()
- backend.openssl_assert(nr != backend._ffi.NULL)
- # organization is a required field
- nr.organization = _encode_asn1_utf8_str(backend, notice.organization)
-
- notice_stack = backend._lib.sk_ASN1_INTEGER_new_null()
- nr.noticenos = notice_stack
- for number in notice.notice_numbers:
- num = _encode_asn1_int(backend, number)
- res = backend._lib.sk_ASN1_INTEGER_push(notice_stack, num)
- backend.openssl_assert(res >= 1)
-
- return nr
-
-
-def _txt2obj(backend, name):
- """
- Converts a Python string with an ASN.1 object ID in dotted form to a
- ASN1_OBJECT.
- """
- name = name.encode('ascii')
- obj = backend._lib.OBJ_txt2obj(name, 1)
- backend.openssl_assert(obj != backend._ffi.NULL)
- return obj
-
-
-def _txt2obj_gc(backend, name):
- obj = _txt2obj(backend, name)
- obj = backend._ffi.gc(obj, backend._lib.ASN1_OBJECT_free)
- return obj
-
-
-def _encode_ocsp_nocheck(backend, ext):
- # Doesn't need to be GC'd
- return backend._lib.ASN1_NULL_new()
-
-
-def _encode_key_usage(backend, key_usage):
- set_bit = backend._lib.ASN1_BIT_STRING_set_bit
- ku = backend._lib.ASN1_BIT_STRING_new()
- ku = backend._ffi.gc(ku, backend._lib.ASN1_BIT_STRING_free)
- res = set_bit(ku, 0, key_usage.digital_signature)
- backend.openssl_assert(res == 1)
- res = set_bit(ku, 1, key_usage.content_commitment)
- backend.openssl_assert(res == 1)
- res = set_bit(ku, 2, key_usage.key_encipherment)
- backend.openssl_assert(res == 1)
- res = set_bit(ku, 3, key_usage.data_encipherment)
- backend.openssl_assert(res == 1)
- res = set_bit(ku, 4, key_usage.key_agreement)
- backend.openssl_assert(res == 1)
- res = set_bit(ku, 5, key_usage.key_cert_sign)
- backend.openssl_assert(res == 1)
- res = set_bit(ku, 6, key_usage.crl_sign)
- backend.openssl_assert(res == 1)
- if key_usage.key_agreement:
- res = set_bit(ku, 7, key_usage.encipher_only)
- backend.openssl_assert(res == 1)
- res = set_bit(ku, 8, key_usage.decipher_only)
- backend.openssl_assert(res == 1)
- else:
- res = set_bit(ku, 7, 0)
- backend.openssl_assert(res == 1)
- res = set_bit(ku, 8, 0)
- backend.openssl_assert(res == 1)
-
- return ku
-
-
-def _encode_authority_key_identifier(backend, authority_keyid):
- akid = backend._lib.AUTHORITY_KEYID_new()
- backend.openssl_assert(akid != backend._ffi.NULL)
- akid = backend._ffi.gc(akid, backend._lib.AUTHORITY_KEYID_free)
- if authority_keyid.key_identifier is not None:
- akid.keyid = _encode_asn1_str(
- backend,
- authority_keyid.key_identifier,
- )
-
- if authority_keyid.authority_cert_issuer is not None:
- akid.issuer = _encode_general_names(
- backend, authority_keyid.authority_cert_issuer
- )
-
- if authority_keyid.authority_cert_serial_number is not None:
- akid.serial = _encode_asn1_int(
- backend, authority_keyid.authority_cert_serial_number
- )
-
- return akid
-
-
-def _encode_basic_constraints(backend, basic_constraints):
- constraints = backend._lib.BASIC_CONSTRAINTS_new()
- constraints = backend._ffi.gc(
- constraints, backend._lib.BASIC_CONSTRAINTS_free
- )
- constraints.ca = 255 if basic_constraints.ca else 0
- if basic_constraints.ca and basic_constraints.path_length is not None:
- constraints.pathlen = _encode_asn1_int(
- backend, basic_constraints.path_length
- )
-
- return constraints
-
-
-def _encode_authority_information_access(backend, authority_info_access):
- aia = backend._lib.sk_ACCESS_DESCRIPTION_new_null()
- backend.openssl_assert(aia != backend._ffi.NULL)
- aia = backend._ffi.gc(
- aia, backend._lib.sk_ACCESS_DESCRIPTION_free
- )
- for access_description in authority_info_access:
- ad = backend._lib.ACCESS_DESCRIPTION_new()
- method = _txt2obj(
- backend, access_description.access_method.dotted_string
- )
- gn = _encode_general_name(backend, access_description.access_location)
- ad.method = method
- ad.location = gn
- res = backend._lib.sk_ACCESS_DESCRIPTION_push(aia, ad)
- backend.openssl_assert(res >= 1)
-
- return aia
-
-
-def _encode_general_names(backend, names):
- general_names = backend._lib.GENERAL_NAMES_new()
- backend.openssl_assert(general_names != backend._ffi.NULL)
- for name in names:
- gn = _encode_general_name(backend, name)
- res = backend._lib.sk_GENERAL_NAME_push(general_names, gn)
- backend.openssl_assert(res != 0)
-
- return general_names
-
-
-def _encode_alt_name(backend, san):
- general_names = _encode_general_names(backend, san)
- general_names = backend._ffi.gc(
- general_names, backend._lib.GENERAL_NAMES_free
- )
- return general_names
-
-
-def _encode_subject_key_identifier(backend, ski):
- return _encode_asn1_str_gc(backend, ski.digest)
-
-
-def _encode_general_name(backend, name):
- if isinstance(name, x509.DNSName):
- gn = backend._lib.GENERAL_NAME_new()
- backend.openssl_assert(gn != backend._ffi.NULL)
- gn.type = backend._lib.GEN_DNS
-
- ia5 = backend._lib.ASN1_IA5STRING_new()
- backend.openssl_assert(ia5 != backend._ffi.NULL)
- # ia5strings are supposed to be ITU T.50 but to allow round-tripping
- # of broken certs that encode utf8 we'll encode utf8 here too.
- value = name.value.encode("utf8")
-
- res = backend._lib.ASN1_STRING_set(ia5, value, len(value))
- backend.openssl_assert(res == 1)
- gn.d.dNSName = ia5
- elif isinstance(name, x509.RegisteredID):
- gn = backend._lib.GENERAL_NAME_new()
- backend.openssl_assert(gn != backend._ffi.NULL)
- gn.type = backend._lib.GEN_RID
- obj = backend._lib.OBJ_txt2obj(
- name.value.dotted_string.encode('ascii'), 1
- )
- backend.openssl_assert(obj != backend._ffi.NULL)
- gn.d.registeredID = obj
- elif isinstance(name, x509.DirectoryName):
- gn = backend._lib.GENERAL_NAME_new()
- backend.openssl_assert(gn != backend._ffi.NULL)
- dir_name = _encode_name(backend, name.value)
- gn.type = backend._lib.GEN_DIRNAME
- gn.d.directoryName = dir_name
- elif isinstance(name, x509.IPAddress):
- gn = backend._lib.GENERAL_NAME_new()
- backend.openssl_assert(gn != backend._ffi.NULL)
- if isinstance(name.value, ipaddress.IPv4Network):
- packed = (
- name.value.network_address.packed +
- utils.int_to_bytes(((1 << 32) - name.value.num_addresses), 4)
- )
- elif isinstance(name.value, ipaddress.IPv6Network):
- packed = (
- name.value.network_address.packed +
- utils.int_to_bytes((1 << 128) - name.value.num_addresses, 16)
- )
- else:
- packed = name.value.packed
- ipaddr = _encode_asn1_str(backend, packed)
- gn.type = backend._lib.GEN_IPADD
- gn.d.iPAddress = ipaddr
- elif isinstance(name, x509.OtherName):
- gn = backend._lib.GENERAL_NAME_new()
- backend.openssl_assert(gn != backend._ffi.NULL)
- other_name = backend._lib.OTHERNAME_new()
- backend.openssl_assert(other_name != backend._ffi.NULL)
-
- type_id = backend._lib.OBJ_txt2obj(
- name.type_id.dotted_string.encode('ascii'), 1
- )
- backend.openssl_assert(type_id != backend._ffi.NULL)
- data = backend._ffi.new("unsigned char[]", name.value)
- data_ptr_ptr = backend._ffi.new("unsigned char **")
- data_ptr_ptr[0] = data
- value = backend._lib.d2i_ASN1_TYPE(
- backend._ffi.NULL, data_ptr_ptr, len(name.value)
- )
- if value == backend._ffi.NULL:
- backend._consume_errors()
- raise ValueError("Invalid ASN.1 data")
- other_name.type_id = type_id
- other_name.value = value
- gn.type = backend._lib.GEN_OTHERNAME
- gn.d.otherName = other_name
- elif isinstance(name, x509.RFC822Name):
- gn = backend._lib.GENERAL_NAME_new()
- backend.openssl_assert(gn != backend._ffi.NULL)
- # ia5strings are supposed to be ITU T.50 but to allow round-tripping
- # of broken certs that encode utf8 we'll encode utf8 here too.
- data = name.value.encode("utf8")
- asn1_str = _encode_asn1_str(backend, data)
- gn.type = backend._lib.GEN_EMAIL
- gn.d.rfc822Name = asn1_str
- elif isinstance(name, x509.UniformResourceIdentifier):
- gn = backend._lib.GENERAL_NAME_new()
- backend.openssl_assert(gn != backend._ffi.NULL)
- # ia5strings are supposed to be ITU T.50 but to allow round-tripping
- # of broken certs that encode utf8 we'll encode utf8 here too.
- data = name.value.encode("utf8")
- asn1_str = _encode_asn1_str(backend, data)
- gn.type = backend._lib.GEN_URI
- gn.d.uniformResourceIdentifier = asn1_str
- else:
- raise ValueError(
- "{0} is an unknown GeneralName type".format(name)
- )
-
- return gn
-
-
-def _encode_extended_key_usage(backend, extended_key_usage):
- eku = backend._lib.sk_ASN1_OBJECT_new_null()
- eku = backend._ffi.gc(eku, backend._lib.sk_ASN1_OBJECT_free)
- for oid in extended_key_usage:
- obj = _txt2obj(backend, oid.dotted_string)
- res = backend._lib.sk_ASN1_OBJECT_push(eku, obj)
- backend.openssl_assert(res >= 1)
-
- return eku
-
-
-_CRLREASONFLAGS = {
- x509.ReasonFlags.key_compromise: 1,
- x509.ReasonFlags.ca_compromise: 2,
- x509.ReasonFlags.affiliation_changed: 3,
- x509.ReasonFlags.superseded: 4,
- x509.ReasonFlags.cessation_of_operation: 5,
- x509.ReasonFlags.certificate_hold: 6,
- x509.ReasonFlags.privilege_withdrawn: 7,
- x509.ReasonFlags.aa_compromise: 8,
-}
-
-
-def _encode_cdps_freshest_crl(backend, cdps):
- cdp = backend._lib.sk_DIST_POINT_new_null()
- cdp = backend._ffi.gc(cdp, backend._lib.sk_DIST_POINT_free)
- for point in cdps:
- dp = backend._lib.DIST_POINT_new()
- backend.openssl_assert(dp != backend._ffi.NULL)
-
- if point.reasons:
- bitmask = backend._lib.ASN1_BIT_STRING_new()
- backend.openssl_assert(bitmask != backend._ffi.NULL)
- dp.reasons = bitmask
- for reason in point.reasons:
- res = backend._lib.ASN1_BIT_STRING_set_bit(
- bitmask, _CRLREASONFLAGS[reason], 1
- )
- backend.openssl_assert(res == 1)
-
- if point.full_name:
- dpn = backend._lib.DIST_POINT_NAME_new()
- backend.openssl_assert(dpn != backend._ffi.NULL)
- dpn.type = _DISTPOINT_TYPE_FULLNAME
- dpn.name.fullname = _encode_general_names(backend, point.full_name)
- dp.distpoint = dpn
-
- if point.relative_name:
- dpn = backend._lib.DIST_POINT_NAME_new()
- backend.openssl_assert(dpn != backend._ffi.NULL)
- dpn.type = _DISTPOINT_TYPE_RELATIVENAME
- relativename = _encode_sk_name_entry(backend, point.relative_name)
- backend.openssl_assert(relativename != backend._ffi.NULL)
- dpn.name.relativename = relativename
- dp.distpoint = dpn
-
- if point.crl_issuer:
- dp.CRLissuer = _encode_general_names(backend, point.crl_issuer)
-
- res = backend._lib.sk_DIST_POINT_push(cdp, dp)
- backend.openssl_assert(res >= 1)
-
- return cdp
-
-
-def _encode_name_constraints(backend, name_constraints):
- nc = backend._lib.NAME_CONSTRAINTS_new()
- backend.openssl_assert(nc != backend._ffi.NULL)
- nc = backend._ffi.gc(nc, backend._lib.NAME_CONSTRAINTS_free)
- permitted = _encode_general_subtree(
- backend, name_constraints.permitted_subtrees
- )
- nc.permittedSubtrees = permitted
- excluded = _encode_general_subtree(
- backend, name_constraints.excluded_subtrees
- )
- nc.excludedSubtrees = excluded
-
- return nc
-
-
-def _encode_policy_constraints(backend, policy_constraints):
- pc = backend._lib.POLICY_CONSTRAINTS_new()
- backend.openssl_assert(pc != backend._ffi.NULL)
- pc = backend._ffi.gc(pc, backend._lib.POLICY_CONSTRAINTS_free)
- if policy_constraints.require_explicit_policy is not None:
- pc.requireExplicitPolicy = _encode_asn1_int(
- backend, policy_constraints.require_explicit_policy
- )
-
- if policy_constraints.inhibit_policy_mapping is not None:
- pc.inhibitPolicyMapping = _encode_asn1_int(
- backend, policy_constraints.inhibit_policy_mapping
- )
-
- return pc
-
-
-def _encode_general_subtree(backend, subtrees):
- if subtrees is None:
- return backend._ffi.NULL
- else:
- general_subtrees = backend._lib.sk_GENERAL_SUBTREE_new_null()
- for name in subtrees:
- gs = backend._lib.GENERAL_SUBTREE_new()
- gs.base = _encode_general_name(backend, name)
- res = backend._lib.sk_GENERAL_SUBTREE_push(general_subtrees, gs)
- assert res >= 1
-
- return general_subtrees
-
-
-def _encode_nonce(backend, nonce):
- return _encode_asn1_str_gc(backend, nonce.nonce)
-
-
-_EXTENSION_ENCODE_HANDLERS = {
- ExtensionOID.BASIC_CONSTRAINTS: _encode_basic_constraints,
- ExtensionOID.SUBJECT_KEY_IDENTIFIER: _encode_subject_key_identifier,
- ExtensionOID.KEY_USAGE: _encode_key_usage,
- ExtensionOID.SUBJECT_ALTERNATIVE_NAME: _encode_alt_name,
- ExtensionOID.ISSUER_ALTERNATIVE_NAME: _encode_alt_name,
- ExtensionOID.EXTENDED_KEY_USAGE: _encode_extended_key_usage,
- ExtensionOID.AUTHORITY_KEY_IDENTIFIER: _encode_authority_key_identifier,
- ExtensionOID.CERTIFICATE_POLICIES: _encode_certificate_policies,
- ExtensionOID.AUTHORITY_INFORMATION_ACCESS: (
- _encode_authority_information_access
- ),
- ExtensionOID.CRL_DISTRIBUTION_POINTS: _encode_cdps_freshest_crl,
- ExtensionOID.FRESHEST_CRL: _encode_cdps_freshest_crl,
- ExtensionOID.INHIBIT_ANY_POLICY: _encode_inhibit_any_policy,
- ExtensionOID.OCSP_NO_CHECK: _encode_ocsp_nocheck,
- ExtensionOID.NAME_CONSTRAINTS: _encode_name_constraints,
- ExtensionOID.POLICY_CONSTRAINTS: _encode_policy_constraints,
-}
-
-_CRL_EXTENSION_ENCODE_HANDLERS = {
- ExtensionOID.ISSUER_ALTERNATIVE_NAME: _encode_alt_name,
- ExtensionOID.AUTHORITY_KEY_IDENTIFIER: _encode_authority_key_identifier,
- ExtensionOID.AUTHORITY_INFORMATION_ACCESS: (
- _encode_authority_information_access
- ),
- ExtensionOID.CRL_NUMBER: _encode_crl_number_delta_crl_indicator,
- ExtensionOID.DELTA_CRL_INDICATOR: _encode_crl_number_delta_crl_indicator,
-}
-
-_CRL_ENTRY_EXTENSION_ENCODE_HANDLERS = {
- CRLEntryExtensionOID.CERTIFICATE_ISSUER: _encode_alt_name,
- CRLEntryExtensionOID.CRL_REASON: _encode_crl_reason,
- CRLEntryExtensionOID.INVALIDITY_DATE: _encode_invalidity_date,
-}
-
-_OCSP_REQUEST_EXTENSION_ENCODE_HANDLERS = {
- OCSPExtensionOID.NONCE: _encode_nonce,
-}
-
-_OCSP_BASICRESP_EXTENSION_ENCODE_HANDLERS = {
- OCSPExtensionOID.NONCE: _encode_nonce,
-}
diff --git a/lib/cryptography/hazmat/backends/openssl/hashes.py b/lib/cryptography/hazmat/backends/openssl/hashes.py
deleted file mode 100644
index c39f57dcdc..0000000000
--- a/lib/cryptography/hazmat/backends/openssl/hashes.py
+++ /dev/null
@@ -1,60 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-
-from cryptography import utils
-from cryptography.exceptions import UnsupportedAlgorithm, _Reasons
-from cryptography.hazmat.primitives import hashes
-
-
-@utils.register_interface(hashes.HashContext)
-class _HashContext(object):
- def __init__(self, backend, algorithm, ctx=None):
- self._algorithm = algorithm
-
- self._backend = backend
-
- if ctx is None:
- ctx = self._backend._lib.Cryptography_EVP_MD_CTX_new()
- ctx = self._backend._ffi.gc(
- ctx, self._backend._lib.Cryptography_EVP_MD_CTX_free
- )
- evp_md = self._backend._evp_md_from_algorithm(algorithm)
- if evp_md == self._backend._ffi.NULL:
- raise UnsupportedAlgorithm(
- "{0} is not a supported hash on this backend.".format(
- algorithm.name),
- _Reasons.UNSUPPORTED_HASH
- )
- res = self._backend._lib.EVP_DigestInit_ex(ctx, evp_md,
- self._backend._ffi.NULL)
- self._backend.openssl_assert(res != 0)
-
- self._ctx = ctx
-
- algorithm = utils.read_only_property("_algorithm")
-
- def copy(self):
- copied_ctx = self._backend._lib.Cryptography_EVP_MD_CTX_new()
- copied_ctx = self._backend._ffi.gc(
- copied_ctx, self._backend._lib.Cryptography_EVP_MD_CTX_free
- )
- res = self._backend._lib.EVP_MD_CTX_copy_ex(copied_ctx, self._ctx)
- self._backend.openssl_assert(res != 0)
- return _HashContext(self._backend, self.algorithm, ctx=copied_ctx)
-
- def update(self, data):
- res = self._backend._lib.EVP_DigestUpdate(self._ctx, data, len(data))
- self._backend.openssl_assert(res != 0)
-
- def finalize(self):
- buf = self._backend._ffi.new("unsigned char[]",
- self._backend._lib.EVP_MAX_MD_SIZE)
- outlen = self._backend._ffi.new("unsigned int *")
- res = self._backend._lib.EVP_DigestFinal_ex(self._ctx, buf, outlen)
- self._backend.openssl_assert(res != 0)
- self._backend.openssl_assert(outlen[0] == self.algorithm.digest_size)
- return self._backend._ffi.buffer(buf)[:outlen[0]]
diff --git a/lib/cryptography/hazmat/backends/openssl/hmac.py b/lib/cryptography/hazmat/backends/openssl/hmac.py
deleted file mode 100644
index 99c43f2a91..0000000000
--- a/lib/cryptography/hazmat/backends/openssl/hmac.py
+++ /dev/null
@@ -1,73 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-
-from cryptography import utils
-from cryptography.exceptions import (
- InvalidSignature, UnsupportedAlgorithm, _Reasons
-)
-from cryptography.hazmat.primitives import constant_time, hashes, mac
-
-
-@utils.register_interface(mac.MACContext)
-@utils.register_interface(hashes.HashContext)
-class _HMACContext(object):
- def __init__(self, backend, key, algorithm, ctx=None):
- self._algorithm = algorithm
- self._backend = backend
-
- if ctx is None:
- ctx = self._backend._lib.Cryptography_HMAC_CTX_new()
- self._backend.openssl_assert(ctx != self._backend._ffi.NULL)
- ctx = self._backend._ffi.gc(
- ctx, self._backend._lib.Cryptography_HMAC_CTX_free
- )
- evp_md = self._backend._evp_md_from_algorithm(algorithm)
- if evp_md == self._backend._ffi.NULL:
- raise UnsupportedAlgorithm(
- "{0} is not a supported hash on this backend".format(
- algorithm.name),
- _Reasons.UNSUPPORTED_HASH
- )
- res = self._backend._lib.HMAC_Init_ex(
- ctx, key, len(key), evp_md, self._backend._ffi.NULL
- )
- self._backend.openssl_assert(res != 0)
-
- self._ctx = ctx
- self._key = key
-
- algorithm = utils.read_only_property("_algorithm")
-
- def copy(self):
- copied_ctx = self._backend._lib.Cryptography_HMAC_CTX_new()
- self._backend.openssl_assert(copied_ctx != self._backend._ffi.NULL)
- copied_ctx = self._backend._ffi.gc(
- copied_ctx, self._backend._lib.Cryptography_HMAC_CTX_free
- )
- res = self._backend._lib.HMAC_CTX_copy(copied_ctx, self._ctx)
- self._backend.openssl_assert(res != 0)
- return _HMACContext(
- self._backend, self._key, self.algorithm, ctx=copied_ctx
- )
-
- def update(self, data):
- res = self._backend._lib.HMAC_Update(self._ctx, data, len(data))
- self._backend.openssl_assert(res != 0)
-
- def finalize(self):
- buf = self._backend._ffi.new("unsigned char[]",
- self._backend._lib.EVP_MAX_MD_SIZE)
- outlen = self._backend._ffi.new("unsigned int *")
- res = self._backend._lib.HMAC_Final(self._ctx, buf, outlen)
- self._backend.openssl_assert(res != 0)
- self._backend.openssl_assert(outlen[0] == self.algorithm.digest_size)
- return self._backend._ffi.buffer(buf)[:outlen[0]]
-
- def verify(self, signature):
- digest = self.finalize()
- if not constant_time.bytes_eq(digest, signature):
- raise InvalidSignature("Signature did not match digest.")
diff --git a/lib/cryptography/hazmat/backends/openssl/ocsp.py b/lib/cryptography/hazmat/backends/openssl/ocsp.py
deleted file mode 100644
index 32e26a0a29..0000000000
--- a/lib/cryptography/hazmat/backends/openssl/ocsp.py
+++ /dev/null
@@ -1,370 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import functools
-
-from cryptography import utils, x509
-from cryptography.exceptions import UnsupportedAlgorithm
-from cryptography.hazmat.backends.openssl.decode_asn1 import (
- _CRL_ENTRY_REASON_CODE_TO_ENUM, _OCSP_BASICRESP_EXT_PARSER,
- _OCSP_REQ_EXT_PARSER, _asn1_integer_to_int,
- _asn1_string_to_bytes, _decode_x509_name, _obj2txt,
- _parse_asn1_generalized_time,
-)
-from cryptography.hazmat.backends.openssl.x509 import _Certificate
-from cryptography.hazmat.primitives import serialization
-from cryptography.x509.ocsp import (
- OCSPCertStatus, OCSPRequest, OCSPResponse, OCSPResponseStatus,
- _CERT_STATUS_TO_ENUM, _OIDS_TO_HASH, _RESPONSE_STATUS_TO_ENUM,
-)
-
-
-def _requires_successful_response(func):
- @functools.wraps(func)
- def wrapper(self, *args):
- if self.response_status != OCSPResponseStatus.SUCCESSFUL:
- raise ValueError(
- "OCSP response status is not successful so the property "
- "has no value"
- )
- else:
- return func(self, *args)
-
- return wrapper
-
-
-def _issuer_key_hash(backend, cert_id):
- key_hash = backend._ffi.new("ASN1_OCTET_STRING **")
- res = backend._lib.OCSP_id_get0_info(
- backend._ffi.NULL, backend._ffi.NULL,
- key_hash, backend._ffi.NULL, cert_id
- )
- backend.openssl_assert(res == 1)
- backend.openssl_assert(key_hash[0] != backend._ffi.NULL)
- return _asn1_string_to_bytes(backend, key_hash[0])
-
-
-def _issuer_name_hash(backend, cert_id):
- name_hash = backend._ffi.new("ASN1_OCTET_STRING **")
- res = backend._lib.OCSP_id_get0_info(
- name_hash, backend._ffi.NULL,
- backend._ffi.NULL, backend._ffi.NULL, cert_id
- )
- backend.openssl_assert(res == 1)
- backend.openssl_assert(name_hash[0] != backend._ffi.NULL)
- return _asn1_string_to_bytes(backend, name_hash[0])
-
-
-def _serial_number(backend, cert_id):
- num = backend._ffi.new("ASN1_INTEGER **")
- res = backend._lib.OCSP_id_get0_info(
- backend._ffi.NULL, backend._ffi.NULL,
- backend._ffi.NULL, num, cert_id
- )
- backend.openssl_assert(res == 1)
- backend.openssl_assert(num[0] != backend._ffi.NULL)
- return _asn1_integer_to_int(backend, num[0])
-
-
-def _hash_algorithm(backend, cert_id):
- asn1obj = backend._ffi.new("ASN1_OBJECT **")
- res = backend._lib.OCSP_id_get0_info(
- backend._ffi.NULL, asn1obj,
- backend._ffi.NULL, backend._ffi.NULL, cert_id
- )
- backend.openssl_assert(res == 1)
- backend.openssl_assert(asn1obj[0] != backend._ffi.NULL)
- oid = _obj2txt(backend, asn1obj[0])
- try:
- return _OIDS_TO_HASH[oid]
- except KeyError:
- raise UnsupportedAlgorithm(
- "Signature algorithm OID: {0} not recognized".format(oid)
- )
-
-
-@utils.register_interface(OCSPResponse)
-class _OCSPResponse(object):
- def __init__(self, backend, ocsp_response):
- self._backend = backend
- self._ocsp_response = ocsp_response
- status = self._backend._lib.OCSP_response_status(self._ocsp_response)
- self._backend.openssl_assert(status in _RESPONSE_STATUS_TO_ENUM)
- self._status = _RESPONSE_STATUS_TO_ENUM[status]
- if self._status is OCSPResponseStatus.SUCCESSFUL:
- basic = self._backend._lib.OCSP_response_get1_basic(
- self._ocsp_response
- )
- self._backend.openssl_assert(basic != self._backend._ffi.NULL)
- self._basic = self._backend._ffi.gc(
- basic, self._backend._lib.OCSP_BASICRESP_free
- )
- self._backend.openssl_assert(
- self._backend._lib.OCSP_resp_count(self._basic) == 1
- )
- self._single = self._backend._lib.OCSP_resp_get0(self._basic, 0)
- self._backend.openssl_assert(
- self._single != self._backend._ffi.NULL
- )
- self._cert_id = self._backend._lib.OCSP_SINGLERESP_get0_id(
- self._single
- )
- self._backend.openssl_assert(
- self._cert_id != self._backend._ffi.NULL
- )
-
- response_status = utils.read_only_property("_status")
-
- @property
- @_requires_successful_response
- def signature_algorithm_oid(self):
- alg = self._backend._lib.OCSP_resp_get0_tbs_sigalg(self._basic)
- self._backend.openssl_assert(alg != self._backend._ffi.NULL)
- oid = _obj2txt(self._backend, alg.algorithm)
- return x509.ObjectIdentifier(oid)
-
- @property
- @_requires_successful_response
- def signature(self):
- sig = self._backend._lib.OCSP_resp_get0_signature(self._basic)
- self._backend.openssl_assert(sig != self._backend._ffi.NULL)
- return _asn1_string_to_bytes(self._backend, sig)
-
- @property
- @_requires_successful_response
- def tbs_response_bytes(self):
- respdata = self._backend._lib.OCSP_resp_get0_respdata(self._basic)
- self._backend.openssl_assert(respdata != self._backend._ffi.NULL)
- pp = self._backend._ffi.new("unsigned char **")
- res = self._backend._lib.i2d_OCSP_RESPDATA(respdata, pp)
- self._backend.openssl_assert(pp[0] != self._backend._ffi.NULL)
- pp = self._backend._ffi.gc(
- pp, lambda pointer: self._backend._lib.OPENSSL_free(pointer[0])
- )
- self._backend.openssl_assert(res > 0)
- return self._backend._ffi.buffer(pp[0], res)[:]
-
- @property
- @_requires_successful_response
- def certificates(self):
- sk_x509 = self._backend._lib.OCSP_resp_get0_certs(self._basic)
- num = self._backend._lib.sk_X509_num(sk_x509)
- certs = []
- for i in range(num):
- x509 = self._backend._lib.sk_X509_value(sk_x509, i)
- self._backend.openssl_assert(x509 != self._backend._ffi.NULL)
- cert = _Certificate(self._backend, x509)
- # We need to keep the OCSP response that the certificate came from
- # alive until the Certificate object itself goes out of scope, so
- # we give it a private reference.
- cert._ocsp_resp = self
- certs.append(cert)
-
- return certs
-
- @property
- @_requires_successful_response
- def responder_key_hash(self):
- _, asn1_string = self._responder_key_name()
- if asn1_string == self._backend._ffi.NULL:
- return None
- else:
- return _asn1_string_to_bytes(self._backend, asn1_string)
-
- @property
- @_requires_successful_response
- def responder_name(self):
- x509_name, _ = self._responder_key_name()
- if x509_name == self._backend._ffi.NULL:
- return None
- else:
- return _decode_x509_name(self._backend, x509_name)
-
- def _responder_key_name(self):
- asn1_string = self._backend._ffi.new("ASN1_OCTET_STRING **")
- x509_name = self._backend._ffi.new("X509_NAME **")
- res = self._backend._lib.OCSP_resp_get0_id(
- self._basic, asn1_string, x509_name
- )
- self._backend.openssl_assert(res == 1)
- return x509_name[0], asn1_string[0]
-
- @property
- @_requires_successful_response
- def produced_at(self):
- produced_at = self._backend._lib.OCSP_resp_get0_produced_at(
- self._basic
- )
- return _parse_asn1_generalized_time(self._backend, produced_at)
-
- @property
- @_requires_successful_response
- def certificate_status(self):
- status = self._backend._lib.OCSP_single_get0_status(
- self._single,
- self._backend._ffi.NULL,
- self._backend._ffi.NULL,
- self._backend._ffi.NULL,
- self._backend._ffi.NULL,
- )
- self._backend.openssl_assert(status in _CERT_STATUS_TO_ENUM)
- return _CERT_STATUS_TO_ENUM[status]
-
- @property
- @_requires_successful_response
- def revocation_time(self):
- if self.certificate_status is not OCSPCertStatus.REVOKED:
- return None
-
- asn1_time = self._backend._ffi.new("ASN1_GENERALIZEDTIME **")
- self._backend._lib.OCSP_single_get0_status(
- self._single,
- self._backend._ffi.NULL,
- asn1_time,
- self._backend._ffi.NULL,
- self._backend._ffi.NULL,
- )
- self._backend.openssl_assert(asn1_time[0] != self._backend._ffi.NULL)
- return _parse_asn1_generalized_time(self._backend, asn1_time[0])
-
- @property
- @_requires_successful_response
- def revocation_reason(self):
- if self.certificate_status is not OCSPCertStatus.REVOKED:
- return None
-
- reason_ptr = self._backend._ffi.new("int *")
- self._backend._lib.OCSP_single_get0_status(
- self._single,
- reason_ptr,
- self._backend._ffi.NULL,
- self._backend._ffi.NULL,
- self._backend._ffi.NULL,
- )
- # If no reason is encoded OpenSSL returns -1
- if reason_ptr[0] == -1:
- return None
- else:
- self._backend.openssl_assert(
- reason_ptr[0] in _CRL_ENTRY_REASON_CODE_TO_ENUM
- )
- return _CRL_ENTRY_REASON_CODE_TO_ENUM[reason_ptr[0]]
-
- @property
- @_requires_successful_response
- def this_update(self):
- asn1_time = self._backend._ffi.new("ASN1_GENERALIZEDTIME **")
- self._backend._lib.OCSP_single_get0_status(
- self._single,
- self._backend._ffi.NULL,
- self._backend._ffi.NULL,
- asn1_time,
- self._backend._ffi.NULL,
- )
- self._backend.openssl_assert(asn1_time[0] != self._backend._ffi.NULL)
- return _parse_asn1_generalized_time(self._backend, asn1_time[0])
-
- @property
- @_requires_successful_response
- def next_update(self):
- asn1_time = self._backend._ffi.new("ASN1_GENERALIZEDTIME **")
- self._backend._lib.OCSP_single_get0_status(
- self._single,
- self._backend._ffi.NULL,
- self._backend._ffi.NULL,
- self._backend._ffi.NULL,
- asn1_time,
- )
- if asn1_time[0] != self._backend._ffi.NULL:
- return _parse_asn1_generalized_time(self._backend, asn1_time[0])
- else:
- return None
-
- @property
- @_requires_successful_response
- def issuer_key_hash(self):
- return _issuer_key_hash(self._backend, self._cert_id)
-
- @property
- @_requires_successful_response
- def issuer_name_hash(self):
- return _issuer_name_hash(self._backend, self._cert_id)
-
- @property
- @_requires_successful_response
- def hash_algorithm(self):
- return _hash_algorithm(self._backend, self._cert_id)
-
- @property
- @_requires_successful_response
- def serial_number(self):
- return _serial_number(self._backend, self._cert_id)
-
- @utils.cached_property
- @_requires_successful_response
- def extensions(self):
- return _OCSP_BASICRESP_EXT_PARSER.parse(self._backend, self._basic)
-
- def public_bytes(self, encoding):
- if encoding is not serialization.Encoding.DER:
- raise ValueError(
- "The only allowed encoding value is Encoding.DER"
- )
-
- bio = self._backend._create_mem_bio_gc()
- res = self._backend._lib.i2d_OCSP_RESPONSE_bio(
- bio, self._ocsp_response
- )
- self._backend.openssl_assert(res > 0)
- return self._backend._read_mem_bio(bio)
-
-
-@utils.register_interface(OCSPRequest)
-class _OCSPRequest(object):
- def __init__(self, backend, ocsp_request):
- if backend._lib.OCSP_request_onereq_count(ocsp_request) > 1:
- raise NotImplementedError(
- 'OCSP request contains more than one request'
- )
- self._backend = backend
- self._ocsp_request = ocsp_request
- self._request = self._backend._lib.OCSP_request_onereq_get0(
- self._ocsp_request, 0
- )
- self._backend.openssl_assert(self._request != self._backend._ffi.NULL)
- self._cert_id = self._backend._lib.OCSP_onereq_get0_id(self._request)
- self._backend.openssl_assert(self._cert_id != self._backend._ffi.NULL)
-
- @property
- def issuer_key_hash(self):
- return _issuer_key_hash(self._backend, self._cert_id)
-
- @property
- def issuer_name_hash(self):
- return _issuer_name_hash(self._backend, self._cert_id)
-
- @property
- def serial_number(self):
- return _serial_number(self._backend, self._cert_id)
-
- @property
- def hash_algorithm(self):
- return _hash_algorithm(self._backend, self._cert_id)
-
- @utils.cached_property
- def extensions(self):
- return _OCSP_REQ_EXT_PARSER.parse(self._backend, self._ocsp_request)
-
- def public_bytes(self, encoding):
- if encoding is not serialization.Encoding.DER:
- raise ValueError(
- "The only allowed encoding value is Encoding.DER"
- )
-
- bio = self._backend._create_mem_bio_gc()
- res = self._backend._lib.i2d_OCSP_REQUEST_bio(bio, self._ocsp_request)
- self._backend.openssl_assert(res > 0)
- return self._backend._read_mem_bio(bio)
diff --git a/lib/cryptography/hazmat/backends/openssl/rsa.py b/lib/cryptography/hazmat/backends/openssl/rsa.py
deleted file mode 100644
index 00f5e37742..0000000000
--- a/lib/cryptography/hazmat/backends/openssl/rsa.py
+++ /dev/null
@@ -1,476 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import math
-
-from cryptography import utils
-from cryptography.exceptions import (
- InvalidSignature, UnsupportedAlgorithm, _Reasons
-)
-from cryptography.hazmat.backends.openssl.utils import (
- _calculate_digest_and_algorithm, _check_not_prehashed,
- _warn_sign_verify_deprecated
-)
-from cryptography.hazmat.primitives import hashes
-from cryptography.hazmat.primitives.asymmetric import (
- AsymmetricSignatureContext, AsymmetricVerificationContext, rsa
-)
-from cryptography.hazmat.primitives.asymmetric.padding import (
- AsymmetricPadding, MGF1, OAEP, PKCS1v15, PSS, calculate_max_pss_salt_length
-)
-from cryptography.hazmat.primitives.asymmetric.rsa import (
- RSAPrivateKeyWithSerialization, RSAPublicKeyWithSerialization
-)
-
-
-def _get_rsa_pss_salt_length(pss, key, hash_algorithm):
- salt = pss._salt_length
-
- if salt is MGF1.MAX_LENGTH or salt is PSS.MAX_LENGTH:
- return calculate_max_pss_salt_length(key, hash_algorithm)
- else:
- return salt
-
-
-def _enc_dec_rsa(backend, key, data, padding):
- if not isinstance(padding, AsymmetricPadding):
- raise TypeError("Padding must be an instance of AsymmetricPadding.")
-
- if isinstance(padding, PKCS1v15):
- padding_enum = backend._lib.RSA_PKCS1_PADDING
- elif isinstance(padding, OAEP):
- padding_enum = backend._lib.RSA_PKCS1_OAEP_PADDING
-
- if not isinstance(padding._mgf, MGF1):
- raise UnsupportedAlgorithm(
- "Only MGF1 is supported by this backend.",
- _Reasons.UNSUPPORTED_MGF
- )
-
- if not backend.rsa_padding_supported(padding):
- raise UnsupportedAlgorithm(
- "This combination of padding and hash algorithm is not "
- "supported by this backend.",
- _Reasons.UNSUPPORTED_PADDING
- )
-
- else:
- raise UnsupportedAlgorithm(
- "{0} is not supported by this backend.".format(
- padding.name
- ),
- _Reasons.UNSUPPORTED_PADDING
- )
-
- return _enc_dec_rsa_pkey_ctx(backend, key, data, padding_enum, padding)
-
-
-def _enc_dec_rsa_pkey_ctx(backend, key, data, padding_enum, padding):
- if isinstance(key, _RSAPublicKey):
- init = backend._lib.EVP_PKEY_encrypt_init
- crypt = backend._lib.EVP_PKEY_encrypt
- else:
- init = backend._lib.EVP_PKEY_decrypt_init
- crypt = backend._lib.EVP_PKEY_decrypt
-
- pkey_ctx = backend._lib.EVP_PKEY_CTX_new(
- key._evp_pkey, backend._ffi.NULL
- )
- backend.openssl_assert(pkey_ctx != backend._ffi.NULL)
- pkey_ctx = backend._ffi.gc(pkey_ctx, backend._lib.EVP_PKEY_CTX_free)
- res = init(pkey_ctx)
- backend.openssl_assert(res == 1)
- res = backend._lib.EVP_PKEY_CTX_set_rsa_padding(
- pkey_ctx, padding_enum)
- backend.openssl_assert(res > 0)
- buf_size = backend._lib.EVP_PKEY_size(key._evp_pkey)
- backend.openssl_assert(buf_size > 0)
- if (
- isinstance(padding, OAEP) and
- backend._lib.Cryptography_HAS_RSA_OAEP_MD
- ):
- mgf1_md = backend._evp_md_non_null_from_algorithm(
- padding._mgf._algorithm)
- res = backend._lib.EVP_PKEY_CTX_set_rsa_mgf1_md(pkey_ctx, mgf1_md)
- backend.openssl_assert(res > 0)
- oaep_md = backend._evp_md_non_null_from_algorithm(padding._algorithm)
- res = backend._lib.EVP_PKEY_CTX_set_rsa_oaep_md(pkey_ctx, oaep_md)
- backend.openssl_assert(res > 0)
-
- if (
- isinstance(padding, OAEP) and
- padding._label is not None and
- len(padding._label) > 0
- ):
- # set0_rsa_oaep_label takes ownership of the char * so we need to
- # copy it into some new memory
- labelptr = backend._lib.OPENSSL_malloc(len(padding._label))
- backend.openssl_assert(labelptr != backend._ffi.NULL)
- backend._ffi.memmove(labelptr, padding._label, len(padding._label))
- res = backend._lib.EVP_PKEY_CTX_set0_rsa_oaep_label(
- pkey_ctx, labelptr, len(padding._label)
- )
- backend.openssl_assert(res == 1)
-
- outlen = backend._ffi.new("size_t *", buf_size)
- buf = backend._ffi.new("unsigned char[]", buf_size)
- res = crypt(pkey_ctx, buf, outlen, data, len(data))
- if res <= 0:
- _handle_rsa_enc_dec_error(backend, key)
-
- return backend._ffi.buffer(buf)[:outlen[0]]
-
-
-def _handle_rsa_enc_dec_error(backend, key):
- errors = backend._consume_errors()
- backend.openssl_assert(errors)
- assert errors[0].lib == backend._lib.ERR_LIB_RSA
- if isinstance(key, _RSAPublicKey):
- assert (errors[0].reason ==
- backend._lib.RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE)
- raise ValueError(
- "Data too long for key size. Encrypt less data or use a "
- "larger key size."
- )
- else:
- decoding_errors = [
- backend._lib.RSA_R_BLOCK_TYPE_IS_NOT_01,
- backend._lib.RSA_R_BLOCK_TYPE_IS_NOT_02,
- backend._lib.RSA_R_OAEP_DECODING_ERROR,
- # Though this error looks similar to the
- # RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE, this occurs on decrypts,
- # rather than on encrypts
- backend._lib.RSA_R_DATA_TOO_LARGE_FOR_MODULUS,
- ]
- if backend._lib.Cryptography_HAS_RSA_R_PKCS_DECODING_ERROR:
- decoding_errors.append(backend._lib.RSA_R_PKCS_DECODING_ERROR)
-
- assert errors[0].reason in decoding_errors
- raise ValueError("Decryption failed.")
-
-
-def _rsa_sig_determine_padding(backend, key, padding, algorithm):
- if not isinstance(padding, AsymmetricPadding):
- raise TypeError("Expected provider of AsymmetricPadding.")
-
- pkey_size = backend._lib.EVP_PKEY_size(key._evp_pkey)
- backend.openssl_assert(pkey_size > 0)
-
- if isinstance(padding, PKCS1v15):
- padding_enum = backend._lib.RSA_PKCS1_PADDING
- elif isinstance(padding, PSS):
- if not isinstance(padding._mgf, MGF1):
- raise UnsupportedAlgorithm(
- "Only MGF1 is supported by this backend.",
- _Reasons.UNSUPPORTED_MGF
- )
-
- # Size of key in bytes - 2 is the maximum
- # PSS signature length (salt length is checked later)
- if pkey_size - algorithm.digest_size - 2 < 0:
- raise ValueError("Digest too large for key size. Use a larger "
- "key or different digest.")
-
- padding_enum = backend._lib.RSA_PKCS1_PSS_PADDING
- else:
- raise UnsupportedAlgorithm(
- "{0} is not supported by this backend.".format(padding.name),
- _Reasons.UNSUPPORTED_PADDING
- )
-
- return padding_enum
-
-
-def _rsa_sig_setup(backend, padding, algorithm, key, data, init_func):
- padding_enum = _rsa_sig_determine_padding(backend, key, padding, algorithm)
- evp_md = backend._evp_md_non_null_from_algorithm(algorithm)
- pkey_ctx = backend._lib.EVP_PKEY_CTX_new(key._evp_pkey, backend._ffi.NULL)
- backend.openssl_assert(pkey_ctx != backend._ffi.NULL)
- pkey_ctx = backend._ffi.gc(pkey_ctx, backend._lib.EVP_PKEY_CTX_free)
- res = init_func(pkey_ctx)
- backend.openssl_assert(res == 1)
- res = backend._lib.EVP_PKEY_CTX_set_signature_md(pkey_ctx, evp_md)
- if res == 0:
- backend._consume_errors()
- raise UnsupportedAlgorithm(
- "{0} is not supported by this backend for RSA signing.".format(
- algorithm.name
- ),
- _Reasons.UNSUPPORTED_HASH
- )
- res = backend._lib.EVP_PKEY_CTX_set_rsa_padding(pkey_ctx, padding_enum)
- backend.openssl_assert(res > 0)
- if isinstance(padding, PSS):
- res = backend._lib.EVP_PKEY_CTX_set_rsa_pss_saltlen(
- pkey_ctx, _get_rsa_pss_salt_length(padding, key, algorithm)
- )
- backend.openssl_assert(res > 0)
-
- mgf1_md = backend._evp_md_non_null_from_algorithm(
- padding._mgf._algorithm)
- res = backend._lib.EVP_PKEY_CTX_set_rsa_mgf1_md(pkey_ctx, mgf1_md)
- backend.openssl_assert(res > 0)
-
- return pkey_ctx
-
-
-def _rsa_sig_sign(backend, padding, algorithm, private_key, data):
- pkey_ctx = _rsa_sig_setup(
- backend, padding, algorithm, private_key, data,
- backend._lib.EVP_PKEY_sign_init
- )
- buflen = backend._ffi.new("size_t *")
- res = backend._lib.EVP_PKEY_sign(
- pkey_ctx,
- backend._ffi.NULL,
- buflen,
- data,
- len(data)
- )
- backend.openssl_assert(res == 1)
- buf = backend._ffi.new("unsigned char[]", buflen[0])
- res = backend._lib.EVP_PKEY_sign(
- pkey_ctx, buf, buflen, data, len(data))
- if res != 1:
- errors = backend._consume_errors()
- assert errors[0].lib == backend._lib.ERR_LIB_RSA
- reason = None
- if (errors[0].reason ==
- backend._lib.RSA_R_DATA_TOO_LARGE_FOR_KEY_SIZE):
- reason = ("Salt length too long for key size. Try using "
- "MAX_LENGTH instead.")
- else:
- assert (errors[0].reason ==
- backend._lib.RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY)
- reason = "Digest too large for key size. Use a larger key."
- assert reason is not None
- raise ValueError(reason)
-
- return backend._ffi.buffer(buf)[:]
-
-
-def _rsa_sig_verify(backend, padding, algorithm, public_key, signature, data):
- pkey_ctx = _rsa_sig_setup(
- backend, padding, algorithm, public_key, data,
- backend._lib.EVP_PKEY_verify_init
- )
- res = backend._lib.EVP_PKEY_verify(
- pkey_ctx, signature, len(signature), data, len(data)
- )
- # The previous call can return negative numbers in the event of an
- # error. This is not a signature failure but we need to fail if it
- # occurs.
- backend.openssl_assert(res >= 0)
- if res == 0:
- backend._consume_errors()
- raise InvalidSignature
-
-
-@utils.register_interface(AsymmetricSignatureContext)
-class _RSASignatureContext(object):
- def __init__(self, backend, private_key, padding, algorithm):
- self._backend = backend
- self._private_key = private_key
-
- # We now call _rsa_sig_determine_padding in _rsa_sig_setup. However
- # we need to make a pointless call to it here so we maintain the
- # API of erroring on init with this context if the values are invalid.
- _rsa_sig_determine_padding(backend, private_key, padding, algorithm)
- self._padding = padding
- self._algorithm = algorithm
- self._hash_ctx = hashes.Hash(self._algorithm, self._backend)
-
- def update(self, data):
- self._hash_ctx.update(data)
-
- def finalize(self):
- return _rsa_sig_sign(
- self._backend,
- self._padding,
- self._algorithm,
- self._private_key,
- self._hash_ctx.finalize()
- )
-
-
-@utils.register_interface(AsymmetricVerificationContext)
-class _RSAVerificationContext(object):
- def __init__(self, backend, public_key, signature, padding, algorithm):
- self._backend = backend
- self._public_key = public_key
- self._signature = signature
- self._padding = padding
- # We now call _rsa_sig_determine_padding in _rsa_sig_setup. However
- # we need to make a pointless call to it here so we maintain the
- # API of erroring on init with this context if the values are invalid.
- _rsa_sig_determine_padding(backend, public_key, padding, algorithm)
-
- padding = padding
- self._algorithm = algorithm
- self._hash_ctx = hashes.Hash(self._algorithm, self._backend)
-
- def update(self, data):
- self._hash_ctx.update(data)
-
- def verify(self):
- return _rsa_sig_verify(
- self._backend,
- self._padding,
- self._algorithm,
- self._public_key,
- self._signature,
- self._hash_ctx.finalize()
- )
-
-
-@utils.register_interface(RSAPrivateKeyWithSerialization)
-class _RSAPrivateKey(object):
- def __init__(self, backend, rsa_cdata, evp_pkey):
- self._backend = backend
- self._rsa_cdata = rsa_cdata
- self._evp_pkey = evp_pkey
-
- n = self._backend._ffi.new("BIGNUM **")
- self._backend._lib.RSA_get0_key(
- self._rsa_cdata, n, self._backend._ffi.NULL,
- self._backend._ffi.NULL
- )
- self._backend.openssl_assert(n[0] != self._backend._ffi.NULL)
- self._key_size = self._backend._lib.BN_num_bits(n[0])
-
- key_size = utils.read_only_property("_key_size")
-
- def signer(self, padding, algorithm):
- _warn_sign_verify_deprecated()
- _check_not_prehashed(algorithm)
- return _RSASignatureContext(self._backend, self, padding, algorithm)
-
- def decrypt(self, ciphertext, padding):
- key_size_bytes = int(math.ceil(self.key_size / 8.0))
- if key_size_bytes != len(ciphertext):
- raise ValueError("Ciphertext length must be equal to key size.")
-
- return _enc_dec_rsa(self._backend, self, ciphertext, padding)
-
- def public_key(self):
- ctx = self._backend._lib.RSAPublicKey_dup(self._rsa_cdata)
- self._backend.openssl_assert(ctx != self._backend._ffi.NULL)
- ctx = self._backend._ffi.gc(ctx, self._backend._lib.RSA_free)
- res = self._backend._lib.RSA_blinding_on(ctx, self._backend._ffi.NULL)
- self._backend.openssl_assert(res == 1)
- evp_pkey = self._backend._rsa_cdata_to_evp_pkey(ctx)
- return _RSAPublicKey(self._backend, ctx, evp_pkey)
-
- def private_numbers(self):
- n = self._backend._ffi.new("BIGNUM **")
- e = self._backend._ffi.new("BIGNUM **")
- d = self._backend._ffi.new("BIGNUM **")
- p = self._backend._ffi.new("BIGNUM **")
- q = self._backend._ffi.new("BIGNUM **")
- dmp1 = self._backend._ffi.new("BIGNUM **")
- dmq1 = self._backend._ffi.new("BIGNUM **")
- iqmp = self._backend._ffi.new("BIGNUM **")
- self._backend._lib.RSA_get0_key(self._rsa_cdata, n, e, d)
- self._backend.openssl_assert(n[0] != self._backend._ffi.NULL)
- self._backend.openssl_assert(e[0] != self._backend._ffi.NULL)
- self._backend.openssl_assert(d[0] != self._backend._ffi.NULL)
- self._backend._lib.RSA_get0_factors(self._rsa_cdata, p, q)
- self._backend.openssl_assert(p[0] != self._backend._ffi.NULL)
- self._backend.openssl_assert(q[0] != self._backend._ffi.NULL)
- self._backend._lib.RSA_get0_crt_params(
- self._rsa_cdata, dmp1, dmq1, iqmp
- )
- self._backend.openssl_assert(dmp1[0] != self._backend._ffi.NULL)
- self._backend.openssl_assert(dmq1[0] != self._backend._ffi.NULL)
- self._backend.openssl_assert(iqmp[0] != self._backend._ffi.NULL)
- return rsa.RSAPrivateNumbers(
- p=self._backend._bn_to_int(p[0]),
- q=self._backend._bn_to_int(q[0]),
- d=self._backend._bn_to_int(d[0]),
- dmp1=self._backend._bn_to_int(dmp1[0]),
- dmq1=self._backend._bn_to_int(dmq1[0]),
- iqmp=self._backend._bn_to_int(iqmp[0]),
- public_numbers=rsa.RSAPublicNumbers(
- e=self._backend._bn_to_int(e[0]),
- n=self._backend._bn_to_int(n[0]),
- )
- )
-
- def private_bytes(self, encoding, format, encryption_algorithm):
- return self._backend._private_key_bytes(
- encoding,
- format,
- encryption_algorithm,
- self._evp_pkey,
- self._rsa_cdata
- )
-
- def sign(self, data, padding, algorithm):
- data, algorithm = _calculate_digest_and_algorithm(
- self._backend, data, algorithm
- )
- return _rsa_sig_sign(self._backend, padding, algorithm, self, data)
-
-
-@utils.register_interface(RSAPublicKeyWithSerialization)
-class _RSAPublicKey(object):
- def __init__(self, backend, rsa_cdata, evp_pkey):
- self._backend = backend
- self._rsa_cdata = rsa_cdata
- self._evp_pkey = evp_pkey
-
- n = self._backend._ffi.new("BIGNUM **")
- self._backend._lib.RSA_get0_key(
- self._rsa_cdata, n, self._backend._ffi.NULL,
- self._backend._ffi.NULL
- )
- self._backend.openssl_assert(n[0] != self._backend._ffi.NULL)
- self._key_size = self._backend._lib.BN_num_bits(n[0])
-
- key_size = utils.read_only_property("_key_size")
-
- def verifier(self, signature, padding, algorithm):
- _warn_sign_verify_deprecated()
- if not isinstance(signature, bytes):
- raise TypeError("signature must be bytes.")
-
- _check_not_prehashed(algorithm)
- return _RSAVerificationContext(
- self._backend, self, signature, padding, algorithm
- )
-
- def encrypt(self, plaintext, padding):
- return _enc_dec_rsa(self._backend, self, plaintext, padding)
-
- def public_numbers(self):
- n = self._backend._ffi.new("BIGNUM **")
- e = self._backend._ffi.new("BIGNUM **")
- self._backend._lib.RSA_get0_key(
- self._rsa_cdata, n, e, self._backend._ffi.NULL
- )
- self._backend.openssl_assert(n[0] != self._backend._ffi.NULL)
- self._backend.openssl_assert(e[0] != self._backend._ffi.NULL)
- return rsa.RSAPublicNumbers(
- e=self._backend._bn_to_int(e[0]),
- n=self._backend._bn_to_int(n[0]),
- )
-
- def public_bytes(self, encoding, format):
- return self._backend._public_key_bytes(
- encoding,
- format,
- self,
- self._evp_pkey,
- self._rsa_cdata
- )
-
- def verify(self, signature, data, padding, algorithm):
- data, algorithm = _calculate_digest_and_algorithm(
- self._backend, data, algorithm
- )
- return _rsa_sig_verify(
- self._backend, padding, algorithm, self, signature, data
- )
diff --git a/lib/cryptography/hazmat/backends/openssl/utils.py b/lib/cryptography/hazmat/backends/openssl/utils.py
deleted file mode 100644
index 05d0fe5891..0000000000
--- a/lib/cryptography/hazmat/backends/openssl/utils.py
+++ /dev/null
@@ -1,45 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import warnings
-
-from cryptography import utils
-from cryptography.hazmat.primitives import hashes
-from cryptography.hazmat.primitives.asymmetric.utils import Prehashed
-
-
-def _calculate_digest_and_algorithm(backend, data, algorithm):
- if not isinstance(algorithm, Prehashed):
- hash_ctx = hashes.Hash(algorithm, backend)
- hash_ctx.update(data)
- data = hash_ctx.finalize()
- else:
- algorithm = algorithm._algorithm
-
- if len(data) != algorithm.digest_size:
- raise ValueError(
- "The provided data must be the same length as the hash "
- "algorithm's digest size."
- )
-
- return (data, algorithm)
-
-
-def _check_not_prehashed(signature_algorithm):
- if isinstance(signature_algorithm, Prehashed):
- raise TypeError(
- "Prehashed is only supported in the sign and verify methods. "
- "It cannot be used with signer or verifier."
- )
-
-
-def _warn_sign_verify_deprecated():
- warnings.warn(
- "signer and verifier have been deprecated. Please use sign "
- "and verify instead.",
- utils.PersistentlyDeprecated,
- stacklevel=3
- )
diff --git a/lib/cryptography/hazmat/backends/openssl/x25519.py b/lib/cryptography/hazmat/backends/openssl/x25519.py
deleted file mode 100644
index 983ece6a97..0000000000
--- a/lib/cryptography/hazmat/backends/openssl/x25519.py
+++ /dev/null
@@ -1,79 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-from cryptography import utils
-from cryptography.hazmat.primitives.asymmetric.x25519 import (
- X25519PrivateKey, X25519PublicKey
-)
-
-
-@utils.register_interface(X25519PublicKey)
-class _X25519PublicKey(object):
- def __init__(self, backend, evp_pkey):
- self._backend = backend
- self._evp_pkey = evp_pkey
-
- def public_bytes(self):
- ucharpp = self._backend._ffi.new("unsigned char **")
- res = self._backend._lib.EVP_PKEY_get1_tls_encodedpoint(
- self._evp_pkey, ucharpp
- )
- self._backend.openssl_assert(res == 32)
- self._backend.openssl_assert(ucharpp[0] != self._backend._ffi.NULL)
- data = self._backend._ffi.gc(
- ucharpp[0], self._backend._lib.OPENSSL_free
- )
- return self._backend._ffi.buffer(data, res)[:]
-
-
-@utils.register_interface(X25519PrivateKey)
-class _X25519PrivateKey(object):
- def __init__(self, backend, evp_pkey):
- self._backend = backend
- self._evp_pkey = evp_pkey
-
- def public_key(self):
- bio = self._backend._create_mem_bio_gc()
- res = self._backend._lib.i2d_PUBKEY_bio(bio, self._evp_pkey)
- self._backend.openssl_assert(res == 1)
- evp_pkey = self._backend._lib.d2i_PUBKEY_bio(
- bio, self._backend._ffi.NULL
- )
- self._backend.openssl_assert(evp_pkey != self._backend._ffi.NULL)
- evp_pkey = self._backend._ffi.gc(
- evp_pkey, self._backend._lib.EVP_PKEY_free
- )
- return _X25519PublicKey(self._backend, evp_pkey)
-
- def exchange(self, peer_public_key):
- if not isinstance(peer_public_key, X25519PublicKey):
- raise TypeError("peer_public_key must be X25519PublicKey.")
-
- ctx = self._backend._lib.EVP_PKEY_CTX_new(
- self._evp_pkey, self._backend._ffi.NULL
- )
- self._backend.openssl_assert(ctx != self._backend._ffi.NULL)
- ctx = self._backend._ffi.gc(ctx, self._backend._lib.EVP_PKEY_CTX_free)
- res = self._backend._lib.EVP_PKEY_derive_init(ctx)
- self._backend.openssl_assert(res == 1)
- res = self._backend._lib.EVP_PKEY_derive_set_peer(
- ctx, peer_public_key._evp_pkey
- )
- self._backend.openssl_assert(res == 1)
- keylen = self._backend._ffi.new("size_t *")
- res = self._backend._lib.EVP_PKEY_derive(
- ctx, self._backend._ffi.NULL, keylen
- )
- self._backend.openssl_assert(res == 1)
- self._backend.openssl_assert(keylen[0] > 0)
- buf = self._backend._ffi.new("unsigned char[]", keylen[0])
- res = self._backend._lib.EVP_PKEY_derive(ctx, buf, keylen)
- if res != 1:
- raise ValueError(
- "Null shared key derived from public/private pair."
- )
-
- return self._backend._ffi.buffer(buf, keylen[0])[:]
diff --git a/lib/cryptography/hazmat/backends/openssl/x509.py b/lib/cryptography/hazmat/backends/openssl/x509.py
deleted file mode 100644
index ac1838c6d1..0000000000
--- a/lib/cryptography/hazmat/backends/openssl/x509.py
+++ /dev/null
@@ -1,556 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import datetime
-import operator
-import warnings
-
-from cryptography import utils, x509
-from cryptography.exceptions import UnsupportedAlgorithm
-from cryptography.hazmat.backends.openssl.decode_asn1 import (
- _CERTIFICATE_EXTENSION_PARSER, _CERTIFICATE_EXTENSION_PARSER_NO_SCT,
- _CRL_EXTENSION_PARSER, _CSR_EXTENSION_PARSER,
- _REVOKED_CERTIFICATE_EXTENSION_PARSER, _asn1_integer_to_int,
- _asn1_string_to_bytes, _decode_x509_name, _obj2txt, _parse_asn1_time
-)
-from cryptography.hazmat.backends.openssl.encode_asn1 import (
- _encode_asn1_int_gc
-)
-from cryptography.hazmat.primitives import hashes, serialization
-from cryptography.hazmat.primitives.asymmetric import dsa, ec, rsa
-
-
-@utils.register_interface(x509.Certificate)
-class _Certificate(object):
- def __init__(self, backend, x509):
- self._backend = backend
- self._x509 = x509
-
- def __repr__(self):
- return "".format(self.subject)
-
- def __eq__(self, other):
- if not isinstance(other, x509.Certificate):
- return NotImplemented
-
- res = self._backend._lib.X509_cmp(self._x509, other._x509)
- return res == 0
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- return hash(self.public_bytes(serialization.Encoding.DER))
-
- def fingerprint(self, algorithm):
- h = hashes.Hash(algorithm, self._backend)
- h.update(self.public_bytes(serialization.Encoding.DER))
- return h.finalize()
-
- @property
- def version(self):
- version = self._backend._lib.X509_get_version(self._x509)
- if version == 0:
- return x509.Version.v1
- elif version == 2:
- return x509.Version.v3
- else:
- raise x509.InvalidVersion(
- "{0} is not a valid X509 version".format(version), version
- )
-
- @property
- def serial(self):
- warnings.warn(
- "Certificate serial is deprecated, use serial_number instead.",
- utils.PersistentlyDeprecated,
- stacklevel=2
- )
- return self.serial_number
-
- @property
- def serial_number(self):
- asn1_int = self._backend._lib.X509_get_serialNumber(self._x509)
- self._backend.openssl_assert(asn1_int != self._backend._ffi.NULL)
- return _asn1_integer_to_int(self._backend, asn1_int)
-
- def public_key(self):
- pkey = self._backend._lib.X509_get_pubkey(self._x509)
- if pkey == self._backend._ffi.NULL:
- # Remove errors from the stack.
- self._backend._consume_errors()
- raise ValueError("Certificate public key is of an unknown type")
-
- pkey = self._backend._ffi.gc(pkey, self._backend._lib.EVP_PKEY_free)
-
- return self._backend._evp_pkey_to_public_key(pkey)
-
- @property
- def not_valid_before(self):
- asn1_time = self._backend._lib.X509_get_notBefore(self._x509)
- return _parse_asn1_time(self._backend, asn1_time)
-
- @property
- def not_valid_after(self):
- asn1_time = self._backend._lib.X509_get_notAfter(self._x509)
- return _parse_asn1_time(self._backend, asn1_time)
-
- @property
- def issuer(self):
- issuer = self._backend._lib.X509_get_issuer_name(self._x509)
- self._backend.openssl_assert(issuer != self._backend._ffi.NULL)
- return _decode_x509_name(self._backend, issuer)
-
- @property
- def subject(self):
- subject = self._backend._lib.X509_get_subject_name(self._x509)
- self._backend.openssl_assert(subject != self._backend._ffi.NULL)
- return _decode_x509_name(self._backend, subject)
-
- @property
- def signature_hash_algorithm(self):
- oid = self.signature_algorithm_oid
- try:
- return x509._SIG_OIDS_TO_HASH[oid]
- except KeyError:
- raise UnsupportedAlgorithm(
- "Signature algorithm OID:{0} not recognized".format(oid)
- )
-
- @property
- def signature_algorithm_oid(self):
- alg = self._backend._ffi.new("X509_ALGOR **")
- self._backend._lib.X509_get0_signature(
- self._backend._ffi.NULL, alg, self._x509
- )
- self._backend.openssl_assert(alg[0] != self._backend._ffi.NULL)
- oid = _obj2txt(self._backend, alg[0].algorithm)
- return x509.ObjectIdentifier(oid)
-
- @utils.cached_property
- def extensions(self):
- if self._backend._lib.CRYPTOGRAPHY_OPENSSL_110_OR_GREATER:
- return _CERTIFICATE_EXTENSION_PARSER.parse(
- self._backend, self._x509
- )
- else:
- return _CERTIFICATE_EXTENSION_PARSER_NO_SCT.parse(
- self._backend, self._x509
- )
-
- @property
- def signature(self):
- sig = self._backend._ffi.new("ASN1_BIT_STRING **")
- self._backend._lib.X509_get0_signature(
- sig, self._backend._ffi.NULL, self._x509
- )
- self._backend.openssl_assert(sig[0] != self._backend._ffi.NULL)
- return _asn1_string_to_bytes(self._backend, sig[0])
-
- @property
- def tbs_certificate_bytes(self):
- pp = self._backend._ffi.new("unsigned char **")
- res = self._backend._lib.i2d_re_X509_tbs(self._x509, pp)
- self._backend.openssl_assert(res > 0)
- pp = self._backend._ffi.gc(
- pp, lambda pointer: self._backend._lib.OPENSSL_free(pointer[0])
- )
- return self._backend._ffi.buffer(pp[0], res)[:]
-
- def public_bytes(self, encoding):
- bio = self._backend._create_mem_bio_gc()
- if encoding is serialization.Encoding.PEM:
- res = self._backend._lib.PEM_write_bio_X509(bio, self._x509)
- elif encoding is serialization.Encoding.DER:
- res = self._backend._lib.i2d_X509_bio(bio, self._x509)
- else:
- raise TypeError("encoding must be an item from the Encoding enum")
-
- self._backend.openssl_assert(res == 1)
- return self._backend._read_mem_bio(bio)
-
-
-@utils.register_interface(x509.RevokedCertificate)
-class _RevokedCertificate(object):
- def __init__(self, backend, crl, x509_revoked):
- self._backend = backend
- # The X509_REVOKED_value is a X509_REVOKED * that has
- # no reference counting. This means when X509_CRL_free is
- # called then the CRL and all X509_REVOKED * are freed. Since
- # you can retain a reference to a single revoked certificate
- # and let the CRL fall out of scope we need to retain a
- # private reference to the CRL inside the RevokedCertificate
- # object to prevent the gc from being called inappropriately.
- self._crl = crl
- self._x509_revoked = x509_revoked
-
- @property
- def serial_number(self):
- asn1_int = self._backend._lib.X509_REVOKED_get0_serialNumber(
- self._x509_revoked
- )
- self._backend.openssl_assert(asn1_int != self._backend._ffi.NULL)
- return _asn1_integer_to_int(self._backend, asn1_int)
-
- @property
- def revocation_date(self):
- return _parse_asn1_time(
- self._backend,
- self._backend._lib.X509_REVOKED_get0_revocationDate(
- self._x509_revoked
- )
- )
-
- @utils.cached_property
- def extensions(self):
- return _REVOKED_CERTIFICATE_EXTENSION_PARSER.parse(
- self._backend, self._x509_revoked
- )
-
-
-@utils.register_interface(x509.CertificateRevocationList)
-class _CertificateRevocationList(object):
- def __init__(self, backend, x509_crl):
- self._backend = backend
- self._x509_crl = x509_crl
-
- def __eq__(self, other):
- if not isinstance(other, x509.CertificateRevocationList):
- return NotImplemented
-
- res = self._backend._lib.X509_CRL_cmp(self._x509_crl, other._x509_crl)
- return res == 0
-
- def __ne__(self, other):
- return not self == other
-
- def fingerprint(self, algorithm):
- h = hashes.Hash(algorithm, self._backend)
- bio = self._backend._create_mem_bio_gc()
- res = self._backend._lib.i2d_X509_CRL_bio(
- bio, self._x509_crl
- )
- self._backend.openssl_assert(res == 1)
- der = self._backend._read_mem_bio(bio)
- h.update(der)
- return h.finalize()
-
- @utils.cached_property
- def _sorted_crl(self):
- # X509_CRL_get0_by_serial sorts in place, which breaks a variety of
- # things we don't want to break (like iteration and the signature).
- # Let's dupe it and sort that instead.
- dup = self._backend._lib.X509_CRL_dup(self._x509_crl)
- self._backend.openssl_assert(dup != self._backend._ffi.NULL)
- dup = self._backend._ffi.gc(dup, self._backend._lib.X509_CRL_free)
- return dup
-
- def get_revoked_certificate_by_serial_number(self, serial_number):
- revoked = self._backend._ffi.new("X509_REVOKED **")
- asn1_int = _encode_asn1_int_gc(self._backend, serial_number)
- res = self._backend._lib.X509_CRL_get0_by_serial(
- self._sorted_crl, revoked, asn1_int
- )
- if res == 0:
- return None
- else:
- self._backend.openssl_assert(
- revoked[0] != self._backend._ffi.NULL
- )
- return _RevokedCertificate(
- self._backend, self._sorted_crl, revoked[0]
- )
-
- @property
- def signature_hash_algorithm(self):
- oid = self.signature_algorithm_oid
- try:
- return x509._SIG_OIDS_TO_HASH[oid]
- except KeyError:
- raise UnsupportedAlgorithm(
- "Signature algorithm OID:{0} not recognized".format(oid)
- )
-
- @property
- def signature_algorithm_oid(self):
- alg = self._backend._ffi.new("X509_ALGOR **")
- self._backend._lib.X509_CRL_get0_signature(
- self._x509_crl, self._backend._ffi.NULL, alg
- )
- self._backend.openssl_assert(alg[0] != self._backend._ffi.NULL)
- oid = _obj2txt(self._backend, alg[0].algorithm)
- return x509.ObjectIdentifier(oid)
-
- @property
- def issuer(self):
- issuer = self._backend._lib.X509_CRL_get_issuer(self._x509_crl)
- self._backend.openssl_assert(issuer != self._backend._ffi.NULL)
- return _decode_x509_name(self._backend, issuer)
-
- @property
- def next_update(self):
- nu = self._backend._lib.X509_CRL_get_nextUpdate(self._x509_crl)
- self._backend.openssl_assert(nu != self._backend._ffi.NULL)
- return _parse_asn1_time(self._backend, nu)
-
- @property
- def last_update(self):
- lu = self._backend._lib.X509_CRL_get_lastUpdate(self._x509_crl)
- self._backend.openssl_assert(lu != self._backend._ffi.NULL)
- return _parse_asn1_time(self._backend, lu)
-
- @property
- def signature(self):
- sig = self._backend._ffi.new("ASN1_BIT_STRING **")
- self._backend._lib.X509_CRL_get0_signature(
- self._x509_crl, sig, self._backend._ffi.NULL
- )
- self._backend.openssl_assert(sig[0] != self._backend._ffi.NULL)
- return _asn1_string_to_bytes(self._backend, sig[0])
-
- @property
- def tbs_certlist_bytes(self):
- pp = self._backend._ffi.new("unsigned char **")
- res = self._backend._lib.i2d_re_X509_CRL_tbs(self._x509_crl, pp)
- self._backend.openssl_assert(res > 0)
- pp = self._backend._ffi.gc(
- pp, lambda pointer: self._backend._lib.OPENSSL_free(pointer[0])
- )
- return self._backend._ffi.buffer(pp[0], res)[:]
-
- def public_bytes(self, encoding):
- bio = self._backend._create_mem_bio_gc()
- if encoding is serialization.Encoding.PEM:
- res = self._backend._lib.PEM_write_bio_X509_CRL(
- bio, self._x509_crl
- )
- elif encoding is serialization.Encoding.DER:
- res = self._backend._lib.i2d_X509_CRL_bio(bio, self._x509_crl)
- else:
- raise TypeError("encoding must be an item from the Encoding enum")
-
- self._backend.openssl_assert(res == 1)
- return self._backend._read_mem_bio(bio)
-
- def _revoked_cert(self, idx):
- revoked = self._backend._lib.X509_CRL_get_REVOKED(self._x509_crl)
- r = self._backend._lib.sk_X509_REVOKED_value(revoked, idx)
- self._backend.openssl_assert(r != self._backend._ffi.NULL)
- return _RevokedCertificate(self._backend, self, r)
-
- def __iter__(self):
- for i in range(len(self)):
- yield self._revoked_cert(i)
-
- def __getitem__(self, idx):
- if isinstance(idx, slice):
- start, stop, step = idx.indices(len(self))
- return [self._revoked_cert(i) for i in range(start, stop, step)]
- else:
- idx = operator.index(idx)
- if idx < 0:
- idx += len(self)
- if not 0 <= idx < len(self):
- raise IndexError
- return self._revoked_cert(idx)
-
- def __len__(self):
- revoked = self._backend._lib.X509_CRL_get_REVOKED(self._x509_crl)
- if revoked == self._backend._ffi.NULL:
- return 0
- else:
- return self._backend._lib.sk_X509_REVOKED_num(revoked)
-
- @utils.cached_property
- def extensions(self):
- return _CRL_EXTENSION_PARSER.parse(self._backend, self._x509_crl)
-
- def is_signature_valid(self, public_key):
- if not isinstance(public_key, (dsa.DSAPublicKey, rsa.RSAPublicKey,
- ec.EllipticCurvePublicKey)):
- raise TypeError('Expecting one of DSAPublicKey, RSAPublicKey,'
- ' or EllipticCurvePublicKey.')
- res = self._backend._lib.X509_CRL_verify(
- self._x509_crl, public_key._evp_pkey
- )
-
- if res != 1:
- self._backend._consume_errors()
- return False
-
- return True
-
-
-@utils.register_interface(x509.CertificateSigningRequest)
-class _CertificateSigningRequest(object):
- def __init__(self, backend, x509_req):
- self._backend = backend
- self._x509_req = x509_req
-
- def __eq__(self, other):
- if not isinstance(other, _CertificateSigningRequest):
- return NotImplemented
-
- self_bytes = self.public_bytes(serialization.Encoding.DER)
- other_bytes = other.public_bytes(serialization.Encoding.DER)
- return self_bytes == other_bytes
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- return hash(self.public_bytes(serialization.Encoding.DER))
-
- def public_key(self):
- pkey = self._backend._lib.X509_REQ_get_pubkey(self._x509_req)
- self._backend.openssl_assert(pkey != self._backend._ffi.NULL)
- pkey = self._backend._ffi.gc(pkey, self._backend._lib.EVP_PKEY_free)
- return self._backend._evp_pkey_to_public_key(pkey)
-
- @property
- def subject(self):
- subject = self._backend._lib.X509_REQ_get_subject_name(self._x509_req)
- self._backend.openssl_assert(subject != self._backend._ffi.NULL)
- return _decode_x509_name(self._backend, subject)
-
- @property
- def signature_hash_algorithm(self):
- oid = self.signature_algorithm_oid
- try:
- return x509._SIG_OIDS_TO_HASH[oid]
- except KeyError:
- raise UnsupportedAlgorithm(
- "Signature algorithm OID:{0} not recognized".format(oid)
- )
-
- @property
- def signature_algorithm_oid(self):
- alg = self._backend._ffi.new("X509_ALGOR **")
- self._backend._lib.X509_REQ_get0_signature(
- self._x509_req, self._backend._ffi.NULL, alg
- )
- self._backend.openssl_assert(alg[0] != self._backend._ffi.NULL)
- oid = _obj2txt(self._backend, alg[0].algorithm)
- return x509.ObjectIdentifier(oid)
-
- @utils.cached_property
- def extensions(self):
- x509_exts = self._backend._lib.X509_REQ_get_extensions(self._x509_req)
- x509_exts = self._backend._ffi.gc(
- x509_exts,
- lambda x: self._backend._lib.sk_X509_EXTENSION_pop_free(
- x, self._backend._ffi.addressof(
- self._backend._lib._original_lib, "X509_EXTENSION_free"
- )
- )
- )
- return _CSR_EXTENSION_PARSER.parse(self._backend, x509_exts)
-
- def public_bytes(self, encoding):
- bio = self._backend._create_mem_bio_gc()
- if encoding is serialization.Encoding.PEM:
- res = self._backend._lib.PEM_write_bio_X509_REQ(
- bio, self._x509_req
- )
- elif encoding is serialization.Encoding.DER:
- res = self._backend._lib.i2d_X509_REQ_bio(bio, self._x509_req)
- else:
- raise TypeError("encoding must be an item from the Encoding enum")
-
- self._backend.openssl_assert(res == 1)
- return self._backend._read_mem_bio(bio)
-
- @property
- def tbs_certrequest_bytes(self):
- pp = self._backend._ffi.new("unsigned char **")
- res = self._backend._lib.i2d_re_X509_REQ_tbs(self._x509_req, pp)
- self._backend.openssl_assert(res > 0)
- pp = self._backend._ffi.gc(
- pp, lambda pointer: self._backend._lib.OPENSSL_free(pointer[0])
- )
- return self._backend._ffi.buffer(pp[0], res)[:]
-
- @property
- def signature(self):
- sig = self._backend._ffi.new("ASN1_BIT_STRING **")
- self._backend._lib.X509_REQ_get0_signature(
- self._x509_req, sig, self._backend._ffi.NULL
- )
- self._backend.openssl_assert(sig[0] != self._backend._ffi.NULL)
- return _asn1_string_to_bytes(self._backend, sig[0])
-
- @property
- def is_signature_valid(self):
- pkey = self._backend._lib.X509_REQ_get_pubkey(self._x509_req)
- self._backend.openssl_assert(pkey != self._backend._ffi.NULL)
- pkey = self._backend._ffi.gc(pkey, self._backend._lib.EVP_PKEY_free)
- res = self._backend._lib.X509_REQ_verify(self._x509_req, pkey)
-
- if res != 1:
- self._backend._consume_errors()
- return False
-
- return True
-
-
-@utils.register_interface(
- x509.certificate_transparency.SignedCertificateTimestamp
-)
-class _SignedCertificateTimestamp(object):
- def __init__(self, backend, sct_list, sct):
- self._backend = backend
- # Keep the SCT_LIST that this SCT came from alive.
- self._sct_list = sct_list
- self._sct = sct
-
- @property
- def version(self):
- version = self._backend._lib.SCT_get_version(self._sct)
- assert version == self._backend._lib.SCT_VERSION_V1
- return x509.certificate_transparency.Version.v1
-
- @property
- def log_id(self):
- out = self._backend._ffi.new("unsigned char **")
- log_id_length = self._backend._lib.SCT_get0_log_id(self._sct, out)
- assert log_id_length >= 0
- return self._backend._ffi.buffer(out[0], log_id_length)[:]
-
- @property
- def timestamp(self):
- timestamp = self._backend._lib.SCT_get_timestamp(self._sct)
- milliseconds = timestamp % 1000
- return datetime.datetime.utcfromtimestamp(
- timestamp // 1000
- ).replace(microsecond=milliseconds * 1000)
-
- @property
- def entry_type(self):
- entry_type = self._backend._lib.SCT_get_log_entry_type(self._sct)
- # We currently only support loading SCTs from the X.509 extension, so
- # we only have precerts.
- assert entry_type == self._backend._lib.CT_LOG_ENTRY_TYPE_PRECERT
- return x509.certificate_transparency.LogEntryType.PRE_CERTIFICATE
-
- @property
- def _signature(self):
- ptrptr = self._backend._ffi.new("unsigned char **")
- res = self._backend._lib.SCT_get0_signature(self._sct, ptrptr)
- self._backend.openssl_assert(res > 0)
- self._backend.openssl_assert(ptrptr[0] != self._backend._ffi.NULL)
- return self._backend._ffi.buffer(ptrptr[0], res)[:]
-
- def __hash__(self):
- return hash(self._signature)
-
- def __eq__(self, other):
- if not isinstance(other, _SignedCertificateTimestamp):
- return NotImplemented
-
- return self._signature == other._signature
-
- def __ne__(self, other):
- return not self == other
diff --git a/lib/cryptography/hazmat/bindings/__init__.py b/lib/cryptography/hazmat/bindings/__init__.py
deleted file mode 100644
index 4b540884df..0000000000
--- a/lib/cryptography/hazmat/bindings/__init__.py
+++ /dev/null
@@ -1,5 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
diff --git a/lib/cryptography/hazmat/bindings/openssl/__init__.py b/lib/cryptography/hazmat/bindings/openssl/__init__.py
deleted file mode 100644
index 4b540884df..0000000000
--- a/lib/cryptography/hazmat/bindings/openssl/__init__.py
+++ /dev/null
@@ -1,5 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
diff --git a/lib/cryptography/hazmat/bindings/openssl/_conditional.py b/lib/cryptography/hazmat/bindings/openssl/_conditional.py
deleted file mode 100644
index 219f163ebd..0000000000
--- a/lib/cryptography/hazmat/bindings/openssl/_conditional.py
+++ /dev/null
@@ -1,366 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-
-def cryptography_has_ec2m():
- return [
- "EC_POINT_set_affine_coordinates_GF2m",
- "EC_POINT_get_affine_coordinates_GF2m",
- "EC_POINT_set_compressed_coordinates_GF2m",
- ]
-
-
-def cryptography_has_ec_1_0_2():
- return [
- "EC_curve_nid2nist",
- ]
-
-
-def cryptography_has_set_ecdh_auto():
- return [
- "SSL_CTX_set_ecdh_auto",
- ]
-
-
-def cryptography_has_rsa_r_pkcs_decoding_error():
- return [
- "RSA_R_PKCS_DECODING_ERROR"
- ]
-
-
-def cryptography_has_rsa_oaep_md():
- return [
- "EVP_PKEY_CTX_set_rsa_oaep_md",
- ]
-
-
-def cryptography_has_rsa_oaep_label():
- return [
- "EVP_PKEY_CTX_set0_rsa_oaep_label",
- ]
-
-
-def cryptography_has_ssl3_method():
- return [
- "SSLv3_method",
- "SSLv3_client_method",
- "SSLv3_server_method",
- ]
-
-
-def cryptography_has_alpn():
- return [
- "SSL_CTX_set_alpn_protos",
- "SSL_set_alpn_protos",
- "SSL_CTX_set_alpn_select_cb",
- "SSL_get0_alpn_selected",
- ]
-
-
-def cryptography_has_compression():
- return [
- "SSL_get_current_compression",
- "SSL_get_current_expansion",
- "SSL_COMP_get_name",
- ]
-
-
-def cryptography_has_get_server_tmp_key():
- return [
- "SSL_get_server_tmp_key",
- ]
-
-
-def cryptography_has_102_verification_error_codes():
- return [
- 'X509_V_ERR_SUITE_B_INVALID_VERSION',
- 'X509_V_ERR_SUITE_B_INVALID_ALGORITHM',
- 'X509_V_ERR_SUITE_B_INVALID_CURVE',
- 'X509_V_ERR_SUITE_B_INVALID_SIGNATURE_ALGORITHM',
- 'X509_V_ERR_SUITE_B_LOS_NOT_ALLOWED',
- 'X509_V_ERR_SUITE_B_CANNOT_SIGN_P_384_WITH_P_256',
- 'X509_V_ERR_HOSTNAME_MISMATCH',
- 'X509_V_ERR_EMAIL_MISMATCH',
- 'X509_V_ERR_IP_ADDRESS_MISMATCH'
- ]
-
-
-def cryptography_has_102_verification_params():
- return [
- "X509_V_FLAG_SUITEB_128_LOS_ONLY",
- "X509_V_FLAG_SUITEB_192_LOS",
- "X509_V_FLAG_SUITEB_128_LOS",
- "X509_VERIFY_PARAM_set1_host",
- "X509_VERIFY_PARAM_set1_email",
- "X509_VERIFY_PARAM_set1_ip",
- "X509_VERIFY_PARAM_set1_ip_asc",
- "X509_VERIFY_PARAM_set_hostflags",
- "SSL_get0_param",
- "X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT",
- "X509_CHECK_FLAG_NO_WILDCARDS",
- "X509_CHECK_FLAG_NO_PARTIAL_WILDCARDS",
- "X509_CHECK_FLAG_MULTI_LABEL_WILDCARDS",
- "X509_CHECK_FLAG_SINGLE_LABEL_SUBDOMAINS"
- ]
-
-
-def cryptography_has_110_verification_params():
- return [
- "X509_CHECK_FLAG_NEVER_CHECK_SUBJECT"
- ]
-
-
-def cryptography_has_x509_v_flag_trusted_first():
- return [
- "X509_V_FLAG_TRUSTED_FIRST",
- ]
-
-
-def cryptography_has_x509_v_flag_partial_chain():
- return [
- "X509_V_FLAG_PARTIAL_CHAIN",
- ]
-
-
-def cryptography_has_set_cert_cb():
- return [
- "SSL_CTX_set_cert_cb",
- "SSL_set_cert_cb",
- ]
-
-
-def cryptography_has_ssl_st():
- return [
- "SSL_ST_BEFORE",
- "SSL_ST_OK",
- "SSL_ST_INIT",
- "SSL_ST_RENEGOTIATE",
- ]
-
-
-def cryptography_has_tls_st():
- return [
- "TLS_ST_BEFORE",
- "TLS_ST_OK",
- ]
-
-
-def cryptography_has_locking_callbacks():
- return [
- "CRYPTO_LOCK",
- "CRYPTO_UNLOCK",
- "CRYPTO_READ",
- "CRYPTO_LOCK_SSL",
- "CRYPTO_lock",
- "Cryptography_setup_ssl_threads",
- ]
-
-
-def cryptography_has_scrypt():
- return [
- "EVP_PBE_scrypt",
- ]
-
-
-def cryptography_has_generic_dtls_method():
- return [
- "DTLS_method",
- "DTLS_server_method",
- "DTLS_client_method",
- "SSL_OP_NO_DTLSv1",
- "SSL_OP_NO_DTLSv1_2",
- "DTLS_set_link_mtu",
- "DTLS_get_link_min_mtu",
- ]
-
-
-def cryptography_has_evp_pkey_dhx():
- return [
- "EVP_PKEY_DHX",
- ]
-
-
-def cryptography_has_mem_functions():
- return [
- "Cryptography_CRYPTO_set_mem_functions",
- ]
-
-
-def cryptography_has_sct():
- return [
- "SCT_get_version",
- "SCT_get_log_entry_type",
- "SCT_get0_log_id",
- "SCT_get0_signature",
- "SCT_get_timestamp",
- "SCT_set_source",
- "sk_SCT_num",
- "sk_SCT_value",
- "SCT_LIST_free",
- "sk_SCT_push",
- "sk_SCT_new_null",
- "SCT_new",
- "SCT_set1_log_id",
- "SCT_set_timestamp",
- "SCT_set_version",
- "SCT_set_log_entry_type",
- ]
-
-
-def cryptography_has_x509_store_ctx_get_issuer():
- return [
- "X509_STORE_get_get_issuer",
- "X509_STORE_set_get_issuer",
- ]
-
-
-def cryptography_has_x25519():
- return [
- "EVP_PKEY_X25519",
- "NID_X25519",
- ]
-
-
-def cryptography_has_ed25519():
- return [
- "NID_ED25519",
- ]
-
-
-def cryptography_has_oneshot_evp_digest_sign_verify():
- return [
- "EVP_DigestSign",
- "EVP_DigestVerify",
- ]
-
-
-def cryptography_has_evp_pkey_get_set_tls_encodedpoint():
- return [
- "EVP_PKEY_get1_tls_encodedpoint",
- "EVP_PKEY_set1_tls_encodedpoint",
- ]
-
-
-def cryptography_has_fips():
- return [
- "FIPS_set_mode",
- "FIPS_mode",
- ]
-
-
-def cryptography_has_ssl_sigalgs():
- return [
- "SSL_CTX_set1_sigalgs_list",
- "SSL_get_sigalgs",
- ]
-
-
-def cryptography_has_psk():
- return [
- "SSL_CTX_use_psk_identity_hint",
- "SSL_CTX_set_psk_server_callback",
- "SSL_CTX_set_psk_client_callback",
- ]
-
-
-def cryptography_has_custom_ext():
- return [
- "SSL_CTX_add_client_custom_ext",
- "SSL_CTX_add_server_custom_ext",
- "SSL_extension_supported",
- ]
-
-
-def cryptography_has_openssl_cleanup():
- return [
- "OPENSSL_cleanup",
- ]
-
-
-def cryptography_has_cipher_details():
- return [
- "SSL_CIPHER_is_aead",
- "SSL_CIPHER_get_cipher_nid",
- "SSL_CIPHER_get_digest_nid",
- "SSL_CIPHER_get_kx_nid",
- "SSL_CIPHER_get_auth_nid",
- ]
-
-
-def cryptography_has_tlsv13():
- return [
- "SSL_OP_NO_TLSv1_3",
- "SSL_VERIFY_POST_HANDSHAKE",
- "SSL_CTX_set_ciphersuites",
- "SSL_verify_client_post_handshake",
- "SSL_CTX_set_post_handshake_auth",
- "SSL_set_post_handshake_auth",
- ]
-
-
-# This is a mapping of
-# {condition: function-returning-names-dependent-on-that-condition} so we can
-# loop over them and delete unsupported names at runtime. It will be removed
-# when cffi supports #if in cdef. We use functions instead of just a dict of
-# lists so we can use coverage to measure which are used.
-CONDITIONAL_NAMES = {
- "Cryptography_HAS_EC2M": cryptography_has_ec2m,
- "Cryptography_HAS_EC_1_0_2": cryptography_has_ec_1_0_2,
- "Cryptography_HAS_SET_ECDH_AUTO": cryptography_has_set_ecdh_auto,
- "Cryptography_HAS_RSA_R_PKCS_DECODING_ERROR": (
- cryptography_has_rsa_r_pkcs_decoding_error
- ),
- "Cryptography_HAS_RSA_OAEP_MD": cryptography_has_rsa_oaep_md,
- "Cryptography_HAS_RSA_OAEP_LABEL": cryptography_has_rsa_oaep_label,
- "Cryptography_HAS_SSL3_METHOD": cryptography_has_ssl3_method,
- "Cryptography_HAS_ALPN": cryptography_has_alpn,
- "Cryptography_HAS_COMPRESSION": cryptography_has_compression,
- "Cryptography_HAS_GET_SERVER_TMP_KEY": cryptography_has_get_server_tmp_key,
- "Cryptography_HAS_102_VERIFICATION_ERROR_CODES": (
- cryptography_has_102_verification_error_codes
- ),
- "Cryptography_HAS_102_VERIFICATION_PARAMS": (
- cryptography_has_102_verification_params
- ),
- "Cryptography_HAS_110_VERIFICATION_PARAMS": (
- cryptography_has_110_verification_params
- ),
- "Cryptography_HAS_X509_V_FLAG_TRUSTED_FIRST": (
- cryptography_has_x509_v_flag_trusted_first
- ),
- "Cryptography_HAS_X509_V_FLAG_PARTIAL_CHAIN": (
- cryptography_has_x509_v_flag_partial_chain
- ),
- "Cryptography_HAS_SET_CERT_CB": cryptography_has_set_cert_cb,
- "Cryptography_HAS_SSL_ST": cryptography_has_ssl_st,
- "Cryptography_HAS_TLS_ST": cryptography_has_tls_st,
- "Cryptography_HAS_LOCKING_CALLBACKS": cryptography_has_locking_callbacks,
- "Cryptography_HAS_SCRYPT": cryptography_has_scrypt,
- "Cryptography_HAS_GENERIC_DTLS_METHOD": (
- cryptography_has_generic_dtls_method
- ),
- "Cryptography_HAS_EVP_PKEY_DHX": cryptography_has_evp_pkey_dhx,
- "Cryptography_HAS_MEM_FUNCTIONS": cryptography_has_mem_functions,
- "Cryptography_HAS_SCT": cryptography_has_sct,
- "Cryptography_HAS_X509_STORE_CTX_GET_ISSUER": (
- cryptography_has_x509_store_ctx_get_issuer
- ),
- "Cryptography_HAS_X25519": cryptography_has_x25519,
- "Cryptography_HAS_ED25519": cryptography_has_ed25519,
- "Cryptography_HAS_ONESHOT_EVP_DIGEST_SIGN_VERIFY": (
- cryptography_has_oneshot_evp_digest_sign_verify
- ),
- "Cryptography_HAS_EVP_PKEY_get_set_tls_encodedpoint": (
- cryptography_has_evp_pkey_get_set_tls_encodedpoint
- ),
- "Cryptography_HAS_FIPS": cryptography_has_fips,
- "Cryptography_HAS_SIGALGS": cryptography_has_ssl_sigalgs,
- "Cryptography_HAS_PSK": cryptography_has_psk,
- "Cryptography_HAS_CUSTOM_EXT": cryptography_has_custom_ext,
- "Cryptography_HAS_OPENSSL_CLEANUP": cryptography_has_openssl_cleanup,
- "Cryptography_HAS_CIPHER_DETAILS": cryptography_has_cipher_details,
- "Cryptography_HAS_TLSv1_3": cryptography_has_tlsv13,
-}
diff --git a/lib/cryptography/hazmat/bindings/openssl/binding.py b/lib/cryptography/hazmat/bindings/openssl/binding.py
deleted file mode 100644
index 0824ea88c9..0000000000
--- a/lib/cryptography/hazmat/bindings/openssl/binding.py
+++ /dev/null
@@ -1,174 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import collections
-import threading
-import types
-import warnings
-
-from cryptography import utils
-from cryptography.exceptions import InternalError
-from cryptography.hazmat.bindings._openssl import ffi, lib
-from cryptography.hazmat.bindings.openssl._conditional import CONDITIONAL_NAMES
-
-_OpenSSLErrorWithText = collections.namedtuple(
- "_OpenSSLErrorWithText", ["code", "lib", "func", "reason", "reason_text"]
-)
-
-
-class _OpenSSLError(object):
- def __init__(self, code, lib, func, reason):
- self._code = code
- self._lib = lib
- self._func = func
- self._reason = reason
-
- def _lib_reason_match(self, lib, reason):
- return lib == self.lib and reason == self.reason
-
- code = utils.read_only_property("_code")
- lib = utils.read_only_property("_lib")
- func = utils.read_only_property("_func")
- reason = utils.read_only_property("_reason")
-
-
-def _consume_errors(lib):
- errors = []
- while True:
- code = lib.ERR_get_error()
- if code == 0:
- break
-
- err_lib = lib.ERR_GET_LIB(code)
- err_func = lib.ERR_GET_FUNC(code)
- err_reason = lib.ERR_GET_REASON(code)
-
- errors.append(_OpenSSLError(code, err_lib, err_func, err_reason))
-
- return errors
-
-
-def _openssl_assert(lib, ok):
- if not ok:
- errors = _consume_errors(lib)
- errors_with_text = []
- for err in errors:
- buf = ffi.new("char[]", 256)
- lib.ERR_error_string_n(err.code, buf, len(buf))
- err_text_reason = ffi.string(buf)
-
- errors_with_text.append(
- _OpenSSLErrorWithText(
- err.code, err.lib, err.func, err.reason, err_text_reason
- )
- )
-
- raise InternalError(
- "Unknown OpenSSL error. This error is commonly encountered when "
- "another library is not cleaning up the OpenSSL error stack. If "
- "you are using cryptography with another library that uses "
- "OpenSSL try disabling it before reporting a bug. Otherwise "
- "please file an issue at https://github.com/pyca/cryptography/"
- "issues with information on how to reproduce "
- "this. ({0!r})".format(errors_with_text),
- errors_with_text
- )
-
-
-def build_conditional_library(lib, conditional_names):
- conditional_lib = types.ModuleType("lib")
- conditional_lib._original_lib = lib
- excluded_names = set()
- for condition, names_cb in conditional_names.items():
- if not getattr(lib, condition):
- excluded_names.update(names_cb())
-
- for attr in dir(lib):
- if attr not in excluded_names:
- setattr(conditional_lib, attr, getattr(lib, attr))
-
- return conditional_lib
-
-
-class Binding(object):
- """
- OpenSSL API wrapper.
- """
- lib = None
- ffi = ffi
- _lib_loaded = False
- _init_lock = threading.Lock()
- _lock_init_lock = threading.Lock()
-
- def __init__(self):
- self._ensure_ffi_initialized()
-
- @classmethod
- def _register_osrandom_engine(cls):
- # Clear any errors extant in the queue before we start. In many
- # scenarios other things may be interacting with OpenSSL in the same
- # process space and it has proven untenable to assume that they will
- # reliably clear the error queue. Once we clear it here we will
- # error on any subsequent unexpected item in the stack.
- cls.lib.ERR_clear_error()
- cls._osrandom_engine_id = cls.lib.Cryptography_osrandom_engine_id
- cls._osrandom_engine_name = cls.lib.Cryptography_osrandom_engine_name
- result = cls.lib.Cryptography_add_osrandom_engine()
- _openssl_assert(cls.lib, result in (1, 2))
-
- @classmethod
- def _ensure_ffi_initialized(cls):
- with cls._init_lock:
- if not cls._lib_loaded:
- cls.lib = build_conditional_library(lib, CONDITIONAL_NAMES)
- cls._lib_loaded = True
- # initialize the SSL library
- cls.lib.SSL_library_init()
- # adds all ciphers/digests for EVP
- cls.lib.OpenSSL_add_all_algorithms()
- # loads error strings for libcrypto and libssl functions
- cls.lib.SSL_load_error_strings()
- cls._register_osrandom_engine()
-
- @classmethod
- def init_static_locks(cls):
- with cls._lock_init_lock:
- cls._ensure_ffi_initialized()
- # Use Python's implementation if available, importing _ssl triggers
- # the setup for this.
- __import__("_ssl")
-
- if (not cls.lib.Cryptography_HAS_LOCKING_CALLBACKS or
- cls.lib.CRYPTO_get_locking_callback() != cls.ffi.NULL):
- return
-
- # If nothing else has setup a locking callback already, we set up
- # our own
- res = lib.Cryptography_setup_ssl_threads()
- _openssl_assert(cls.lib, res == 1)
-
-
-def _verify_openssl_version(lib):
- if (
- lib.CRYPTOGRAPHY_OPENSSL_LESS_THAN_102 and
- not lib.CRYPTOGRAPHY_IS_LIBRESSL
- ):
- warnings.warn(
- "OpenSSL version 1.0.1 is no longer supported by the OpenSSL "
- "project, please upgrade. A future version of cryptography will "
- "drop support for it.",
- utils.CryptographyDeprecationWarning
- )
-
-
-# OpenSSL is not thread safe until the locks are initialized. We call this
-# method in module scope so that it executes with the import lock. On
-# Pythons < 3.4 this import lock is a global lock, which can prevent a race
-# condition registering the OpenSSL locks. On Python 3.4+ the import lock
-# is per module so this approach will not work.
-Binding.init_static_locks()
-
-_verify_openssl_version(Binding.lib)
diff --git a/lib/cryptography/hazmat/primitives/__init__.py b/lib/cryptography/hazmat/primitives/__init__.py
deleted file mode 100644
index 4b540884df..0000000000
--- a/lib/cryptography/hazmat/primitives/__init__.py
+++ /dev/null
@@ -1,5 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
diff --git a/lib/cryptography/hazmat/primitives/asymmetric/__init__.py b/lib/cryptography/hazmat/primitives/asymmetric/__init__.py
deleted file mode 100644
index 494a7a1350..0000000000
--- a/lib/cryptography/hazmat/primitives/asymmetric/__init__.py
+++ /dev/null
@@ -1,40 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import abc
-
-import six
-
-
-@six.add_metaclass(abc.ABCMeta)
-class AsymmetricSignatureContext(object):
- @abc.abstractmethod
- def update(self, data):
- """
- Processes the provided bytes and returns nothing.
- """
-
- @abc.abstractmethod
- def finalize(self):
- """
- Returns the signature as bytes.
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class AsymmetricVerificationContext(object):
- @abc.abstractmethod
- def update(self, data):
- """
- Processes the provided bytes and returns nothing.
- """
-
- @abc.abstractmethod
- def verify(self):
- """
- Raises an exception if the bytes provided to update do not match the
- signature or the signature does not match the public key.
- """
diff --git a/lib/cryptography/hazmat/primitives/asymmetric/dh.py b/lib/cryptography/hazmat/primitives/asymmetric/dh.py
deleted file mode 100644
index 4fc995245d..0000000000
--- a/lib/cryptography/hazmat/primitives/asymmetric/dh.py
+++ /dev/null
@@ -1,212 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import abc
-
-import six
-
-from cryptography import utils
-
-
-def generate_parameters(generator, key_size, backend):
- return backend.generate_dh_parameters(generator, key_size)
-
-
-class DHPrivateNumbers(object):
- def __init__(self, x, public_numbers):
- if not isinstance(x, six.integer_types):
- raise TypeError("x must be an integer.")
-
- if not isinstance(public_numbers, DHPublicNumbers):
- raise TypeError("public_numbers must be an instance of "
- "DHPublicNumbers.")
-
- self._x = x
- self._public_numbers = public_numbers
-
- def __eq__(self, other):
- if not isinstance(other, DHPrivateNumbers):
- return NotImplemented
-
- return (
- self._x == other._x and
- self._public_numbers == other._public_numbers
- )
-
- def __ne__(self, other):
- return not self == other
-
- def private_key(self, backend):
- return backend.load_dh_private_numbers(self)
-
- public_numbers = utils.read_only_property("_public_numbers")
- x = utils.read_only_property("_x")
-
-
-class DHPublicNumbers(object):
- def __init__(self, y, parameter_numbers):
- if not isinstance(y, six.integer_types):
- raise TypeError("y must be an integer.")
-
- if not isinstance(parameter_numbers, DHParameterNumbers):
- raise TypeError(
- "parameters must be an instance of DHParameterNumbers.")
-
- self._y = y
- self._parameter_numbers = parameter_numbers
-
- def __eq__(self, other):
- if not isinstance(other, DHPublicNumbers):
- return NotImplemented
-
- return (
- self._y == other._y and
- self._parameter_numbers == other._parameter_numbers
- )
-
- def __ne__(self, other):
- return not self == other
-
- def public_key(self, backend):
- return backend.load_dh_public_numbers(self)
-
- y = utils.read_only_property("_y")
- parameter_numbers = utils.read_only_property("_parameter_numbers")
-
-
-class DHParameterNumbers(object):
- def __init__(self, p, g, q=None):
- if (
- not isinstance(p, six.integer_types) or
- not isinstance(g, six.integer_types)
- ):
- raise TypeError("p and g must be integers")
- if q is not None and not isinstance(q, six.integer_types):
- raise TypeError("q must be integer or None")
-
- if g < 2:
- raise ValueError("DH generator must be 2 or greater")
-
- self._p = p
- self._g = g
- self._q = q
-
- def __eq__(self, other):
- if not isinstance(other, DHParameterNumbers):
- return NotImplemented
-
- return (
- self._p == other._p and
- self._g == other._g and
- self._q == other._q
- )
-
- def __ne__(self, other):
- return not self == other
-
- def parameters(self, backend):
- return backend.load_dh_parameter_numbers(self)
-
- p = utils.read_only_property("_p")
- g = utils.read_only_property("_g")
- q = utils.read_only_property("_q")
-
-
-@six.add_metaclass(abc.ABCMeta)
-class DHParameters(object):
- @abc.abstractmethod
- def generate_private_key(self):
- """
- Generates and returns a DHPrivateKey.
- """
-
- @abc.abstractmethod
- def parameter_bytes(self, encoding, format):
- """
- Returns the parameters serialized as bytes.
- """
-
- @abc.abstractmethod
- def parameter_numbers(self):
- """
- Returns a DHParameterNumbers.
- """
-
-
-DHParametersWithSerialization = DHParameters
-
-
-@six.add_metaclass(abc.ABCMeta)
-class DHPrivateKey(object):
- @abc.abstractproperty
- def key_size(self):
- """
- The bit length of the prime modulus.
- """
-
- @abc.abstractmethod
- def public_key(self):
- """
- The DHPublicKey associated with this private key.
- """
-
- @abc.abstractmethod
- def parameters(self):
- """
- The DHParameters object associated with this private key.
- """
-
- @abc.abstractmethod
- def exchange(self, peer_public_key):
- """
- Given peer's DHPublicKey, carry out the key exchange and
- return shared key as bytes.
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class DHPrivateKeyWithSerialization(DHPrivateKey):
- @abc.abstractmethod
- def private_numbers(self):
- """
- Returns a DHPrivateNumbers.
- """
-
- @abc.abstractmethod
- def private_bytes(self, encoding, format, encryption_algorithm):
- """
- Returns the key serialized as bytes.
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class DHPublicKey(object):
- @abc.abstractproperty
- def key_size(self):
- """
- The bit length of the prime modulus.
- """
-
- @abc.abstractmethod
- def parameters(self):
- """
- The DHParameters object associated with this public key.
- """
-
- @abc.abstractmethod
- def public_numbers(self):
- """
- Returns a DHPublicNumbers.
- """
-
- @abc.abstractmethod
- def public_bytes(self, encoding, format):
- """
- Returns the key serialized as bytes.
- """
-
-
-DHPublicKeyWithSerialization = DHPublicKey
diff --git a/lib/cryptography/hazmat/primitives/asymmetric/dsa.py b/lib/cryptography/hazmat/primitives/asymmetric/dsa.py
deleted file mode 100644
index e380a441f1..0000000000
--- a/lib/cryptography/hazmat/primitives/asymmetric/dsa.py
+++ /dev/null
@@ -1,254 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import abc
-
-import six
-
-from cryptography import utils
-
-
-@six.add_metaclass(abc.ABCMeta)
-class DSAParameters(object):
- @abc.abstractmethod
- def generate_private_key(self):
- """
- Generates and returns a DSAPrivateKey.
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class DSAParametersWithNumbers(DSAParameters):
- @abc.abstractmethod
- def parameter_numbers(self):
- """
- Returns a DSAParameterNumbers.
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class DSAPrivateKey(object):
- @abc.abstractproperty
- def key_size(self):
- """
- The bit length of the prime modulus.
- """
-
- @abc.abstractmethod
- def public_key(self):
- """
- The DSAPublicKey associated with this private key.
- """
-
- @abc.abstractmethod
- def parameters(self):
- """
- The DSAParameters object associated with this private key.
- """
-
- @abc.abstractmethod
- def signer(self, signature_algorithm):
- """
- Returns an AsymmetricSignatureContext used for signing data.
- """
-
- @abc.abstractmethod
- def sign(self, data, algorithm):
- """
- Signs the data
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class DSAPrivateKeyWithSerialization(DSAPrivateKey):
- @abc.abstractmethod
- def private_numbers(self):
- """
- Returns a DSAPrivateNumbers.
- """
-
- @abc.abstractmethod
- def private_bytes(self, encoding, format, encryption_algorithm):
- """
- Returns the key serialized as bytes.
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class DSAPublicKey(object):
- @abc.abstractproperty
- def key_size(self):
- """
- The bit length of the prime modulus.
- """
-
- @abc.abstractmethod
- def parameters(self):
- """
- The DSAParameters object associated with this public key.
- """
-
- @abc.abstractmethod
- def verifier(self, signature, signature_algorithm):
- """
- Returns an AsymmetricVerificationContext used for signing data.
- """
-
- @abc.abstractmethod
- def public_numbers(self):
- """
- Returns a DSAPublicNumbers.
- """
-
- @abc.abstractmethod
- def public_bytes(self, encoding, format):
- """
- Returns the key serialized as bytes.
- """
-
- @abc.abstractmethod
- def verify(self, signature, data, algorithm):
- """
- Verifies the signature of the data.
- """
-
-
-DSAPublicKeyWithSerialization = DSAPublicKey
-
-
-def generate_parameters(key_size, backend):
- return backend.generate_dsa_parameters(key_size)
-
-
-def generate_private_key(key_size, backend):
- return backend.generate_dsa_private_key_and_parameters(key_size)
-
-
-def _check_dsa_parameters(parameters):
- if parameters.p.bit_length() not in [1024, 2048, 3072]:
- raise ValueError("p must be exactly 1024, 2048, or 3072 bits long")
- if parameters.q.bit_length() not in [160, 224, 256]:
- raise ValueError("q must be exactly 160, 224, or 256 bits long")
-
- if not (1 < parameters.g < parameters.p):
- raise ValueError("g, p don't satisfy 1 < g < p.")
-
-
-def _check_dsa_private_numbers(numbers):
- parameters = numbers.public_numbers.parameter_numbers
- _check_dsa_parameters(parameters)
- if numbers.x <= 0 or numbers.x >= parameters.q:
- raise ValueError("x must be > 0 and < q.")
-
- if numbers.public_numbers.y != pow(parameters.g, numbers.x, parameters.p):
- raise ValueError("y must be equal to (g ** x % p).")
-
-
-class DSAParameterNumbers(object):
- def __init__(self, p, q, g):
- if (
- not isinstance(p, six.integer_types) or
- not isinstance(q, six.integer_types) or
- not isinstance(g, six.integer_types)
- ):
- raise TypeError(
- "DSAParameterNumbers p, q, and g arguments must be integers."
- )
-
- self._p = p
- self._q = q
- self._g = g
-
- p = utils.read_only_property("_p")
- q = utils.read_only_property("_q")
- g = utils.read_only_property("_g")
-
- def parameters(self, backend):
- return backend.load_dsa_parameter_numbers(self)
-
- def __eq__(self, other):
- if not isinstance(other, DSAParameterNumbers):
- return NotImplemented
-
- return self.p == other.p and self.q == other.q and self.g == other.g
-
- def __ne__(self, other):
- return not self == other
-
- def __repr__(self):
- return (
- "".format(
- self=self
- )
- )
-
-
-class DSAPublicNumbers(object):
- def __init__(self, y, parameter_numbers):
- if not isinstance(y, six.integer_types):
- raise TypeError("DSAPublicNumbers y argument must be an integer.")
-
- if not isinstance(parameter_numbers, DSAParameterNumbers):
- raise TypeError(
- "parameter_numbers must be a DSAParameterNumbers instance."
- )
-
- self._y = y
- self._parameter_numbers = parameter_numbers
-
- y = utils.read_only_property("_y")
- parameter_numbers = utils.read_only_property("_parameter_numbers")
-
- def public_key(self, backend):
- return backend.load_dsa_public_numbers(self)
-
- def __eq__(self, other):
- if not isinstance(other, DSAPublicNumbers):
- return NotImplemented
-
- return (
- self.y == other.y and
- self.parameter_numbers == other.parameter_numbers
- )
-
- def __ne__(self, other):
- return not self == other
-
- def __repr__(self):
- return (
- "".format(self=self)
- )
-
-
-class DSAPrivateNumbers(object):
- def __init__(self, x, public_numbers):
- if not isinstance(x, six.integer_types):
- raise TypeError("DSAPrivateNumbers x argument must be an integer.")
-
- if not isinstance(public_numbers, DSAPublicNumbers):
- raise TypeError(
- "public_numbers must be a DSAPublicNumbers instance."
- )
- self._public_numbers = public_numbers
- self._x = x
-
- x = utils.read_only_property("_x")
- public_numbers = utils.read_only_property("_public_numbers")
-
- def private_key(self, backend):
- return backend.load_dsa_private_numbers(self)
-
- def __eq__(self, other):
- if not isinstance(other, DSAPrivateNumbers):
- return NotImplemented
-
- return (
- self.x == other.x and self.public_numbers == other.public_numbers
- )
-
- def __ne__(self, other):
- return not self == other
diff --git a/lib/cryptography/hazmat/primitives/asymmetric/ec.py b/lib/cryptography/hazmat/primitives/asymmetric/ec.py
deleted file mode 100644
index 431ecb7971..0000000000
--- a/lib/cryptography/hazmat/primitives/asymmetric/ec.py
+++ /dev/null
@@ -1,421 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import abc
-
-import six
-
-from cryptography import utils
-from cryptography.hazmat._oid import ObjectIdentifier
-
-
-class EllipticCurveOID(object):
- SECP192R1 = ObjectIdentifier("1.2.840.10045.3.1.1")
- SECP224R1 = ObjectIdentifier("1.3.132.0.33")
- SECP256K1 = ObjectIdentifier("1.3.132.0.10")
- SECP256R1 = ObjectIdentifier("1.2.840.10045.3.1.7")
- SECP384R1 = ObjectIdentifier("1.3.132.0.34")
- SECP521R1 = ObjectIdentifier("1.3.132.0.35")
-
-
-@six.add_metaclass(abc.ABCMeta)
-class EllipticCurve(object):
- @abc.abstractproperty
- def name(self):
- """
- The name of the curve. e.g. secp256r1.
- """
-
- @abc.abstractproperty
- def key_size(self):
- """
- Bit size of a secret scalar for the curve.
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class EllipticCurveSignatureAlgorithm(object):
- @abc.abstractproperty
- def algorithm(self):
- """
- The digest algorithm used with this signature.
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class EllipticCurvePrivateKey(object):
- @abc.abstractmethod
- def signer(self, signature_algorithm):
- """
- Returns an AsymmetricSignatureContext used for signing data.
- """
-
- @abc.abstractmethod
- def exchange(self, algorithm, peer_public_key):
- """
- Performs a key exchange operation using the provided algorithm with the
- provided peer's public key.
- """
-
- @abc.abstractmethod
- def public_key(self):
- """
- The EllipticCurvePublicKey for this private key.
- """
-
- @abc.abstractproperty
- def curve(self):
- """
- The EllipticCurve that this key is on.
- """
-
- @abc.abstractproperty
- def key_size(self):
- """
- Bit size of a secret scalar for the curve.
- """
-
- @abc.abstractmethod
- def sign(self, data, signature_algorithm):
- """
- Signs the data
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class EllipticCurvePrivateKeyWithSerialization(EllipticCurvePrivateKey):
- @abc.abstractmethod
- def private_numbers(self):
- """
- Returns an EllipticCurvePrivateNumbers.
- """
-
- @abc.abstractmethod
- def private_bytes(self, encoding, format, encryption_algorithm):
- """
- Returns the key serialized as bytes.
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class EllipticCurvePublicKey(object):
- @abc.abstractmethod
- def verifier(self, signature, signature_algorithm):
- """
- Returns an AsymmetricVerificationContext used for signing data.
- """
-
- @abc.abstractproperty
- def curve(self):
- """
- The EllipticCurve that this key is on.
- """
-
- @abc.abstractproperty
- def key_size(self):
- """
- Bit size of a secret scalar for the curve.
- """
-
- @abc.abstractmethod
- def public_numbers(self):
- """
- Returns an EllipticCurvePublicNumbers.
- """
-
- @abc.abstractmethod
- def public_bytes(self, encoding, format):
- """
- Returns the key serialized as bytes.
- """
-
- @abc.abstractmethod
- def verify(self, signature, data, signature_algorithm):
- """
- Verifies the signature of the data.
- """
-
-
-EllipticCurvePublicKeyWithSerialization = EllipticCurvePublicKey
-
-
-@utils.register_interface(EllipticCurve)
-class SECT571R1(object):
- name = "sect571r1"
- key_size = 570
-
-
-@utils.register_interface(EllipticCurve)
-class SECT409R1(object):
- name = "sect409r1"
- key_size = 409
-
-
-@utils.register_interface(EllipticCurve)
-class SECT283R1(object):
- name = "sect283r1"
- key_size = 283
-
-
-@utils.register_interface(EllipticCurve)
-class SECT233R1(object):
- name = "sect233r1"
- key_size = 233
-
-
-@utils.register_interface(EllipticCurve)
-class SECT163R2(object):
- name = "sect163r2"
- key_size = 163
-
-
-@utils.register_interface(EllipticCurve)
-class SECT571K1(object):
- name = "sect571k1"
- key_size = 571
-
-
-@utils.register_interface(EllipticCurve)
-class SECT409K1(object):
- name = "sect409k1"
- key_size = 409
-
-
-@utils.register_interface(EllipticCurve)
-class SECT283K1(object):
- name = "sect283k1"
- key_size = 283
-
-
-@utils.register_interface(EllipticCurve)
-class SECT233K1(object):
- name = "sect233k1"
- key_size = 233
-
-
-@utils.register_interface(EllipticCurve)
-class SECT163K1(object):
- name = "sect163k1"
- key_size = 163
-
-
-@utils.register_interface(EllipticCurve)
-class SECP521R1(object):
- name = "secp521r1"
- key_size = 521
-
-
-@utils.register_interface(EllipticCurve)
-class SECP384R1(object):
- name = "secp384r1"
- key_size = 384
-
-
-@utils.register_interface(EllipticCurve)
-class SECP256R1(object):
- name = "secp256r1"
- key_size = 256
-
-
-@utils.register_interface(EllipticCurve)
-class SECP256K1(object):
- name = "secp256k1"
- key_size = 256
-
-
-@utils.register_interface(EllipticCurve)
-class SECP224R1(object):
- name = "secp224r1"
- key_size = 224
-
-
-@utils.register_interface(EllipticCurve)
-class SECP192R1(object):
- name = "secp192r1"
- key_size = 192
-
-
-@utils.register_interface(EllipticCurve)
-class BrainpoolP256R1(object):
- name = "brainpoolP256r1"
- key_size = 256
-
-
-@utils.register_interface(EllipticCurve)
-class BrainpoolP384R1(object):
- name = "brainpoolP384r1"
- key_size = 384
-
-
-@utils.register_interface(EllipticCurve)
-class BrainpoolP512R1(object):
- name = "brainpoolP512r1"
- key_size = 512
-
-
-_CURVE_TYPES = {
- "prime192v1": SECP192R1,
- "prime256v1": SECP256R1,
-
- "secp192r1": SECP192R1,
- "secp224r1": SECP224R1,
- "secp256r1": SECP256R1,
- "secp384r1": SECP384R1,
- "secp521r1": SECP521R1,
- "secp256k1": SECP256K1,
-
- "sect163k1": SECT163K1,
- "sect233k1": SECT233K1,
- "sect283k1": SECT283K1,
- "sect409k1": SECT409K1,
- "sect571k1": SECT571K1,
-
- "sect163r2": SECT163R2,
- "sect233r1": SECT233R1,
- "sect283r1": SECT283R1,
- "sect409r1": SECT409R1,
- "sect571r1": SECT571R1,
-
- "brainpoolP256r1": BrainpoolP256R1,
- "brainpoolP384r1": BrainpoolP384R1,
- "brainpoolP512r1": BrainpoolP512R1,
-}
-
-
-@utils.register_interface(EllipticCurveSignatureAlgorithm)
-class ECDSA(object):
- def __init__(self, algorithm):
- self._algorithm = algorithm
-
- algorithm = utils.read_only_property("_algorithm")
-
-
-def generate_private_key(curve, backend):
- return backend.generate_elliptic_curve_private_key(curve)
-
-
-def derive_private_key(private_value, curve, backend):
- if not isinstance(private_value, six.integer_types):
- raise TypeError("private_value must be an integer type.")
-
- if private_value <= 0:
- raise ValueError("private_value must be a positive integer.")
-
- if not isinstance(curve, EllipticCurve):
- raise TypeError("curve must provide the EllipticCurve interface.")
-
- return backend.derive_elliptic_curve_private_key(private_value, curve)
-
-
-class EllipticCurvePublicNumbers(object):
- def __init__(self, x, y, curve):
- if (
- not isinstance(x, six.integer_types) or
- not isinstance(y, six.integer_types)
- ):
- raise TypeError("x and y must be integers.")
-
- if not isinstance(curve, EllipticCurve):
- raise TypeError("curve must provide the EllipticCurve interface.")
-
- self._y = y
- self._x = x
- self._curve = curve
-
- def public_key(self, backend):
- return backend.load_elliptic_curve_public_numbers(self)
-
- def encode_point(self):
- # key_size is in bits. Convert to bytes and round up
- byte_length = (self.curve.key_size + 7) // 8
- return (
- b'\x04' + utils.int_to_bytes(self.x, byte_length) +
- utils.int_to_bytes(self.y, byte_length)
- )
-
- @classmethod
- def from_encoded_point(cls, curve, data):
- if not isinstance(curve, EllipticCurve):
- raise TypeError("curve must be an EllipticCurve instance")
-
- if data.startswith(b'\x04'):
- # key_size is in bits. Convert to bytes and round up
- byte_length = (curve.key_size + 7) // 8
- if len(data) == 2 * byte_length + 1:
- x = utils.int_from_bytes(data[1:byte_length + 1], 'big')
- y = utils.int_from_bytes(data[byte_length + 1:], 'big')
- return cls(x, y, curve)
- else:
- raise ValueError('Invalid elliptic curve point data length')
- else:
- raise ValueError('Unsupported elliptic curve point type')
-
- curve = utils.read_only_property("_curve")
- x = utils.read_only_property("_x")
- y = utils.read_only_property("_y")
-
- def __eq__(self, other):
- if not isinstance(other, EllipticCurvePublicNumbers):
- return NotImplemented
-
- return (
- self.x == other.x and
- self.y == other.y and
- self.curve.name == other.curve.name and
- self.curve.key_size == other.curve.key_size
- )
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- return hash((self.x, self.y, self.curve.name, self.curve.key_size))
-
- def __repr__(self):
- return (
- "".format(self)
- )
-
-
-class EllipticCurvePrivateNumbers(object):
- def __init__(self, private_value, public_numbers):
- if not isinstance(private_value, six.integer_types):
- raise TypeError("private_value must be an integer.")
-
- if not isinstance(public_numbers, EllipticCurvePublicNumbers):
- raise TypeError(
- "public_numbers must be an EllipticCurvePublicNumbers "
- "instance."
- )
-
- self._private_value = private_value
- self._public_numbers = public_numbers
-
- def private_key(self, backend):
- return backend.load_elliptic_curve_private_numbers(self)
-
- private_value = utils.read_only_property("_private_value")
- public_numbers = utils.read_only_property("_public_numbers")
-
- def __eq__(self, other):
- if not isinstance(other, EllipticCurvePrivateNumbers):
- return NotImplemented
-
- return (
- self.private_value == other.private_value and
- self.public_numbers == other.public_numbers
- )
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- return hash((self.private_value, self.public_numbers))
-
-
-class ECDH(object):
- pass
diff --git a/lib/cryptography/hazmat/primitives/asymmetric/padding.py b/lib/cryptography/hazmat/primitives/asymmetric/padding.py
deleted file mode 100644
index a37c3f90ca..0000000000
--- a/lib/cryptography/hazmat/primitives/asymmetric/padding.py
+++ /dev/null
@@ -1,79 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import abc
-import math
-
-import six
-
-from cryptography import utils
-from cryptography.hazmat.primitives import hashes
-from cryptography.hazmat.primitives.asymmetric import rsa
-
-
-@six.add_metaclass(abc.ABCMeta)
-class AsymmetricPadding(object):
- @abc.abstractproperty
- def name(self):
- """
- A string naming this padding (e.g. "PSS", "PKCS1").
- """
-
-
-@utils.register_interface(AsymmetricPadding)
-class PKCS1v15(object):
- name = "EMSA-PKCS1-v1_5"
-
-
-@utils.register_interface(AsymmetricPadding)
-class PSS(object):
- MAX_LENGTH = object()
- name = "EMSA-PSS"
-
- def __init__(self, mgf, salt_length):
- self._mgf = mgf
-
- if (not isinstance(salt_length, six.integer_types) and
- salt_length is not self.MAX_LENGTH):
- raise TypeError("salt_length must be an integer.")
-
- if salt_length is not self.MAX_LENGTH and salt_length < 0:
- raise ValueError("salt_length must be zero or greater.")
-
- self._salt_length = salt_length
-
-
-@utils.register_interface(AsymmetricPadding)
-class OAEP(object):
- name = "EME-OAEP"
-
- def __init__(self, mgf, algorithm, label):
- if not isinstance(algorithm, hashes.HashAlgorithm):
- raise TypeError("Expected instance of hashes.HashAlgorithm.")
-
- self._mgf = mgf
- self._algorithm = algorithm
- self._label = label
-
-
-class MGF1(object):
- MAX_LENGTH = object()
-
- def __init__(self, algorithm):
- if not isinstance(algorithm, hashes.HashAlgorithm):
- raise TypeError("Expected instance of hashes.HashAlgorithm.")
-
- self._algorithm = algorithm
-
-
-def calculate_max_pss_salt_length(key, hash_algorithm):
- if not isinstance(key, (rsa.RSAPrivateKey, rsa.RSAPublicKey)):
- raise TypeError("key must be an RSA public or private key")
- # bit length - 1 per RFC 3447
- emlen = int(math.ceil((key.key_size - 1) / 8.0))
- salt_length = emlen - hash_algorithm.digest_size - 2
- assert salt_length >= 0
- return salt_length
diff --git a/lib/cryptography/hazmat/primitives/asymmetric/rsa.py b/lib/cryptography/hazmat/primitives/asymmetric/rsa.py
deleted file mode 100644
index 27db671af8..0000000000
--- a/lib/cryptography/hazmat/primitives/asymmetric/rsa.py
+++ /dev/null
@@ -1,368 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import abc
-try:
- # Only available in math in 3.5+
- from math import gcd
-except ImportError:
- from fractions import gcd
-
-import six
-
-from cryptography import utils
-from cryptography.exceptions import UnsupportedAlgorithm, _Reasons
-from cryptography.hazmat.backends.interfaces import RSABackend
-
-
-@six.add_metaclass(abc.ABCMeta)
-class RSAPrivateKey(object):
- @abc.abstractmethod
- def signer(self, padding, algorithm):
- """
- Returns an AsymmetricSignatureContext used for signing data.
- """
-
- @abc.abstractmethod
- def decrypt(self, ciphertext, padding):
- """
- Decrypts the provided ciphertext.
- """
-
- @abc.abstractproperty
- def key_size(self):
- """
- The bit length of the public modulus.
- """
-
- @abc.abstractmethod
- def public_key(self):
- """
- The RSAPublicKey associated with this private key.
- """
-
- @abc.abstractmethod
- def sign(self, data, padding, algorithm):
- """
- Signs the data.
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class RSAPrivateKeyWithSerialization(RSAPrivateKey):
- @abc.abstractmethod
- def private_numbers(self):
- """
- Returns an RSAPrivateNumbers.
- """
-
- @abc.abstractmethod
- def private_bytes(self, encoding, format, encryption_algorithm):
- """
- Returns the key serialized as bytes.
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class RSAPublicKey(object):
- @abc.abstractmethod
- def verifier(self, signature, padding, algorithm):
- """
- Returns an AsymmetricVerificationContext used for verifying signatures.
- """
-
- @abc.abstractmethod
- def encrypt(self, plaintext, padding):
- """
- Encrypts the given plaintext.
- """
-
- @abc.abstractproperty
- def key_size(self):
- """
- The bit length of the public modulus.
- """
-
- @abc.abstractmethod
- def public_numbers(self):
- """
- Returns an RSAPublicNumbers
- """
-
- @abc.abstractmethod
- def public_bytes(self, encoding, format):
- """
- Returns the key serialized as bytes.
- """
-
- @abc.abstractmethod
- def verify(self, signature, data, padding, algorithm):
- """
- Verifies the signature of the data.
- """
-
-
-RSAPublicKeyWithSerialization = RSAPublicKey
-
-
-def generate_private_key(public_exponent, key_size, backend):
- if not isinstance(backend, RSABackend):
- raise UnsupportedAlgorithm(
- "Backend object does not implement RSABackend.",
- _Reasons.BACKEND_MISSING_INTERFACE
- )
-
- _verify_rsa_parameters(public_exponent, key_size)
- return backend.generate_rsa_private_key(public_exponent, key_size)
-
-
-def _verify_rsa_parameters(public_exponent, key_size):
- if public_exponent < 3:
- raise ValueError("public_exponent must be >= 3.")
-
- if public_exponent & 1 == 0:
- raise ValueError("public_exponent must be odd.")
-
- if key_size < 512:
- raise ValueError("key_size must be at least 512-bits.")
-
-
-def _check_private_key_components(p, q, private_exponent, dmp1, dmq1, iqmp,
- public_exponent, modulus):
- if modulus < 3:
- raise ValueError("modulus must be >= 3.")
-
- if p >= modulus:
- raise ValueError("p must be < modulus.")
-
- if q >= modulus:
- raise ValueError("q must be < modulus.")
-
- if dmp1 >= modulus:
- raise ValueError("dmp1 must be < modulus.")
-
- if dmq1 >= modulus:
- raise ValueError("dmq1 must be < modulus.")
-
- if iqmp >= modulus:
- raise ValueError("iqmp must be < modulus.")
-
- if private_exponent >= modulus:
- raise ValueError("private_exponent must be < modulus.")
-
- if public_exponent < 3 or public_exponent >= modulus:
- raise ValueError("public_exponent must be >= 3 and < modulus.")
-
- if public_exponent & 1 == 0:
- raise ValueError("public_exponent must be odd.")
-
- if dmp1 & 1 == 0:
- raise ValueError("dmp1 must be odd.")
-
- if dmq1 & 1 == 0:
- raise ValueError("dmq1 must be odd.")
-
- if p * q != modulus:
- raise ValueError("p*q must equal modulus.")
-
-
-def _check_public_key_components(e, n):
- if n < 3:
- raise ValueError("n must be >= 3.")
-
- if e < 3 or e >= n:
- raise ValueError("e must be >= 3 and < n.")
-
- if e & 1 == 0:
- raise ValueError("e must be odd.")
-
-
-def _modinv(e, m):
- """
- Modular Multiplicative Inverse. Returns x such that: (x*e) mod m == 1
- """
- x1, y1, x2, y2 = 1, 0, 0, 1
- a, b = e, m
- while b > 0:
- q, r = divmod(a, b)
- xn, yn = x1 - q * x2, y1 - q * y2
- a, b, x1, y1, x2, y2 = b, r, x2, y2, xn, yn
- return x1 % m
-
-
-def rsa_crt_iqmp(p, q):
- """
- Compute the CRT (q ** -1) % p value from RSA primes p and q.
- """
- return _modinv(q, p)
-
-
-def rsa_crt_dmp1(private_exponent, p):
- """
- Compute the CRT private_exponent % (p - 1) value from the RSA
- private_exponent (d) and p.
- """
- return private_exponent % (p - 1)
-
-
-def rsa_crt_dmq1(private_exponent, q):
- """
- Compute the CRT private_exponent % (q - 1) value from the RSA
- private_exponent (d) and q.
- """
- return private_exponent % (q - 1)
-
-
-# Controls the number of iterations rsa_recover_prime_factors will perform
-# to obtain the prime factors. Each iteration increments by 2 so the actual
-# maximum attempts is half this number.
-_MAX_RECOVERY_ATTEMPTS = 1000
-
-
-def rsa_recover_prime_factors(n, e, d):
- """
- Compute factors p and q from the private exponent d. We assume that n has
- no more than two factors. This function is adapted from code in PyCrypto.
- """
- # See 8.2.2(i) in Handbook of Applied Cryptography.
- ktot = d * e - 1
- # The quantity d*e-1 is a multiple of phi(n), even,
- # and can be represented as t*2^s.
- t = ktot
- while t % 2 == 0:
- t = t // 2
- # Cycle through all multiplicative inverses in Zn.
- # The algorithm is non-deterministic, but there is a 50% chance
- # any candidate a leads to successful factoring.
- # See "Digitalized Signatures and Public Key Functions as Intractable
- # as Factorization", M. Rabin, 1979
- spotted = False
- a = 2
- while not spotted and a < _MAX_RECOVERY_ATTEMPTS:
- k = t
- # Cycle through all values a^{t*2^i}=a^k
- while k < ktot:
- cand = pow(a, k, n)
- # Check if a^k is a non-trivial root of unity (mod n)
- if cand != 1 and cand != (n - 1) and pow(cand, 2, n) == 1:
- # We have found a number such that (cand-1)(cand+1)=0 (mod n).
- # Either of the terms divides n.
- p = gcd(cand + 1, n)
- spotted = True
- break
- k *= 2
- # This value was not any good... let's try another!
- a += 2
- if not spotted:
- raise ValueError("Unable to compute factors p and q from exponent d.")
- # Found !
- q, r = divmod(n, p)
- assert r == 0
- p, q = sorted((p, q), reverse=True)
- return (p, q)
-
-
-class RSAPrivateNumbers(object):
- def __init__(self, p, q, d, dmp1, dmq1, iqmp,
- public_numbers):
- if (
- not isinstance(p, six.integer_types) or
- not isinstance(q, six.integer_types) or
- not isinstance(d, six.integer_types) or
- not isinstance(dmp1, six.integer_types) or
- not isinstance(dmq1, six.integer_types) or
- not isinstance(iqmp, six.integer_types)
- ):
- raise TypeError(
- "RSAPrivateNumbers p, q, d, dmp1, dmq1, iqmp arguments must"
- " all be an integers."
- )
-
- if not isinstance(public_numbers, RSAPublicNumbers):
- raise TypeError(
- "RSAPrivateNumbers public_numbers must be an RSAPublicNumbers"
- " instance."
- )
-
- self._p = p
- self._q = q
- self._d = d
- self._dmp1 = dmp1
- self._dmq1 = dmq1
- self._iqmp = iqmp
- self._public_numbers = public_numbers
-
- p = utils.read_only_property("_p")
- q = utils.read_only_property("_q")
- d = utils.read_only_property("_d")
- dmp1 = utils.read_only_property("_dmp1")
- dmq1 = utils.read_only_property("_dmq1")
- iqmp = utils.read_only_property("_iqmp")
- public_numbers = utils.read_only_property("_public_numbers")
-
- def private_key(self, backend):
- return backend.load_rsa_private_numbers(self)
-
- def __eq__(self, other):
- if not isinstance(other, RSAPrivateNumbers):
- return NotImplemented
-
- return (
- self.p == other.p and
- self.q == other.q and
- self.d == other.d and
- self.dmp1 == other.dmp1 and
- self.dmq1 == other.dmq1 and
- self.iqmp == other.iqmp and
- self.public_numbers == other.public_numbers
- )
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- return hash((
- self.p,
- self.q,
- self.d,
- self.dmp1,
- self.dmq1,
- self.iqmp,
- self.public_numbers,
- ))
-
-
-class RSAPublicNumbers(object):
- def __init__(self, e, n):
- if (
- not isinstance(e, six.integer_types) or
- not isinstance(n, six.integer_types)
- ):
- raise TypeError("RSAPublicNumbers arguments must be integers.")
-
- self._e = e
- self._n = n
-
- e = utils.read_only_property("_e")
- n = utils.read_only_property("_n")
-
- def public_key(self, backend):
- return backend.load_rsa_public_numbers(self)
-
- def __repr__(self):
- return "".format(self)
-
- def __eq__(self, other):
- if not isinstance(other, RSAPublicNumbers):
- return NotImplemented
-
- return self.e == other.e and self.n == other.n
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- return hash((self.e, self.n))
diff --git a/lib/cryptography/hazmat/primitives/asymmetric/utils.py b/lib/cryptography/hazmat/primitives/asymmetric/utils.py
deleted file mode 100644
index ef1e7eb928..0000000000
--- a/lib/cryptography/hazmat/primitives/asymmetric/utils.py
+++ /dev/null
@@ -1,60 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import warnings
-
-from asn1crypto.algos import DSASignature
-
-import six
-
-from cryptography import utils
-from cryptography.hazmat.primitives import hashes
-
-
-def decode_rfc6979_signature(signature):
- warnings.warn(
- "decode_rfc6979_signature is deprecated and will "
- "be removed in a future version, use decode_dss_signature instead.",
- utils.PersistentlyDeprecated,
- stacklevel=2
- )
- return decode_dss_signature(signature)
-
-
-def decode_dss_signature(signature):
- data = DSASignature.load(signature, strict=True).native
- return data['r'], data['s']
-
-
-def encode_rfc6979_signature(r, s):
- warnings.warn(
- "encode_rfc6979_signature is deprecated and will "
- "be removed in a future version, use encode_dss_signature instead.",
- utils.PersistentlyDeprecated,
- stacklevel=2
- )
- return encode_dss_signature(r, s)
-
-
-def encode_dss_signature(r, s):
- if (
- not isinstance(r, six.integer_types) or
- not isinstance(s, six.integer_types)
- ):
- raise ValueError("Both r and s must be integers")
-
- return DSASignature({'r': r, 's': s}).dump()
-
-
-class Prehashed(object):
- def __init__(self, algorithm):
- if not isinstance(algorithm, hashes.HashAlgorithm):
- raise TypeError("Expected instance of HashAlgorithm.")
-
- self._algorithm = algorithm
- self._digest_size = algorithm.digest_size
-
- digest_size = utils.read_only_property("_digest_size")
diff --git a/lib/cryptography/hazmat/primitives/asymmetric/x25519.py b/lib/cryptography/hazmat/primitives/asymmetric/x25519.py
deleted file mode 100644
index 5c4652ae6b..0000000000
--- a/lib/cryptography/hazmat/primitives/asymmetric/x25519.py
+++ /dev/null
@@ -1,54 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import abc
-
-import six
-
-from cryptography.exceptions import UnsupportedAlgorithm, _Reasons
-
-
-@six.add_metaclass(abc.ABCMeta)
-class X25519PublicKey(object):
- @classmethod
- def from_public_bytes(cls, data):
- from cryptography.hazmat.backends.openssl.backend import backend
- if not backend.x25519_supported():
- raise UnsupportedAlgorithm(
- "X25519 is not supported by this version of OpenSSL.",
- _Reasons.UNSUPPORTED_EXCHANGE_ALGORITHM
- )
- return backend.x25519_load_public_bytes(data)
-
- @abc.abstractmethod
- def public_bytes(self):
- pass
-
-
-@six.add_metaclass(abc.ABCMeta)
-class X25519PrivateKey(object):
- @classmethod
- def generate(cls):
- from cryptography.hazmat.backends.openssl.backend import backend
- if not backend.x25519_supported():
- raise UnsupportedAlgorithm(
- "X25519 is not supported by this version of OpenSSL.",
- _Reasons.UNSUPPORTED_EXCHANGE_ALGORITHM
- )
- return backend.x25519_generate_key()
-
- @classmethod
- def _from_private_bytes(cls, data):
- from cryptography.hazmat.backends.openssl.backend import backend
- return backend.x25519_load_private_bytes(data)
-
- @abc.abstractmethod
- def public_key(self):
- pass
-
- @abc.abstractmethod
- def exchange(self, peer_public_key):
- pass
diff --git a/lib/cryptography/hazmat/primitives/ciphers/__init__.py b/lib/cryptography/hazmat/primitives/ciphers/__init__.py
deleted file mode 100644
index 171b1c693b..0000000000
--- a/lib/cryptography/hazmat/primitives/ciphers/__init__.py
+++ /dev/null
@@ -1,21 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-from cryptography.hazmat.primitives.ciphers.base import (
- AEADCipherContext, AEADDecryptionContext, AEADEncryptionContext,
- BlockCipherAlgorithm, Cipher, CipherAlgorithm, CipherContext
-)
-
-
-__all__ = [
- "Cipher",
- "CipherAlgorithm",
- "BlockCipherAlgorithm",
- "CipherContext",
- "AEADCipherContext",
- "AEADDecryptionContext",
- "AEADEncryptionContext",
-]
diff --git a/lib/cryptography/hazmat/primitives/ciphers/aead.py b/lib/cryptography/hazmat/primitives/ciphers/aead.py
deleted file mode 100644
index 16899d00fc..0000000000
--- a/lib/cryptography/hazmat/primitives/ciphers/aead.py
+++ /dev/null
@@ -1,188 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import os
-
-from cryptography import exceptions, utils
-from cryptography.hazmat.backends.openssl import aead
-from cryptography.hazmat.backends.openssl.backend import backend
-
-
-class ChaCha20Poly1305(object):
- _MAX_SIZE = 2 ** 32
-
- def __init__(self, key):
- if not backend.aead_cipher_supported(self):
- raise exceptions.UnsupportedAlgorithm(
- "ChaCha20Poly1305 is not supported by this version of OpenSSL",
- exceptions._Reasons.UNSUPPORTED_CIPHER
- )
- utils._check_bytes("key", key)
-
- if len(key) != 32:
- raise ValueError("ChaCha20Poly1305 key must be 32 bytes.")
-
- self._key = key
-
- @classmethod
- def generate_key(cls):
- return os.urandom(32)
-
- def encrypt(self, nonce, data, associated_data):
- if associated_data is None:
- associated_data = b""
-
- if len(data) > self._MAX_SIZE or len(associated_data) > self._MAX_SIZE:
- # This is OverflowError to match what cffi would raise
- raise OverflowError(
- "Data or associated data too long. Max 2**32 bytes"
- )
-
- self._check_params(nonce, data, associated_data)
- return aead._encrypt(
- backend, self, nonce, data, associated_data, 16
- )
-
- def decrypt(self, nonce, data, associated_data):
- if associated_data is None:
- associated_data = b""
-
- self._check_params(nonce, data, associated_data)
- return aead._decrypt(
- backend, self, nonce, data, associated_data, 16
- )
-
- def _check_params(self, nonce, data, associated_data):
- utils._check_bytes("nonce", nonce)
- utils._check_bytes("data", data)
- utils._check_bytes("associated_data", associated_data)
- if len(nonce) != 12:
- raise ValueError("Nonce must be 12 bytes")
-
-
-class AESCCM(object):
- _MAX_SIZE = 2 ** 32
-
- def __init__(self, key, tag_length=16):
- utils._check_bytes("key", key)
- if len(key) not in (16, 24, 32):
- raise ValueError("AESCCM key must be 128, 192, or 256 bits.")
-
- self._key = key
- if not isinstance(tag_length, int):
- raise TypeError("tag_length must be an integer")
-
- if tag_length not in (4, 6, 8, 10, 12, 14, 16):
- raise ValueError("Invalid tag_length")
-
- self._tag_length = tag_length
-
- if not backend.aead_cipher_supported(self):
- raise exceptions.UnsupportedAlgorithm(
- "AESCCM is not supported by this version of OpenSSL",
- exceptions._Reasons.UNSUPPORTED_CIPHER
- )
-
- @classmethod
- def generate_key(cls, bit_length):
- if not isinstance(bit_length, int):
- raise TypeError("bit_length must be an integer")
-
- if bit_length not in (128, 192, 256):
- raise ValueError("bit_length must be 128, 192, or 256")
-
- return os.urandom(bit_length // 8)
-
- def encrypt(self, nonce, data, associated_data):
- if associated_data is None:
- associated_data = b""
-
- if len(data) > self._MAX_SIZE or len(associated_data) > self._MAX_SIZE:
- # This is OverflowError to match what cffi would raise
- raise OverflowError(
- "Data or associated data too long. Max 2**32 bytes"
- )
-
- self._check_params(nonce, data, associated_data)
- self._validate_lengths(nonce, len(data))
- return aead._encrypt(
- backend, self, nonce, data, associated_data, self._tag_length
- )
-
- def decrypt(self, nonce, data, associated_data):
- if associated_data is None:
- associated_data = b""
-
- self._check_params(nonce, data, associated_data)
- return aead._decrypt(
- backend, self, nonce, data, associated_data, self._tag_length
- )
-
- def _validate_lengths(self, nonce, data_len):
- # For information about computing this, see
- # https://tools.ietf.org/html/rfc3610#section-2.1
- l_val = 15 - len(nonce)
- if 2 ** (8 * l_val) < data_len:
- raise ValueError("Nonce too long for data")
-
- def _check_params(self, nonce, data, associated_data):
- utils._check_bytes("nonce", nonce)
- utils._check_bytes("data", data)
- utils._check_bytes("associated_data", associated_data)
- if not 7 <= len(nonce) <= 13:
- raise ValueError("Nonce must be between 7 and 13 bytes")
-
-
-class AESGCM(object):
- _MAX_SIZE = 2 ** 32
-
- def __init__(self, key):
- utils._check_bytes("key", key)
- if len(key) not in (16, 24, 32):
- raise ValueError("AESGCM key must be 128, 192, or 256 bits.")
-
- self._key = key
-
- @classmethod
- def generate_key(cls, bit_length):
- if not isinstance(bit_length, int):
- raise TypeError("bit_length must be an integer")
-
- if bit_length not in (128, 192, 256):
- raise ValueError("bit_length must be 128, 192, or 256")
-
- return os.urandom(bit_length // 8)
-
- def encrypt(self, nonce, data, associated_data):
- if associated_data is None:
- associated_data = b""
-
- if len(data) > self._MAX_SIZE or len(associated_data) > self._MAX_SIZE:
- # This is OverflowError to match what cffi would raise
- raise OverflowError(
- "Data or associated data too long. Max 2**32 bytes"
- )
-
- self._check_params(nonce, data, associated_data)
- return aead._encrypt(
- backend, self, nonce, data, associated_data, 16
- )
-
- def decrypt(self, nonce, data, associated_data):
- if associated_data is None:
- associated_data = b""
-
- self._check_params(nonce, data, associated_data)
- return aead._decrypt(
- backend, self, nonce, data, associated_data, 16
- )
-
- def _check_params(self, nonce, data, associated_data):
- utils._check_bytes("nonce", nonce)
- utils._check_bytes("data", data)
- utils._check_bytes("associated_data", associated_data)
- if len(nonce) == 0:
- raise ValueError("Nonce must be at least 1 byte")
diff --git a/lib/cryptography/hazmat/primitives/ciphers/algorithms.py b/lib/cryptography/hazmat/primitives/ciphers/algorithms.py
deleted file mode 100644
index 68a9e33085..0000000000
--- a/lib/cryptography/hazmat/primitives/ciphers/algorithms.py
+++ /dev/null
@@ -1,168 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-from cryptography import utils
-from cryptography.hazmat.primitives.ciphers import (
- BlockCipherAlgorithm, CipherAlgorithm
-)
-from cryptography.hazmat.primitives.ciphers.modes import ModeWithNonce
-
-
-def _verify_key_size(algorithm, key):
- # Verify that the key is instance of bytes
- utils._check_bytes("key", key)
-
- # Verify that the key size matches the expected key size
- if len(key) * 8 not in algorithm.key_sizes:
- raise ValueError("Invalid key size ({0}) for {1}.".format(
- len(key) * 8, algorithm.name
- ))
- return key
-
-
-@utils.register_interface(BlockCipherAlgorithm)
-@utils.register_interface(CipherAlgorithm)
-class AES(object):
- name = "AES"
- block_size = 128
- # 512 added to support AES-256-XTS, which uses 512-bit keys
- key_sizes = frozenset([128, 192, 256, 512])
-
- def __init__(self, key):
- self.key = _verify_key_size(self, key)
-
- @property
- def key_size(self):
- return len(self.key) * 8
-
-
-@utils.register_interface(BlockCipherAlgorithm)
-@utils.register_interface(CipherAlgorithm)
-class Camellia(object):
- name = "camellia"
- block_size = 128
- key_sizes = frozenset([128, 192, 256])
-
- def __init__(self, key):
- self.key = _verify_key_size(self, key)
-
- @property
- def key_size(self):
- return len(self.key) * 8
-
-
-@utils.register_interface(BlockCipherAlgorithm)
-@utils.register_interface(CipherAlgorithm)
-class TripleDES(object):
- name = "3DES"
- block_size = 64
- key_sizes = frozenset([64, 128, 192])
-
- def __init__(self, key):
- if len(key) == 8:
- key += key + key
- elif len(key) == 16:
- key += key[:8]
- self.key = _verify_key_size(self, key)
-
- @property
- def key_size(self):
- return len(self.key) * 8
-
-
-@utils.register_interface(BlockCipherAlgorithm)
-@utils.register_interface(CipherAlgorithm)
-class Blowfish(object):
- name = "Blowfish"
- block_size = 64
- key_sizes = frozenset(range(32, 449, 8))
-
- def __init__(self, key):
- self.key = _verify_key_size(self, key)
-
- @property
- def key_size(self):
- return len(self.key) * 8
-
-
-@utils.register_interface(BlockCipherAlgorithm)
-@utils.register_interface(CipherAlgorithm)
-class CAST5(object):
- name = "CAST5"
- block_size = 64
- key_sizes = frozenset(range(40, 129, 8))
-
- def __init__(self, key):
- self.key = _verify_key_size(self, key)
-
- @property
- def key_size(self):
- return len(self.key) * 8
-
-
-@utils.register_interface(CipherAlgorithm)
-class ARC4(object):
- name = "RC4"
- key_sizes = frozenset([40, 56, 64, 80, 128, 160, 192, 256])
-
- def __init__(self, key):
- self.key = _verify_key_size(self, key)
-
- @property
- def key_size(self):
- return len(self.key) * 8
-
-
-@utils.register_interface(CipherAlgorithm)
-class IDEA(object):
- name = "IDEA"
- block_size = 64
- key_sizes = frozenset([128])
-
- def __init__(self, key):
- self.key = _verify_key_size(self, key)
-
- @property
- def key_size(self):
- return len(self.key) * 8
-
-
-@utils.register_interface(BlockCipherAlgorithm)
-@utils.register_interface(CipherAlgorithm)
-class SEED(object):
- name = "SEED"
- block_size = 128
- key_sizes = frozenset([128])
-
- def __init__(self, key):
- self.key = _verify_key_size(self, key)
-
- @property
- def key_size(self):
- return len(self.key) * 8
-
-
-@utils.register_interface(CipherAlgorithm)
-@utils.register_interface(ModeWithNonce)
-class ChaCha20(object):
- name = "ChaCha20"
- key_sizes = frozenset([256])
-
- def __init__(self, key, nonce):
- self.key = _verify_key_size(self, key)
- if not isinstance(nonce, bytes):
- raise TypeError("nonce must be bytes")
-
- if len(nonce) != 16:
- raise ValueError("nonce must be 128-bits (16 bytes)")
-
- self._nonce = nonce
-
- nonce = utils.read_only_property("_nonce")
-
- @property
- def key_size(self):
- return len(self.key) * 8
diff --git a/lib/cryptography/hazmat/primitives/ciphers/base.py b/lib/cryptography/hazmat/primitives/ciphers/base.py
deleted file mode 100644
index f857041421..0000000000
--- a/lib/cryptography/hazmat/primitives/ciphers/base.py
+++ /dev/null
@@ -1,235 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import abc
-
-import six
-
-from cryptography import utils
-from cryptography.exceptions import (
- AlreadyFinalized, AlreadyUpdated, NotYetFinalized, UnsupportedAlgorithm,
- _Reasons
-)
-from cryptography.hazmat.backends.interfaces import CipherBackend
-from cryptography.hazmat.primitives.ciphers import modes
-
-
-@six.add_metaclass(abc.ABCMeta)
-class CipherAlgorithm(object):
- @abc.abstractproperty
- def name(self):
- """
- A string naming this mode (e.g. "AES", "Camellia").
- """
-
- @abc.abstractproperty
- def key_size(self):
- """
- The size of the key being used as an integer in bits (e.g. 128, 256).
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class BlockCipherAlgorithm(object):
- @abc.abstractproperty
- def block_size(self):
- """
- The size of a block as an integer in bits (e.g. 64, 128).
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class CipherContext(object):
- @abc.abstractmethod
- def update(self, data):
- """
- Processes the provided bytes through the cipher and returns the results
- as bytes.
- """
-
- @abc.abstractmethod
- def update_into(self, data, buf):
- """
- Processes the provided bytes and writes the resulting data into the
- provided buffer. Returns the number of bytes written.
- """
-
- @abc.abstractmethod
- def finalize(self):
- """
- Returns the results of processing the final block as bytes.
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class AEADCipherContext(object):
- @abc.abstractmethod
- def authenticate_additional_data(self, data):
- """
- Authenticates the provided bytes.
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class AEADDecryptionContext(object):
- @abc.abstractmethod
- def finalize_with_tag(self, tag):
- """
- Returns the results of processing the final block as bytes and allows
- delayed passing of the authentication tag.
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class AEADEncryptionContext(object):
- @abc.abstractproperty
- def tag(self):
- """
- Returns tag bytes. This is only available after encryption is
- finalized.
- """
-
-
-class Cipher(object):
- def __init__(self, algorithm, mode, backend):
- if not isinstance(backend, CipherBackend):
- raise UnsupportedAlgorithm(
- "Backend object does not implement CipherBackend.",
- _Reasons.BACKEND_MISSING_INTERFACE
- )
-
- if not isinstance(algorithm, CipherAlgorithm):
- raise TypeError("Expected interface of CipherAlgorithm.")
-
- if mode is not None:
- mode.validate_for_algorithm(algorithm)
-
- self.algorithm = algorithm
- self.mode = mode
- self._backend = backend
-
- def encryptor(self):
- if isinstance(self.mode, modes.ModeWithAuthenticationTag):
- if self.mode.tag is not None:
- raise ValueError(
- "Authentication tag must be None when encrypting."
- )
- ctx = self._backend.create_symmetric_encryption_ctx(
- self.algorithm, self.mode
- )
- return self._wrap_ctx(ctx, encrypt=True)
-
- def decryptor(self):
- ctx = self._backend.create_symmetric_decryption_ctx(
- self.algorithm, self.mode
- )
- return self._wrap_ctx(ctx, encrypt=False)
-
- def _wrap_ctx(self, ctx, encrypt):
- if isinstance(self.mode, modes.ModeWithAuthenticationTag):
- if encrypt:
- return _AEADEncryptionContext(ctx)
- else:
- return _AEADCipherContext(ctx)
- else:
- return _CipherContext(ctx)
-
-
-@utils.register_interface(CipherContext)
-class _CipherContext(object):
- def __init__(self, ctx):
- self._ctx = ctx
-
- def update(self, data):
- if self._ctx is None:
- raise AlreadyFinalized("Context was already finalized.")
- return self._ctx.update(data)
-
- def update_into(self, data, buf):
- if self._ctx is None:
- raise AlreadyFinalized("Context was already finalized.")
- return self._ctx.update_into(data, buf)
-
- def finalize(self):
- if self._ctx is None:
- raise AlreadyFinalized("Context was already finalized.")
- data = self._ctx.finalize()
- self._ctx = None
- return data
-
-
-@utils.register_interface(AEADCipherContext)
-@utils.register_interface(CipherContext)
-@utils.register_interface(AEADDecryptionContext)
-class _AEADCipherContext(object):
- def __init__(self, ctx):
- self._ctx = ctx
- self._bytes_processed = 0
- self._aad_bytes_processed = 0
- self._tag = None
- self._updated = False
-
- def _check_limit(self, data_size):
- if self._ctx is None:
- raise AlreadyFinalized("Context was already finalized.")
- self._updated = True
- self._bytes_processed += data_size
- if self._bytes_processed > self._ctx._mode._MAX_ENCRYPTED_BYTES:
- raise ValueError(
- "{0} has a maximum encrypted byte limit of {1}".format(
- self._ctx._mode.name, self._ctx._mode._MAX_ENCRYPTED_BYTES
- )
- )
-
- def update(self, data):
- self._check_limit(len(data))
- return self._ctx.update(data)
-
- def update_into(self, data, buf):
- self._check_limit(len(data))
- return self._ctx.update_into(data, buf)
-
- def finalize(self):
- if self._ctx is None:
- raise AlreadyFinalized("Context was already finalized.")
- data = self._ctx.finalize()
- self._tag = self._ctx.tag
- self._ctx = None
- return data
-
- def finalize_with_tag(self, tag):
- if self._ctx is None:
- raise AlreadyFinalized("Context was already finalized.")
- data = self._ctx.finalize_with_tag(tag)
- self._tag = self._ctx.tag
- self._ctx = None
- return data
-
- def authenticate_additional_data(self, data):
- if self._ctx is None:
- raise AlreadyFinalized("Context was already finalized.")
- if self._updated:
- raise AlreadyUpdated("Update has been called on this context.")
-
- self._aad_bytes_processed += len(data)
- if self._aad_bytes_processed > self._ctx._mode._MAX_AAD_BYTES:
- raise ValueError(
- "{0} has a maximum AAD byte limit of {1}".format(
- self._ctx._mode.name, self._ctx._mode._MAX_AAD_BYTES
- )
- )
-
- self._ctx.authenticate_additional_data(data)
-
-
-@utils.register_interface(AEADEncryptionContext)
-class _AEADEncryptionContext(_AEADCipherContext):
- @property
- def tag(self):
- if self._ctx is not None:
- raise NotYetFinalized("You must finalize encryption before "
- "getting the tag.")
- return self._tag
diff --git a/lib/cryptography/hazmat/primitives/ciphers/modes.py b/lib/cryptography/hazmat/primitives/ciphers/modes.py
deleted file mode 100644
index e82c1a8d6a..0000000000
--- a/lib/cryptography/hazmat/primitives/ciphers/modes.py
+++ /dev/null
@@ -1,231 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import abc
-
-import six
-
-from cryptography import utils
-
-
-@six.add_metaclass(abc.ABCMeta)
-class Mode(object):
- @abc.abstractproperty
- def name(self):
- """
- A string naming this mode (e.g. "ECB", "CBC").
- """
-
- @abc.abstractmethod
- def validate_for_algorithm(self, algorithm):
- """
- Checks that all the necessary invariants of this (mode, algorithm)
- combination are met.
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class ModeWithInitializationVector(object):
- @abc.abstractproperty
- def initialization_vector(self):
- """
- The value of the initialization vector for this mode as bytes.
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class ModeWithTweak(object):
- @abc.abstractproperty
- def tweak(self):
- """
- The value of the tweak for this mode as bytes.
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class ModeWithNonce(object):
- @abc.abstractproperty
- def nonce(self):
- """
- The value of the nonce for this mode as bytes.
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class ModeWithAuthenticationTag(object):
- @abc.abstractproperty
- def tag(self):
- """
- The value of the tag supplied to the constructor of this mode.
- """
-
-
-def _check_aes_key_length(self, algorithm):
- if algorithm.key_size > 256 and algorithm.name == "AES":
- raise ValueError(
- "Only 128, 192, and 256 bit keys are allowed for this AES mode"
- )
-
-
-def _check_iv_length(self, algorithm):
- if len(self.initialization_vector) * 8 != algorithm.block_size:
- raise ValueError("Invalid IV size ({0}) for {1}.".format(
- len(self.initialization_vector), self.name
- ))
-
-
-def _check_iv_and_key_length(self, algorithm):
- _check_aes_key_length(self, algorithm)
- _check_iv_length(self, algorithm)
-
-
-@utils.register_interface(Mode)
-@utils.register_interface(ModeWithInitializationVector)
-class CBC(object):
- name = "CBC"
-
- def __init__(self, initialization_vector):
- if not isinstance(initialization_vector, bytes):
- raise TypeError("initialization_vector must be bytes")
-
- self._initialization_vector = initialization_vector
-
- initialization_vector = utils.read_only_property("_initialization_vector")
- validate_for_algorithm = _check_iv_and_key_length
-
-
-@utils.register_interface(Mode)
-@utils.register_interface(ModeWithTweak)
-class XTS(object):
- name = "XTS"
-
- def __init__(self, tweak):
- if not isinstance(tweak, bytes):
- raise TypeError("tweak must be bytes")
-
- if len(tweak) != 16:
- raise ValueError("tweak must be 128-bits (16 bytes)")
-
- self._tweak = tweak
-
- tweak = utils.read_only_property("_tweak")
-
- def validate_for_algorithm(self, algorithm):
- if algorithm.key_size not in (256, 512):
- raise ValueError(
- "The XTS specification requires a 256-bit key for AES-128-XTS"
- " and 512-bit key for AES-256-XTS"
- )
-
-
-@utils.register_interface(Mode)
-class ECB(object):
- name = "ECB"
-
- validate_for_algorithm = _check_aes_key_length
-
-
-@utils.register_interface(Mode)
-@utils.register_interface(ModeWithInitializationVector)
-class OFB(object):
- name = "OFB"
-
- def __init__(self, initialization_vector):
- if not isinstance(initialization_vector, bytes):
- raise TypeError("initialization_vector must be bytes")
-
- self._initialization_vector = initialization_vector
-
- initialization_vector = utils.read_only_property("_initialization_vector")
- validate_for_algorithm = _check_iv_and_key_length
-
-
-@utils.register_interface(Mode)
-@utils.register_interface(ModeWithInitializationVector)
-class CFB(object):
- name = "CFB"
-
- def __init__(self, initialization_vector):
- if not isinstance(initialization_vector, bytes):
- raise TypeError("initialization_vector must be bytes")
-
- self._initialization_vector = initialization_vector
-
- initialization_vector = utils.read_only_property("_initialization_vector")
- validate_for_algorithm = _check_iv_and_key_length
-
-
-@utils.register_interface(Mode)
-@utils.register_interface(ModeWithInitializationVector)
-class CFB8(object):
- name = "CFB8"
-
- def __init__(self, initialization_vector):
- if not isinstance(initialization_vector, bytes):
- raise TypeError("initialization_vector must be bytes")
-
- self._initialization_vector = initialization_vector
-
- initialization_vector = utils.read_only_property("_initialization_vector")
- validate_for_algorithm = _check_iv_and_key_length
-
-
-@utils.register_interface(Mode)
-@utils.register_interface(ModeWithNonce)
-class CTR(object):
- name = "CTR"
-
- def __init__(self, nonce):
- if not isinstance(nonce, bytes):
- raise TypeError("nonce must be bytes")
-
- self._nonce = nonce
-
- nonce = utils.read_only_property("_nonce")
-
- def validate_for_algorithm(self, algorithm):
- _check_aes_key_length(self, algorithm)
- if len(self.nonce) * 8 != algorithm.block_size:
- raise ValueError("Invalid nonce size ({0}) for {1}.".format(
- len(self.nonce), self.name
- ))
-
-
-@utils.register_interface(Mode)
-@utils.register_interface(ModeWithInitializationVector)
-@utils.register_interface(ModeWithAuthenticationTag)
-class GCM(object):
- name = "GCM"
- _MAX_ENCRYPTED_BYTES = (2 ** 39 - 256) // 8
- _MAX_AAD_BYTES = (2 ** 64) // 8
-
- def __init__(self, initialization_vector, tag=None, min_tag_length=16):
- # len(initialization_vector) must in [1, 2 ** 64), but it's impossible
- # to actually construct a bytes object that large, so we don't check
- # for it
- if not isinstance(initialization_vector, bytes):
- raise TypeError("initialization_vector must be bytes")
- if len(initialization_vector) == 0:
- raise ValueError("initialization_vector must be at least 1 byte")
- self._initialization_vector = initialization_vector
- if tag is not None:
- if not isinstance(tag, bytes):
- raise TypeError("tag must be bytes or None")
- if min_tag_length < 4:
- raise ValueError("min_tag_length must be >= 4")
- if len(tag) < min_tag_length:
- raise ValueError(
- "Authentication tag must be {0} bytes or longer.".format(
- min_tag_length)
- )
- self._tag = tag
- self._min_tag_length = min_tag_length
-
- tag = utils.read_only_property("_tag")
- initialization_vector = utils.read_only_property("_initialization_vector")
-
- def validate_for_algorithm(self, algorithm):
- _check_aes_key_length(self, algorithm)
diff --git a/lib/cryptography/hazmat/primitives/cmac.py b/lib/cryptography/hazmat/primitives/cmac.py
deleted file mode 100644
index 77537f047c..0000000000
--- a/lib/cryptography/hazmat/primitives/cmac.py
+++ /dev/null
@@ -1,66 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-from cryptography import utils
-from cryptography.exceptions import (
- AlreadyFinalized, UnsupportedAlgorithm, _Reasons
-)
-from cryptography.hazmat.backends.interfaces import CMACBackend
-from cryptography.hazmat.primitives import ciphers, mac
-
-
-@utils.register_interface(mac.MACContext)
-class CMAC(object):
- def __init__(self, algorithm, backend, ctx=None):
- if not isinstance(backend, CMACBackend):
- raise UnsupportedAlgorithm(
- "Backend object does not implement CMACBackend.",
- _Reasons.BACKEND_MISSING_INTERFACE
- )
-
- if not isinstance(algorithm, ciphers.BlockCipherAlgorithm):
- raise TypeError(
- "Expected instance of BlockCipherAlgorithm."
- )
- self._algorithm = algorithm
-
- self._backend = backend
- if ctx is None:
- self._ctx = self._backend.create_cmac_ctx(self._algorithm)
- else:
- self._ctx = ctx
-
- def update(self, data):
- if self._ctx is None:
- raise AlreadyFinalized("Context was already finalized.")
- if not isinstance(data, bytes):
- raise TypeError("data must be bytes.")
- self._ctx.update(data)
-
- def finalize(self):
- if self._ctx is None:
- raise AlreadyFinalized("Context was already finalized.")
- digest = self._ctx.finalize()
- self._ctx = None
- return digest
-
- def verify(self, signature):
- if not isinstance(signature, bytes):
- raise TypeError("signature must be bytes.")
- if self._ctx is None:
- raise AlreadyFinalized("Context was already finalized.")
-
- ctx, self._ctx = self._ctx, None
- ctx.verify(signature)
-
- def copy(self):
- if self._ctx is None:
- raise AlreadyFinalized("Context was already finalized.")
- return CMAC(
- self._algorithm,
- backend=self._backend,
- ctx=self._ctx.copy()
- )
diff --git a/lib/cryptography/hazmat/primitives/constant_time.py b/lib/cryptography/hazmat/primitives/constant_time.py
deleted file mode 100644
index 0e987ea758..0000000000
--- a/lib/cryptography/hazmat/primitives/constant_time.py
+++ /dev/null
@@ -1,35 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import hmac
-import warnings
-
-from cryptography import utils
-from cryptography.hazmat.bindings._constant_time import lib
-
-
-if hasattr(hmac, "compare_digest"):
- def bytes_eq(a, b):
- if not isinstance(a, bytes) or not isinstance(b, bytes):
- raise TypeError("a and b must be bytes.")
-
- return hmac.compare_digest(a, b)
-
-else:
- warnings.warn(
- "Support for your Python version is deprecated. The next version of "
- "cryptography will remove support. Please upgrade to a 2.7.x "
- "release that supports hmac.compare_digest as soon as possible.",
- utils.DeprecatedIn23,
- )
-
- def bytes_eq(a, b):
- if not isinstance(a, bytes) or not isinstance(b, bytes):
- raise TypeError("a and b must be bytes.")
-
- return lib.Cryptography_constant_time_bytes_eq(
- a, len(a), b, len(b)
- ) == 1
diff --git a/lib/cryptography/hazmat/primitives/hashes.py b/lib/cryptography/hazmat/primitives/hashes.py
deleted file mode 100644
index 3f3aadd6f9..0000000000
--- a/lib/cryptography/hazmat/primitives/hashes.py
+++ /dev/null
@@ -1,185 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import abc
-
-import six
-
-from cryptography import utils
-from cryptography.exceptions import (
- AlreadyFinalized, UnsupportedAlgorithm, _Reasons
-)
-from cryptography.hazmat.backends.interfaces import HashBackend
-
-
-@six.add_metaclass(abc.ABCMeta)
-class HashAlgorithm(object):
- @abc.abstractproperty
- def name(self):
- """
- A string naming this algorithm (e.g. "sha256", "md5").
- """
-
- @abc.abstractproperty
- def digest_size(self):
- """
- The size of the resulting digest in bytes.
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class HashContext(object):
- @abc.abstractproperty
- def algorithm(self):
- """
- A HashAlgorithm that will be used by this context.
- """
-
- @abc.abstractmethod
- def update(self, data):
- """
- Processes the provided bytes through the hash.
- """
-
- @abc.abstractmethod
- def finalize(self):
- """
- Finalizes the hash context and returns the hash digest as bytes.
- """
-
- @abc.abstractmethod
- def copy(self):
- """
- Return a HashContext that is a copy of the current context.
- """
-
-
-@utils.register_interface(HashContext)
-class Hash(object):
- def __init__(self, algorithm, backend, ctx=None):
- if not isinstance(backend, HashBackend):
- raise UnsupportedAlgorithm(
- "Backend object does not implement HashBackend.",
- _Reasons.BACKEND_MISSING_INTERFACE
- )
-
- if not isinstance(algorithm, HashAlgorithm):
- raise TypeError("Expected instance of hashes.HashAlgorithm.")
- self._algorithm = algorithm
-
- self._backend = backend
-
- if ctx is None:
- self._ctx = self._backend.create_hash_ctx(self.algorithm)
- else:
- self._ctx = ctx
-
- algorithm = utils.read_only_property("_algorithm")
-
- def update(self, data):
- if self._ctx is None:
- raise AlreadyFinalized("Context was already finalized.")
- if not isinstance(data, bytes):
- raise TypeError("data must be bytes.")
- self._ctx.update(data)
-
- def copy(self):
- if self._ctx is None:
- raise AlreadyFinalized("Context was already finalized.")
- return Hash(
- self.algorithm, backend=self._backend, ctx=self._ctx.copy()
- )
-
- def finalize(self):
- if self._ctx is None:
- raise AlreadyFinalized("Context was already finalized.")
- digest = self._ctx.finalize()
- self._ctx = None
- return digest
-
-
-@utils.register_interface(HashAlgorithm)
-class SHA1(object):
- name = "sha1"
- digest_size = 20
- block_size = 64
-
-
-@utils.register_interface(HashAlgorithm)
-class SHA224(object):
- name = "sha224"
- digest_size = 28
- block_size = 64
-
-
-@utils.register_interface(HashAlgorithm)
-class SHA256(object):
- name = "sha256"
- digest_size = 32
- block_size = 64
-
-
-@utils.register_interface(HashAlgorithm)
-class SHA384(object):
- name = "sha384"
- digest_size = 48
- block_size = 128
-
-
-@utils.register_interface(HashAlgorithm)
-class SHA512(object):
- name = "sha512"
- digest_size = 64
- block_size = 128
-
-
-@utils.register_interface(HashAlgorithm)
-class MD5(object):
- name = "md5"
- digest_size = 16
- block_size = 64
-
-
-@utils.register_interface(HashAlgorithm)
-class BLAKE2b(object):
- name = "blake2b"
- _max_digest_size = 64
- _min_digest_size = 1
- block_size = 128
-
- def __init__(self, digest_size):
- if (
- digest_size > self._max_digest_size or
- digest_size < self._min_digest_size
- ):
- raise ValueError("Digest size must be {0}-{1}".format(
- self._min_digest_size, self._max_digest_size)
- )
-
- self._digest_size = digest_size
-
- digest_size = utils.read_only_property("_digest_size")
-
-
-@utils.register_interface(HashAlgorithm)
-class BLAKE2s(object):
- name = "blake2s"
- block_size = 64
- _max_digest_size = 32
- _min_digest_size = 1
-
- def __init__(self, digest_size):
- if (
- digest_size > self._max_digest_size or
- digest_size < self._min_digest_size
- ):
- raise ValueError("Digest size must be {0}-{1}".format(
- self._min_digest_size, self._max_digest_size)
- )
-
- self._digest_size = digest_size
-
- digest_size = utils.read_only_property("_digest_size")
diff --git a/lib/cryptography/hazmat/primitives/hmac.py b/lib/cryptography/hazmat/primitives/hmac.py
deleted file mode 100644
index 2e9a4e2fe6..0000000000
--- a/lib/cryptography/hazmat/primitives/hmac.py
+++ /dev/null
@@ -1,69 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-from cryptography import utils
-from cryptography.exceptions import (
- AlreadyFinalized, UnsupportedAlgorithm, _Reasons
-)
-from cryptography.hazmat.backends.interfaces import HMACBackend
-from cryptography.hazmat.primitives import hashes, mac
-
-
-@utils.register_interface(mac.MACContext)
-@utils.register_interface(hashes.HashContext)
-class HMAC(object):
- def __init__(self, key, algorithm, backend, ctx=None):
- if not isinstance(backend, HMACBackend):
- raise UnsupportedAlgorithm(
- "Backend object does not implement HMACBackend.",
- _Reasons.BACKEND_MISSING_INTERFACE
- )
-
- if not isinstance(algorithm, hashes.HashAlgorithm):
- raise TypeError("Expected instance of hashes.HashAlgorithm.")
- self._algorithm = algorithm
-
- self._backend = backend
- self._key = key
- if ctx is None:
- self._ctx = self._backend.create_hmac_ctx(key, self.algorithm)
- else:
- self._ctx = ctx
-
- algorithm = utils.read_only_property("_algorithm")
-
- def update(self, data):
- if self._ctx is None:
- raise AlreadyFinalized("Context was already finalized.")
- if not isinstance(data, bytes):
- raise TypeError("data must be bytes.")
- self._ctx.update(data)
-
- def copy(self):
- if self._ctx is None:
- raise AlreadyFinalized("Context was already finalized.")
- return HMAC(
- self._key,
- self.algorithm,
- backend=self._backend,
- ctx=self._ctx.copy()
- )
-
- def finalize(self):
- if self._ctx is None:
- raise AlreadyFinalized("Context was already finalized.")
- digest = self._ctx.finalize()
- self._ctx = None
- return digest
-
- def verify(self, signature):
- if not isinstance(signature, bytes):
- raise TypeError("signature must be bytes.")
- if self._ctx is None:
- raise AlreadyFinalized("Context was already finalized.")
-
- ctx, self._ctx = self._ctx, None
- ctx.verify(signature)
diff --git a/lib/cryptography/hazmat/primitives/kdf/__init__.py b/lib/cryptography/hazmat/primitives/kdf/__init__.py
deleted file mode 100644
index 2d0724e5da..0000000000
--- a/lib/cryptography/hazmat/primitives/kdf/__init__.py
+++ /dev/null
@@ -1,26 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import abc
-
-import six
-
-
-@six.add_metaclass(abc.ABCMeta)
-class KeyDerivationFunction(object):
- @abc.abstractmethod
- def derive(self, key_material):
- """
- Deterministically generates and returns a new key based on the existing
- key material.
- """
-
- @abc.abstractmethod
- def verify(self, key_material, expected_key):
- """
- Checks whether the key generated by the key material matches the
- expected derived key. Raises an exception if they do not match.
- """
diff --git a/lib/cryptography/hazmat/primitives/kdf/concatkdf.py b/lib/cryptography/hazmat/primitives/kdf/concatkdf.py
deleted file mode 100644
index c6399e4f76..0000000000
--- a/lib/cryptography/hazmat/primitives/kdf/concatkdf.py
+++ /dev/null
@@ -1,125 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import struct
-
-from cryptography import utils
-from cryptography.exceptions import (
- AlreadyFinalized, InvalidKey, UnsupportedAlgorithm, _Reasons
-)
-from cryptography.hazmat.backends.interfaces import HMACBackend
-from cryptography.hazmat.backends.interfaces import HashBackend
-from cryptography.hazmat.primitives import constant_time, hashes, hmac
-from cryptography.hazmat.primitives.kdf import KeyDerivationFunction
-
-
-def _int_to_u32be(n):
- return struct.pack('>I', n)
-
-
-def _common_args_checks(algorithm, length, otherinfo):
- max_length = algorithm.digest_size * (2 ** 32 - 1)
- if length > max_length:
- raise ValueError(
- "Can not derive keys larger than {0} bits.".format(
- max_length
- ))
- if not (otherinfo is None or isinstance(otherinfo, bytes)):
- raise TypeError("otherinfo must be bytes.")
-
-
-def _concatkdf_derive(key_material, length, auxfn, otherinfo):
- if not isinstance(key_material, bytes):
- raise TypeError("key_material must be bytes.")
-
- output = [b""]
- outlen = 0
- counter = 1
-
- while (length > outlen):
- h = auxfn()
- h.update(_int_to_u32be(counter))
- h.update(key_material)
- h.update(otherinfo)
- output.append(h.finalize())
- outlen += len(output[-1])
- counter += 1
-
- return b"".join(output)[:length]
-
-
-@utils.register_interface(KeyDerivationFunction)
-class ConcatKDFHash(object):
- def __init__(self, algorithm, length, otherinfo, backend):
-
- _common_args_checks(algorithm, length, otherinfo)
- self._algorithm = algorithm
- self._length = length
- self._otherinfo = otherinfo
- if self._otherinfo is None:
- self._otherinfo = b""
-
- if not isinstance(backend, HashBackend):
- raise UnsupportedAlgorithm(
- "Backend object does not implement HashBackend.",
- _Reasons.BACKEND_MISSING_INTERFACE
- )
- self._backend = backend
- self._used = False
-
- def _hash(self):
- return hashes.Hash(self._algorithm, self._backend)
-
- def derive(self, key_material):
- if self._used:
- raise AlreadyFinalized
- self._used = True
- return _concatkdf_derive(key_material, self._length,
- self._hash, self._otherinfo)
-
- def verify(self, key_material, expected_key):
- if not constant_time.bytes_eq(self.derive(key_material), expected_key):
- raise InvalidKey
-
-
-@utils.register_interface(KeyDerivationFunction)
-class ConcatKDFHMAC(object):
- def __init__(self, algorithm, length, salt, otherinfo, backend):
-
- _common_args_checks(algorithm, length, otherinfo)
- self._algorithm = algorithm
- self._length = length
- self._otherinfo = otherinfo
- if self._otherinfo is None:
- self._otherinfo = b""
-
- if not (salt is None or isinstance(salt, bytes)):
- raise TypeError("salt must be bytes.")
- if salt is None:
- salt = b"\x00" * algorithm.block_size
- self._salt = salt
-
- if not isinstance(backend, HMACBackend):
- raise UnsupportedAlgorithm(
- "Backend object does not implement HMACBackend.",
- _Reasons.BACKEND_MISSING_INTERFACE
- )
- self._backend = backend
- self._used = False
-
- def _hmac(self):
- return hmac.HMAC(self._salt, self._algorithm, self._backend)
-
- def derive(self, key_material):
- if self._used:
- raise AlreadyFinalized
- self._used = True
- return _concatkdf_derive(key_material, self._length,
- self._hmac, self._otherinfo)
-
- def verify(self, key_material, expected_key):
- if not constant_time.bytes_eq(self.derive(key_material), expected_key):
- raise InvalidKey
diff --git a/lib/cryptography/hazmat/primitives/kdf/hkdf.py b/lib/cryptography/hazmat/primitives/kdf/hkdf.py
deleted file mode 100644
index 917b4e9c4c..0000000000
--- a/lib/cryptography/hazmat/primitives/kdf/hkdf.py
+++ /dev/null
@@ -1,116 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import six
-
-from cryptography import utils
-from cryptography.exceptions import (
- AlreadyFinalized, InvalidKey, UnsupportedAlgorithm, _Reasons
-)
-from cryptography.hazmat.backends.interfaces import HMACBackend
-from cryptography.hazmat.primitives import constant_time, hmac
-from cryptography.hazmat.primitives.kdf import KeyDerivationFunction
-
-
-@utils.register_interface(KeyDerivationFunction)
-class HKDF(object):
- def __init__(self, algorithm, length, salt, info, backend):
- if not isinstance(backend, HMACBackend):
- raise UnsupportedAlgorithm(
- "Backend object does not implement HMACBackend.",
- _Reasons.BACKEND_MISSING_INTERFACE
- )
-
- self._algorithm = algorithm
-
- if not (salt is None or isinstance(salt, bytes)):
- raise TypeError("salt must be bytes.")
-
- if salt is None:
- salt = b"\x00" * self._algorithm.digest_size
-
- self._salt = salt
-
- self._backend = backend
-
- self._hkdf_expand = HKDFExpand(self._algorithm, length, info, backend)
-
- def _extract(self, key_material):
- h = hmac.HMAC(self._salt, self._algorithm, backend=self._backend)
- h.update(key_material)
- return h.finalize()
-
- def derive(self, key_material):
- if not isinstance(key_material, bytes):
- raise TypeError("key_material must be bytes.")
-
- return self._hkdf_expand.derive(self._extract(key_material))
-
- def verify(self, key_material, expected_key):
- if not constant_time.bytes_eq(self.derive(key_material), expected_key):
- raise InvalidKey
-
-
-@utils.register_interface(KeyDerivationFunction)
-class HKDFExpand(object):
- def __init__(self, algorithm, length, info, backend):
- if not isinstance(backend, HMACBackend):
- raise UnsupportedAlgorithm(
- "Backend object does not implement HMACBackend.",
- _Reasons.BACKEND_MISSING_INTERFACE
- )
-
- self._algorithm = algorithm
-
- self._backend = backend
-
- max_length = 255 * algorithm.digest_size
-
- if length > max_length:
- raise ValueError(
- "Can not derive keys larger than {0} octets.".format(
- max_length
- ))
-
- self._length = length
-
- if not (info is None or isinstance(info, bytes)):
- raise TypeError("info must be bytes.")
-
- if info is None:
- info = b""
-
- self._info = info
-
- self._used = False
-
- def _expand(self, key_material):
- output = [b""]
- counter = 1
-
- while self._algorithm.digest_size * (len(output) - 1) < self._length:
- h = hmac.HMAC(key_material, self._algorithm, backend=self._backend)
- h.update(output[-1])
- h.update(self._info)
- h.update(six.int2byte(counter))
- output.append(h.finalize())
- counter += 1
-
- return b"".join(output)[:self._length]
-
- def derive(self, key_material):
- if not isinstance(key_material, bytes):
- raise TypeError("key_material must be bytes.")
-
- if self._used:
- raise AlreadyFinalized
-
- self._used = True
- return self._expand(key_material)
-
- def verify(self, key_material, expected_key):
- if not constant_time.bytes_eq(self.derive(key_material), expected_key):
- raise InvalidKey
diff --git a/lib/cryptography/hazmat/primitives/kdf/kbkdf.py b/lib/cryptography/hazmat/primitives/kdf/kbkdf.py
deleted file mode 100644
index 14de56ebff..0000000000
--- a/lib/cryptography/hazmat/primitives/kdf/kbkdf.py
+++ /dev/null
@@ -1,148 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-from enum import Enum
-
-from six.moves import range
-
-from cryptography import utils
-from cryptography.exceptions import (
- AlreadyFinalized, InvalidKey, UnsupportedAlgorithm, _Reasons
-)
-from cryptography.hazmat.backends.interfaces import HMACBackend
-from cryptography.hazmat.primitives import constant_time, hashes, hmac
-from cryptography.hazmat.primitives.kdf import KeyDerivationFunction
-
-
-class Mode(Enum):
- CounterMode = "ctr"
-
-
-class CounterLocation(Enum):
- BeforeFixed = "before_fixed"
- AfterFixed = "after_fixed"
-
-
-@utils.register_interface(KeyDerivationFunction)
-class KBKDFHMAC(object):
- def __init__(self, algorithm, mode, length, rlen, llen,
- location, label, context, fixed, backend):
- if not isinstance(backend, HMACBackend):
- raise UnsupportedAlgorithm(
- "Backend object does not implement HMACBackend.",
- _Reasons.BACKEND_MISSING_INTERFACE
- )
-
- if not isinstance(algorithm, hashes.HashAlgorithm):
- raise UnsupportedAlgorithm(
- "Algorithm supplied is not a supported hash algorithm.",
- _Reasons.UNSUPPORTED_HASH
- )
-
- if not backend.hmac_supported(algorithm):
- raise UnsupportedAlgorithm(
- "Algorithm supplied is not a supported hmac algorithm.",
- _Reasons.UNSUPPORTED_HASH
- )
-
- if not isinstance(mode, Mode):
- raise TypeError("mode must be of type Mode")
-
- if not isinstance(location, CounterLocation):
- raise TypeError("location must be of type CounterLocation")
-
- if (label or context) and fixed:
- raise ValueError("When supplying fixed data, "
- "label and context are ignored.")
-
- if rlen is None or not self._valid_byte_length(rlen):
- raise ValueError("rlen must be between 1 and 4")
-
- if llen is None and fixed is None:
- raise ValueError("Please specify an llen")
-
- if llen is not None and not isinstance(llen, int):
- raise TypeError("llen must be an integer")
-
- if label is None:
- label = b''
-
- if context is None:
- context = b''
-
- if (not isinstance(label, bytes) or
- not isinstance(context, bytes)):
- raise TypeError('label and context must be of type bytes')
-
- self._algorithm = algorithm
- self._mode = mode
- self._length = length
- self._rlen = rlen
- self._llen = llen
- self._location = location
- self._label = label
- self._context = context
- self._backend = backend
- self._used = False
- self._fixed_data = fixed
-
- def _valid_byte_length(self, value):
- if not isinstance(value, int):
- raise TypeError('value must be of type int')
-
- value_bin = utils.int_to_bytes(1, value)
- if not 1 <= len(value_bin) <= 4:
- return False
- return True
-
- def derive(self, key_material):
- if self._used:
- raise AlreadyFinalized
-
- if not isinstance(key_material, bytes):
- raise TypeError('key_material must be bytes')
- self._used = True
-
- # inverse floor division (equivalent to ceiling)
- rounds = -(-self._length // self._algorithm.digest_size)
-
- output = [b'']
-
- # For counter mode, the number of iterations shall not be
- # larger than 2^r-1, where r <= 32 is the binary length of the counter
- # This ensures that the counter values used as an input to the
- # PRF will not repeat during a particular call to the KDF function.
- r_bin = utils.int_to_bytes(1, self._rlen)
- if rounds > pow(2, len(r_bin) * 8) - 1:
- raise ValueError('There are too many iterations.')
-
- for i in range(1, rounds + 1):
- h = hmac.HMAC(key_material, self._algorithm, backend=self._backend)
-
- counter = utils.int_to_bytes(i, self._rlen)
- if self._location == CounterLocation.BeforeFixed:
- h.update(counter)
-
- h.update(self._generate_fixed_input())
-
- if self._location == CounterLocation.AfterFixed:
- h.update(counter)
-
- output.append(h.finalize())
-
- return b''.join(output)[:self._length]
-
- def _generate_fixed_input(self):
- if self._fixed_data and isinstance(self._fixed_data, bytes):
- return self._fixed_data
-
- l_val = utils.int_to_bytes(self._length * 8, self._llen)
-
- return b"".join([self._label, b"\x00", self._context, l_val])
-
- def verify(self, key_material, expected_key):
- if not constant_time.bytes_eq(self.derive(key_material), expected_key):
- raise InvalidKey
diff --git a/lib/cryptography/hazmat/primitives/kdf/pbkdf2.py b/lib/cryptography/hazmat/primitives/kdf/pbkdf2.py
deleted file mode 100644
index f8ce7a3b32..0000000000
--- a/lib/cryptography/hazmat/primitives/kdf/pbkdf2.py
+++ /dev/null
@@ -1,58 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-from cryptography import utils
-from cryptography.exceptions import (
- AlreadyFinalized, InvalidKey, UnsupportedAlgorithm, _Reasons
-)
-from cryptography.hazmat.backends.interfaces import PBKDF2HMACBackend
-from cryptography.hazmat.primitives import constant_time
-from cryptography.hazmat.primitives.kdf import KeyDerivationFunction
-
-
-@utils.register_interface(KeyDerivationFunction)
-class PBKDF2HMAC(object):
- def __init__(self, algorithm, length, salt, iterations, backend):
- if not isinstance(backend, PBKDF2HMACBackend):
- raise UnsupportedAlgorithm(
- "Backend object does not implement PBKDF2HMACBackend.",
- _Reasons.BACKEND_MISSING_INTERFACE
- )
-
- if not backend.pbkdf2_hmac_supported(algorithm):
- raise UnsupportedAlgorithm(
- "{0} is not supported for PBKDF2 by this backend.".format(
- algorithm.name),
- _Reasons.UNSUPPORTED_HASH
- )
- self._used = False
- self._algorithm = algorithm
- self._length = length
- if not isinstance(salt, bytes):
- raise TypeError("salt must be bytes.")
- self._salt = salt
- self._iterations = iterations
- self._backend = backend
-
- def derive(self, key_material):
- if self._used:
- raise AlreadyFinalized("PBKDF2 instances can only be used once.")
- self._used = True
-
- if not isinstance(key_material, bytes):
- raise TypeError("key_material must be bytes.")
- return self._backend.derive_pbkdf2_hmac(
- self._algorithm,
- self._length,
- self._salt,
- self._iterations,
- key_material
- )
-
- def verify(self, key_material, expected_key):
- derived_key = self.derive(key_material)
- if not constant_time.bytes_eq(derived_key, expected_key):
- raise InvalidKey("Keys do not match.")
diff --git a/lib/cryptography/hazmat/primitives/kdf/scrypt.py b/lib/cryptography/hazmat/primitives/kdf/scrypt.py
deleted file mode 100644
index 77dcf9ab13..0000000000
--- a/lib/cryptography/hazmat/primitives/kdf/scrypt.py
+++ /dev/null
@@ -1,66 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import sys
-
-from cryptography import utils
-from cryptography.exceptions import (
- AlreadyFinalized, InvalidKey, UnsupportedAlgorithm, _Reasons
-)
-from cryptography.hazmat.backends.interfaces import ScryptBackend
-from cryptography.hazmat.primitives import constant_time
-from cryptography.hazmat.primitives.kdf import KeyDerivationFunction
-
-
-# This is used by the scrypt tests to skip tests that require more memory
-# than the MEM_LIMIT
-_MEM_LIMIT = sys.maxsize // 2
-
-
-@utils.register_interface(KeyDerivationFunction)
-class Scrypt(object):
- def __init__(self, salt, length, n, r, p, backend):
- if not isinstance(backend, ScryptBackend):
- raise UnsupportedAlgorithm(
- "Backend object does not implement ScryptBackend.",
- _Reasons.BACKEND_MISSING_INTERFACE
- )
-
- self._length = length
- if not isinstance(salt, bytes):
- raise TypeError("salt must be bytes.")
-
- if n < 2 or (n & (n - 1)) != 0:
- raise ValueError("n must be greater than 1 and be a power of 2.")
-
- if r < 1:
- raise ValueError("r must be greater than or equal to 1.")
-
- if p < 1:
- raise ValueError("p must be greater than or equal to 1.")
-
- self._used = False
- self._salt = salt
- self._n = n
- self._r = r
- self._p = p
- self._backend = backend
-
- def derive(self, key_material):
- if self._used:
- raise AlreadyFinalized("Scrypt instances can only be used once.")
- self._used = True
-
- if not isinstance(key_material, bytes):
- raise TypeError("key_material must be bytes.")
- return self._backend.derive_scrypt(
- key_material, self._salt, self._length, self._n, self._r, self._p
- )
-
- def verify(self, key_material, expected_key):
- derived_key = self.derive(key_material)
- if not constant_time.bytes_eq(derived_key, expected_key):
- raise InvalidKey("Keys do not match.")
diff --git a/lib/cryptography/hazmat/primitives/kdf/x963kdf.py b/lib/cryptography/hazmat/primitives/kdf/x963kdf.py
deleted file mode 100644
index 83789b31af..0000000000
--- a/lib/cryptography/hazmat/primitives/kdf/x963kdf.py
+++ /dev/null
@@ -1,70 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import struct
-
-from cryptography import utils
-from cryptography.exceptions import (
- AlreadyFinalized, InvalidKey, UnsupportedAlgorithm, _Reasons
-)
-from cryptography.hazmat.backends.interfaces import HashBackend
-from cryptography.hazmat.primitives import constant_time, hashes
-from cryptography.hazmat.primitives.kdf import KeyDerivationFunction
-
-
-def _int_to_u32be(n):
- return struct.pack('>I', n)
-
-
-@utils.register_interface(KeyDerivationFunction)
-class X963KDF(object):
- def __init__(self, algorithm, length, sharedinfo, backend):
-
- max_len = algorithm.digest_size * (2 ** 32 - 1)
- if length > max_len:
- raise ValueError(
- "Can not derive keys larger than {0} bits.".format(max_len))
- if not (sharedinfo is None or isinstance(sharedinfo, bytes)):
- raise TypeError("sharedinfo must be bytes.")
- self._algorithm = algorithm
- self._length = length
- self._sharedinfo = sharedinfo
-
- if not isinstance(backend, HashBackend):
- raise UnsupportedAlgorithm(
- "Backend object does not implement HashBackend.",
- _Reasons.BACKEND_MISSING_INTERFACE
- )
- self._backend = backend
- self._used = False
-
- def derive(self, key_material):
- if self._used:
- raise AlreadyFinalized
- self._used = True
-
- if not isinstance(key_material, bytes):
- raise TypeError("key_material must be bytes.")
-
- output = [b""]
- outlen = 0
- counter = 1
-
- while self._length > outlen:
- h = hashes.Hash(self._algorithm, self._backend)
- h.update(key_material)
- h.update(_int_to_u32be(counter))
- if self._sharedinfo is not None:
- h.update(self._sharedinfo)
- output.append(h.finalize())
- outlen += len(output[-1])
- counter += 1
-
- return b"".join(output)[:self._length]
-
- def verify(self, key_material, expected_key):
- if not constant_time.bytes_eq(self.derive(key_material), expected_key):
- raise InvalidKey
diff --git a/lib/cryptography/hazmat/primitives/keywrap.py b/lib/cryptography/hazmat/primitives/keywrap.py
deleted file mode 100644
index f55c519cff..0000000000
--- a/lib/cryptography/hazmat/primitives/keywrap.py
+++ /dev/null
@@ -1,154 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import struct
-
-from cryptography.hazmat.primitives.ciphers import Cipher
-from cryptography.hazmat.primitives.ciphers.algorithms import AES
-from cryptography.hazmat.primitives.ciphers.modes import ECB
-from cryptography.hazmat.primitives.constant_time import bytes_eq
-
-
-def _wrap_core(wrapping_key, a, r, backend):
- # RFC 3394 Key Wrap - 2.2.1 (index method)
- encryptor = Cipher(AES(wrapping_key), ECB(), backend).encryptor()
- n = len(r)
- for j in range(6):
- for i in range(n):
- # every encryption operation is a discrete 16 byte chunk (because
- # AES has a 128-bit block size) and since we're using ECB it is
- # safe to reuse the encryptor for the entire operation
- b = encryptor.update(a + r[i])
- # pack/unpack are safe as these are always 64-bit chunks
- a = struct.pack(
- ">Q", struct.unpack(">Q", b[:8])[0] ^ ((n * j) + i + 1)
- )
- r[i] = b[-8:]
-
- assert encryptor.finalize() == b""
-
- return a + b"".join(r)
-
-
-def aes_key_wrap(wrapping_key, key_to_wrap, backend):
- if len(wrapping_key) not in [16, 24, 32]:
- raise ValueError("The wrapping key must be a valid AES key length")
-
- if len(key_to_wrap) < 16:
- raise ValueError("The key to wrap must be at least 16 bytes")
-
- if len(key_to_wrap) % 8 != 0:
- raise ValueError("The key to wrap must be a multiple of 8 bytes")
-
- a = b"\xa6\xa6\xa6\xa6\xa6\xa6\xa6\xa6"
- r = [key_to_wrap[i:i + 8] for i in range(0, len(key_to_wrap), 8)]
- return _wrap_core(wrapping_key, a, r, backend)
-
-
-def _unwrap_core(wrapping_key, a, r, backend):
- # Implement RFC 3394 Key Unwrap - 2.2.2 (index method)
- decryptor = Cipher(AES(wrapping_key), ECB(), backend).decryptor()
- n = len(r)
- for j in reversed(range(6)):
- for i in reversed(range(n)):
- # pack/unpack are safe as these are always 64-bit chunks
- atr = struct.pack(
- ">Q", struct.unpack(">Q", a)[0] ^ ((n * j) + i + 1)
- ) + r[i]
- # every decryption operation is a discrete 16 byte chunk so
- # it is safe to reuse the decryptor for the entire operation
- b = decryptor.update(atr)
- a = b[:8]
- r[i] = b[-8:]
-
- assert decryptor.finalize() == b""
- return a, r
-
-
-def aes_key_wrap_with_padding(wrapping_key, key_to_wrap, backend):
- if len(wrapping_key) not in [16, 24, 32]:
- raise ValueError("The wrapping key must be a valid AES key length")
-
- aiv = b"\xA6\x59\x59\xA6" + struct.pack(">i", len(key_to_wrap))
- # pad the key to wrap if necessary
- pad = (8 - (len(key_to_wrap) % 8)) % 8
- key_to_wrap = key_to_wrap + b"\x00" * pad
- if len(key_to_wrap) == 8:
- # RFC 5649 - 4.1 - exactly 8 octets after padding
- encryptor = Cipher(AES(wrapping_key), ECB(), backend).encryptor()
- b = encryptor.update(aiv + key_to_wrap)
- assert encryptor.finalize() == b""
- return b
- else:
- r = [key_to_wrap[i:i + 8] for i in range(0, len(key_to_wrap), 8)]
- return _wrap_core(wrapping_key, aiv, r, backend)
-
-
-def aes_key_unwrap_with_padding(wrapping_key, wrapped_key, backend):
- if len(wrapped_key) < 16:
- raise InvalidUnwrap("Must be at least 16 bytes")
-
- if len(wrapping_key) not in [16, 24, 32]:
- raise ValueError("The wrapping key must be a valid AES key length")
-
- if len(wrapped_key) == 16:
- # RFC 5649 - 4.2 - exactly two 64-bit blocks
- decryptor = Cipher(AES(wrapping_key), ECB(), backend).decryptor()
- b = decryptor.update(wrapped_key)
- assert decryptor.finalize() == b""
- a = b[:8]
- data = b[8:]
- n = 1
- else:
- r = [wrapped_key[i:i + 8] for i in range(0, len(wrapped_key), 8)]
- encrypted_aiv = r.pop(0)
- n = len(r)
- a, r = _unwrap_core(wrapping_key, encrypted_aiv, r, backend)
- data = b"".join(r)
-
- # 1) Check that MSB(32,A) = A65959A6.
- # 2) Check that 8*(n-1) < LSB(32,A) <= 8*n. If so, let
- # MLI = LSB(32,A).
- # 3) Let b = (8*n)-MLI, and then check that the rightmost b octets of
- # the output data are zero.
- (mli,) = struct.unpack(">I", a[4:])
- b = (8 * n) - mli
- if (
- not bytes_eq(a[:4], b"\xa6\x59\x59\xa6") or not
- 8 * (n - 1) < mli <= 8 * n or (
- b != 0 and not bytes_eq(data[-b:], b"\x00" * b)
- )
- ):
- raise InvalidUnwrap()
-
- if b == 0:
- return data
- else:
- return data[:-b]
-
-
-def aes_key_unwrap(wrapping_key, wrapped_key, backend):
- if len(wrapped_key) < 24:
- raise InvalidUnwrap("Must be at least 24 bytes")
-
- if len(wrapped_key) % 8 != 0:
- raise InvalidUnwrap("The wrapped key must be a multiple of 8 bytes")
-
- if len(wrapping_key) not in [16, 24, 32]:
- raise ValueError("The wrapping key must be a valid AES key length")
-
- aiv = b"\xa6\xa6\xa6\xa6\xa6\xa6\xa6\xa6"
- r = [wrapped_key[i:i + 8] for i in range(0, len(wrapped_key), 8)]
- a = r.pop(0)
- a, r = _unwrap_core(wrapping_key, a, r, backend)
- if not bytes_eq(a, aiv):
- raise InvalidUnwrap()
-
- return b"".join(r)
-
-
-class InvalidUnwrap(Exception):
- pass
diff --git a/lib/cryptography/hazmat/primitives/mac.py b/lib/cryptography/hazmat/primitives/mac.py
deleted file mode 100644
index 4c95190ba1..0000000000
--- a/lib/cryptography/hazmat/primitives/mac.py
+++ /dev/null
@@ -1,37 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import abc
-
-import six
-
-
-@six.add_metaclass(abc.ABCMeta)
-class MACContext(object):
- @abc.abstractmethod
- def update(self, data):
- """
- Processes the provided bytes.
- """
-
- @abc.abstractmethod
- def finalize(self):
- """
- Returns the message authentication code as bytes.
- """
-
- @abc.abstractmethod
- def copy(self):
- """
- Return a MACContext that is a copy of the current context.
- """
-
- @abc.abstractmethod
- def verify(self, signature):
- """
- Checks if the generated message authentication code matches the
- signature.
- """
diff --git a/lib/cryptography/hazmat/primitives/padding.py b/lib/cryptography/hazmat/primitives/padding.py
deleted file mode 100644
index a081976edd..0000000000
--- a/lib/cryptography/hazmat/primitives/padding.py
+++ /dev/null
@@ -1,202 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import abc
-
-import six
-
-from cryptography import utils
-from cryptography.exceptions import AlreadyFinalized
-from cryptography.hazmat.bindings._padding import lib
-
-
-@six.add_metaclass(abc.ABCMeta)
-class PaddingContext(object):
- @abc.abstractmethod
- def update(self, data):
- """
- Pads the provided bytes and returns any available data as bytes.
- """
-
- @abc.abstractmethod
- def finalize(self):
- """
- Finalize the padding, returns bytes.
- """
-
-
-def _byte_padding_check(block_size):
- if not (0 <= block_size <= 2040):
- raise ValueError("block_size must be in range(0, 2041).")
-
- if block_size % 8 != 0:
- raise ValueError("block_size must be a multiple of 8.")
-
-
-def _byte_padding_update(buffer_, data, block_size):
- if buffer_ is None:
- raise AlreadyFinalized("Context was already finalized.")
-
- if not isinstance(data, bytes):
- raise TypeError("data must be bytes.")
-
- buffer_ += data
-
- finished_blocks = len(buffer_) // (block_size // 8)
-
- result = buffer_[:finished_blocks * (block_size // 8)]
- buffer_ = buffer_[finished_blocks * (block_size // 8):]
-
- return buffer_, result
-
-
-def _byte_padding_pad(buffer_, block_size, paddingfn):
- if buffer_ is None:
- raise AlreadyFinalized("Context was already finalized.")
-
- pad_size = block_size // 8 - len(buffer_)
- return buffer_ + paddingfn(pad_size)
-
-
-def _byte_unpadding_update(buffer_, data, block_size):
- if buffer_ is None:
- raise AlreadyFinalized("Context was already finalized.")
-
- if not isinstance(data, bytes):
- raise TypeError("data must be bytes.")
-
- buffer_ += data
-
- finished_blocks = max(len(buffer_) // (block_size // 8) - 1, 0)
-
- result = buffer_[:finished_blocks * (block_size // 8)]
- buffer_ = buffer_[finished_blocks * (block_size // 8):]
-
- return buffer_, result
-
-
-def _byte_unpadding_check(buffer_, block_size, checkfn):
- if buffer_ is None:
- raise AlreadyFinalized("Context was already finalized.")
-
- if len(buffer_) != block_size // 8:
- raise ValueError("Invalid padding bytes.")
-
- valid = checkfn(buffer_, block_size // 8)
-
- if not valid:
- raise ValueError("Invalid padding bytes.")
-
- pad_size = six.indexbytes(buffer_, -1)
- return buffer_[:-pad_size]
-
-
-class PKCS7(object):
- def __init__(self, block_size):
- _byte_padding_check(block_size)
- self.block_size = block_size
-
- def padder(self):
- return _PKCS7PaddingContext(self.block_size)
-
- def unpadder(self):
- return _PKCS7UnpaddingContext(self.block_size)
-
-
-@utils.register_interface(PaddingContext)
-class _PKCS7PaddingContext(object):
- def __init__(self, block_size):
- self.block_size = block_size
- # TODO: more copies than necessary, we should use zero-buffer (#193)
- self._buffer = b""
-
- def update(self, data):
- self._buffer, result = _byte_padding_update(
- self._buffer, data, self.block_size)
- return result
-
- def _padding(self, size):
- return six.int2byte(size) * size
-
- def finalize(self):
- result = _byte_padding_pad(
- self._buffer, self.block_size, self._padding)
- self._buffer = None
- return result
-
-
-@utils.register_interface(PaddingContext)
-class _PKCS7UnpaddingContext(object):
- def __init__(self, block_size):
- self.block_size = block_size
- # TODO: more copies than necessary, we should use zero-buffer (#193)
- self._buffer = b""
-
- def update(self, data):
- self._buffer, result = _byte_unpadding_update(
- self._buffer, data, self.block_size)
- return result
-
- def finalize(self):
- result = _byte_unpadding_check(
- self._buffer, self.block_size,
- lib.Cryptography_check_pkcs7_padding)
- self._buffer = None
- return result
-
-
-class ANSIX923(object):
- def __init__(self, block_size):
- _byte_padding_check(block_size)
- self.block_size = block_size
-
- def padder(self):
- return _ANSIX923PaddingContext(self.block_size)
-
- def unpadder(self):
- return _ANSIX923UnpaddingContext(self.block_size)
-
-
-@utils.register_interface(PaddingContext)
-class _ANSIX923PaddingContext(object):
- def __init__(self, block_size):
- self.block_size = block_size
- # TODO: more copies than necessary, we should use zero-buffer (#193)
- self._buffer = b""
-
- def update(self, data):
- self._buffer, result = _byte_padding_update(
- self._buffer, data, self.block_size)
- return result
-
- def _padding(self, size):
- return six.int2byte(0) * (size - 1) + six.int2byte(size)
-
- def finalize(self):
- result = _byte_padding_pad(
- self._buffer, self.block_size, self._padding)
- self._buffer = None
- return result
-
-
-@utils.register_interface(PaddingContext)
-class _ANSIX923UnpaddingContext(object):
- def __init__(self, block_size):
- self.block_size = block_size
- # TODO: more copies than necessary, we should use zero-buffer (#193)
- self._buffer = b""
-
- def update(self, data):
- self._buffer, result = _byte_unpadding_update(
- self._buffer, data, self.block_size)
- return result
-
- def finalize(self):
- result = _byte_unpadding_check(
- self._buffer, self.block_size,
- lib.Cryptography_check_ansix923_padding)
- self._buffer = None
- return result
diff --git a/lib/cryptography/hazmat/primitives/serialization.py b/lib/cryptography/hazmat/primitives/serialization.py
deleted file mode 100644
index bd09e6e3a7..0000000000
--- a/lib/cryptography/hazmat/primitives/serialization.py
+++ /dev/null
@@ -1,209 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import abc
-import base64
-import struct
-from enum import Enum
-
-import six
-
-from cryptography import utils
-from cryptography.exceptions import UnsupportedAlgorithm
-from cryptography.hazmat.primitives.asymmetric import dsa, ec, rsa
-
-
-def load_pem_private_key(data, password, backend):
- return backend.load_pem_private_key(data, password)
-
-
-def load_pem_public_key(data, backend):
- return backend.load_pem_public_key(data)
-
-
-def load_pem_parameters(data, backend):
- return backend.load_pem_parameters(data)
-
-
-def load_der_private_key(data, password, backend):
- return backend.load_der_private_key(data, password)
-
-
-def load_der_public_key(data, backend):
- return backend.load_der_public_key(data)
-
-
-def load_der_parameters(data, backend):
- return backend.load_der_parameters(data)
-
-
-def load_ssh_public_key(data, backend):
- key_parts = data.split(b' ', 2)
-
- if len(key_parts) < 2:
- raise ValueError(
- 'Key is not in the proper format or contains extra data.')
-
- key_type = key_parts[0]
-
- if key_type == b'ssh-rsa':
- loader = _load_ssh_rsa_public_key
- elif key_type == b'ssh-dss':
- loader = _load_ssh_dss_public_key
- elif key_type in [
- b'ecdsa-sha2-nistp256', b'ecdsa-sha2-nistp384', b'ecdsa-sha2-nistp521',
- ]:
- loader = _load_ssh_ecdsa_public_key
- else:
- raise UnsupportedAlgorithm('Key type is not supported.')
-
- key_body = key_parts[1]
-
- try:
- decoded_data = base64.b64decode(key_body)
- except TypeError:
- raise ValueError('Key is not in the proper format.')
-
- inner_key_type, rest = _ssh_read_next_string(decoded_data)
-
- if inner_key_type != key_type:
- raise ValueError(
- 'Key header and key body contain different key type values.'
- )
-
- return loader(key_type, rest, backend)
-
-
-def _load_ssh_rsa_public_key(key_type, decoded_data, backend):
- e, rest = _ssh_read_next_mpint(decoded_data)
- n, rest = _ssh_read_next_mpint(rest)
-
- if rest:
- raise ValueError('Key body contains extra bytes.')
-
- return rsa.RSAPublicNumbers(e, n).public_key(backend)
-
-
-def _load_ssh_dss_public_key(key_type, decoded_data, backend):
- p, rest = _ssh_read_next_mpint(decoded_data)
- q, rest = _ssh_read_next_mpint(rest)
- g, rest = _ssh_read_next_mpint(rest)
- y, rest = _ssh_read_next_mpint(rest)
-
- if rest:
- raise ValueError('Key body contains extra bytes.')
-
- parameter_numbers = dsa.DSAParameterNumbers(p, q, g)
- public_numbers = dsa.DSAPublicNumbers(y, parameter_numbers)
-
- return public_numbers.public_key(backend)
-
-
-def _load_ssh_ecdsa_public_key(expected_key_type, decoded_data, backend):
- curve_name, rest = _ssh_read_next_string(decoded_data)
- data, rest = _ssh_read_next_string(rest)
-
- if expected_key_type != b"ecdsa-sha2-" + curve_name:
- raise ValueError(
- 'Key header and key body contain different key type values.'
- )
-
- if rest:
- raise ValueError('Key body contains extra bytes.')
-
- curve = {
- b"nistp256": ec.SECP256R1,
- b"nistp384": ec.SECP384R1,
- b"nistp521": ec.SECP521R1,
- }[curve_name]()
-
- if six.indexbytes(data, 0) != 4:
- raise NotImplementedError(
- "Compressed elliptic curve points are not supported"
- )
-
- numbers = ec.EllipticCurvePublicNumbers.from_encoded_point(curve, data)
- return numbers.public_key(backend)
-
-
-def _ssh_read_next_string(data):
- """
- Retrieves the next RFC 4251 string value from the data.
-
- While the RFC calls these strings, in Python they are bytes objects.
- """
- if len(data) < 4:
- raise ValueError("Key is not in the proper format")
-
- str_len, = struct.unpack('>I', data[:4])
- if len(data) < str_len + 4:
- raise ValueError("Key is not in the proper format")
-
- return data[4:4 + str_len], data[4 + str_len:]
-
-
-def _ssh_read_next_mpint(data):
- """
- Reads the next mpint from the data.
-
- Currently, all mpints are interpreted as unsigned.
- """
- mpint_data, rest = _ssh_read_next_string(data)
-
- return (
- utils.int_from_bytes(mpint_data, byteorder='big', signed=False), rest
- )
-
-
-def _ssh_write_string(data):
- return struct.pack(">I", len(data)) + data
-
-
-def _ssh_write_mpint(value):
- data = utils.int_to_bytes(value)
- if six.indexbytes(data, 0) & 0x80:
- data = b"\x00" + data
- return _ssh_write_string(data)
-
-
-class Encoding(Enum):
- PEM = "PEM"
- DER = "DER"
- OpenSSH = "OpenSSH"
-
-
-class PrivateFormat(Enum):
- PKCS8 = "PKCS8"
- TraditionalOpenSSL = "TraditionalOpenSSL"
-
-
-class PublicFormat(Enum):
- SubjectPublicKeyInfo = "X.509 subjectPublicKeyInfo with PKCS#1"
- PKCS1 = "Raw PKCS#1"
- OpenSSH = "OpenSSH"
-
-
-class ParameterFormat(Enum):
- PKCS3 = "PKCS3"
-
-
-@six.add_metaclass(abc.ABCMeta)
-class KeySerializationEncryption(object):
- pass
-
-
-@utils.register_interface(KeySerializationEncryption)
-class BestAvailableEncryption(object):
- def __init__(self, password):
- if not isinstance(password, bytes) or len(password) == 0:
- raise ValueError("Password must be 1 or more bytes.")
-
- self.password = password
-
-
-@utils.register_interface(KeySerializationEncryption)
-class NoEncryption(object):
- pass
diff --git a/lib/cryptography/hazmat/primitives/twofactor/__init__.py b/lib/cryptography/hazmat/primitives/twofactor/__init__.py
deleted file mode 100644
index e71f9e67a3..0000000000
--- a/lib/cryptography/hazmat/primitives/twofactor/__init__.py
+++ /dev/null
@@ -1,9 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-
-class InvalidToken(Exception):
- pass
diff --git a/lib/cryptography/hazmat/primitives/twofactor/hotp.py b/lib/cryptography/hazmat/primitives/twofactor/hotp.py
deleted file mode 100644
index 4ad1bdc2f0..0000000000
--- a/lib/cryptography/hazmat/primitives/twofactor/hotp.py
+++ /dev/null
@@ -1,68 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import struct
-
-import six
-
-from cryptography.exceptions import (
- UnsupportedAlgorithm, _Reasons
-)
-from cryptography.hazmat.backends.interfaces import HMACBackend
-from cryptography.hazmat.primitives import constant_time, hmac
-from cryptography.hazmat.primitives.hashes import SHA1, SHA256, SHA512
-from cryptography.hazmat.primitives.twofactor import InvalidToken
-from cryptography.hazmat.primitives.twofactor.utils import _generate_uri
-
-
-class HOTP(object):
- def __init__(self, key, length, algorithm, backend,
- enforce_key_length=True):
- if not isinstance(backend, HMACBackend):
- raise UnsupportedAlgorithm(
- "Backend object does not implement HMACBackend.",
- _Reasons.BACKEND_MISSING_INTERFACE
- )
-
- if len(key) < 16 and enforce_key_length is True:
- raise ValueError("Key length has to be at least 128 bits.")
-
- if not isinstance(length, six.integer_types):
- raise TypeError("Length parameter must be an integer type.")
-
- if length < 6 or length > 8:
- raise ValueError("Length of HOTP has to be between 6 to 8.")
-
- if not isinstance(algorithm, (SHA1, SHA256, SHA512)):
- raise TypeError("Algorithm must be SHA1, SHA256 or SHA512.")
-
- self._key = key
- self._length = length
- self._algorithm = algorithm
- self._backend = backend
-
- def generate(self, counter):
- truncated_value = self._dynamic_truncate(counter)
- hotp = truncated_value % (10 ** self._length)
- return "{0:0{1}}".format(hotp, self._length).encode()
-
- def verify(self, hotp, counter):
- if not constant_time.bytes_eq(self.generate(counter), hotp):
- raise InvalidToken("Supplied HOTP value does not match.")
-
- def _dynamic_truncate(self, counter):
- ctx = hmac.HMAC(self._key, self._algorithm, self._backend)
- ctx.update(struct.pack(">Q", counter))
- hmac_value = ctx.finalize()
-
- offset = six.indexbytes(hmac_value, len(hmac_value) - 1) & 0b1111
- p = hmac_value[offset:offset + 4]
- return struct.unpack(">I", p)[0] & 0x7fffffff
-
- def get_provisioning_uri(self, account_name, counter, issuer):
- return _generate_uri(self, "hotp", account_name, issuer, [
- ("counter", int(counter)),
- ])
diff --git a/lib/cryptography/hazmat/primitives/twofactor/totp.py b/lib/cryptography/hazmat/primitives/twofactor/totp.py
deleted file mode 100644
index 499f2824a8..0000000000
--- a/lib/cryptography/hazmat/primitives/twofactor/totp.py
+++ /dev/null
@@ -1,40 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-from cryptography.exceptions import (
- UnsupportedAlgorithm, _Reasons
-)
-from cryptography.hazmat.backends.interfaces import HMACBackend
-from cryptography.hazmat.primitives import constant_time
-from cryptography.hazmat.primitives.twofactor import InvalidToken
-from cryptography.hazmat.primitives.twofactor.hotp import HOTP
-from cryptography.hazmat.primitives.twofactor.utils import _generate_uri
-
-
-class TOTP(object):
- def __init__(self, key, length, algorithm, time_step, backend,
- enforce_key_length=True):
- if not isinstance(backend, HMACBackend):
- raise UnsupportedAlgorithm(
- "Backend object does not implement HMACBackend.",
- _Reasons.BACKEND_MISSING_INTERFACE
- )
-
- self._time_step = time_step
- self._hotp = HOTP(key, length, algorithm, backend, enforce_key_length)
-
- def generate(self, time):
- counter = int(time / self._time_step)
- return self._hotp.generate(counter)
-
- def verify(self, totp, time):
- if not constant_time.bytes_eq(self.generate(time), totp):
- raise InvalidToken("Supplied TOTP value does not match.")
-
- def get_provisioning_uri(self, account_name, issuer):
- return _generate_uri(self._hotp, "totp", account_name, issuer, [
- ("period", int(self._time_step)),
- ])
diff --git a/lib/cryptography/hazmat/primitives/twofactor/utils.py b/lib/cryptography/hazmat/primitives/twofactor/utils.py
deleted file mode 100644
index 0ed8c4c89d..0000000000
--- a/lib/cryptography/hazmat/primitives/twofactor/utils.py
+++ /dev/null
@@ -1,30 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import base64
-
-from six.moves.urllib.parse import quote, urlencode
-
-
-def _generate_uri(hotp, type_name, account_name, issuer, extra_parameters):
- parameters = [
- ("digits", hotp._length),
- ("secret", base64.b32encode(hotp._key)),
- ("algorithm", hotp._algorithm.name.upper()),
- ]
-
- if issuer is not None:
- parameters.append(("issuer", issuer))
-
- parameters.extend(extra_parameters)
-
- uriparts = {
- "type": type_name,
- "label": ("%s:%s" % (quote(issuer), quote(account_name)) if issuer
- else quote(account_name)),
- "parameters": urlencode(parameters),
- }
- return "otpauth://{type}/{label}?{parameters}".format(**uriparts)
diff --git a/lib/cryptography/utils.py b/lib/cryptography/utils.py
deleted file mode 100644
index 3d45a77131..0000000000
--- a/lib/cryptography/utils.py
+++ /dev/null
@@ -1,165 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import abc
-import binascii
-import inspect
-import sys
-import warnings
-
-
-# We use a UserWarning subclass, instead of DeprecationWarning, because CPython
-# decided deprecation warnings should be invisble by default.
-class CryptographyDeprecationWarning(UserWarning):
- pass
-
-
-# Several APIs were deprecated with no specific end-of-life date because of the
-# ubiquity of their use. They should not be removed until we agree on when that
-# cycle ends.
-PersistentlyDeprecated = CryptographyDeprecationWarning
-DeprecatedIn21 = CryptographyDeprecationWarning
-DeprecatedIn23 = CryptographyDeprecationWarning
-
-
-def _check_bytes(name, value):
- if not isinstance(value, bytes):
- raise TypeError("{0} must be bytes".format(name))
-
-
-def read_only_property(name):
- return property(lambda self: getattr(self, name))
-
-
-def register_interface(iface):
- def register_decorator(klass):
- verify_interface(iface, klass)
- iface.register(klass)
- return klass
- return register_decorator
-
-
-def register_interface_if(predicate, iface):
- def register_decorator(klass):
- if predicate:
- verify_interface(iface, klass)
- iface.register(klass)
- return klass
- return register_decorator
-
-
-if hasattr(int, "from_bytes"):
- int_from_bytes = int.from_bytes
-else:
- def int_from_bytes(data, byteorder, signed=False):
- assert byteorder == 'big'
- assert not signed
-
- return int(binascii.hexlify(data), 16)
-
-
-if hasattr(int, "to_bytes"):
- def int_to_bytes(integer, length=None):
- return integer.to_bytes(
- length or (integer.bit_length() + 7) // 8 or 1, 'big'
- )
-else:
- def int_to_bytes(integer, length=None):
- hex_string = '%x' % integer
- if length is None:
- n = len(hex_string)
- else:
- n = length * 2
- return binascii.unhexlify(hex_string.zfill(n + (n & 1)))
-
-
-class InterfaceNotImplemented(Exception):
- pass
-
-
-if hasattr(inspect, "signature"):
- signature = inspect.signature
-else:
- signature = inspect.getargspec
-
-
-def verify_interface(iface, klass):
- for method in iface.__abstractmethods__:
- if not hasattr(klass, method):
- raise InterfaceNotImplemented(
- "{0} is missing a {1!r} method".format(klass, method)
- )
- if isinstance(getattr(iface, method), abc.abstractproperty):
- # Can't properly verify these yet.
- continue
- sig = signature(getattr(iface, method))
- actual = signature(getattr(klass, method))
- if sig != actual:
- raise InterfaceNotImplemented(
- "{0}.{1}'s signature differs from the expected. Expected: "
- "{2!r}. Received: {3!r}".format(
- klass, method, sig, actual
- )
- )
-
-
-# No longer needed as of 2.2, but retained because we have external consumers
-# who use it.
-def bit_length(x):
- return x.bit_length()
-
-
-class _DeprecatedValue(object):
- def __init__(self, value, message, warning_class):
- self.value = value
- self.message = message
- self.warning_class = warning_class
-
-
-class _ModuleWithDeprecations(object):
- def __init__(self, module):
- self.__dict__["_module"] = module
-
- def __getattr__(self, attr):
- obj = getattr(self._module, attr)
- if isinstance(obj, _DeprecatedValue):
- warnings.warn(obj.message, obj.warning_class, stacklevel=2)
- obj = obj.value
- return obj
-
- def __setattr__(self, attr, value):
- setattr(self._module, attr, value)
-
- def __delattr__(self, attr):
- obj = getattr(self._module, attr)
- if isinstance(obj, _DeprecatedValue):
- warnings.warn(obj.message, obj.warning_class, stacklevel=2)
-
- delattr(self._module, attr)
-
- def __dir__(self):
- return ["_module"] + dir(self._module)
-
-
-def deprecated(value, module_name, message, warning_class):
- module = sys.modules[module_name]
- if not isinstance(module, _ModuleWithDeprecations):
- sys.modules[module_name] = _ModuleWithDeprecations(module)
- return _DeprecatedValue(value, message, warning_class)
-
-
-def cached_property(func):
- cached_name = "_cached_{0}".format(func)
- sentinel = object()
-
- def inner(instance):
- cache = getattr(instance, cached_name, sentinel)
- if cache is not sentinel:
- return cache
- result = func(instance)
- setattr(instance, cached_name, result)
- return result
- return property(inner)
diff --git a/lib/cryptography/x509/__init__.py b/lib/cryptography/x509/__init__.py
deleted file mode 100644
index fd0194555e..0000000000
--- a/lib/cryptography/x509/__init__.py
+++ /dev/null
@@ -1,188 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-from cryptography.x509 import certificate_transparency
-from cryptography.x509.base import (
- Certificate, CertificateBuilder, CertificateRevocationList,
- CertificateRevocationListBuilder,
- CertificateSigningRequest, CertificateSigningRequestBuilder,
- InvalidVersion, RevokedCertificate, RevokedCertificateBuilder,
- Version, load_der_x509_certificate, load_der_x509_crl, load_der_x509_csr,
- load_pem_x509_certificate, load_pem_x509_crl, load_pem_x509_csr,
- random_serial_number,
-)
-from cryptography.x509.extensions import (
- AccessDescription, AuthorityInformationAccess,
- AuthorityKeyIdentifier, BasicConstraints, CRLDistributionPoints,
- CRLNumber, CRLReason, CertificateIssuer, CertificatePolicies,
- DeltaCRLIndicator, DistributionPoint, DuplicateExtension, ExtendedKeyUsage,
- Extension, ExtensionNotFound, ExtensionType, Extensions, FreshestCRL,
- GeneralNames, InhibitAnyPolicy, InvalidityDate, IssuerAlternativeName,
- KeyUsage, NameConstraints, NoticeReference, OCSPNoCheck, OCSPNonce,
- PolicyConstraints, PolicyInformation, PrecertPoison,
- PrecertificateSignedCertificateTimestamps, ReasonFlags,
- SubjectAlternativeName, SubjectKeyIdentifier, TLSFeature, TLSFeatureType,
- UnrecognizedExtension, UserNotice
-)
-from cryptography.x509.general_name import (
- DNSName, DirectoryName, GeneralName, IPAddress, OtherName, RFC822Name,
- RegisteredID, UniformResourceIdentifier, UnsupportedGeneralNameType,
- _GENERAL_NAMES
-)
-from cryptography.x509.name import (
- Name, NameAttribute, RelativeDistinguishedName
-)
-from cryptography.x509.oid import (
- AuthorityInformationAccessOID, CRLEntryExtensionOID,
- CertificatePoliciesOID, ExtendedKeyUsageOID, ExtensionOID, NameOID,
- ObjectIdentifier, SignatureAlgorithmOID, _SIG_OIDS_TO_HASH
-)
-
-
-OID_AUTHORITY_INFORMATION_ACCESS = ExtensionOID.AUTHORITY_INFORMATION_ACCESS
-OID_AUTHORITY_KEY_IDENTIFIER = ExtensionOID.AUTHORITY_KEY_IDENTIFIER
-OID_BASIC_CONSTRAINTS = ExtensionOID.BASIC_CONSTRAINTS
-OID_CERTIFICATE_POLICIES = ExtensionOID.CERTIFICATE_POLICIES
-OID_CRL_DISTRIBUTION_POINTS = ExtensionOID.CRL_DISTRIBUTION_POINTS
-OID_EXTENDED_KEY_USAGE = ExtensionOID.EXTENDED_KEY_USAGE
-OID_FRESHEST_CRL = ExtensionOID.FRESHEST_CRL
-OID_INHIBIT_ANY_POLICY = ExtensionOID.INHIBIT_ANY_POLICY
-OID_ISSUER_ALTERNATIVE_NAME = ExtensionOID.ISSUER_ALTERNATIVE_NAME
-OID_KEY_USAGE = ExtensionOID.KEY_USAGE
-OID_NAME_CONSTRAINTS = ExtensionOID.NAME_CONSTRAINTS
-OID_OCSP_NO_CHECK = ExtensionOID.OCSP_NO_CHECK
-OID_POLICY_CONSTRAINTS = ExtensionOID.POLICY_CONSTRAINTS
-OID_POLICY_MAPPINGS = ExtensionOID.POLICY_MAPPINGS
-OID_SUBJECT_ALTERNATIVE_NAME = ExtensionOID.SUBJECT_ALTERNATIVE_NAME
-OID_SUBJECT_DIRECTORY_ATTRIBUTES = ExtensionOID.SUBJECT_DIRECTORY_ATTRIBUTES
-OID_SUBJECT_INFORMATION_ACCESS = ExtensionOID.SUBJECT_INFORMATION_ACCESS
-OID_SUBJECT_KEY_IDENTIFIER = ExtensionOID.SUBJECT_KEY_IDENTIFIER
-
-OID_DSA_WITH_SHA1 = SignatureAlgorithmOID.DSA_WITH_SHA1
-OID_DSA_WITH_SHA224 = SignatureAlgorithmOID.DSA_WITH_SHA224
-OID_DSA_WITH_SHA256 = SignatureAlgorithmOID.DSA_WITH_SHA256
-OID_ECDSA_WITH_SHA1 = SignatureAlgorithmOID.ECDSA_WITH_SHA1
-OID_ECDSA_WITH_SHA224 = SignatureAlgorithmOID.ECDSA_WITH_SHA224
-OID_ECDSA_WITH_SHA256 = SignatureAlgorithmOID.ECDSA_WITH_SHA256
-OID_ECDSA_WITH_SHA384 = SignatureAlgorithmOID.ECDSA_WITH_SHA384
-OID_ECDSA_WITH_SHA512 = SignatureAlgorithmOID.ECDSA_WITH_SHA512
-OID_RSA_WITH_MD5 = SignatureAlgorithmOID.RSA_WITH_MD5
-OID_RSA_WITH_SHA1 = SignatureAlgorithmOID.RSA_WITH_SHA1
-OID_RSA_WITH_SHA224 = SignatureAlgorithmOID.RSA_WITH_SHA224
-OID_RSA_WITH_SHA256 = SignatureAlgorithmOID.RSA_WITH_SHA256
-OID_RSA_WITH_SHA384 = SignatureAlgorithmOID.RSA_WITH_SHA384
-OID_RSA_WITH_SHA512 = SignatureAlgorithmOID.RSA_WITH_SHA512
-OID_RSASSA_PSS = SignatureAlgorithmOID.RSASSA_PSS
-
-OID_COMMON_NAME = NameOID.COMMON_NAME
-OID_COUNTRY_NAME = NameOID.COUNTRY_NAME
-OID_DOMAIN_COMPONENT = NameOID.DOMAIN_COMPONENT
-OID_DN_QUALIFIER = NameOID.DN_QUALIFIER
-OID_EMAIL_ADDRESS = NameOID.EMAIL_ADDRESS
-OID_GENERATION_QUALIFIER = NameOID.GENERATION_QUALIFIER
-OID_GIVEN_NAME = NameOID.GIVEN_NAME
-OID_LOCALITY_NAME = NameOID.LOCALITY_NAME
-OID_ORGANIZATIONAL_UNIT_NAME = NameOID.ORGANIZATIONAL_UNIT_NAME
-OID_ORGANIZATION_NAME = NameOID.ORGANIZATION_NAME
-OID_PSEUDONYM = NameOID.PSEUDONYM
-OID_SERIAL_NUMBER = NameOID.SERIAL_NUMBER
-OID_STATE_OR_PROVINCE_NAME = NameOID.STATE_OR_PROVINCE_NAME
-OID_SURNAME = NameOID.SURNAME
-OID_TITLE = NameOID.TITLE
-
-OID_CLIENT_AUTH = ExtendedKeyUsageOID.CLIENT_AUTH
-OID_CODE_SIGNING = ExtendedKeyUsageOID.CODE_SIGNING
-OID_EMAIL_PROTECTION = ExtendedKeyUsageOID.EMAIL_PROTECTION
-OID_OCSP_SIGNING = ExtendedKeyUsageOID.OCSP_SIGNING
-OID_SERVER_AUTH = ExtendedKeyUsageOID.SERVER_AUTH
-OID_TIME_STAMPING = ExtendedKeyUsageOID.TIME_STAMPING
-
-OID_ANY_POLICY = CertificatePoliciesOID.ANY_POLICY
-OID_CPS_QUALIFIER = CertificatePoliciesOID.CPS_QUALIFIER
-OID_CPS_USER_NOTICE = CertificatePoliciesOID.CPS_USER_NOTICE
-
-OID_CERTIFICATE_ISSUER = CRLEntryExtensionOID.CERTIFICATE_ISSUER
-OID_CRL_REASON = CRLEntryExtensionOID.CRL_REASON
-OID_INVALIDITY_DATE = CRLEntryExtensionOID.INVALIDITY_DATE
-
-OID_CA_ISSUERS = AuthorityInformationAccessOID.CA_ISSUERS
-OID_OCSP = AuthorityInformationAccessOID.OCSP
-
-__all__ = [
- "certificate_transparency",
- "load_pem_x509_certificate",
- "load_der_x509_certificate",
- "load_pem_x509_csr",
- "load_der_x509_csr",
- "load_pem_x509_crl",
- "load_der_x509_crl",
- "random_serial_number",
- "InvalidVersion",
- "DeltaCRLIndicator",
- "DuplicateExtension",
- "ExtensionNotFound",
- "UnsupportedGeneralNameType",
- "NameAttribute",
- "Name",
- "RelativeDistinguishedName",
- "ObjectIdentifier",
- "ExtensionType",
- "Extensions",
- "Extension",
- "ExtendedKeyUsage",
- "FreshestCRL",
- "TLSFeature",
- "TLSFeatureType",
- "OCSPNoCheck",
- "BasicConstraints",
- "CRLNumber",
- "KeyUsage",
- "AuthorityInformationAccess",
- "AccessDescription",
- "CertificatePolicies",
- "PolicyInformation",
- "UserNotice",
- "NoticeReference",
- "SubjectKeyIdentifier",
- "NameConstraints",
- "CRLDistributionPoints",
- "DistributionPoint",
- "ReasonFlags",
- "InhibitAnyPolicy",
- "SubjectAlternativeName",
- "IssuerAlternativeName",
- "AuthorityKeyIdentifier",
- "GeneralNames",
- "GeneralName",
- "RFC822Name",
- "DNSName",
- "UniformResourceIdentifier",
- "RegisteredID",
- "DirectoryName",
- "IPAddress",
- "OtherName",
- "Certificate",
- "CertificateRevocationList",
- "CertificateRevocationListBuilder",
- "CertificateSigningRequest",
- "RevokedCertificate",
- "RevokedCertificateBuilder",
- "CertificateSigningRequestBuilder",
- "CertificateBuilder",
- "Version",
- "_SIG_OIDS_TO_HASH",
- "OID_CA_ISSUERS",
- "OID_OCSP",
- "_GENERAL_NAMES",
- "CertificateIssuer",
- "CRLReason",
- "InvalidityDate",
- "UnrecognizedExtension",
- "PolicyConstraints",
- "PrecertificateSignedCertificateTimestamps",
- "PrecertPoison",
- "OCSPNonce",
-]
diff --git a/lib/cryptography/x509/base.py b/lib/cryptography/x509/base.py
deleted file mode 100644
index a3b334a149..0000000000
--- a/lib/cryptography/x509/base.py
+++ /dev/null
@@ -1,753 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import abc
-import datetime
-import os
-from enum import Enum
-
-import six
-
-from cryptography import utils
-from cryptography.hazmat.primitives.asymmetric import dsa, ec, rsa
-from cryptography.x509.extensions import Extension, ExtensionType
-from cryptography.x509.name import Name
-
-
-_UNIX_EPOCH = datetime.datetime(1970, 1, 1)
-
-
-def _reject_duplicate_extension(extension, extensions):
- # This is quadratic in the number of extensions
- for e in extensions:
- if e.oid == extension.oid:
- raise ValueError('This extension has already been set.')
-
-
-def _convert_to_naive_utc_time(time):
- """Normalizes a datetime to a naive datetime in UTC.
-
- time -- datetime to normalize. Assumed to be in UTC if not timezone
- aware.
- """
- if time.tzinfo is not None:
- offset = time.utcoffset()
- offset = offset if offset else datetime.timedelta()
- return time.replace(tzinfo=None) - offset
- else:
- return time
-
-
-class Version(Enum):
- v1 = 0
- v3 = 2
-
-
-def load_pem_x509_certificate(data, backend):
- return backend.load_pem_x509_certificate(data)
-
-
-def load_der_x509_certificate(data, backend):
- return backend.load_der_x509_certificate(data)
-
-
-def load_pem_x509_csr(data, backend):
- return backend.load_pem_x509_csr(data)
-
-
-def load_der_x509_csr(data, backend):
- return backend.load_der_x509_csr(data)
-
-
-def load_pem_x509_crl(data, backend):
- return backend.load_pem_x509_crl(data)
-
-
-def load_der_x509_crl(data, backend):
- return backend.load_der_x509_crl(data)
-
-
-class InvalidVersion(Exception):
- def __init__(self, msg, parsed_version):
- super(InvalidVersion, self).__init__(msg)
- self.parsed_version = parsed_version
-
-
-@six.add_metaclass(abc.ABCMeta)
-class Certificate(object):
- @abc.abstractmethod
- def fingerprint(self, algorithm):
- """
- Returns bytes using digest passed.
- """
-
- @abc.abstractproperty
- def serial_number(self):
- """
- Returns certificate serial number
- """
-
- @abc.abstractproperty
- def version(self):
- """
- Returns the certificate version
- """
-
- @abc.abstractmethod
- def public_key(self):
- """
- Returns the public key
- """
-
- @abc.abstractproperty
- def not_valid_before(self):
- """
- Not before time (represented as UTC datetime)
- """
-
- @abc.abstractproperty
- def not_valid_after(self):
- """
- Not after time (represented as UTC datetime)
- """
-
- @abc.abstractproperty
- def issuer(self):
- """
- Returns the issuer name object.
- """
-
- @abc.abstractproperty
- def subject(self):
- """
- Returns the subject name object.
- """
-
- @abc.abstractproperty
- def signature_hash_algorithm(self):
- """
- Returns a HashAlgorithm corresponding to the type of the digest signed
- in the certificate.
- """
-
- @abc.abstractproperty
- def signature_algorithm_oid(self):
- """
- Returns the ObjectIdentifier of the signature algorithm.
- """
-
- @abc.abstractproperty
- def extensions(self):
- """
- Returns an Extensions object.
- """
-
- @abc.abstractproperty
- def signature(self):
- """
- Returns the signature bytes.
- """
-
- @abc.abstractproperty
- def tbs_certificate_bytes(self):
- """
- Returns the tbsCertificate payload bytes as defined in RFC 5280.
- """
-
- @abc.abstractmethod
- def __eq__(self, other):
- """
- Checks equality.
- """
-
- @abc.abstractmethod
- def __ne__(self, other):
- """
- Checks not equal.
- """
-
- @abc.abstractmethod
- def __hash__(self):
- """
- Computes a hash.
- """
-
- @abc.abstractmethod
- def public_bytes(self, encoding):
- """
- Serializes the certificate to PEM or DER format.
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class CertificateRevocationList(object):
- @abc.abstractmethod
- def public_bytes(self, encoding):
- """
- Serializes the CRL to PEM or DER format.
- """
-
- @abc.abstractmethod
- def fingerprint(self, algorithm):
- """
- Returns bytes using digest passed.
- """
-
- @abc.abstractmethod
- def get_revoked_certificate_by_serial_number(self, serial_number):
- """
- Returns an instance of RevokedCertificate or None if the serial_number
- is not in the CRL.
- """
-
- @abc.abstractproperty
- def signature_hash_algorithm(self):
- """
- Returns a HashAlgorithm corresponding to the type of the digest signed
- in the certificate.
- """
-
- @abc.abstractproperty
- def signature_algorithm_oid(self):
- """
- Returns the ObjectIdentifier of the signature algorithm.
- """
-
- @abc.abstractproperty
- def issuer(self):
- """
- Returns the X509Name with the issuer of this CRL.
- """
-
- @abc.abstractproperty
- def next_update(self):
- """
- Returns the date of next update for this CRL.
- """
-
- @abc.abstractproperty
- def last_update(self):
- """
- Returns the date of last update for this CRL.
- """
-
- @abc.abstractproperty
- def extensions(self):
- """
- Returns an Extensions object containing a list of CRL extensions.
- """
-
- @abc.abstractproperty
- def signature(self):
- """
- Returns the signature bytes.
- """
-
- @abc.abstractproperty
- def tbs_certlist_bytes(self):
- """
- Returns the tbsCertList payload bytes as defined in RFC 5280.
- """
-
- @abc.abstractmethod
- def __eq__(self, other):
- """
- Checks equality.
- """
-
- @abc.abstractmethod
- def __ne__(self, other):
- """
- Checks not equal.
- """
-
- @abc.abstractmethod
- def __len__(self):
- """
- Number of revoked certificates in the CRL.
- """
-
- @abc.abstractmethod
- def __getitem__(self, idx):
- """
- Returns a revoked certificate (or slice of revoked certificates).
- """
-
- @abc.abstractmethod
- def __iter__(self):
- """
- Iterator over the revoked certificates
- """
-
- @abc.abstractmethod
- def is_signature_valid(self, public_key):
- """
- Verifies signature of revocation list against given public key.
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class CertificateSigningRequest(object):
- @abc.abstractmethod
- def __eq__(self, other):
- """
- Checks equality.
- """
-
- @abc.abstractmethod
- def __ne__(self, other):
- """
- Checks not equal.
- """
-
- @abc.abstractmethod
- def __hash__(self):
- """
- Computes a hash.
- """
-
- @abc.abstractmethod
- def public_key(self):
- """
- Returns the public key
- """
-
- @abc.abstractproperty
- def subject(self):
- """
- Returns the subject name object.
- """
-
- @abc.abstractproperty
- def signature_hash_algorithm(self):
- """
- Returns a HashAlgorithm corresponding to the type of the digest signed
- in the certificate.
- """
-
- @abc.abstractproperty
- def signature_algorithm_oid(self):
- """
- Returns the ObjectIdentifier of the signature algorithm.
- """
-
- @abc.abstractproperty
- def extensions(self):
- """
- Returns the extensions in the signing request.
- """
-
- @abc.abstractmethod
- def public_bytes(self, encoding):
- """
- Encodes the request to PEM or DER format.
- """
-
- @abc.abstractproperty
- def signature(self):
- """
- Returns the signature bytes.
- """
-
- @abc.abstractproperty
- def tbs_certrequest_bytes(self):
- """
- Returns the PKCS#10 CertificationRequestInfo bytes as defined in RFC
- 2986.
- """
-
- @abc.abstractproperty
- def is_signature_valid(self):
- """
- Verifies signature of signing request.
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class RevokedCertificate(object):
- @abc.abstractproperty
- def serial_number(self):
- """
- Returns the serial number of the revoked certificate.
- """
-
- @abc.abstractproperty
- def revocation_date(self):
- """
- Returns the date of when this certificate was revoked.
- """
-
- @abc.abstractproperty
- def extensions(self):
- """
- Returns an Extensions object containing a list of Revoked extensions.
- """
-
-
-class CertificateSigningRequestBuilder(object):
- def __init__(self, subject_name=None, extensions=[]):
- """
- Creates an empty X.509 certificate request (v1).
- """
- self._subject_name = subject_name
- self._extensions = extensions
-
- def subject_name(self, name):
- """
- Sets the certificate requestor's distinguished name.
- """
- if not isinstance(name, Name):
- raise TypeError('Expecting x509.Name object.')
- if self._subject_name is not None:
- raise ValueError('The subject name may only be set once.')
- return CertificateSigningRequestBuilder(name, self._extensions)
-
- def add_extension(self, extension, critical):
- """
- Adds an X.509 extension to the certificate request.
- """
- if not isinstance(extension, ExtensionType):
- raise TypeError("extension must be an ExtensionType")
-
- extension = Extension(extension.oid, critical, extension)
- _reject_duplicate_extension(extension, self._extensions)
-
- return CertificateSigningRequestBuilder(
- self._subject_name, self._extensions + [extension]
- )
-
- def sign(self, private_key, algorithm, backend):
- """
- Signs the request using the requestor's private key.
- """
- if self._subject_name is None:
- raise ValueError("A CertificateSigningRequest must have a subject")
- return backend.create_x509_csr(self, private_key, algorithm)
-
-
-class CertificateBuilder(object):
- def __init__(self, issuer_name=None, subject_name=None,
- public_key=None, serial_number=None, not_valid_before=None,
- not_valid_after=None, extensions=[]):
- self._version = Version.v3
- self._issuer_name = issuer_name
- self._subject_name = subject_name
- self._public_key = public_key
- self._serial_number = serial_number
- self._not_valid_before = not_valid_before
- self._not_valid_after = not_valid_after
- self._extensions = extensions
-
- def issuer_name(self, name):
- """
- Sets the CA's distinguished name.
- """
- if not isinstance(name, Name):
- raise TypeError('Expecting x509.Name object.')
- if self._issuer_name is not None:
- raise ValueError('The issuer name may only be set once.')
- return CertificateBuilder(
- name, self._subject_name, self._public_key,
- self._serial_number, self._not_valid_before,
- self._not_valid_after, self._extensions
- )
-
- def subject_name(self, name):
- """
- Sets the requestor's distinguished name.
- """
- if not isinstance(name, Name):
- raise TypeError('Expecting x509.Name object.')
- if self._subject_name is not None:
- raise ValueError('The subject name may only be set once.')
- return CertificateBuilder(
- self._issuer_name, name, self._public_key,
- self._serial_number, self._not_valid_before,
- self._not_valid_after, self._extensions
- )
-
- def public_key(self, key):
- """
- Sets the requestor's public key (as found in the signing request).
- """
- if not isinstance(key, (dsa.DSAPublicKey, rsa.RSAPublicKey,
- ec.EllipticCurvePublicKey)):
- raise TypeError('Expecting one of DSAPublicKey, RSAPublicKey,'
- ' or EllipticCurvePublicKey.')
- if self._public_key is not None:
- raise ValueError('The public key may only be set once.')
- return CertificateBuilder(
- self._issuer_name, self._subject_name, key,
- self._serial_number, self._not_valid_before,
- self._not_valid_after, self._extensions
- )
-
- def serial_number(self, number):
- """
- Sets the certificate serial number.
- """
- if not isinstance(number, six.integer_types):
- raise TypeError('Serial number must be of integral type.')
- if self._serial_number is not None:
- raise ValueError('The serial number may only be set once.')
- if number <= 0:
- raise ValueError('The serial number should be positive.')
-
- # ASN.1 integers are always signed, so most significant bit must be
- # zero.
- if number.bit_length() >= 160: # As defined in RFC 5280
- raise ValueError('The serial number should not be more than 159 '
- 'bits.')
- return CertificateBuilder(
- self._issuer_name, self._subject_name,
- self._public_key, number, self._not_valid_before,
- self._not_valid_after, self._extensions
- )
-
- def not_valid_before(self, time):
- """
- Sets the certificate activation time.
- """
- if not isinstance(time, datetime.datetime):
- raise TypeError('Expecting datetime object.')
- if self._not_valid_before is not None:
- raise ValueError('The not valid before may only be set once.')
- time = _convert_to_naive_utc_time(time)
- if time <= _UNIX_EPOCH:
- raise ValueError('The not valid before date must be after the unix'
- ' epoch (1970 January 1).')
- if self._not_valid_after is not None and time > self._not_valid_after:
- raise ValueError(
- 'The not valid before date must be before the not valid after '
- 'date.'
- )
- return CertificateBuilder(
- self._issuer_name, self._subject_name,
- self._public_key, self._serial_number, time,
- self._not_valid_after, self._extensions
- )
-
- def not_valid_after(self, time):
- """
- Sets the certificate expiration time.
- """
- if not isinstance(time, datetime.datetime):
- raise TypeError('Expecting datetime object.')
- if self._not_valid_after is not None:
- raise ValueError('The not valid after may only be set once.')
- time = _convert_to_naive_utc_time(time)
- if time <= _UNIX_EPOCH:
- raise ValueError('The not valid after date must be after the unix'
- ' epoch (1970 January 1).')
- if (self._not_valid_before is not None and
- time < self._not_valid_before):
- raise ValueError(
- 'The not valid after date must be after the not valid before '
- 'date.'
- )
- return CertificateBuilder(
- self._issuer_name, self._subject_name,
- self._public_key, self._serial_number, self._not_valid_before,
- time, self._extensions
- )
-
- def add_extension(self, extension, critical):
- """
- Adds an X.509 extension to the certificate.
- """
- if not isinstance(extension, ExtensionType):
- raise TypeError("extension must be an ExtensionType")
-
- extension = Extension(extension.oid, critical, extension)
- _reject_duplicate_extension(extension, self._extensions)
-
- return CertificateBuilder(
- self._issuer_name, self._subject_name,
- self._public_key, self._serial_number, self._not_valid_before,
- self._not_valid_after, self._extensions + [extension]
- )
-
- def sign(self, private_key, algorithm, backend):
- """
- Signs the certificate using the CA's private key.
- """
- if self._subject_name is None:
- raise ValueError("A certificate must have a subject name")
-
- if self._issuer_name is None:
- raise ValueError("A certificate must have an issuer name")
-
- if self._serial_number is None:
- raise ValueError("A certificate must have a serial number")
-
- if self._not_valid_before is None:
- raise ValueError("A certificate must have a not valid before time")
-
- if self._not_valid_after is None:
- raise ValueError("A certificate must have a not valid after time")
-
- if self._public_key is None:
- raise ValueError("A certificate must have a public key")
-
- return backend.create_x509_certificate(self, private_key, algorithm)
-
-
-class CertificateRevocationListBuilder(object):
- def __init__(self, issuer_name=None, last_update=None, next_update=None,
- extensions=[], revoked_certificates=[]):
- self._issuer_name = issuer_name
- self._last_update = last_update
- self._next_update = next_update
- self._extensions = extensions
- self._revoked_certificates = revoked_certificates
-
- def issuer_name(self, issuer_name):
- if not isinstance(issuer_name, Name):
- raise TypeError('Expecting x509.Name object.')
- if self._issuer_name is not None:
- raise ValueError('The issuer name may only be set once.')
- return CertificateRevocationListBuilder(
- issuer_name, self._last_update, self._next_update,
- self._extensions, self._revoked_certificates
- )
-
- def last_update(self, last_update):
- if not isinstance(last_update, datetime.datetime):
- raise TypeError('Expecting datetime object.')
- if self._last_update is not None:
- raise ValueError('Last update may only be set once.')
- last_update = _convert_to_naive_utc_time(last_update)
- if last_update <= _UNIX_EPOCH:
- raise ValueError('The last update date must be after the unix'
- ' epoch (1970 January 1).')
- if self._next_update is not None and last_update > self._next_update:
- raise ValueError(
- 'The last update date must be before the next update date.'
- )
- return CertificateRevocationListBuilder(
- self._issuer_name, last_update, self._next_update,
- self._extensions, self._revoked_certificates
- )
-
- def next_update(self, next_update):
- if not isinstance(next_update, datetime.datetime):
- raise TypeError('Expecting datetime object.')
- if self._next_update is not None:
- raise ValueError('Last update may only be set once.')
- next_update = _convert_to_naive_utc_time(next_update)
- if next_update <= _UNIX_EPOCH:
- raise ValueError('The last update date must be after the unix'
- ' epoch (1970 January 1).')
- if self._last_update is not None and next_update < self._last_update:
- raise ValueError(
- 'The next update date must be after the last update date.'
- )
- return CertificateRevocationListBuilder(
- self._issuer_name, self._last_update, next_update,
- self._extensions, self._revoked_certificates
- )
-
- def add_extension(self, extension, critical):
- """
- Adds an X.509 extension to the certificate revocation list.
- """
- if not isinstance(extension, ExtensionType):
- raise TypeError("extension must be an ExtensionType")
-
- extension = Extension(extension.oid, critical, extension)
- _reject_duplicate_extension(extension, self._extensions)
- return CertificateRevocationListBuilder(
- self._issuer_name, self._last_update, self._next_update,
- self._extensions + [extension], self._revoked_certificates
- )
-
- def add_revoked_certificate(self, revoked_certificate):
- """
- Adds a revoked certificate to the CRL.
- """
- if not isinstance(revoked_certificate, RevokedCertificate):
- raise TypeError("Must be an instance of RevokedCertificate")
-
- return CertificateRevocationListBuilder(
- self._issuer_name, self._last_update,
- self._next_update, self._extensions,
- self._revoked_certificates + [revoked_certificate]
- )
-
- def sign(self, private_key, algorithm, backend):
- if self._issuer_name is None:
- raise ValueError("A CRL must have an issuer name")
-
- if self._last_update is None:
- raise ValueError("A CRL must have a last update time")
-
- if self._next_update is None:
- raise ValueError("A CRL must have a next update time")
-
- return backend.create_x509_crl(self, private_key, algorithm)
-
-
-class RevokedCertificateBuilder(object):
- def __init__(self, serial_number=None, revocation_date=None,
- extensions=[]):
- self._serial_number = serial_number
- self._revocation_date = revocation_date
- self._extensions = extensions
-
- def serial_number(self, number):
- if not isinstance(number, six.integer_types):
- raise TypeError('Serial number must be of integral type.')
- if self._serial_number is not None:
- raise ValueError('The serial number may only be set once.')
- if number <= 0:
- raise ValueError('The serial number should be positive')
-
- # ASN.1 integers are always signed, so most significant bit must be
- # zero.
- if number.bit_length() >= 160: # As defined in RFC 5280
- raise ValueError('The serial number should not be more than 159 '
- 'bits.')
- return RevokedCertificateBuilder(
- number, self._revocation_date, self._extensions
- )
-
- def revocation_date(self, time):
- if not isinstance(time, datetime.datetime):
- raise TypeError('Expecting datetime object.')
- if self._revocation_date is not None:
- raise ValueError('The revocation date may only be set once.')
- time = _convert_to_naive_utc_time(time)
- if time <= _UNIX_EPOCH:
- raise ValueError('The revocation date must be after the unix'
- ' epoch (1970 January 1).')
- return RevokedCertificateBuilder(
- self._serial_number, time, self._extensions
- )
-
- def add_extension(self, extension, critical):
- if not isinstance(extension, ExtensionType):
- raise TypeError("extension must be an ExtensionType")
-
- extension = Extension(extension.oid, critical, extension)
- _reject_duplicate_extension(extension, self._extensions)
- return RevokedCertificateBuilder(
- self._serial_number, self._revocation_date,
- self._extensions + [extension]
- )
-
- def build(self, backend):
- if self._serial_number is None:
- raise ValueError("A revoked certificate must have a serial number")
- if self._revocation_date is None:
- raise ValueError(
- "A revoked certificate must have a revocation date"
- )
-
- return backend.create_x509_revoked_certificate(self)
-
-
-def random_serial_number():
- return utils.int_from_bytes(os.urandom(20), "big") >> 1
diff --git a/lib/cryptography/x509/certificate_transparency.py b/lib/cryptography/x509/certificate_transparency.py
deleted file mode 100644
index d00fe81269..0000000000
--- a/lib/cryptography/x509/certificate_transparency.py
+++ /dev/null
@@ -1,46 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import abc
-from enum import Enum
-
-import six
-
-
-class LogEntryType(Enum):
- X509_CERTIFICATE = 0
- PRE_CERTIFICATE = 1
-
-
-class Version(Enum):
- v1 = 0
-
-
-@six.add_metaclass(abc.ABCMeta)
-class SignedCertificateTimestamp(object):
- @abc.abstractproperty
- def version(self):
- """
- Returns the SCT version.
- """
-
- @abc.abstractproperty
- def log_id(self):
- """
- Returns an identifier indicating which log this SCT is for.
- """
-
- @abc.abstractproperty
- def timestamp(self):
- """
- Returns the timestamp for this SCT.
- """
-
- @abc.abstractproperty
- def entry_type(self):
- """
- Returns whether this is an SCT for a certificate or pre-certificate.
- """
diff --git a/lib/cryptography/x509/extensions.py b/lib/cryptography/x509/extensions.py
deleted file mode 100644
index 6301af5a29..0000000000
--- a/lib/cryptography/x509/extensions.py
+++ /dev/null
@@ -1,1477 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import abc
-import datetime
-import hashlib
-import ipaddress
-from enum import Enum
-
-from asn1crypto.keys import PublicKeyInfo
-
-import six
-
-from cryptography import utils
-from cryptography.hazmat.primitives import constant_time, serialization
-from cryptography.hazmat.primitives.asymmetric.ec import EllipticCurvePublicKey
-from cryptography.hazmat.primitives.asymmetric.rsa import RSAPublicKey
-from cryptography.x509.certificate_transparency import (
- SignedCertificateTimestamp
-)
-from cryptography.x509.general_name import GeneralName, IPAddress, OtherName
-from cryptography.x509.name import RelativeDistinguishedName
-from cryptography.x509.oid import (
- CRLEntryExtensionOID, ExtensionOID, OCSPExtensionOID, ObjectIdentifier,
-)
-
-
-def _key_identifier_from_public_key(public_key):
- if isinstance(public_key, RSAPublicKey):
- data = public_key.public_bytes(
- serialization.Encoding.DER,
- serialization.PublicFormat.PKCS1,
- )
- elif isinstance(public_key, EllipticCurvePublicKey):
- data = public_key.public_numbers().encode_point()
- else:
- # This is a very slow way to do this.
- serialized = public_key.public_bytes(
- serialization.Encoding.DER,
- serialization.PublicFormat.SubjectPublicKeyInfo
- )
-
- data = six.binary_type(PublicKeyInfo.load(serialized)['public_key'])
-
- return hashlib.sha1(data).digest()
-
-
-class DuplicateExtension(Exception):
- def __init__(self, msg, oid):
- super(DuplicateExtension, self).__init__(msg)
- self.oid = oid
-
-
-class ExtensionNotFound(Exception):
- def __init__(self, msg, oid):
- super(ExtensionNotFound, self).__init__(msg)
- self.oid = oid
-
-
-@six.add_metaclass(abc.ABCMeta)
-class ExtensionType(object):
- @abc.abstractproperty
- def oid(self):
- """
- Returns the oid associated with the given extension type.
- """
-
-
-class Extensions(object):
- def __init__(self, extensions):
- self._extensions = extensions
-
- def get_extension_for_oid(self, oid):
- for ext in self:
- if ext.oid == oid:
- return ext
-
- raise ExtensionNotFound("No {0} extension was found".format(oid), oid)
-
- def get_extension_for_class(self, extclass):
- if extclass is UnrecognizedExtension:
- raise TypeError(
- "UnrecognizedExtension can't be used with "
- "get_extension_for_class because more than one instance of the"
- " class may be present."
- )
-
- for ext in self:
- if isinstance(ext.value, extclass):
- return ext
-
- raise ExtensionNotFound(
- "No {0} extension was found".format(extclass), extclass.oid
- )
-
- def __iter__(self):
- return iter(self._extensions)
-
- def __len__(self):
- return len(self._extensions)
-
- def __getitem__(self, idx):
- return self._extensions[idx]
-
- def __repr__(self):
- return (
- "".format(self._extensions)
- )
-
-
-@utils.register_interface(ExtensionType)
-class CRLNumber(object):
- oid = ExtensionOID.CRL_NUMBER
-
- def __init__(self, crl_number):
- if not isinstance(crl_number, six.integer_types):
- raise TypeError("crl_number must be an integer")
-
- self._crl_number = crl_number
-
- def __eq__(self, other):
- if not isinstance(other, CRLNumber):
- return NotImplemented
-
- return self.crl_number == other.crl_number
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- return hash(self.crl_number)
-
- def __repr__(self):
- return "".format(self.crl_number)
-
- crl_number = utils.read_only_property("_crl_number")
-
-
-@utils.register_interface(ExtensionType)
-class AuthorityKeyIdentifier(object):
- oid = ExtensionOID.AUTHORITY_KEY_IDENTIFIER
-
- def __init__(self, key_identifier, authority_cert_issuer,
- authority_cert_serial_number):
- if (authority_cert_issuer is None) != (
- authority_cert_serial_number is None
- ):
- raise ValueError(
- "authority_cert_issuer and authority_cert_serial_number "
- "must both be present or both None"
- )
-
- if authority_cert_issuer is not None:
- authority_cert_issuer = list(authority_cert_issuer)
- if not all(
- isinstance(x, GeneralName) for x in authority_cert_issuer
- ):
- raise TypeError(
- "authority_cert_issuer must be a list of GeneralName "
- "objects"
- )
-
- if authority_cert_serial_number is not None and not isinstance(
- authority_cert_serial_number, six.integer_types
- ):
- raise TypeError(
- "authority_cert_serial_number must be an integer"
- )
-
- self._key_identifier = key_identifier
- self._authority_cert_issuer = authority_cert_issuer
- self._authority_cert_serial_number = authority_cert_serial_number
-
- @classmethod
- def from_issuer_public_key(cls, public_key):
- digest = _key_identifier_from_public_key(public_key)
- return cls(
- key_identifier=digest,
- authority_cert_issuer=None,
- authority_cert_serial_number=None
- )
-
- @classmethod
- def from_issuer_subject_key_identifier(cls, ski):
- return cls(
- key_identifier=ski.value.digest,
- authority_cert_issuer=None,
- authority_cert_serial_number=None
- )
-
- def __repr__(self):
- return (
- "".format(self)
- )
-
- def __eq__(self, other):
- if not isinstance(other, AuthorityKeyIdentifier):
- return NotImplemented
-
- return (
- self.key_identifier == other.key_identifier and
- self.authority_cert_issuer == other.authority_cert_issuer and
- self.authority_cert_serial_number ==
- other.authority_cert_serial_number
- )
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- if self.authority_cert_issuer is None:
- aci = None
- else:
- aci = tuple(self.authority_cert_issuer)
- return hash((
- self.key_identifier, aci, self.authority_cert_serial_number
- ))
-
- key_identifier = utils.read_only_property("_key_identifier")
- authority_cert_issuer = utils.read_only_property("_authority_cert_issuer")
- authority_cert_serial_number = utils.read_only_property(
- "_authority_cert_serial_number"
- )
-
-
-@utils.register_interface(ExtensionType)
-class SubjectKeyIdentifier(object):
- oid = ExtensionOID.SUBJECT_KEY_IDENTIFIER
-
- def __init__(self, digest):
- self._digest = digest
-
- @classmethod
- def from_public_key(cls, public_key):
- return cls(_key_identifier_from_public_key(public_key))
-
- digest = utils.read_only_property("_digest")
-
- def __repr__(self):
- return "".format(self.digest)
-
- def __eq__(self, other):
- if not isinstance(other, SubjectKeyIdentifier):
- return NotImplemented
-
- return constant_time.bytes_eq(self.digest, other.digest)
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- return hash(self.digest)
-
-
-@utils.register_interface(ExtensionType)
-class AuthorityInformationAccess(object):
- oid = ExtensionOID.AUTHORITY_INFORMATION_ACCESS
-
- def __init__(self, descriptions):
- descriptions = list(descriptions)
- if not all(isinstance(x, AccessDescription) for x in descriptions):
- raise TypeError(
- "Every item in the descriptions list must be an "
- "AccessDescription"
- )
-
- self._descriptions = descriptions
-
- def __iter__(self):
- return iter(self._descriptions)
-
- def __len__(self):
- return len(self._descriptions)
-
- def __repr__(self):
- return "".format(self._descriptions)
-
- def __eq__(self, other):
- if not isinstance(other, AuthorityInformationAccess):
- return NotImplemented
-
- return self._descriptions == other._descriptions
-
- def __ne__(self, other):
- return not self == other
-
- def __getitem__(self, idx):
- return self._descriptions[idx]
-
- def __hash__(self):
- return hash(tuple(self._descriptions))
-
-
-class AccessDescription(object):
- def __init__(self, access_method, access_location):
- if not isinstance(access_method, ObjectIdentifier):
- raise TypeError("access_method must be an ObjectIdentifier")
-
- if not isinstance(access_location, GeneralName):
- raise TypeError("access_location must be a GeneralName")
-
- self._access_method = access_method
- self._access_location = access_location
-
- def __repr__(self):
- return (
- "".format(self)
- )
-
- def __eq__(self, other):
- if not isinstance(other, AccessDescription):
- return NotImplemented
-
- return (
- self.access_method == other.access_method and
- self.access_location == other.access_location
- )
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- return hash((self.access_method, self.access_location))
-
- access_method = utils.read_only_property("_access_method")
- access_location = utils.read_only_property("_access_location")
-
-
-@utils.register_interface(ExtensionType)
-class BasicConstraints(object):
- oid = ExtensionOID.BASIC_CONSTRAINTS
-
- def __init__(self, ca, path_length):
- if not isinstance(ca, bool):
- raise TypeError("ca must be a boolean value")
-
- if path_length is not None and not ca:
- raise ValueError("path_length must be None when ca is False")
-
- if (
- path_length is not None and
- (not isinstance(path_length, six.integer_types) or path_length < 0)
- ):
- raise TypeError(
- "path_length must be a non-negative integer or None"
- )
-
- self._ca = ca
- self._path_length = path_length
-
- ca = utils.read_only_property("_ca")
- path_length = utils.read_only_property("_path_length")
-
- def __repr__(self):
- return ("").format(self)
-
- def __eq__(self, other):
- if not isinstance(other, BasicConstraints):
- return NotImplemented
-
- return self.ca == other.ca and self.path_length == other.path_length
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- return hash((self.ca, self.path_length))
-
-
-@utils.register_interface(ExtensionType)
-class DeltaCRLIndicator(object):
- oid = ExtensionOID.DELTA_CRL_INDICATOR
-
- def __init__(self, crl_number):
- if not isinstance(crl_number, six.integer_types):
- raise TypeError("crl_number must be an integer")
-
- self._crl_number = crl_number
-
- crl_number = utils.read_only_property("_crl_number")
-
- def __eq__(self, other):
- if not isinstance(other, DeltaCRLIndicator):
- return NotImplemented
-
- return self.crl_number == other.crl_number
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- return hash(self.crl_number)
-
- def __repr__(self):
- return "".format(self)
-
-
-@utils.register_interface(ExtensionType)
-class CRLDistributionPoints(object):
- oid = ExtensionOID.CRL_DISTRIBUTION_POINTS
-
- def __init__(self, distribution_points):
- distribution_points = list(distribution_points)
- if not all(
- isinstance(x, DistributionPoint) for x in distribution_points
- ):
- raise TypeError(
- "distribution_points must be a list of DistributionPoint "
- "objects"
- )
-
- self._distribution_points = distribution_points
-
- def __iter__(self):
- return iter(self._distribution_points)
-
- def __len__(self):
- return len(self._distribution_points)
-
- def __repr__(self):
- return "".format(self._distribution_points)
-
- def __eq__(self, other):
- if not isinstance(other, CRLDistributionPoints):
- return NotImplemented
-
- return self._distribution_points == other._distribution_points
-
- def __ne__(self, other):
- return not self == other
-
- def __getitem__(self, idx):
- return self._distribution_points[idx]
-
- def __hash__(self):
- return hash(tuple(self._distribution_points))
-
-
-@utils.register_interface(ExtensionType)
-class FreshestCRL(object):
- oid = ExtensionOID.FRESHEST_CRL
-
- def __init__(self, distribution_points):
- distribution_points = list(distribution_points)
- if not all(
- isinstance(x, DistributionPoint) for x in distribution_points
- ):
- raise TypeError(
- "distribution_points must be a list of DistributionPoint "
- "objects"
- )
-
- self._distribution_points = distribution_points
-
- def __iter__(self):
- return iter(self._distribution_points)
-
- def __len__(self):
- return len(self._distribution_points)
-
- def __repr__(self):
- return "".format(self._distribution_points)
-
- def __eq__(self, other):
- if not isinstance(other, FreshestCRL):
- return NotImplemented
-
- return self._distribution_points == other._distribution_points
-
- def __ne__(self, other):
- return not self == other
-
- def __getitem__(self, idx):
- return self._distribution_points[idx]
-
- def __hash__(self):
- return hash(tuple(self._distribution_points))
-
-
-class DistributionPoint(object):
- def __init__(self, full_name, relative_name, reasons, crl_issuer):
- if full_name and relative_name:
- raise ValueError(
- "You cannot provide both full_name and relative_name, at "
- "least one must be None."
- )
-
- if full_name:
- full_name = list(full_name)
- if not all(isinstance(x, GeneralName) for x in full_name):
- raise TypeError(
- "full_name must be a list of GeneralName objects"
- )
-
- if relative_name:
- if not isinstance(relative_name, RelativeDistinguishedName):
- raise TypeError(
- "relative_name must be a RelativeDistinguishedName"
- )
-
- if crl_issuer:
- crl_issuer = list(crl_issuer)
- if not all(isinstance(x, GeneralName) for x in crl_issuer):
- raise TypeError(
- "crl_issuer must be None or a list of general names"
- )
-
- if reasons and (not isinstance(reasons, frozenset) or not all(
- isinstance(x, ReasonFlags) for x in reasons
- )):
- raise TypeError("reasons must be None or frozenset of ReasonFlags")
-
- if reasons and (
- ReasonFlags.unspecified in reasons or
- ReasonFlags.remove_from_crl in reasons
- ):
- raise ValueError(
- "unspecified and remove_from_crl are not valid reasons in a "
- "DistributionPoint"
- )
-
- if reasons and not crl_issuer and not (full_name or relative_name):
- raise ValueError(
- "You must supply crl_issuer, full_name, or relative_name when "
- "reasons is not None"
- )
-
- self._full_name = full_name
- self._relative_name = relative_name
- self._reasons = reasons
- self._crl_issuer = crl_issuer
-
- def __repr__(self):
- return (
- "".format(self)
- )
-
- def __eq__(self, other):
- if not isinstance(other, DistributionPoint):
- return NotImplemented
-
- return (
- self.full_name == other.full_name and
- self.relative_name == other.relative_name and
- self.reasons == other.reasons and
- self.crl_issuer == other.crl_issuer
- )
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- if self.full_name is not None:
- fn = tuple(self.full_name)
- else:
- fn = None
-
- if self.crl_issuer is not None:
- crl_issuer = tuple(self.crl_issuer)
- else:
- crl_issuer = None
-
- return hash((fn, self.relative_name, self.reasons, crl_issuer))
-
- full_name = utils.read_only_property("_full_name")
- relative_name = utils.read_only_property("_relative_name")
- reasons = utils.read_only_property("_reasons")
- crl_issuer = utils.read_only_property("_crl_issuer")
-
-
-class ReasonFlags(Enum):
- unspecified = "unspecified"
- key_compromise = "keyCompromise"
- ca_compromise = "cACompromise"
- affiliation_changed = "affiliationChanged"
- superseded = "superseded"
- cessation_of_operation = "cessationOfOperation"
- certificate_hold = "certificateHold"
- privilege_withdrawn = "privilegeWithdrawn"
- aa_compromise = "aACompromise"
- remove_from_crl = "removeFromCRL"
-
-
-@utils.register_interface(ExtensionType)
-class PolicyConstraints(object):
- oid = ExtensionOID.POLICY_CONSTRAINTS
-
- def __init__(self, require_explicit_policy, inhibit_policy_mapping):
- if require_explicit_policy is not None and not isinstance(
- require_explicit_policy, six.integer_types
- ):
- raise TypeError(
- "require_explicit_policy must be a non-negative integer or "
- "None"
- )
-
- if inhibit_policy_mapping is not None and not isinstance(
- inhibit_policy_mapping, six.integer_types
- ):
- raise TypeError(
- "inhibit_policy_mapping must be a non-negative integer or None"
- )
-
- if inhibit_policy_mapping is None and require_explicit_policy is None:
- raise ValueError(
- "At least one of require_explicit_policy and "
- "inhibit_policy_mapping must not be None"
- )
-
- self._require_explicit_policy = require_explicit_policy
- self._inhibit_policy_mapping = inhibit_policy_mapping
-
- def __repr__(self):
- return (
- u"".format(self)
- )
-
- def __eq__(self, other):
- if not isinstance(other, PolicyConstraints):
- return NotImplemented
-
- return (
- self.require_explicit_policy == other.require_explicit_policy and
- self.inhibit_policy_mapping == other.inhibit_policy_mapping
- )
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- return hash(
- (self.require_explicit_policy, self.inhibit_policy_mapping)
- )
-
- require_explicit_policy = utils.read_only_property(
- "_require_explicit_policy"
- )
- inhibit_policy_mapping = utils.read_only_property(
- "_inhibit_policy_mapping"
- )
-
-
-@utils.register_interface(ExtensionType)
-class CertificatePolicies(object):
- oid = ExtensionOID.CERTIFICATE_POLICIES
-
- def __init__(self, policies):
- policies = list(policies)
- if not all(isinstance(x, PolicyInformation) for x in policies):
- raise TypeError(
- "Every item in the policies list must be a "
- "PolicyInformation"
- )
-
- self._policies = policies
-
- def __iter__(self):
- return iter(self._policies)
-
- def __len__(self):
- return len(self._policies)
-
- def __repr__(self):
- return "".format(self._policies)
-
- def __eq__(self, other):
- if not isinstance(other, CertificatePolicies):
- return NotImplemented
-
- return self._policies == other._policies
-
- def __ne__(self, other):
- return not self == other
-
- def __getitem__(self, idx):
- return self._policies[idx]
-
- def __hash__(self):
- return hash(tuple(self._policies))
-
-
-class PolicyInformation(object):
- def __init__(self, policy_identifier, policy_qualifiers):
- if not isinstance(policy_identifier, ObjectIdentifier):
- raise TypeError("policy_identifier must be an ObjectIdentifier")
-
- self._policy_identifier = policy_identifier
-
- if policy_qualifiers:
- policy_qualifiers = list(policy_qualifiers)
- if not all(
- isinstance(x, (six.text_type, UserNotice))
- for x in policy_qualifiers
- ):
- raise TypeError(
- "policy_qualifiers must be a list of strings and/or "
- "UserNotice objects or None"
- )
-
- self._policy_qualifiers = policy_qualifiers
-
- def __repr__(self):
- return (
- "".format(self)
- )
-
- def __eq__(self, other):
- if not isinstance(other, PolicyInformation):
- return NotImplemented
-
- return (
- self.policy_identifier == other.policy_identifier and
- self.policy_qualifiers == other.policy_qualifiers
- )
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- if self.policy_qualifiers is not None:
- pq = tuple(self.policy_qualifiers)
- else:
- pq = None
-
- return hash((self.policy_identifier, pq))
-
- policy_identifier = utils.read_only_property("_policy_identifier")
- policy_qualifiers = utils.read_only_property("_policy_qualifiers")
-
-
-class UserNotice(object):
- def __init__(self, notice_reference, explicit_text):
- if notice_reference and not isinstance(
- notice_reference, NoticeReference
- ):
- raise TypeError(
- "notice_reference must be None or a NoticeReference"
- )
-
- self._notice_reference = notice_reference
- self._explicit_text = explicit_text
-
- def __repr__(self):
- return (
- "".format(self)
- )
-
- def __eq__(self, other):
- if not isinstance(other, UserNotice):
- return NotImplemented
-
- return (
- self.notice_reference == other.notice_reference and
- self.explicit_text == other.explicit_text
- )
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- return hash((self.notice_reference, self.explicit_text))
-
- notice_reference = utils.read_only_property("_notice_reference")
- explicit_text = utils.read_only_property("_explicit_text")
-
-
-class NoticeReference(object):
- def __init__(self, organization, notice_numbers):
- self._organization = organization
- notice_numbers = list(notice_numbers)
- if not all(isinstance(x, int) for x in notice_numbers):
- raise TypeError(
- "notice_numbers must be a list of integers"
- )
-
- self._notice_numbers = notice_numbers
-
- def __repr__(self):
- return (
- "".format(self)
- )
-
- def __eq__(self, other):
- if not isinstance(other, NoticeReference):
- return NotImplemented
-
- return (
- self.organization == other.organization and
- self.notice_numbers == other.notice_numbers
- )
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- return hash((self.organization, tuple(self.notice_numbers)))
-
- organization = utils.read_only_property("_organization")
- notice_numbers = utils.read_only_property("_notice_numbers")
-
-
-@utils.register_interface(ExtensionType)
-class ExtendedKeyUsage(object):
- oid = ExtensionOID.EXTENDED_KEY_USAGE
-
- def __init__(self, usages):
- usages = list(usages)
- if not all(isinstance(x, ObjectIdentifier) for x in usages):
- raise TypeError(
- "Every item in the usages list must be an ObjectIdentifier"
- )
-
- self._usages = usages
-
- def __iter__(self):
- return iter(self._usages)
-
- def __len__(self):
- return len(self._usages)
-
- def __repr__(self):
- return "".format(self._usages)
-
- def __eq__(self, other):
- if not isinstance(other, ExtendedKeyUsage):
- return NotImplemented
-
- return self._usages == other._usages
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- return hash(tuple(self._usages))
-
-
-@utils.register_interface(ExtensionType)
-class OCSPNoCheck(object):
- oid = ExtensionOID.OCSP_NO_CHECK
-
-
-@utils.register_interface(ExtensionType)
-class PrecertPoison(object):
- oid = ExtensionOID.PRECERT_POISON
-
-
-@utils.register_interface(ExtensionType)
-class TLSFeature(object):
- oid = ExtensionOID.TLS_FEATURE
-
- def __init__(self, features):
- features = list(features)
- if (
- not all(isinstance(x, TLSFeatureType) for x in features) or
- len(features) == 0
- ):
- raise TypeError(
- "features must be a list of elements from the TLSFeatureType "
- "enum"
- )
-
- self._features = features
-
- def __iter__(self):
- return iter(self._features)
-
- def __len__(self):
- return len(self._features)
-
- def __repr__(self):
- return "".format(self)
-
- def __eq__(self, other):
- if not isinstance(other, TLSFeature):
- return NotImplemented
-
- return self._features == other._features
-
- def __getitem__(self, idx):
- return self._features[idx]
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- return hash(tuple(self._features))
-
-
-class TLSFeatureType(Enum):
- # status_request is defined in RFC 6066 and is used for what is commonly
- # called OCSP Must-Staple when present in the TLS Feature extension in an
- # X.509 certificate.
- status_request = 5
- # status_request_v2 is defined in RFC 6961 and allows multiple OCSP
- # responses to be provided. It is not currently in use by clients or
- # servers.
- status_request_v2 = 17
-
-
-_TLS_FEATURE_TYPE_TO_ENUM = dict((x.value, x) for x in TLSFeatureType)
-
-
-@utils.register_interface(ExtensionType)
-class InhibitAnyPolicy(object):
- oid = ExtensionOID.INHIBIT_ANY_POLICY
-
- def __init__(self, skip_certs):
- if not isinstance(skip_certs, six.integer_types):
- raise TypeError("skip_certs must be an integer")
-
- if skip_certs < 0:
- raise ValueError("skip_certs must be a non-negative integer")
-
- self._skip_certs = skip_certs
-
- def __repr__(self):
- return "".format(self)
-
- def __eq__(self, other):
- if not isinstance(other, InhibitAnyPolicy):
- return NotImplemented
-
- return self.skip_certs == other.skip_certs
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- return hash(self.skip_certs)
-
- skip_certs = utils.read_only_property("_skip_certs")
-
-
-@utils.register_interface(ExtensionType)
-class KeyUsage(object):
- oid = ExtensionOID.KEY_USAGE
-
- def __init__(self, digital_signature, content_commitment, key_encipherment,
- data_encipherment, key_agreement, key_cert_sign, crl_sign,
- encipher_only, decipher_only):
- if not key_agreement and (encipher_only or decipher_only):
- raise ValueError(
- "encipher_only and decipher_only can only be true when "
- "key_agreement is true"
- )
-
- self._digital_signature = digital_signature
- self._content_commitment = content_commitment
- self._key_encipherment = key_encipherment
- self._data_encipherment = data_encipherment
- self._key_agreement = key_agreement
- self._key_cert_sign = key_cert_sign
- self._crl_sign = crl_sign
- self._encipher_only = encipher_only
- self._decipher_only = decipher_only
-
- digital_signature = utils.read_only_property("_digital_signature")
- content_commitment = utils.read_only_property("_content_commitment")
- key_encipherment = utils.read_only_property("_key_encipherment")
- data_encipherment = utils.read_only_property("_data_encipherment")
- key_agreement = utils.read_only_property("_key_agreement")
- key_cert_sign = utils.read_only_property("_key_cert_sign")
- crl_sign = utils.read_only_property("_crl_sign")
-
- @property
- def encipher_only(self):
- if not self.key_agreement:
- raise ValueError(
- "encipher_only is undefined unless key_agreement is true"
- )
- else:
- return self._encipher_only
-
- @property
- def decipher_only(self):
- if not self.key_agreement:
- raise ValueError(
- "decipher_only is undefined unless key_agreement is true"
- )
- else:
- return self._decipher_only
-
- def __repr__(self):
- try:
- encipher_only = self.encipher_only
- decipher_only = self.decipher_only
- except ValueError:
- encipher_only = None
- decipher_only = None
-
- return ("").format(
- self, encipher_only, decipher_only)
-
- def __eq__(self, other):
- if not isinstance(other, KeyUsage):
- return NotImplemented
-
- return (
- self.digital_signature == other.digital_signature and
- self.content_commitment == other.content_commitment and
- self.key_encipherment == other.key_encipherment and
- self.data_encipherment == other.data_encipherment and
- self.key_agreement == other.key_agreement and
- self.key_cert_sign == other.key_cert_sign and
- self.crl_sign == other.crl_sign and
- self._encipher_only == other._encipher_only and
- self._decipher_only == other._decipher_only
- )
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- return hash((
- self.digital_signature, self.content_commitment,
- self.key_encipherment, self.data_encipherment,
- self.key_agreement, self.key_cert_sign,
- self.crl_sign, self._encipher_only,
- self._decipher_only
- ))
-
-
-@utils.register_interface(ExtensionType)
-class NameConstraints(object):
- oid = ExtensionOID.NAME_CONSTRAINTS
-
- def __init__(self, permitted_subtrees, excluded_subtrees):
- if permitted_subtrees is not None:
- permitted_subtrees = list(permitted_subtrees)
- if not all(
- isinstance(x, GeneralName) for x in permitted_subtrees
- ):
- raise TypeError(
- "permitted_subtrees must be a list of GeneralName objects "
- "or None"
- )
-
- self._validate_ip_name(permitted_subtrees)
-
- if excluded_subtrees is not None:
- excluded_subtrees = list(excluded_subtrees)
- if not all(
- isinstance(x, GeneralName) for x in excluded_subtrees
- ):
- raise TypeError(
- "excluded_subtrees must be a list of GeneralName objects "
- "or None"
- )
-
- self._validate_ip_name(excluded_subtrees)
-
- if permitted_subtrees is None and excluded_subtrees is None:
- raise ValueError(
- "At least one of permitted_subtrees and excluded_subtrees "
- "must not be None"
- )
-
- self._permitted_subtrees = permitted_subtrees
- self._excluded_subtrees = excluded_subtrees
-
- def __eq__(self, other):
- if not isinstance(other, NameConstraints):
- return NotImplemented
-
- return (
- self.excluded_subtrees == other.excluded_subtrees and
- self.permitted_subtrees == other.permitted_subtrees
- )
-
- def __ne__(self, other):
- return not self == other
-
- def _validate_ip_name(self, tree):
- if any(isinstance(name, IPAddress) and not isinstance(
- name.value, (ipaddress.IPv4Network, ipaddress.IPv6Network)
- ) for name in tree):
- raise TypeError(
- "IPAddress name constraints must be an IPv4Network or"
- " IPv6Network object"
- )
-
- def __repr__(self):
- return (
- u"".format(self)
- )
-
- def __hash__(self):
- if self.permitted_subtrees is not None:
- ps = tuple(self.permitted_subtrees)
- else:
- ps = None
-
- if self.excluded_subtrees is not None:
- es = tuple(self.excluded_subtrees)
- else:
- es = None
-
- return hash((ps, es))
-
- permitted_subtrees = utils.read_only_property("_permitted_subtrees")
- excluded_subtrees = utils.read_only_property("_excluded_subtrees")
-
-
-class Extension(object):
- def __init__(self, oid, critical, value):
- if not isinstance(oid, ObjectIdentifier):
- raise TypeError(
- "oid argument must be an ObjectIdentifier instance."
- )
-
- if not isinstance(critical, bool):
- raise TypeError("critical must be a boolean value")
-
- self._oid = oid
- self._critical = critical
- self._value = value
-
- oid = utils.read_only_property("_oid")
- critical = utils.read_only_property("_critical")
- value = utils.read_only_property("_value")
-
- def __repr__(self):
- return ("").format(self)
-
- def __eq__(self, other):
- if not isinstance(other, Extension):
- return NotImplemented
-
- return (
- self.oid == other.oid and
- self.critical == other.critical and
- self.value == other.value
- )
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- return hash((self.oid, self.critical, self.value))
-
-
-class GeneralNames(object):
- def __init__(self, general_names):
- general_names = list(general_names)
- if not all(isinstance(x, GeneralName) for x in general_names):
- raise TypeError(
- "Every item in the general_names list must be an "
- "object conforming to the GeneralName interface"
- )
-
- self._general_names = general_names
-
- def __iter__(self):
- return iter(self._general_names)
-
- def __len__(self):
- return len(self._general_names)
-
- def get_values_for_type(self, type):
- # Return the value of each GeneralName, except for OtherName instances
- # which we return directly because it has two important properties not
- # just one value.
- objs = (i for i in self if isinstance(i, type))
- if type != OtherName:
- objs = (i.value for i in objs)
- return list(objs)
-
- def __repr__(self):
- return "".format(self._general_names)
-
- def __eq__(self, other):
- if not isinstance(other, GeneralNames):
- return NotImplemented
-
- return self._general_names == other._general_names
-
- def __ne__(self, other):
- return not self == other
-
- def __getitem__(self, idx):
- return self._general_names[idx]
-
- def __hash__(self):
- return hash(tuple(self._general_names))
-
-
-@utils.register_interface(ExtensionType)
-class SubjectAlternativeName(object):
- oid = ExtensionOID.SUBJECT_ALTERNATIVE_NAME
-
- def __init__(self, general_names):
- self._general_names = GeneralNames(general_names)
-
- def __iter__(self):
- return iter(self._general_names)
-
- def __len__(self):
- return len(self._general_names)
-
- def get_values_for_type(self, type):
- return self._general_names.get_values_for_type(type)
-
- def __repr__(self):
- return "".format(self._general_names)
-
- def __eq__(self, other):
- if not isinstance(other, SubjectAlternativeName):
- return NotImplemented
-
- return self._general_names == other._general_names
-
- def __getitem__(self, idx):
- return self._general_names[idx]
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- return hash(self._general_names)
-
-
-@utils.register_interface(ExtensionType)
-class IssuerAlternativeName(object):
- oid = ExtensionOID.ISSUER_ALTERNATIVE_NAME
-
- def __init__(self, general_names):
- self._general_names = GeneralNames(general_names)
-
- def __iter__(self):
- return iter(self._general_names)
-
- def __len__(self):
- return len(self._general_names)
-
- def get_values_for_type(self, type):
- return self._general_names.get_values_for_type(type)
-
- def __repr__(self):
- return "".format(self._general_names)
-
- def __eq__(self, other):
- if not isinstance(other, IssuerAlternativeName):
- return NotImplemented
-
- return self._general_names == other._general_names
-
- def __ne__(self, other):
- return not self == other
-
- def __getitem__(self, idx):
- return self._general_names[idx]
-
- def __hash__(self):
- return hash(self._general_names)
-
-
-@utils.register_interface(ExtensionType)
-class CertificateIssuer(object):
- oid = CRLEntryExtensionOID.CERTIFICATE_ISSUER
-
- def __init__(self, general_names):
- self._general_names = GeneralNames(general_names)
-
- def __iter__(self):
- return iter(self._general_names)
-
- def __len__(self):
- return len(self._general_names)
-
- def get_values_for_type(self, type):
- return self._general_names.get_values_for_type(type)
-
- def __repr__(self):
- return "".format(self._general_names)
-
- def __eq__(self, other):
- if not isinstance(other, CertificateIssuer):
- return NotImplemented
-
- return self._general_names == other._general_names
-
- def __ne__(self, other):
- return not self == other
-
- def __getitem__(self, idx):
- return self._general_names[idx]
-
- def __hash__(self):
- return hash(self._general_names)
-
-
-@utils.register_interface(ExtensionType)
-class CRLReason(object):
- oid = CRLEntryExtensionOID.CRL_REASON
-
- def __init__(self, reason):
- if not isinstance(reason, ReasonFlags):
- raise TypeError("reason must be an element from ReasonFlags")
-
- self._reason = reason
-
- def __repr__(self):
- return "".format(self._reason)
-
- def __eq__(self, other):
- if not isinstance(other, CRLReason):
- return NotImplemented
-
- return self.reason == other.reason
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- return hash(self.reason)
-
- reason = utils.read_only_property("_reason")
-
-
-@utils.register_interface(ExtensionType)
-class InvalidityDate(object):
- oid = CRLEntryExtensionOID.INVALIDITY_DATE
-
- def __init__(self, invalidity_date):
- if not isinstance(invalidity_date, datetime.datetime):
- raise TypeError("invalidity_date must be a datetime.datetime")
-
- self._invalidity_date = invalidity_date
-
- def __repr__(self):
- return "".format(
- self._invalidity_date
- )
-
- def __eq__(self, other):
- if not isinstance(other, InvalidityDate):
- return NotImplemented
-
- return self.invalidity_date == other.invalidity_date
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- return hash(self.invalidity_date)
-
- invalidity_date = utils.read_only_property("_invalidity_date")
-
-
-@utils.register_interface(ExtensionType)
-class PrecertificateSignedCertificateTimestamps(object):
- oid = ExtensionOID.PRECERT_SIGNED_CERTIFICATE_TIMESTAMPS
-
- def __init__(self, signed_certificate_timestamps):
- signed_certificate_timestamps = list(signed_certificate_timestamps)
- if not all(
- isinstance(sct, SignedCertificateTimestamp)
- for sct in signed_certificate_timestamps
- ):
- raise TypeError(
- "Every item in the signed_certificate_timestamps list must be "
- "a SignedCertificateTimestamp"
- )
- self._signed_certificate_timestamps = signed_certificate_timestamps
-
- def __iter__(self):
- return iter(self._signed_certificate_timestamps)
-
- def __len__(self):
- return len(self._signed_certificate_timestamps)
-
- def __getitem__(self, idx):
- return self._signed_certificate_timestamps[idx]
-
- def __repr__(self):
- return (
- "".format(
- list(self)
- )
- )
-
- def __hash__(self):
- return hash(tuple(self._signed_certificate_timestamps))
-
- def __eq__(self, other):
- if not isinstance(other, PrecertificateSignedCertificateTimestamps):
- return NotImplemented
-
- return (
- self._signed_certificate_timestamps ==
- other._signed_certificate_timestamps
- )
-
- def __ne__(self, other):
- return not self == other
-
-
-@utils.register_interface(ExtensionType)
-class OCSPNonce(object):
- oid = OCSPExtensionOID.NONCE
-
- def __init__(self, nonce):
- if not isinstance(nonce, bytes):
- raise TypeError("nonce must be bytes")
-
- self._nonce = nonce
-
- def __eq__(self, other):
- if not isinstance(other, OCSPNonce):
- return NotImplemented
-
- return self.nonce == other.nonce
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- return hash(self.nonce)
-
- def __repr__(self):
- return "".format(self)
-
- nonce = utils.read_only_property("_nonce")
-
-
-@utils.register_interface(ExtensionType)
-class UnrecognizedExtension(object):
- def __init__(self, oid, value):
- if not isinstance(oid, ObjectIdentifier):
- raise TypeError("oid must be an ObjectIdentifier")
- self._oid = oid
- self._value = value
-
- oid = utils.read_only_property("_oid")
- value = utils.read_only_property("_value")
-
- def __repr__(self):
- return (
- "".format(
- self
- )
- )
-
- def __eq__(self, other):
- if not isinstance(other, UnrecognizedExtension):
- return NotImplemented
-
- return self.oid == other.oid and self.value == other.value
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- return hash((self.oid, self.value))
diff --git a/lib/cryptography/x509/general_name.py b/lib/cryptography/x509/general_name.py
deleted file mode 100644
index 26f389a518..0000000000
--- a/lib/cryptography/x509/general_name.py
+++ /dev/null
@@ -1,345 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import abc
-import ipaddress
-import warnings
-from email.utils import parseaddr
-
-import idna
-
-import six
-from six.moves import urllib_parse
-
-from cryptography import utils
-from cryptography.x509.name import Name
-from cryptography.x509.oid import ObjectIdentifier
-
-
-_GENERAL_NAMES = {
- 0: "otherName",
- 1: "rfc822Name",
- 2: "dNSName",
- 3: "x400Address",
- 4: "directoryName",
- 5: "ediPartyName",
- 6: "uniformResourceIdentifier",
- 7: "iPAddress",
- 8: "registeredID",
-}
-
-
-class UnsupportedGeneralNameType(Exception):
- def __init__(self, msg, type):
- super(UnsupportedGeneralNameType, self).__init__(msg)
- self.type = type
-
-
-@six.add_metaclass(abc.ABCMeta)
-class GeneralName(object):
- @abc.abstractproperty
- def value(self):
- """
- Return the value of the object
- """
-
-
-@utils.register_interface(GeneralName)
-class RFC822Name(object):
- def __init__(self, value):
- if isinstance(value, six.text_type):
- try:
- value.encode("ascii")
- except UnicodeEncodeError:
- value = self._idna_encode(value)
- warnings.warn(
- "RFC822Name values should be passed as an A-label string. "
- "This means unicode characters should be encoded via "
- "idna. Support for passing unicode strings (aka U-label) "
- "will be removed in a future version.",
- utils.DeprecatedIn21,
- stacklevel=2,
- )
- else:
- raise TypeError("value must be string")
-
- name, address = parseaddr(value)
- if name or not address:
- # parseaddr has found a name (e.g. Name ) or the entire
- # value is an empty string.
- raise ValueError("Invalid rfc822name value")
-
- self._value = value
-
- value = utils.read_only_property("_value")
-
- @classmethod
- def _init_without_validation(cls, value):
- instance = cls.__new__(cls)
- instance._value = value
- return instance
-
- def _idna_encode(self, value):
- _, address = parseaddr(value)
- parts = address.split(u"@")
- return parts[0] + "@" + idna.encode(parts[1]).decode("ascii")
-
- def __repr__(self):
- return "".format(self.value)
-
- def __eq__(self, other):
- if not isinstance(other, RFC822Name):
- return NotImplemented
-
- return self.value == other.value
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- return hash(self.value)
-
-
-def _idna_encode(value):
- # Retain prefixes '*.' for common/alt names and '.' for name constraints
- for prefix in ['*.', '.']:
- if value.startswith(prefix):
- value = value[len(prefix):]
- return prefix + idna.encode(value).decode("ascii")
- return idna.encode(value).decode("ascii")
-
-
-@utils.register_interface(GeneralName)
-class DNSName(object):
- def __init__(self, value):
- if isinstance(value, six.text_type):
- try:
- value.encode("ascii")
- except UnicodeEncodeError:
- value = _idna_encode(value)
- warnings.warn(
- "DNSName values should be passed as an A-label string. "
- "This means unicode characters should be encoded via "
- "idna. Support for passing unicode strings (aka U-label) "
- "will be removed in a future version.",
- utils.DeprecatedIn21,
- stacklevel=2,
- )
- else:
- raise TypeError("value must be string")
-
- self._value = value
-
- value = utils.read_only_property("_value")
-
- @classmethod
- def _init_without_validation(cls, value):
- instance = cls.__new__(cls)
- instance._value = value
- return instance
-
- def __repr__(self):
- return "".format(self.value)
-
- def __eq__(self, other):
- if not isinstance(other, DNSName):
- return NotImplemented
-
- return self.value == other.value
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- return hash(self.value)
-
-
-@utils.register_interface(GeneralName)
-class UniformResourceIdentifier(object):
- def __init__(self, value):
- if isinstance(value, six.text_type):
- try:
- value.encode("ascii")
- except UnicodeEncodeError:
- value = self._idna_encode(value)
- warnings.warn(
- "URI values should be passed as an A-label string. "
- "This means unicode characters should be encoded via "
- "idna. Support for passing unicode strings (aka U-label) "
- " will be removed in a future version.",
- utils.DeprecatedIn21,
- stacklevel=2,
- )
- else:
- raise TypeError("value must be string")
-
- self._value = value
-
- value = utils.read_only_property("_value")
-
- @classmethod
- def _init_without_validation(cls, value):
- instance = cls.__new__(cls)
- instance._value = value
- return instance
-
- def _idna_encode(self, value):
- parsed = urllib_parse.urlparse(value)
- if parsed.port:
- netloc = (
- idna.encode(parsed.hostname) +
- ":{0}".format(parsed.port).encode("ascii")
- ).decode("ascii")
- else:
- netloc = idna.encode(parsed.hostname).decode("ascii")
-
- # Note that building a URL in this fashion means it should be
- # semantically indistinguishable from the original but is not
- # guaranteed to be exactly the same.
- return urllib_parse.urlunparse((
- parsed.scheme,
- netloc,
- parsed.path,
- parsed.params,
- parsed.query,
- parsed.fragment
- ))
-
- def __repr__(self):
- return "".format(self.value)
-
- def __eq__(self, other):
- if not isinstance(other, UniformResourceIdentifier):
- return NotImplemented
-
- return self.value == other.value
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- return hash(self.value)
-
-
-@utils.register_interface(GeneralName)
-class DirectoryName(object):
- def __init__(self, value):
- if not isinstance(value, Name):
- raise TypeError("value must be a Name")
-
- self._value = value
-
- value = utils.read_only_property("_value")
-
- def __repr__(self):
- return "".format(self.value)
-
- def __eq__(self, other):
- if not isinstance(other, DirectoryName):
- return NotImplemented
-
- return self.value == other.value
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- return hash(self.value)
-
-
-@utils.register_interface(GeneralName)
-class RegisteredID(object):
- def __init__(self, value):
- if not isinstance(value, ObjectIdentifier):
- raise TypeError("value must be an ObjectIdentifier")
-
- self._value = value
-
- value = utils.read_only_property("_value")
-
- def __repr__(self):
- return "".format(self.value)
-
- def __eq__(self, other):
- if not isinstance(other, RegisteredID):
- return NotImplemented
-
- return self.value == other.value
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- return hash(self.value)
-
-
-@utils.register_interface(GeneralName)
-class IPAddress(object):
- def __init__(self, value):
- if not isinstance(
- value,
- (
- ipaddress.IPv4Address,
- ipaddress.IPv6Address,
- ipaddress.IPv4Network,
- ipaddress.IPv6Network
- )
- ):
- raise TypeError(
- "value must be an instance of ipaddress.IPv4Address, "
- "ipaddress.IPv6Address, ipaddress.IPv4Network, or "
- "ipaddress.IPv6Network"
- )
-
- self._value = value
-
- value = utils.read_only_property("_value")
-
- def __repr__(self):
- return "".format(self.value)
-
- def __eq__(self, other):
- if not isinstance(other, IPAddress):
- return NotImplemented
-
- return self.value == other.value
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- return hash(self.value)
-
-
-@utils.register_interface(GeneralName)
-class OtherName(object):
- def __init__(self, type_id, value):
- if not isinstance(type_id, ObjectIdentifier):
- raise TypeError("type_id must be an ObjectIdentifier")
- if not isinstance(value, bytes):
- raise TypeError("value must be a binary string")
-
- self._type_id = type_id
- self._value = value
-
- type_id = utils.read_only_property("_type_id")
- value = utils.read_only_property("_value")
-
- def __repr__(self):
- return "".format(
- self.type_id, self.value)
-
- def __eq__(self, other):
- if not isinstance(other, OtherName):
- return NotImplemented
-
- return self.type_id == other.type_id and self.value == other.value
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- return hash((self.type_id, self.value))
diff --git a/lib/cryptography/x509/name.py b/lib/cryptography/x509/name.py
deleted file mode 100644
index 5548eda8b7..0000000000
--- a/lib/cryptography/x509/name.py
+++ /dev/null
@@ -1,190 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-from enum import Enum
-
-import six
-
-from cryptography import utils
-from cryptography.x509.oid import NameOID, ObjectIdentifier
-
-
-class _ASN1Type(Enum):
- UTF8String = 12
- NumericString = 18
- PrintableString = 19
- T61String = 20
- IA5String = 22
- UTCTime = 23
- GeneralizedTime = 24
- VisibleString = 26
- UniversalString = 28
- BMPString = 30
-
-
-_ASN1_TYPE_TO_ENUM = dict((i.value, i) for i in _ASN1Type)
-_SENTINEL = object()
-_NAMEOID_DEFAULT_TYPE = {
- NameOID.COUNTRY_NAME: _ASN1Type.PrintableString,
- NameOID.JURISDICTION_COUNTRY_NAME: _ASN1Type.PrintableString,
- NameOID.SERIAL_NUMBER: _ASN1Type.PrintableString,
- NameOID.DN_QUALIFIER: _ASN1Type.PrintableString,
- NameOID.EMAIL_ADDRESS: _ASN1Type.IA5String,
- NameOID.DOMAIN_COMPONENT: _ASN1Type.IA5String,
-}
-
-
-class NameAttribute(object):
- def __init__(self, oid, value, _type=_SENTINEL):
- if not isinstance(oid, ObjectIdentifier):
- raise TypeError(
- "oid argument must be an ObjectIdentifier instance."
- )
-
- if not isinstance(value, six.text_type):
- raise TypeError(
- "value argument must be a text type."
- )
-
- if (
- oid == NameOID.COUNTRY_NAME or
- oid == NameOID.JURISDICTION_COUNTRY_NAME
- ):
- if len(value.encode("utf8")) != 2:
- raise ValueError(
- "Country name must be a 2 character country code"
- )
-
- if len(value) == 0:
- raise ValueError("Value cannot be an empty string")
-
- # The appropriate ASN1 string type varies by OID and is defined across
- # multiple RFCs including 2459, 3280, and 5280. In general UTF8String
- # is preferred (2459), but 3280 and 5280 specify several OIDs with
- # alternate types. This means when we see the sentinel value we need
- # to look up whether the OID has a non-UTF8 type. If it does, set it
- # to that. Otherwise, UTF8!
- if _type == _SENTINEL:
- _type = _NAMEOID_DEFAULT_TYPE.get(oid, _ASN1Type.UTF8String)
-
- if not isinstance(_type, _ASN1Type):
- raise TypeError("_type must be from the _ASN1Type enum")
-
- self._oid = oid
- self._value = value
- self._type = _type
-
- oid = utils.read_only_property("_oid")
- value = utils.read_only_property("_value")
-
- def __eq__(self, other):
- if not isinstance(other, NameAttribute):
- return NotImplemented
-
- return (
- self.oid == other.oid and
- self.value == other.value
- )
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- return hash((self.oid, self.value))
-
- def __repr__(self):
- return "".format(self)
-
-
-class RelativeDistinguishedName(object):
- def __init__(self, attributes):
- attributes = list(attributes)
- if not attributes:
- raise ValueError("a relative distinguished name cannot be empty")
- if not all(isinstance(x, NameAttribute) for x in attributes):
- raise TypeError("attributes must be an iterable of NameAttribute")
-
- # Keep list and frozenset to preserve attribute order where it matters
- self._attributes = attributes
- self._attribute_set = frozenset(attributes)
-
- if len(self._attribute_set) != len(attributes):
- raise ValueError("duplicate attributes are not allowed")
-
- def get_attributes_for_oid(self, oid):
- return [i for i in self if i.oid == oid]
-
- def __eq__(self, other):
- if not isinstance(other, RelativeDistinguishedName):
- return NotImplemented
-
- return self._attribute_set == other._attribute_set
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- return hash(self._attribute_set)
-
- def __iter__(self):
- return iter(self._attributes)
-
- def __len__(self):
- return len(self._attributes)
-
- def __repr__(self):
- return "".format(list(self))
-
-
-class Name(object):
- def __init__(self, attributes):
- attributes = list(attributes)
- if all(isinstance(x, NameAttribute) for x in attributes):
- self._attributes = [
- RelativeDistinguishedName([x]) for x in attributes
- ]
- elif all(isinstance(x, RelativeDistinguishedName) for x in attributes):
- self._attributes = attributes
- else:
- raise TypeError(
- "attributes must be a list of NameAttribute"
- " or a list RelativeDistinguishedName"
- )
-
- def get_attributes_for_oid(self, oid):
- return [i for i in self if i.oid == oid]
-
- @property
- def rdns(self):
- return self._attributes
-
- def public_bytes(self, backend):
- return backend.x509_name_bytes(self)
-
- def __eq__(self, other):
- if not isinstance(other, Name):
- return NotImplemented
-
- return self._attributes == other._attributes
-
- def __ne__(self, other):
- return not self == other
-
- def __hash__(self):
- # TODO: this is relatively expensive, if this looks like a bottleneck
- # for you, consider optimizing!
- return hash(tuple(self._attributes))
-
- def __iter__(self):
- for rdn in self._attributes:
- for ava in rdn:
- yield ava
-
- def __len__(self):
- return sum(len(rdn) for rdn in self._attributes)
-
- def __repr__(self):
- return "".format(list(self))
diff --git a/lib/cryptography/x509/ocsp.py b/lib/cryptography/x509/ocsp.py
deleted file mode 100644
index 2b0b1dc3cc..0000000000
--- a/lib/cryptography/x509/ocsp.py
+++ /dev/null
@@ -1,416 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-import abc
-import datetime
-from enum import Enum
-
-import six
-
-from cryptography import x509
-from cryptography.hazmat.primitives import hashes
-from cryptography.x509.base import (
- _UNIX_EPOCH, _convert_to_naive_utc_time, _reject_duplicate_extension
-)
-
-
-_OIDS_TO_HASH = {
- "1.3.14.3.2.26": hashes.SHA1(),
- "2.16.840.1.101.3.4.2.4": hashes.SHA224(),
- "2.16.840.1.101.3.4.2.1": hashes.SHA256(),
- "2.16.840.1.101.3.4.2.2": hashes.SHA384(),
- "2.16.840.1.101.3.4.2.3": hashes.SHA512(),
-}
-
-
-class OCSPResponderEncoding(Enum):
- HASH = "By Hash"
- NAME = "By Name"
-
-
-class OCSPResponseStatus(Enum):
- SUCCESSFUL = 0
- MALFORMED_REQUEST = 1
- INTERNAL_ERROR = 2
- TRY_LATER = 3
- SIG_REQUIRED = 5
- UNAUTHORIZED = 6
-
-
-_RESPONSE_STATUS_TO_ENUM = dict((x.value, x) for x in OCSPResponseStatus)
-_ALLOWED_HASHES = (
- hashes.SHA1, hashes.SHA224, hashes.SHA256,
- hashes.SHA384, hashes.SHA512
-)
-
-
-def _verify_algorithm(algorithm):
- if not isinstance(algorithm, _ALLOWED_HASHES):
- raise ValueError(
- "Algorithm must be SHA1, SHA224, SHA256, SHA384, or SHA512"
- )
-
-
-class OCSPCertStatus(Enum):
- GOOD = 0
- REVOKED = 1
- UNKNOWN = 2
-
-
-_CERT_STATUS_TO_ENUM = dict((x.value, x) for x in OCSPCertStatus)
-
-
-def load_der_ocsp_request(data):
- from cryptography.hazmat.backends.openssl.backend import backend
- return backend.load_der_ocsp_request(data)
-
-
-def load_der_ocsp_response(data):
- from cryptography.hazmat.backends.openssl.backend import backend
- return backend.load_der_ocsp_response(data)
-
-
-class OCSPRequestBuilder(object):
- def __init__(self, request=None, extensions=[]):
- self._request = request
- self._extensions = extensions
-
- def add_certificate(self, cert, issuer, algorithm):
- if self._request is not None:
- raise ValueError("Only one certificate can be added to a request")
-
- _verify_algorithm(algorithm)
- if (
- not isinstance(cert, x509.Certificate) or
- not isinstance(issuer, x509.Certificate)
- ):
- raise TypeError("cert and issuer must be a Certificate")
-
- return OCSPRequestBuilder((cert, issuer, algorithm), self._extensions)
-
- def add_extension(self, extension, critical):
- if not isinstance(extension, x509.ExtensionType):
- raise TypeError("extension must be an ExtensionType")
-
- extension = x509.Extension(extension.oid, critical, extension)
- _reject_duplicate_extension(extension, self._extensions)
-
- return OCSPRequestBuilder(
- self._request, self._extensions + [extension]
- )
-
- def build(self):
- from cryptography.hazmat.backends.openssl.backend import backend
- if self._request is None:
- raise ValueError("You must add a certificate before building")
-
- return backend.create_ocsp_request(self)
-
-
-class _SingleResponse(object):
- def __init__(self, cert, issuer, algorithm, cert_status, this_update,
- next_update, revocation_time, revocation_reason):
- if (
- not isinstance(cert, x509.Certificate) or
- not isinstance(issuer, x509.Certificate)
- ):
- raise TypeError("cert and issuer must be a Certificate")
-
- _verify_algorithm(algorithm)
- if not isinstance(this_update, datetime.datetime):
- raise TypeError("this_update must be a datetime object")
- if (
- next_update is not None and
- not isinstance(next_update, datetime.datetime)
- ):
- raise TypeError("next_update must be a datetime object or None")
-
- self._cert = cert
- self._issuer = issuer
- self._algorithm = algorithm
- self._this_update = this_update
- self._next_update = next_update
-
- if not isinstance(cert_status, OCSPCertStatus):
- raise TypeError(
- "cert_status must be an item from the OCSPCertStatus enum"
- )
- if cert_status is not OCSPCertStatus.REVOKED:
- if revocation_time is not None:
- raise ValueError(
- "revocation_time can only be provided if the certificate "
- "is revoked"
- )
- if revocation_reason is not None:
- raise ValueError(
- "revocation_reason can only be provided if the certificate"
- " is revoked"
- )
- else:
- if not isinstance(revocation_time, datetime.datetime):
- raise TypeError("revocation_time must be a datetime object")
-
- revocation_time = _convert_to_naive_utc_time(revocation_time)
- if revocation_time <= _UNIX_EPOCH:
- raise ValueError('The revocation_time must be after the unix'
- ' epoch (1970 January 1).')
-
- if (
- revocation_reason is not None and
- not isinstance(revocation_reason, x509.ReasonFlags)
- ):
- raise TypeError(
- "revocation_reason must be an item from the ReasonFlags "
- "enum or None"
- )
-
- self._cert_status = cert_status
- self._revocation_time = revocation_time
- self._revocation_reason = revocation_reason
-
-
-class OCSPResponseBuilder(object):
- def __init__(self, response=None, responder_id=None, certs=None,
- extensions=[]):
- self._response = response
- self._responder_id = responder_id
- self._certs = certs
- self._extensions = extensions
-
- def add_response(self, cert, issuer, algorithm, cert_status, this_update,
- next_update, revocation_time, revocation_reason):
- if self._response is not None:
- raise ValueError("Only one response per OCSPResponse.")
-
- singleresp = _SingleResponse(
- cert, issuer, algorithm, cert_status, this_update, next_update,
- revocation_time, revocation_reason
- )
- return OCSPResponseBuilder(
- singleresp, self._responder_id,
- self._certs, self._extensions,
- )
-
- def responder_id(self, encoding, responder_cert):
- if self._responder_id is not None:
- raise ValueError("responder_id can only be set once")
- if not isinstance(responder_cert, x509.Certificate):
- raise TypeError("responder_cert must be a Certificate")
- if not isinstance(encoding, OCSPResponderEncoding):
- raise TypeError(
- "encoding must be an element from OCSPResponderEncoding"
- )
-
- return OCSPResponseBuilder(
- self._response, (responder_cert, encoding),
- self._certs, self._extensions,
- )
-
- def certificates(self, certs):
- if self._certs is not None:
- raise ValueError("certificates may only be set once")
- certs = list(certs)
- if len(certs) == 0:
- raise ValueError("certs must not be an empty list")
- if not all(isinstance(x, x509.Certificate) for x in certs):
- raise TypeError("certs must be a list of Certificates")
- return OCSPResponseBuilder(
- self._response, self._responder_id,
- certs, self._extensions,
- )
-
- def add_extension(self, extension, critical):
- if not isinstance(extension, x509.ExtensionType):
- raise TypeError("extension must be an ExtensionType")
-
- extension = x509.Extension(extension.oid, critical, extension)
- _reject_duplicate_extension(extension, self._extensions)
-
- return OCSPResponseBuilder(
- self._response, self._responder_id,
- self._certs, self._extensions + [extension],
- )
-
- def sign(self, private_key, algorithm):
- from cryptography.hazmat.backends.openssl.backend import backend
- if self._response is None:
- raise ValueError("You must add a response before signing")
- if self._responder_id is None:
- raise ValueError("You must add a responder_id before signing")
-
- if not isinstance(algorithm, hashes.HashAlgorithm):
- raise TypeError("Algorithm must be a registered hash algorithm.")
-
- return backend.create_ocsp_response(
- OCSPResponseStatus.SUCCESSFUL, self, private_key, algorithm
- )
-
- @classmethod
- def build_unsuccessful(cls, response_status):
- from cryptography.hazmat.backends.openssl.backend import backend
- if not isinstance(response_status, OCSPResponseStatus):
- raise TypeError(
- "response_status must be an item from OCSPResponseStatus"
- )
- if response_status is OCSPResponseStatus.SUCCESSFUL:
- raise ValueError("response_status cannot be SUCCESSFUL")
-
- return backend.create_ocsp_response(response_status, None, None, None)
-
-
-@six.add_metaclass(abc.ABCMeta)
-class OCSPRequest(object):
- @abc.abstractproperty
- def issuer_key_hash(self):
- """
- The hash of the issuer public key
- """
-
- @abc.abstractproperty
- def issuer_name_hash(self):
- """
- The hash of the issuer name
- """
-
- @abc.abstractproperty
- def hash_algorithm(self):
- """
- The hash algorithm used in the issuer name and key hashes
- """
-
- @abc.abstractproperty
- def serial_number(self):
- """
- The serial number of the cert whose status is being checked
- """
- @abc.abstractmethod
- def public_bytes(self, encoding):
- """
- Serializes the request to DER
- """
-
- @abc.abstractproperty
- def extensions(self):
- """
- The list of request extensions. Not single request extensions.
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class OCSPResponse(object):
- @abc.abstractproperty
- def response_status(self):
- """
- The status of the response. This is a value from the OCSPResponseStatus
- enumeration
- """
-
- @abc.abstractproperty
- def signature_algorithm_oid(self):
- """
- The ObjectIdentifier of the signature algorithm
- """
-
- @abc.abstractproperty
- def signature(self):
- """
- The signature bytes
- """
-
- @abc.abstractproperty
- def tbs_response_bytes(self):
- """
- The tbsResponseData bytes
- """
-
- @abc.abstractproperty
- def certificates(self):
- """
- A list of certificates used to help build a chain to verify the OCSP
- response. This situation occurs when the OCSP responder uses a delegate
- certificate.
- """
-
- @abc.abstractproperty
- def responder_key_hash(self):
- """
- The responder's key hash or None
- """
-
- @abc.abstractproperty
- def responder_name(self):
- """
- The responder's Name or None
- """
-
- @abc.abstractproperty
- def produced_at(self):
- """
- The time the response was produced
- """
-
- @abc.abstractproperty
- def certificate_status(self):
- """
- The status of the certificate (an element from the OCSPCertStatus enum)
- """
-
- @abc.abstractproperty
- def revocation_time(self):
- """
- The date of when the certificate was revoked or None if not
- revoked.
- """
-
- @abc.abstractproperty
- def revocation_reason(self):
- """
- The reason the certificate was revoked or None if not specified or
- not revoked.
- """
-
- @abc.abstractproperty
- def this_update(self):
- """
- The most recent time at which the status being indicated is known by
- the responder to have been correct
- """
-
- @abc.abstractproperty
- def next_update(self):
- """
- The time when newer information will be available
- """
-
- @abc.abstractproperty
- def issuer_key_hash(self):
- """
- The hash of the issuer public key
- """
-
- @abc.abstractproperty
- def issuer_name_hash(self):
- """
- The hash of the issuer name
- """
-
- @abc.abstractproperty
- def hash_algorithm(self):
- """
- The hash algorithm used in the issuer name and key hashes
- """
-
- @abc.abstractproperty
- def serial_number(self):
- """
- The serial number of the cert whose status is being checked
- """
-
- @abc.abstractproperty
- def extensions(self):
- """
- The list of response extensions. Not single response extensions.
- """
diff --git a/lib/cryptography/x509/oid.py b/lib/cryptography/x509/oid.py
deleted file mode 100644
index ec19007fe3..0000000000
--- a/lib/cryptography/x509/oid.py
+++ /dev/null
@@ -1,225 +0,0 @@
-# This file is dual licensed under the terms of the Apache License, Version
-# 2.0, and the BSD License. See the LICENSE file in the root of this repository
-# for complete details.
-
-from __future__ import absolute_import, division, print_function
-
-from cryptography.hazmat._oid import ObjectIdentifier
-from cryptography.hazmat.primitives import hashes
-
-
-class ExtensionOID(object):
- SUBJECT_DIRECTORY_ATTRIBUTES = ObjectIdentifier("2.5.29.9")
- SUBJECT_KEY_IDENTIFIER = ObjectIdentifier("2.5.29.14")
- KEY_USAGE = ObjectIdentifier("2.5.29.15")
- SUBJECT_ALTERNATIVE_NAME = ObjectIdentifier("2.5.29.17")
- ISSUER_ALTERNATIVE_NAME = ObjectIdentifier("2.5.29.18")
- BASIC_CONSTRAINTS = ObjectIdentifier("2.5.29.19")
- NAME_CONSTRAINTS = ObjectIdentifier("2.5.29.30")
- CRL_DISTRIBUTION_POINTS = ObjectIdentifier("2.5.29.31")
- CERTIFICATE_POLICIES = ObjectIdentifier("2.5.29.32")
- POLICY_MAPPINGS = ObjectIdentifier("2.5.29.33")
- AUTHORITY_KEY_IDENTIFIER = ObjectIdentifier("2.5.29.35")
- POLICY_CONSTRAINTS = ObjectIdentifier("2.5.29.36")
- EXTENDED_KEY_USAGE = ObjectIdentifier("2.5.29.37")
- FRESHEST_CRL = ObjectIdentifier("2.5.29.46")
- INHIBIT_ANY_POLICY = ObjectIdentifier("2.5.29.54")
- ISSUING_DISTRIBUTION_POINT = ObjectIdentifier("2.5.29.28")
- AUTHORITY_INFORMATION_ACCESS = ObjectIdentifier("1.3.6.1.5.5.7.1.1")
- SUBJECT_INFORMATION_ACCESS = ObjectIdentifier("1.3.6.1.5.5.7.1.11")
- OCSP_NO_CHECK = ObjectIdentifier("1.3.6.1.5.5.7.48.1.5")
- TLS_FEATURE = ObjectIdentifier("1.3.6.1.5.5.7.1.24")
- CRL_NUMBER = ObjectIdentifier("2.5.29.20")
- DELTA_CRL_INDICATOR = ObjectIdentifier("2.5.29.27")
- PRECERT_SIGNED_CERTIFICATE_TIMESTAMPS = (
- ObjectIdentifier("1.3.6.1.4.1.11129.2.4.2")
- )
- PRECERT_POISON = (
- ObjectIdentifier("1.3.6.1.4.1.11129.2.4.3")
- )
-
-
-class OCSPExtensionOID(object):
- NONCE = ObjectIdentifier("1.3.6.1.5.5.7.48.1.2")
-
-
-class CRLEntryExtensionOID(object):
- CERTIFICATE_ISSUER = ObjectIdentifier("2.5.29.29")
- CRL_REASON = ObjectIdentifier("2.5.29.21")
- INVALIDITY_DATE = ObjectIdentifier("2.5.29.24")
-
-
-class NameOID(object):
- COMMON_NAME = ObjectIdentifier("2.5.4.3")
- COUNTRY_NAME = ObjectIdentifier("2.5.4.6")
- LOCALITY_NAME = ObjectIdentifier("2.5.4.7")
- STATE_OR_PROVINCE_NAME = ObjectIdentifier("2.5.4.8")
- STREET_ADDRESS = ObjectIdentifier("2.5.4.9")
- ORGANIZATION_NAME = ObjectIdentifier("2.5.4.10")
- ORGANIZATIONAL_UNIT_NAME = ObjectIdentifier("2.5.4.11")
- SERIAL_NUMBER = ObjectIdentifier("2.5.4.5")
- SURNAME = ObjectIdentifier("2.5.4.4")
- GIVEN_NAME = ObjectIdentifier("2.5.4.42")
- TITLE = ObjectIdentifier("2.5.4.12")
- GENERATION_QUALIFIER = ObjectIdentifier("2.5.4.44")
- X500_UNIQUE_IDENTIFIER = ObjectIdentifier("2.5.4.45")
- DN_QUALIFIER = ObjectIdentifier("2.5.4.46")
- PSEUDONYM = ObjectIdentifier("2.5.4.65")
- USER_ID = ObjectIdentifier("0.9.2342.19200300.100.1.1")
- DOMAIN_COMPONENT = ObjectIdentifier("0.9.2342.19200300.100.1.25")
- EMAIL_ADDRESS = ObjectIdentifier("1.2.840.113549.1.9.1")
- JURISDICTION_COUNTRY_NAME = ObjectIdentifier("1.3.6.1.4.1.311.60.2.1.3")
- JURISDICTION_LOCALITY_NAME = ObjectIdentifier("1.3.6.1.4.1.311.60.2.1.1")
- JURISDICTION_STATE_OR_PROVINCE_NAME = ObjectIdentifier(
- "1.3.6.1.4.1.311.60.2.1.2"
- )
- BUSINESS_CATEGORY = ObjectIdentifier("2.5.4.15")
- POSTAL_ADDRESS = ObjectIdentifier("2.5.4.16")
- POSTAL_CODE = ObjectIdentifier("2.5.4.17")
-
-
-class SignatureAlgorithmOID(object):
- RSA_WITH_MD5 = ObjectIdentifier("1.2.840.113549.1.1.4")
- RSA_WITH_SHA1 = ObjectIdentifier("1.2.840.113549.1.1.5")
- # This is an alternate OID for RSA with SHA1 that is occasionally seen
- _RSA_WITH_SHA1 = ObjectIdentifier("1.3.14.3.2.29")
- RSA_WITH_SHA224 = ObjectIdentifier("1.2.840.113549.1.1.14")
- RSA_WITH_SHA256 = ObjectIdentifier("1.2.840.113549.1.1.11")
- RSA_WITH_SHA384 = ObjectIdentifier("1.2.840.113549.1.1.12")
- RSA_WITH_SHA512 = ObjectIdentifier("1.2.840.113549.1.1.13")
- RSASSA_PSS = ObjectIdentifier("1.2.840.113549.1.1.10")
- ECDSA_WITH_SHA1 = ObjectIdentifier("1.2.840.10045.4.1")
- ECDSA_WITH_SHA224 = ObjectIdentifier("1.2.840.10045.4.3.1")
- ECDSA_WITH_SHA256 = ObjectIdentifier("1.2.840.10045.4.3.2")
- ECDSA_WITH_SHA384 = ObjectIdentifier("1.2.840.10045.4.3.3")
- ECDSA_WITH_SHA512 = ObjectIdentifier("1.2.840.10045.4.3.4")
- DSA_WITH_SHA1 = ObjectIdentifier("1.2.840.10040.4.3")
- DSA_WITH_SHA224 = ObjectIdentifier("2.16.840.1.101.3.4.3.1")
- DSA_WITH_SHA256 = ObjectIdentifier("2.16.840.1.101.3.4.3.2")
-
-
-_SIG_OIDS_TO_HASH = {
- SignatureAlgorithmOID.RSA_WITH_MD5: hashes.MD5(),
- SignatureAlgorithmOID.RSA_WITH_SHA1: hashes.SHA1(),
- SignatureAlgorithmOID._RSA_WITH_SHA1: hashes.SHA1(),
- SignatureAlgorithmOID.RSA_WITH_SHA224: hashes.SHA224(),
- SignatureAlgorithmOID.RSA_WITH_SHA256: hashes.SHA256(),
- SignatureAlgorithmOID.RSA_WITH_SHA384: hashes.SHA384(),
- SignatureAlgorithmOID.RSA_WITH_SHA512: hashes.SHA512(),
- SignatureAlgorithmOID.ECDSA_WITH_SHA1: hashes.SHA1(),
- SignatureAlgorithmOID.ECDSA_WITH_SHA224: hashes.SHA224(),
- SignatureAlgorithmOID.ECDSA_WITH_SHA256: hashes.SHA256(),
- SignatureAlgorithmOID.ECDSA_WITH_SHA384: hashes.SHA384(),
- SignatureAlgorithmOID.ECDSA_WITH_SHA512: hashes.SHA512(),
- SignatureAlgorithmOID.DSA_WITH_SHA1: hashes.SHA1(),
- SignatureAlgorithmOID.DSA_WITH_SHA224: hashes.SHA224(),
- SignatureAlgorithmOID.DSA_WITH_SHA256: hashes.SHA256()
-}
-
-
-class ExtendedKeyUsageOID(object):
- SERVER_AUTH = ObjectIdentifier("1.3.6.1.5.5.7.3.1")
- CLIENT_AUTH = ObjectIdentifier("1.3.6.1.5.5.7.3.2")
- CODE_SIGNING = ObjectIdentifier("1.3.6.1.5.5.7.3.3")
- EMAIL_PROTECTION = ObjectIdentifier("1.3.6.1.5.5.7.3.4")
- TIME_STAMPING = ObjectIdentifier("1.3.6.1.5.5.7.3.8")
- OCSP_SIGNING = ObjectIdentifier("1.3.6.1.5.5.7.3.9")
- ANY_EXTENDED_KEY_USAGE = ObjectIdentifier("2.5.29.37.0")
-
-
-class AuthorityInformationAccessOID(object):
- CA_ISSUERS = ObjectIdentifier("1.3.6.1.5.5.7.48.2")
- OCSP = ObjectIdentifier("1.3.6.1.5.5.7.48.1")
-
-
-class CertificatePoliciesOID(object):
- CPS_QUALIFIER = ObjectIdentifier("1.3.6.1.5.5.7.2.1")
- CPS_USER_NOTICE = ObjectIdentifier("1.3.6.1.5.5.7.2.2")
- ANY_POLICY = ObjectIdentifier("2.5.29.32.0")
-
-
-_OID_NAMES = {
- NameOID.COMMON_NAME: "commonName",
- NameOID.COUNTRY_NAME: "countryName",
- NameOID.LOCALITY_NAME: "localityName",
- NameOID.STATE_OR_PROVINCE_NAME: "stateOrProvinceName",
- NameOID.STREET_ADDRESS: "streetAddress",
- NameOID.ORGANIZATION_NAME: "organizationName",
- NameOID.ORGANIZATIONAL_UNIT_NAME: "organizationalUnitName",
- NameOID.SERIAL_NUMBER: "serialNumber",
- NameOID.SURNAME: "surname",
- NameOID.GIVEN_NAME: "givenName",
- NameOID.TITLE: "title",
- NameOID.GENERATION_QUALIFIER: "generationQualifier",
- NameOID.X500_UNIQUE_IDENTIFIER: "x500UniqueIdentifier",
- NameOID.DN_QUALIFIER: "dnQualifier",
- NameOID.PSEUDONYM: "pseudonym",
- NameOID.USER_ID: "userID",
- NameOID.DOMAIN_COMPONENT: "domainComponent",
- NameOID.EMAIL_ADDRESS: "emailAddress",
- NameOID.JURISDICTION_COUNTRY_NAME: "jurisdictionCountryName",
- NameOID.JURISDICTION_LOCALITY_NAME: "jurisdictionLocalityName",
- NameOID.JURISDICTION_STATE_OR_PROVINCE_NAME: (
- "jurisdictionStateOrProvinceName"
- ),
- NameOID.BUSINESS_CATEGORY: "businessCategory",
- NameOID.POSTAL_ADDRESS: "postalAddress",
- NameOID.POSTAL_CODE: "postalCode",
-
- SignatureAlgorithmOID.RSA_WITH_MD5: "md5WithRSAEncryption",
- SignatureAlgorithmOID.RSA_WITH_SHA1: "sha1WithRSAEncryption",
- SignatureAlgorithmOID.RSA_WITH_SHA224: "sha224WithRSAEncryption",
- SignatureAlgorithmOID.RSA_WITH_SHA256: "sha256WithRSAEncryption",
- SignatureAlgorithmOID.RSA_WITH_SHA384: "sha384WithRSAEncryption",
- SignatureAlgorithmOID.RSA_WITH_SHA512: "sha512WithRSAEncryption",
- SignatureAlgorithmOID.RSASSA_PSS: "RSASSA-PSS",
- SignatureAlgorithmOID.ECDSA_WITH_SHA1: "ecdsa-with-SHA1",
- SignatureAlgorithmOID.ECDSA_WITH_SHA224: "ecdsa-with-SHA224",
- SignatureAlgorithmOID.ECDSA_WITH_SHA256: "ecdsa-with-SHA256",
- SignatureAlgorithmOID.ECDSA_WITH_SHA384: "ecdsa-with-SHA384",
- SignatureAlgorithmOID.ECDSA_WITH_SHA512: "ecdsa-with-SHA512",
- SignatureAlgorithmOID.DSA_WITH_SHA1: "dsa-with-sha1",
- SignatureAlgorithmOID.DSA_WITH_SHA224: "dsa-with-sha224",
- SignatureAlgorithmOID.DSA_WITH_SHA256: "dsa-with-sha256",
- ExtendedKeyUsageOID.SERVER_AUTH: "serverAuth",
- ExtendedKeyUsageOID.CLIENT_AUTH: "clientAuth",
- ExtendedKeyUsageOID.CODE_SIGNING: "codeSigning",
- ExtendedKeyUsageOID.EMAIL_PROTECTION: "emailProtection",
- ExtendedKeyUsageOID.TIME_STAMPING: "timeStamping",
- ExtendedKeyUsageOID.OCSP_SIGNING: "OCSPSigning",
- ExtensionOID.SUBJECT_DIRECTORY_ATTRIBUTES: "subjectDirectoryAttributes",
- ExtensionOID.SUBJECT_KEY_IDENTIFIER: "subjectKeyIdentifier",
- ExtensionOID.KEY_USAGE: "keyUsage",
- ExtensionOID.SUBJECT_ALTERNATIVE_NAME: "subjectAltName",
- ExtensionOID.ISSUER_ALTERNATIVE_NAME: "issuerAltName",
- ExtensionOID.BASIC_CONSTRAINTS: "basicConstraints",
- ExtensionOID.PRECERT_SIGNED_CERTIFICATE_TIMESTAMPS: (
- "signedCertificateTimestampList"
- ),
- CRLEntryExtensionOID.CRL_REASON: "cRLReason",
- CRLEntryExtensionOID.INVALIDITY_DATE: "invalidityDate",
- CRLEntryExtensionOID.CERTIFICATE_ISSUER: "certificateIssuer",
- ExtensionOID.NAME_CONSTRAINTS: "nameConstraints",
- ExtensionOID.CRL_DISTRIBUTION_POINTS: "cRLDistributionPoints",
- ExtensionOID.CERTIFICATE_POLICIES: "certificatePolicies",
- ExtensionOID.POLICY_MAPPINGS: "policyMappings",
- ExtensionOID.AUTHORITY_KEY_IDENTIFIER: "authorityKeyIdentifier",
- ExtensionOID.POLICY_CONSTRAINTS: "policyConstraints",
- ExtensionOID.EXTENDED_KEY_USAGE: "extendedKeyUsage",
- ExtensionOID.FRESHEST_CRL: "freshestCRL",
- ExtensionOID.INHIBIT_ANY_POLICY: "inhibitAnyPolicy",
- ExtensionOID.ISSUING_DISTRIBUTION_POINT: (
- "issuingDistributionPoint"
- ),
- ExtensionOID.AUTHORITY_INFORMATION_ACCESS: "authorityInfoAccess",
- ExtensionOID.SUBJECT_INFORMATION_ACCESS: "subjectInfoAccess",
- ExtensionOID.OCSP_NO_CHECK: "OCSPNoCheck",
- ExtensionOID.CRL_NUMBER: "cRLNumber",
- ExtensionOID.DELTA_CRL_INDICATOR: "deltaCRLIndicator",
- ExtensionOID.TLS_FEATURE: "TLSFeature",
- AuthorityInformationAccessOID.OCSP: "OCSP",
- AuthorityInformationAccessOID.CA_ISSUERS: "caIssuers",
- CertificatePoliciesOID.CPS_QUALIFIER: "id-qt-cps",
- CertificatePoliciesOID.CPS_USER_NOTICE: "id-qt-unotice",
- OCSPExtensionOID.NONCE: "OCSPNonce",
-}
diff --git a/lib/cssselect-1.0.1.dist-info/DESCRIPTION.rst b/lib/cssselect-1.0.1.dist-info/DESCRIPTION.rst
deleted file mode 100644
index ab79e832e9..0000000000
--- a/lib/cssselect-1.0.1.dist-info/DESCRIPTION.rst
+++ /dev/null
@@ -1,27 +0,0 @@
-===================================
-cssselect: CSS Selectors for Python
-===================================
-
-*cssselect* parses `CSS3 Selectors`_ and translate them to `XPath 1.0`_
-expressions. Such expressions can be used in lxml_ or another XPath engine
-to find the matching elements in an XML or HTML document.
-
-This module used to live inside of lxml as ``lxml.cssselect`` before it was
-extracted as a stand-alone project.
-
-.. _CSS3 Selectors: https://www.w3.org/TR/css3-selectors/
-.. _XPath 1.0: https://www.w3.org/TR/xpath/
-.. _lxml: http://lxml.de/
-
-
-Quick facts:
-
-* Free software: BSD licensed
-* Compatible with Python 2.6+ and 3.3+
-* Latest documentation `on Read the Docs `_
-* Source, issues and pull requests `on Github
- `_
-* Releases `on PyPI `_
-* Install with ``pip install cssselect``
-
-
diff --git a/lib/cssselect-1.0.1.dist-info/INSTALLER b/lib/cssselect-1.0.1.dist-info/INSTALLER
deleted file mode 100644
index a1b589e38a..0000000000
--- a/lib/cssselect-1.0.1.dist-info/INSTALLER
+++ /dev/null
@@ -1 +0,0 @@
-pip
diff --git a/lib/cssselect-1.0.1.dist-info/METADATA b/lib/cssselect-1.0.1.dist-info/METADATA
deleted file mode 100644
index c6bf01c575..0000000000
--- a/lib/cssselect-1.0.1.dist-info/METADATA
+++ /dev/null
@@ -1,48 +0,0 @@
-Metadata-Version: 2.0
-Name: cssselect
-Version: 1.0.1
-Summary: cssselect parses CSS3 Selectors and translates them to XPath 1.0
-Home-page: https://github.com/scrapy/cssselect
-Author: Paul Tremberth
-Author-email: paul.tremberth@gmail.com
-License: BSD
-Platform: UNKNOWN
-Classifier: Development Status :: 4 - Beta
-Classifier: Intended Audience :: Developers
-Classifier: License :: OSI Approved :: BSD License
-Classifier: Programming Language :: Python :: 2
-Classifier: Programming Language :: Python :: 2.6
-Classifier: Programming Language :: Python :: 2.7
-Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.3
-Classifier: Programming Language :: Python :: 3.4
-Classifier: Programming Language :: Python :: 3.5
-Classifier: Programming Language :: Python :: 3.6
-
-===================================
-cssselect: CSS Selectors for Python
-===================================
-
-*cssselect* parses `CSS3 Selectors`_ and translate them to `XPath 1.0`_
-expressions. Such expressions can be used in lxml_ or another XPath engine
-to find the matching elements in an XML or HTML document.
-
-This module used to live inside of lxml as ``lxml.cssselect`` before it was
-extracted as a stand-alone project.
-
-.. _CSS3 Selectors: https://www.w3.org/TR/css3-selectors/
-.. _XPath 1.0: https://www.w3.org/TR/xpath/
-.. _lxml: http://lxml.de/
-
-
-Quick facts:
-
-* Free software: BSD licensed
-* Compatible with Python 2.6+ and 3.3+
-* Latest documentation `on Read the Docs `_
-* Source, issues and pull requests `on Github
- `_
-* Releases `on PyPI `_
-* Install with ``pip install cssselect``
-
-
diff --git a/lib/cssselect-1.0.1.dist-info/RECORD b/lib/cssselect-1.0.1.dist-info/RECORD
deleted file mode 100644
index 55191f1f49..0000000000
--- a/lib/cssselect-1.0.1.dist-info/RECORD
+++ /dev/null
@@ -1,13 +0,0 @@
-cssselect/__init__.py,sha256=84-OaSM1zXsWcrbkiO89RFg5UWibfy-DWdDg-iAQlU4,639
-cssselect/parser.py,sha256=kt8XulESIK8atSypuNCgKEPJlyVh3-oKDZyNA27dRUA,23708
-cssselect/xpath.py,sha256=0gbRZvq8s4FQT4DaXtzQDeZKh5yDElFgJ3Y3lVWpp_E,27792
-cssselect-1.0.1.dist-info/DESCRIPTION.rst,sha256=nv0d5nxmIaOdbPeUWEV0i0YhMDIEsQgdLI0uAA1uLoc,913
-cssselect-1.0.1.dist-info/METADATA,sha256=ZwplTkdNvaDXDJ9-EaJSavqNUwSrAv7R8OcLhtLYRsk,1715
-cssselect-1.0.1.dist-info/RECORD,,
-cssselect-1.0.1.dist-info/WHEEL,sha256=o2k-Qa-RMNIJmUdIc7KU6VWR_ErNRbWNlxDIpl7lm34,110
-cssselect-1.0.1.dist-info/metadata.json,sha256=jMQm6d6TvQ8UXsVRA288MuZbw9zlAUlmeTW51uI_Krg,906
-cssselect-1.0.1.dist-info/top_level.txt,sha256=GKK3Utu_ceog6CK27VXNdbyiqGnoyJo3970FLo5JdUU,10
-cssselect-1.0.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
-cssselect/__init__.pyc,,
-cssselect/parser.pyc,,
-cssselect/xpath.pyc,,
diff --git a/lib/cssselect-1.0.1.dist-info/WHEEL b/lib/cssselect-1.0.1.dist-info/WHEEL
deleted file mode 100644
index 8b6dd1b5a8..0000000000
--- a/lib/cssselect-1.0.1.dist-info/WHEEL
+++ /dev/null
@@ -1,6 +0,0 @@
-Wheel-Version: 1.0
-Generator: bdist_wheel (0.29.0)
-Root-Is-Purelib: true
-Tag: py2-none-any
-Tag: py3-none-any
-
diff --git a/lib/cssselect-1.0.1.dist-info/metadata.json b/lib/cssselect-1.0.1.dist-info/metadata.json
deleted file mode 100644
index f3e14834fe..0000000000
--- a/lib/cssselect-1.0.1.dist-info/metadata.json
+++ /dev/null
@@ -1 +0,0 @@
-{"classifiers": ["Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6"], "extensions": {"python.details": {"contacts": [{"email": "paul.tremberth@gmail.com", "name": "Paul Tremberth", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst"}, "project_urls": {"Home": "https://github.com/scrapy/cssselect"}}}, "generator": "bdist_wheel (0.29.0)", "license": "BSD", "metadata_version": "2.0", "name": "cssselect", "summary": "cssselect parses CSS3 Selectors and translates them to XPath 1.0", "version": "1.0.1"}
\ No newline at end of file
diff --git a/lib/cssselect-1.0.1.dist-info/top_level.txt b/lib/cssselect-1.0.1.dist-info/top_level.txt
deleted file mode 100644
index d2a154e7c0..0000000000
--- a/lib/cssselect-1.0.1.dist-info/top_level.txt
+++ /dev/null
@@ -1 +0,0 @@
-cssselect
diff --git a/lib/cssselect/__init__.py b/lib/cssselect/__init__.py
deleted file mode 100644
index 3b06261f35..0000000000
--- a/lib/cssselect/__init__.py
+++ /dev/null
@@ -1,22 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- CSS Selectors based on XPath
- ============================
-
- This module supports selecting XML/HTML elements based on CSS selectors.
- See the `CSSSelector` class for details.
-
-
- :copyright: (c) 2007-2012 Ian Bicking and contributors.
- See AUTHORS for more details.
- :license: BSD, see LICENSE for more details.
-
-"""
-
-from cssselect.parser import (parse, Selector, FunctionalPseudoElement,
- SelectorError, SelectorSyntaxError)
-from cssselect.xpath import GenericTranslator, HTMLTranslator, ExpressionError
-
-
-VERSION = '1.0.1'
-__version__ = VERSION
diff --git a/lib/cssselect/parser.py b/lib/cssselect/parser.py
deleted file mode 100644
index d155252b34..0000000000
--- a/lib/cssselect/parser.py
+++ /dev/null
@@ -1,766 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- cssselect.parser
- ================
-
- Tokenizer, parser and parsed objects for CSS selectors.
-
-
- :copyright: (c) 2007-2012 Ian Bicking and contributors.
- See AUTHORS for more details.
- :license: BSD, see LICENSE for more details.
-
-"""
-
-import sys
-import re
-import operator
-
-
-if sys.version_info[0] < 3:
- _unicode = unicode
- _unichr = unichr
-else:
- _unicode = str
- _unichr = chr
-
-
-def ascii_lower(string):
- """Lower-case, but only in the ASCII range."""
- return string.encode('utf8').lower().decode('utf8')
-
-
-class SelectorError(Exception):
- """Common parent for :class:`SelectorSyntaxError` and
- :class:`ExpressionError`.
-
- You can just use ``except SelectorError:`` when calling
- :meth:`~GenericTranslator.css_to_xpath` and handle both exceptions types.
-
- """
-
-class SelectorSyntaxError(SelectorError, SyntaxError):
- """Parsing a selector that does not match the grammar."""
-
-
-#### Parsed objects
-
-class Selector(object):
- """
- Represents a parsed selector.
-
- :meth:`~GenericTranslator.selector_to_xpath` accepts this object,
- but ignores :attr:`pseudo_element`. It is the user’s responsibility
- to account for pseudo-elements and reject selectors with unknown
- or unsupported pseudo-elements.
-
- """
- def __init__(self, tree, pseudo_element=None):
- self.parsed_tree = tree
- if pseudo_element is not None and not isinstance(
- pseudo_element, FunctionalPseudoElement):
- pseudo_element = ascii_lower(pseudo_element)
- #: A :class:`FunctionalPseudoElement`,
- #: or the identifier for the pseudo-element as a string,
- # or ``None``.
- #:
- #: +-------------------------+----------------+--------------------------------+
- #: | | Selector | Pseudo-element |
- #: +=========================+================+================================+
- #: | CSS3 syntax | ``a::before`` | ``'before'`` |
- #: +-------------------------+----------------+--------------------------------+
- #: | Older syntax | ``a:before`` | ``'before'`` |
- #: +-------------------------+----------------+--------------------------------+
- #: | From the Lists3_ draft, | ``li::marker`` | ``'marker'`` |
- #: | not in Selectors3 | | |
- #: +-------------------------+----------------+--------------------------------+
- #: | Invalid pseudo-class | ``li:marker`` | ``None`` |
- #: +-------------------------+----------------+--------------------------------+
- #: | Functinal | ``a::foo(2)`` | ``FunctionalPseudoElement(…)`` |
- #: +-------------------------+----------------+--------------------------------+
- #:
- #: .. _Lists3: http://www.w3.org/TR/2011/WD-css3-lists-20110524/#marker-pseudoelement
- self.pseudo_element = pseudo_element
-
- def __repr__(self):
- if isinstance(self.pseudo_element, FunctionalPseudoElement):
- pseudo_element = repr(self.pseudo_element)
- elif self.pseudo_element:
- pseudo_element = '::%s' % self.pseudo_element
- else:
- pseudo_element = ''
- return '%s[%r%s]' % (
- self.__class__.__name__, self.parsed_tree, pseudo_element)
-
- def specificity(self):
- """Return the specificity_ of this selector as a tuple of 3 integers.
-
- .. _specificity: http://www.w3.org/TR/selectors/#specificity
-
- """
- a, b, c = self.parsed_tree.specificity()
- if self.pseudo_element:
- c += 1
- return a, b, c
-
-
-class Class(object):
- """
- Represents selector.class_name
- """
- def __init__(self, selector, class_name):
- self.selector = selector
- self.class_name = class_name
-
- def __repr__(self):
- return '%s[%r.%s]' % (
- self.__class__.__name__, self.selector, self.class_name)
-
- def specificity(self):
- a, b, c = self.selector.specificity()
- b += 1
- return a, b, c
-
-
-class FunctionalPseudoElement(object):
- """
- Represents selector::name(arguments)
-
- .. attribute:: name
-
- The name (identifier) of the pseudo-element, as a string.
-
- .. attribute:: arguments
-
- The arguments of the pseudo-element, as a list of tokens.
-
- **Note:** tokens are not part of the public API,
- and may change between cssselect versions.
- Use at your own risks.
-
- """
- def __init__(self, name, arguments):
- self.name = ascii_lower(name)
- self.arguments = arguments
-
- def __repr__(self):
- return '%s[::%s(%r)]' % (
- self.__class__.__name__, self.name,
- [token.value for token in self.arguments])
-
- def argument_types(self):
- return [token.type for token in self.arguments]
-
- def specificity(self):
- a, b, c = self.selector.specificity()
- b += 1
- return a, b, c
-
-
-class Function(object):
- """
- Represents selector:name(expr)
- """
- def __init__(self, selector, name, arguments):
- self.selector = selector
- self.name = ascii_lower(name)
- self.arguments = arguments
-
- def __repr__(self):
- return '%s[%r:%s(%r)]' % (
- self.__class__.__name__, self.selector, self.name,
- [token.value for token in self.arguments])
-
- def argument_types(self):
- return [token.type for token in self.arguments]
-
- def specificity(self):
- a, b, c = self.selector.specificity()
- b += 1
- return a, b, c
-
-
-class Pseudo(object):
- """
- Represents selector:ident
- """
- def __init__(self, selector, ident):
- self.selector = selector
- self.ident = ascii_lower(ident)
-
- def __repr__(self):
- return '%s[%r:%s]' % (
- self.__class__.__name__, self.selector, self.ident)
-
- def specificity(self):
- a, b, c = self.selector.specificity()
- b += 1
- return a, b, c
-
-
-class Negation(object):
- """
- Represents selector:not(subselector)
- """
- def __init__(self, selector, subselector):
- self.selector = selector
- self.subselector = subselector
-
- def __repr__(self):
- return '%s[%r:not(%r)]' % (
- self.__class__.__name__, self.selector, self.subselector)
-
- def specificity(self):
- a1, b1, c1 = self.selector.specificity()
- a2, b2, c2 = self.subselector.specificity()
- return a1 + a2, b1 + b2, c1 + c2
-
-
-class Attrib(object):
- """
- Represents selector[namespace|attrib operator value]
- """
- def __init__(self, selector, namespace, attrib, operator, value):
- self.selector = selector
- self.namespace = namespace
- self.attrib = attrib
- self.operator = operator
- self.value = value
-
- def __repr__(self):
- if self.namespace:
- attrib = '%s|%s' % (self.namespace, self.attrib)
- else:
- attrib = self.attrib
- if self.operator == 'exists':
- return '%s[%r[%s]]' % (
- self.__class__.__name__, self.selector, attrib)
- else:
- return '%s[%r[%s %s %r]]' % (
- self.__class__.__name__, self.selector, attrib,
- self.operator, self.value)
-
- def specificity(self):
- a, b, c = self.selector.specificity()
- b += 1
- return a, b, c
-
-
-class Element(object):
- """
- Represents namespace|element
-
- `None` is for the universal selector '*'
-
- """
- def __init__(self, namespace=None, element=None):
- self.namespace = namespace
- self.element = element
-
- def __repr__(self):
- element = self.element or '*'
- if self.namespace:
- element = '%s|%s' % (self.namespace, element)
- return '%s[%s]' % (self.__class__.__name__, element)
-
- def specificity(self):
- if self.element:
- return 0, 0, 1
- else:
- return 0, 0, 0
-
-
-class Hash(object):
- """
- Represents selector#id
- """
- def __init__(self, selector, id):
- self.selector = selector
- self.id = id
-
- def __repr__(self):
- return '%s[%r#%s]' % (
- self.__class__.__name__, self.selector, self.id)
-
- def specificity(self):
- a, b, c = self.selector.specificity()
- a += 1
- return a, b, c
-
-
-class CombinedSelector(object):
- def __init__(self, selector, combinator, subselector):
- assert selector is not None
- self.selector = selector
- self.combinator = combinator
- self.subselector = subselector
-
- def __repr__(self):
- if self.combinator == ' ':
- comb = ''
- else:
- comb = self.combinator
- return '%s[%r %s %r]' % (
- self.__class__.__name__, self.selector, comb, self.subselector)
-
- def specificity(self):
- a1, b1, c1 = self.selector.specificity()
- a2, b2, c2 = self.subselector.specificity()
- return a1 + a2, b1 + b2, c1 + c2
-
-
-#### Parser
-
-# foo
-_el_re = re.compile(r'^[ \t\r\n\f]*([a-zA-Z]+)[ \t\r\n\f]*$')
-
-# foo#bar or #bar
-_id_re = re.compile(r'^[ \t\r\n\f]*([a-zA-Z]*)#([a-zA-Z0-9_-]+)[ \t\r\n\f]*$')
-
-# foo.bar or .bar
-_class_re = re.compile(
- r'^[ \t\r\n\f]*([a-zA-Z]*)\.([a-zA-Z][a-zA-Z0-9_-]*)[ \t\r\n\f]*$')
-
-
-def parse(css):
- """Parse a CSS *group of selectors*.
-
- If you don't care about pseudo-elements or selector specificity,
- you can skip this and use :meth:`~GenericTranslator.css_to_xpath`.
-
- :param css:
- A *group of selectors* as an Unicode string.
- :raises:
- :class:`SelectorSyntaxError` on invalid selectors.
- :returns:
- A list of parsed :class:`Selector` objects, one for each
- selector in the comma-separated group.
-
- """
- # Fast path for simple cases
- match = _el_re.match(css)
- if match:
- return [Selector(Element(element=match.group(1)))]
- match = _id_re.match(css)
- if match is not None:
- return [Selector(Hash(Element(element=match.group(1) or None),
- match.group(2)))]
- match = _class_re.match(css)
- if match is not None:
- return [Selector(Class(Element(element=match.group(1) or None),
- match.group(2)))]
-
- stream = TokenStream(tokenize(css))
- stream.source = css
- return list(parse_selector_group(stream))
-# except SelectorSyntaxError:
-# e = sys.exc_info()[1]
-# message = "%s at %s -> %r" % (
-# e, stream.used, stream.peek())
-# e.msg = message
-# if sys.version_info < (2,6):
-# e.message = message
-# e.args = tuple([message])
-# raise
-
-
-def parse_selector_group(stream):
- stream.skip_whitespace()
- while 1:
- yield Selector(*parse_selector(stream))
- if stream.peek() == ('DELIM', ','):
- stream.next()
- stream.skip_whitespace()
- else:
- break
-
-def parse_selector(stream):
- result, pseudo_element = parse_simple_selector(stream)
- while 1:
- stream.skip_whitespace()
- peek = stream.peek()
- if peek in (('EOF', None), ('DELIM', ',')):
- break
- if pseudo_element:
- raise SelectorSyntaxError(
- 'Got pseudo-element ::%s not at the end of a selector'
- % pseudo_element)
- if peek.is_delim('+', '>', '~'):
- # A combinator
- combinator = stream.next().value
- stream.skip_whitespace()
- else:
- # By exclusion, the last parse_simple_selector() ended
- # at peek == ' '
- combinator = ' '
- next_selector, pseudo_element = parse_simple_selector(stream)
- result = CombinedSelector(result, combinator, next_selector)
- return result, pseudo_element
-
-
-def parse_simple_selector(stream, inside_negation=False):
- stream.skip_whitespace()
- selector_start = len(stream.used)
- peek = stream.peek()
- if peek.type == 'IDENT' or peek == ('DELIM', '*'):
- if peek.type == 'IDENT':
- namespace = stream.next().value
- else:
- stream.next()
- namespace = None
- if stream.peek() == ('DELIM', '|'):
- stream.next()
- element = stream.next_ident_or_star()
- else:
- element = namespace
- namespace = None
- else:
- element = namespace = None
- result = Element(namespace, element)
- pseudo_element = None
- while 1:
- peek = stream.peek()
- if peek.type in ('S', 'EOF') or peek.is_delim(',', '+', '>', '~') or (
- inside_negation and peek == ('DELIM', ')')):
- break
- if pseudo_element:
- raise SelectorSyntaxError(
- 'Got pseudo-element ::%s not at the end of a selector'
- % pseudo_element)
- if peek.type == 'HASH':
- result = Hash(result, stream.next().value)
- elif peek == ('DELIM', '.'):
- stream.next()
- result = Class(result, stream.next_ident())
- elif peek == ('DELIM', '['):
- stream.next()
- result = parse_attrib(result, stream)
- elif peek == ('DELIM', ':'):
- stream.next()
- if stream.peek() == ('DELIM', ':'):
- stream.next()
- pseudo_element = stream.next_ident()
- if stream.peek() == ('DELIM', '('):
- stream.next()
- pseudo_element = FunctionalPseudoElement(
- pseudo_element, parse_arguments(stream))
- continue
- ident = stream.next_ident()
- if ident.lower() in ('first-line', 'first-letter',
- 'before', 'after'):
- # Special case: CSS 2.1 pseudo-elements can have a single ':'
- # Any new pseudo-element must have two.
- pseudo_element = _unicode(ident)
- continue
- if stream.peek() != ('DELIM', '('):
- result = Pseudo(result, ident)
- continue
- stream.next()
- stream.skip_whitespace()
- if ident.lower() == 'not':
- if inside_negation:
- raise SelectorSyntaxError('Got nested :not()')
- argument, argument_pseudo_element = parse_simple_selector(
- stream, inside_negation=True)
- next = stream.next()
- if argument_pseudo_element:
- raise SelectorSyntaxError(
- 'Got pseudo-element ::%s inside :not() at %s'
- % (argument_pseudo_element, next.pos))
- if next != ('DELIM', ')'):
- raise SelectorSyntaxError("Expected ')', got %s" % (next,))
- result = Negation(result, argument)
- else:
- result = Function(result, ident, parse_arguments(stream))
- else:
- raise SelectorSyntaxError(
- "Expected selector, got %s" % (peek,))
- if len(stream.used) == selector_start:
- raise SelectorSyntaxError(
- "Expected selector, got %s" % (stream.peek(),))
- return result, pseudo_element
-
-
-def parse_arguments(stream):
- arguments = []
- while 1:
- stream.skip_whitespace()
- next = stream.next()
- if next.type in ('IDENT', 'STRING', 'NUMBER') or next in [
- ('DELIM', '+'), ('DELIM', '-')]:
- arguments.append(next)
- elif next == ('DELIM', ')'):
- return arguments
- else:
- raise SelectorSyntaxError(
- "Expected an argument, got %s" % (next,))
-
-
-def parse_attrib(selector, stream):
- stream.skip_whitespace()
- attrib = stream.next_ident_or_star()
- if attrib is None and stream.peek() != ('DELIM', '|'):
- raise SelectorSyntaxError(
- "Expected '|', got %s" % (stream.peek(),))
- if stream.peek() == ('DELIM', '|'):
- stream.next()
- if stream.peek() == ('DELIM', '='):
- namespace = None
- stream.next()
- op = '|='
- else:
- namespace = attrib
- attrib = stream.next_ident()
- op = None
- else:
- namespace = op = None
- if op is None:
- stream.skip_whitespace()
- next = stream.next()
- if next == ('DELIM', ']'):
- return Attrib(selector, namespace, attrib, 'exists', None)
- elif next == ('DELIM', '='):
- op = '='
- elif next.is_delim('^', '$', '*', '~', '|', '!') and (
- stream.peek() == ('DELIM', '=')):
- op = next.value + '='
- stream.next()
- else:
- raise SelectorSyntaxError(
- "Operator expected, got %s" % (next,))
- stream.skip_whitespace()
- value = stream.next()
- if value.type not in ('IDENT', 'STRING'):
- raise SelectorSyntaxError(
- "Expected string or ident, got %s" % (value,))
- stream.skip_whitespace()
- next = stream.next()
- if next != ('DELIM', ']'):
- raise SelectorSyntaxError(
- "Expected ']', got %s" % (next,))
- return Attrib(selector, namespace, attrib, op, value.value)
-
-
-def parse_series(tokens):
- """
- Parses the arguments for :nth-child() and friends.
-
- :raises: A list of tokens
- :returns: :``(a, b)``
-
- """
- for token in tokens:
- if token.type == 'STRING':
- raise ValueError('String tokens not allowed in series.')
- s = ''.join(token.value for token in tokens).strip()
- if s == 'odd':
- return (2, 1)
- elif s == 'even':
- return (2, 0)
- elif s == 'n':
- return (1, 0)
- if 'n' not in s:
- # Just b
- return (0, int(s))
- a, b = s.split('n', 1)
- if not a:
- a = 1
- elif a == '-' or a == '+':
- a = int(a+'1')
- else:
- a = int(a)
- if not b:
- b = 0
- else:
- b = int(b)
- return (a, b)
-
-
-#### Token objects
-
-class Token(tuple):
- def __new__(cls, type_, value, pos):
- obj = tuple.__new__(cls, (type_, value))
- obj.pos = pos
- return obj
-
- def __repr__(self):
- return "<%s '%s' at %i>" % (self.type, self.value, self.pos)
-
- def is_delim(self, *values):
- return self.type == 'DELIM' and self.value in values
-
- type = property(operator.itemgetter(0))
- value = property(operator.itemgetter(1))
-
-
-class EOFToken(Token):
- def __new__(cls, pos):
- return Token.__new__(cls, 'EOF', None, pos)
-
- def __repr__(self):
- return '<%s at %i>' % (self.type, self.pos)
-
-
-#### Tokenizer
-
-
-class TokenMacros:
- unicode_escape = r'\\([0-9a-f]{1,6})(?:\r\n|[ \n\r\t\f])?'
- escape = unicode_escape + r'|\\[^\n\r\f0-9a-f]'
- string_escape = r'\\(?:\n|\r\n|\r|\f)|' + escape
- nonascii = r'[^\0-\177]'
- nmchar = '[_a-z0-9-]|%s|%s' % (escape, nonascii)
- nmstart = '[_a-z]|%s|%s' % (escape, nonascii)
-
-def _compile(pattern):
- return re.compile(pattern % vars(TokenMacros), re.IGNORECASE).match
-
-_match_whitespace = _compile(r'[ \t\r\n\f]+')
-_match_number = _compile('[+-]?(?:[0-9]*\.[0-9]+|[0-9]+)')
-_match_hash = _compile('#(?:%(nmchar)s)+')
-_match_ident = _compile('-?(?:%(nmstart)s)(?:%(nmchar)s)*')
-_match_string_by_quote = {
- "'": _compile(r"([^\n\r\f\\']|%(string_escape)s)*"),
- '"': _compile(r'([^\n\r\f\\"]|%(string_escape)s)*'),
-}
-
-_sub_simple_escape = re.compile(r'\\(.)').sub
-_sub_unicode_escape = re.compile(TokenMacros.unicode_escape, re.I).sub
-_sub_newline_escape =re.compile(r'\\(?:\n|\r\n|\r|\f)').sub
-
-# Same as r'\1', but faster on CPython
-if hasattr(operator, 'methodcaller'):
- # Python 2.6+
- _replace_simple = operator.methodcaller('group', 1)
-else:
- def _replace_simple(match):
- return match.group(1)
-
-def _replace_unicode(match):
- codepoint = int(match.group(1), 16)
- if codepoint > sys.maxunicode:
- codepoint = 0xFFFD
- return _unichr(codepoint)
-
-
-def unescape_ident(value):
- value = _sub_unicode_escape(_replace_unicode, value)
- value = _sub_simple_escape(_replace_simple, value)
- return value
-
-
-def tokenize(s):
- pos = 0
- len_s = len(s)
- while pos < len_s:
- match = _match_whitespace(s, pos=pos)
- if match:
- yield Token('S', ' ', pos)
- pos = match.end()
- continue
-
- match = _match_ident(s, pos=pos)
- if match:
- value = _sub_simple_escape(_replace_simple,
- _sub_unicode_escape(_replace_unicode, match.group()))
- yield Token('IDENT', value, pos)
- pos = match.end()
- continue
-
- match = _match_hash(s, pos=pos)
- if match:
- value = _sub_simple_escape(_replace_simple,
- _sub_unicode_escape(_replace_unicode, match.group()[1:]))
- yield Token('HASH', value, pos)
- pos = match.end()
- continue
-
- quote = s[pos]
- if quote in _match_string_by_quote:
- match = _match_string_by_quote[quote](s, pos=pos + 1)
- assert match, 'Should have found at least an empty match'
- end_pos = match.end()
- if end_pos == len_s:
- raise SelectorSyntaxError('Unclosed string at %s' % pos)
- if s[end_pos] != quote:
- raise SelectorSyntaxError('Invalid string at %s' % pos)
- value = _sub_simple_escape(_replace_simple,
- _sub_unicode_escape(_replace_unicode,
- _sub_newline_escape('', match.group())))
- yield Token('STRING', value, pos)
- pos = end_pos + 1
- continue
-
- match = _match_number(s, pos=pos)
- if match:
- value = match.group()
- yield Token('NUMBER', value, pos)
- pos = match.end()
- continue
-
- pos2 = pos + 2
- if s[pos:pos2] == '/*':
- pos = s.find('*/', pos2)
- if pos == -1:
- pos = len_s
- else:
- pos += 2
- continue
-
- yield Token('DELIM', s[pos], pos)
- pos += 1
-
- assert pos == len_s
- yield EOFToken(pos)
-
-
-class TokenStream(object):
- def __init__(self, tokens, source=None):
- self.used = []
- self.tokens = iter(tokens)
- self.source = source
- self.peeked = None
- self._peeking = False
- try:
- self.next_token = self.tokens.next
- except AttributeError:
- # Python 3
- self.next_token = self.tokens.__next__
-
- def next(self):
- if self._peeking:
- self._peeking = False
- self.used.append(self.peeked)
- return self.peeked
- else:
- next = self.next_token()
- self.used.append(next)
- return next
-
- def peek(self):
- if not self._peeking:
- self.peeked = self.next_token()
- self._peeking = True
- return self.peeked
-
- def next_ident(self):
- next = self.next()
- if next.type != 'IDENT':
- raise SelectorSyntaxError('Expected ident, got %s' % (next,))
- return next.value
-
- def next_ident_or_star(self):
- next = self.next()
- if next.type == 'IDENT':
- return next.value
- elif next == ('DELIM', '*'):
- return None
- else:
- raise SelectorSyntaxError(
- "Expected ident or '*', got %s" % (next,))
-
- def skip_whitespace(self):
- peek = self.peek()
- if peek.type == 'S':
- self.next()
diff --git a/lib/cssselect/xpath.py b/lib/cssselect/xpath.py
deleted file mode 100644
index 698748a492..0000000000
--- a/lib/cssselect/xpath.py
+++ /dev/null
@@ -1,773 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- cssselect.xpath
- ===============
-
- Translation of parsed CSS selectors to XPath expressions.
-
-
- :copyright: (c) 2007-2012 Ian Bicking and contributors.
- See AUTHORS for more details.
- :license: BSD, see LICENSE for more details.
-
-"""
-
-import sys
-import re
-
-from cssselect.parser import parse, parse_series, SelectorError
-
-
-if sys.version_info[0] < 3:
- _basestring = basestring
- _unicode = unicode
-else:
- _basestring = str
- _unicode = str
-
-
-def _unicode_safe_getattr(obj, name, default=None):
- # getattr() with a non-ASCII name fails on Python 2.x
- name = name.encode('ascii', 'replace').decode('ascii')
- return getattr(obj, name, default)
-
-
-class ExpressionError(SelectorError, RuntimeError):
- """Unknown or unsupported selector (eg. pseudo-class)."""
-
-
-#### XPath Helpers
-
-class XPathExpr(object):
-
- def __init__(self, path='', element='*', condition='', star_prefix=False):
- self.path = path
- self.element = element
- self.condition = condition
-
- def __str__(self):
- path = _unicode(self.path) + _unicode(self.element)
- if self.condition:
- path += '[%s]' % self.condition
- return path
-
- def __repr__(self):
- return '%s[%s]' % (self.__class__.__name__, self)
-
- def add_condition(self, condition):
- if self.condition:
- self.condition = '%s and (%s)' % (self.condition, condition)
- else:
- self.condition = condition
- return self
-
- def add_name_test(self):
- if self.element == '*':
- # We weren't doing a test anyway
- return
- self.add_condition(
- "name() = %s" % GenericTranslator.xpath_literal(self.element))
- self.element = '*'
-
- def add_star_prefix(self):
- """
- Append '*/' to the path to keep the context constrained
- to a single parent.
- """
- self.path += '*/'
-
- def join(self, combiner, other):
- path = _unicode(self) + combiner
- # Any "star prefix" is redundant when joining.
- if other.path != '*/':
- path += other.path
- self.path = path
- self.element = other.element
- self.condition = other.condition
- return self
-
-
-split_at_single_quotes = re.compile("('+)").split
-
-# The spec is actually more permissive than that, but don’t bother.
-# This is just for the fast path.
-# http://www.w3.org/TR/REC-xml/#NT-NameStartChar
-is_safe_name = re.compile('^[a-zA-Z_][a-zA-Z0-9_.-]*$').match
-
-# Test that the string is not empty and does not contain whitespace
-is_non_whitespace = re.compile(r'^[^ \t\r\n\f]+$').match
-
-
-#### Translation
-
-class GenericTranslator(object):
- """
- Translator for "generic" XML documents.
-
- Everything is case-sensitive, no assumption is made on the meaning
- of element names and attribute names.
-
- """
-
- ####
- #### HERE BE DRAGONS
- ####
- #### You are welcome to hook into this to change some behavior,
- #### but do so at your own risks.
- #### Until is has recieved a lot more work and review,
- #### I reserve the right to change this API in backward-incompatible ways
- #### with any minor version of cssselect.
- #### See https://github.com/scrapy/cssselect/pull/22
- #### -- Simon Sapin.
- ####
-
- combinator_mapping = {
- ' ': 'descendant',
- '>': 'child',
- '+': 'direct_adjacent',
- '~': 'indirect_adjacent',
- }
-
- attribute_operator_mapping = {
- 'exists': 'exists',
- '=': 'equals',
- '~=': 'includes',
- '|=': 'dashmatch',
- '^=': 'prefixmatch',
- '$=': 'suffixmatch',
- '*=': 'substringmatch',
- '!=': 'different', # XXX Not in Level 3 but meh
- }
-
- #: The attribute used for ID selectors depends on the document language:
- #: http://www.w3.org/TR/selectors/#id-selectors
- id_attribute = 'id'
-
- #: The attribute used for ``:lang()`` depends on the document language:
- #: http://www.w3.org/TR/selectors/#lang-pseudo
- lang_attribute = 'xml:lang'
-
- #: The case sensitivity of document language element names,
- #: attribute names, and attribute values in selectors depends
- #: on the document language.
- #: http://www.w3.org/TR/selectors/#casesens
- #:
- #: When a document language defines one of these as case-insensitive,
- #: cssselect assumes that the document parser makes the parsed values
- #: lower-case. Making the selector lower-case too makes the comparaison
- #: case-insensitive.
- #:
- #: In HTML, element names and attributes names (but not attribute values)
- #: are case-insensitive. All of lxml.html, html5lib, BeautifulSoup4
- #: and HTMLParser make them lower-case in their parse result, so
- #: the assumption holds.
- lower_case_element_names = False
- lower_case_attribute_names = False
- lower_case_attribute_values = False
-
- # class used to represent and xpath expression
- xpathexpr_cls = XPathExpr
-
- def css_to_xpath(self, css, prefix='descendant-or-self::'):
- """Translate a *group of selectors* to XPath.
-
- Pseudo-elements are not supported here since XPath only knows
- about "real" elements.
-
- :param css:
- A *group of selectors* as an Unicode string.
- :param prefix:
- This string is prepended to the XPath expression for each selector.
- The default makes selectors scoped to the context node’s subtree.
- :raises:
- :class:`SelectorSyntaxError` on invalid selectors,
- :class:`ExpressionError` on unknown/unsupported selectors,
- including pseudo-elements.
- :returns:
- The equivalent XPath 1.0 expression as an Unicode string.
-
- """
- return ' | '.join(self.selector_to_xpath(selector, prefix,
- translate_pseudo_elements=True)
- for selector in parse(css))
-
- def selector_to_xpath(self, selector, prefix='descendant-or-self::',
- translate_pseudo_elements=False):
- """Translate a parsed selector to XPath.
-
-
- :param selector:
- A parsed :class:`Selector` object.
- :param prefix:
- This string is prepended to the resulting XPath expression.
- The default makes selectors scoped to the context node’s subtree.
- :param translate_pseudo_elements:
- Unless this is set to ``True`` (as :meth:`css_to_xpath` does),
- the :attr:`~Selector.pseudo_element` attribute of the selector
- is ignored.
- It is the caller's responsibility to reject selectors
- with pseudo-elements, or to account for them somehow.
- :raises:
- :class:`ExpressionError` on unknown/unsupported selectors.
- :returns:
- The equivalent XPath 1.0 expression as an Unicode string.
-
- """
- tree = getattr(selector, 'parsed_tree', None)
- if not tree:
- raise TypeError('Expected a parsed selector, got %r' % (selector,))
- xpath = self.xpath(tree)
- assert isinstance(xpath, self.xpathexpr_cls) # help debug a missing 'return'
- if translate_pseudo_elements and selector.pseudo_element:
- xpath = self.xpath_pseudo_element(xpath, selector.pseudo_element)
- return (prefix or '') + _unicode(xpath)
-
- def xpath_pseudo_element(self, xpath, pseudo_element):
- """Translate a pseudo-element.
-
- Defaults to not supporting pseudo-elements at all,
- but can be overridden by sub-classes.
-
- """
- raise ExpressionError('Pseudo-elements are not supported.')
-
- @staticmethod
- def xpath_literal(s):
- s = _unicode(s)
- if "'" not in s:
- s = "'%s'" % s
- elif '"' not in s:
- s = '"%s"' % s
- else:
- s = "concat(%s)" % ','.join([
- (("'" in part) and '"%s"' or "'%s'") % part
- for part in split_at_single_quotes(s) if part
- ])
- return s
-
- def xpath(self, parsed_selector):
- """Translate any parsed selector object."""
- type_name = type(parsed_selector).__name__
- method = getattr(self, 'xpath_%s' % type_name.lower(), None)
- if method is None:
- raise ExpressionError('%s is not supported.' % type_name)
- return method(parsed_selector)
-
-
- # Dispatched by parsed object type
-
- def xpath_combinedselector(self, combined):
- """Translate a combined selector."""
- combinator = self.combinator_mapping[combined.combinator]
- method = getattr(self, 'xpath_%s_combinator' % combinator)
- return method(self.xpath(combined.selector),
- self.xpath(combined.subselector))
-
- def xpath_negation(self, negation):
- xpath = self.xpath(negation.selector)
- sub_xpath = self.xpath(negation.subselector)
- sub_xpath.add_name_test()
- if sub_xpath.condition:
- return xpath.add_condition('not(%s)' % sub_xpath.condition)
- else:
- return xpath.add_condition('0')
-
- def xpath_function(self, function):
- """Translate a functional pseudo-class."""
- method = 'xpath_%s_function' % function.name.replace('-', '_')
- method = _unicode_safe_getattr(self, method, None)
- if not method:
- raise ExpressionError(
- "The pseudo-class :%s() is unknown" % function.name)
- return method(self.xpath(function.selector), function)
-
- def xpath_pseudo(self, pseudo):
- """Translate a pseudo-class."""
- method = 'xpath_%s_pseudo' % pseudo.ident.replace('-', '_')
- method = _unicode_safe_getattr(self, method, None)
- if not method:
- # TODO: better error message for pseudo-elements?
- raise ExpressionError(
- "The pseudo-class :%s is unknown" % pseudo.ident)
- return method(self.xpath(pseudo.selector))
-
-
- def xpath_attrib(self, selector):
- """Translate an attribute selector."""
- operator = self.attribute_operator_mapping[selector.operator]
- method = getattr(self, 'xpath_attrib_%s' % operator)
- if self.lower_case_attribute_names:
- name = selector.attrib.lower()
- else:
- name = selector.attrib
- safe = is_safe_name(name)
- if selector.namespace:
- name = '%s:%s' % (selector.namespace, name)
- safe = safe and is_safe_name(selector.namespace)
- if safe:
- attrib = '@' + name
- else:
- attrib = 'attribute::*[name() = %s]' % self.xpath_literal(name)
- if self.lower_case_attribute_values:
- value = selector.value.lower()
- else:
- value = selector.value
- return method(self.xpath(selector.selector), attrib, value)
-
- def xpath_class(self, class_selector):
- """Translate a class selector."""
- # .foo is defined as [class~=foo] in the spec.
- xpath = self.xpath(class_selector.selector)
- return self.xpath_attrib_includes(
- xpath, '@class', class_selector.class_name)
-
- def xpath_hash(self, id_selector):
- """Translate an ID selector."""
- xpath = self.xpath(id_selector.selector)
- return self.xpath_attrib_equals(xpath, '@id', id_selector.id)
-
- def xpath_element(self, selector):
- """Translate a type or universal selector."""
- element = selector.element
- if not element:
- element = '*'
- safe = True
- else:
- safe = is_safe_name(element)
- if self.lower_case_element_names:
- element = element.lower()
- if selector.namespace:
- # Namespace prefixes are case-sensitive.
- # http://www.w3.org/TR/css3-namespace/#prefixes
- element = '%s:%s' % (selector.namespace, element)
- safe = safe and is_safe_name(selector.namespace)
- xpath = self.xpathexpr_cls(element=element)
- if not safe:
- xpath.add_name_test()
- return xpath
-
-
- # CombinedSelector: dispatch by combinator
-
- def xpath_descendant_combinator(self, left, right):
- """right is a child, grand-child or further descendant of left"""
- return left.join('/descendant-or-self::*/', right)
-
- def xpath_child_combinator(self, left, right):
- """right is an immediate child of left"""
- return left.join('/', right)
-
- def xpath_direct_adjacent_combinator(self, left, right):
- """right is a sibling immediately after left"""
- xpath = left.join('/following-sibling::', right)
- xpath.add_name_test()
- return xpath.add_condition('position() = 1')
-
- def xpath_indirect_adjacent_combinator(self, left, right):
- """right is a sibling after left, immediately or not"""
- return left.join('/following-sibling::', right)
-
-
- # Function: dispatch by function/pseudo-class name
-
- def xpath_nth_child_function(self, xpath, function, last=False,
- add_name_test=True):
- try:
- a, b = parse_series(function.arguments)
- except ValueError:
- raise ExpressionError("Invalid series: '%r'" % function.arguments)
-
- # From https://www.w3.org/TR/css3-selectors/#structural-pseudos:
- #
- # :nth-child(an+b)
- # an+b-1 siblings before
- #
- # :nth-last-child(an+b)
- # an+b-1 siblings after
- #
- # :nth-of-type(an+b)
- # an+b-1 siblings with the same expanded element name before
- #
- # :nth-last-of-type(an+b)
- # an+b-1 siblings with the same expanded element name after
- #
- # So,
- # for :nth-child and :nth-of-type
- #
- # count(preceding-sibling::) = an+b-1
- #
- # for :nth-last-child and :nth-last-of-type
- #
- # count(following-sibling::) = an+b-1
- #
- # therefore,
- # count(...) - (b-1) ≡ 0 (mod a)
- #
- # if a == 0:
- # ~~~~~~~~~~
- # count(...) = b-1
- #
- # if a < 0:
- # ~~~~~~~~~
- # count(...) - b +1 <= 0
- # -> count(...) <= b-1
- #
- # if a > 0:
- # ~~~~~~~~~
- # count(...) - b +1 >= 0
- # -> count(...) >= b-1
-
- # work with b-1 instead
- b_min_1 = b - 1
-
- # early-exit condition 1:
- # ~~~~~~~~~~~~~~~~~~~~~~~
- # for a == 1, nth-*(an+b) means n+b-1 siblings before/after,
- # and since n ∈ {0, 1, 2, ...}, if b-1<=0,
- # there is always an "n" matching any number of siblings (maybe none)
- if a == 1 and b_min_1 <=0:
- return xpath
-
- # early-exit condition 2:
- # ~~~~~~~~~~~~~~~~~~~~~~~
- # an+b-1 siblings with a<0 and (b-1)<0 is not possible
- if a < 0 and b_min_1 < 0:
- return xpath.add_condition('0')
-
- # `add_name_test` boolean is inverted and somewhat counter-intuitive:
- #
- # nth_of_type() calls nth_child(add_name_test=False)
- if add_name_test:
- nodetest = '*'
- else:
- nodetest = '%s' % xpath.element
-
- # count siblings before or after the element
- if not last:
- siblings_count = 'count(preceding-sibling::%s)' % nodetest
- else:
- siblings_count = 'count(following-sibling::%s)' % nodetest
-
- # special case of fixed position: nth-*(0n+b)
- # if a == 0:
- # ~~~~~~~~~~
- # count(***-sibling::***) = b-1
- if a == 0:
- return xpath.add_condition('%s = %s' % (siblings_count, b_min_1))
-
- expr = []
-
- if a > 0:
- # siblings count, an+b-1, is always >= 0,
- # so if a>0, and (b-1)<=0, an "n" exists to satisfy this,
- # therefore, the predicate is only interesting if (b-1)>0
- if b_min_1 > 0:
- expr.append('%s >= %s' % (siblings_count, b_min_1))
- else:
- # if a<0, and (b-1)<0, no "n" satisfies this,
- # this is tested above as an early exist condition
- # otherwise,
- expr.append('%s <= %s' % (siblings_count, b_min_1))
-
- # operations modulo 1 or -1 are simpler, one only needs to verify:
- #
- # - either:
- # count(***-sibling::***) - (b-1) = n = 0, 1, 2, 3, etc.,
- # i.e. count(***-sibling::***) >= (b-1)
- #
- # - or:
- # count(***-sibling::***) - (b-1) = -n = 0, -1, -2, -3, etc.,
- # i.e. count(***-sibling::***) <= (b-1)
- # we we just did above.
- #
- if abs(a) != 1:
- # count(***-sibling::***) - (b-1) ≡ 0 (mod a)
- left = siblings_count
-
- # apply "modulo a" on 2nd term, -(b-1),
- # to simplify things like "(... +6) % -3",
- # and also make it positive with |a|
- b_neg = (-b_min_1) % abs(a)
-
- if b_neg != 0:
- b_neg = '+%s' % (b_neg)
- left = '(%s %s)' % (left, b_neg)
-
- expr.append('%s mod %s = 0' % (left, a))
-
- xpath.add_condition(' and '.join(expr))
- return xpath
-
- def xpath_nth_last_child_function(self, xpath, function):
- return self.xpath_nth_child_function(xpath, function, last=True)
-
- def xpath_nth_of_type_function(self, xpath, function):
- if xpath.element == '*':
- raise ExpressionError(
- "*:nth-of-type() is not implemented")
- return self.xpath_nth_child_function(xpath, function,
- add_name_test=False)
-
- def xpath_nth_last_of_type_function(self, xpath, function):
- if xpath.element == '*':
- raise ExpressionError(
- "*:nth-of-type() is not implemented")
- return self.xpath_nth_child_function(xpath, function, last=True,
- add_name_test=False)
-
- def xpath_contains_function(self, xpath, function):
- # Defined there, removed in later drafts:
- # http://www.w3.org/TR/2001/CR-css3-selectors-20011113/#content-selectors
- if function.argument_types() not in (['STRING'], ['IDENT']):
- raise ExpressionError(
- "Expected a single string or ident for :contains(), got %r"
- % function.arguments)
- value = function.arguments[0].value
- return xpath.add_condition(
- 'contains(., %s)' % self.xpath_literal(value))
-
- def xpath_lang_function(self, xpath, function):
- if function.argument_types() not in (['STRING'], ['IDENT']):
- raise ExpressionError(
- "Expected a single string or ident for :lang(), got %r"
- % function.arguments)
- value = function.arguments[0].value
- return xpath.add_condition(
- "lang(%s)" % (self.xpath_literal(value)))
-
-
- # Pseudo: dispatch by pseudo-class name
-
- def xpath_root_pseudo(self, xpath):
- return xpath.add_condition("not(parent::*)")
-
- def xpath_first_child_pseudo(self, xpath):
- return xpath.add_condition('count(preceding-sibling::*) = 0')
-
- def xpath_last_child_pseudo(self, xpath):
- return xpath.add_condition('count(following-sibling::*) = 0')
-
- def xpath_first_of_type_pseudo(self, xpath):
- if xpath.element == '*':
- raise ExpressionError(
- "*:first-of-type is not implemented")
- return xpath.add_condition('count(preceding-sibling::%s) = 0' % xpath.element)
-
- def xpath_last_of_type_pseudo(self, xpath):
- if xpath.element == '*':
- raise ExpressionError(
- "*:last-of-type is not implemented")
- return xpath.add_condition('count(following-sibling::%s) = 0' % xpath.element)
-
- def xpath_only_child_pseudo(self, xpath):
- return xpath.add_condition('count(parent::*/child::*) = 1')
-
- def xpath_only_of_type_pseudo(self, xpath):
- if xpath.element == '*':
- raise ExpressionError(
- "*:only-of-type is not implemented")
- return xpath.add_condition('count(parent::*/child::%s) = 1' % xpath.element)
-
- def xpath_empty_pseudo(self, xpath):
- return xpath.add_condition("not(*) and not(string-length())")
-
- def pseudo_never_matches(self, xpath):
- """Common implementation for pseudo-classes that never match."""
- return xpath.add_condition("0")
-
- xpath_link_pseudo = pseudo_never_matches
- xpath_visited_pseudo = pseudo_never_matches
- xpath_hover_pseudo = pseudo_never_matches
- xpath_active_pseudo = pseudo_never_matches
- xpath_focus_pseudo = pseudo_never_matches
- xpath_target_pseudo = pseudo_never_matches
- xpath_enabled_pseudo = pseudo_never_matches
- xpath_disabled_pseudo = pseudo_never_matches
- xpath_checked_pseudo = pseudo_never_matches
-
- # Attrib: dispatch by attribute operator
-
- def xpath_attrib_exists(self, xpath, name, value):
- assert not value
- xpath.add_condition(name)
- return xpath
-
- def xpath_attrib_equals(self, xpath, name, value):
- xpath.add_condition('%s = %s' % (name, self.xpath_literal(value)))
- return xpath
-
- def xpath_attrib_different(self, xpath, name, value):
- # FIXME: this seems like a weird hack...
- if value:
- xpath.add_condition('not(%s) or %s != %s'
- % (name, name, self.xpath_literal(value)))
- else:
- xpath.add_condition('%s != %s'
- % (name, self.xpath_literal(value)))
- return xpath
-
- def xpath_attrib_includes(self, xpath, name, value):
- if is_non_whitespace(value):
- xpath.add_condition(
- "%s and contains(concat(' ', normalize-space(%s), ' '), %s)"
- % (name, name, self.xpath_literal(' '+value+' ')))
- else:
- xpath.add_condition('0')
- return xpath
-
- def xpath_attrib_dashmatch(self, xpath, name, value):
- # Weird, but true...
- xpath.add_condition('%s and (%s = %s or starts-with(%s, %s))' % (
- name,
- name, self.xpath_literal(value),
- name, self.xpath_literal(value + '-')))
- return xpath
-
- def xpath_attrib_prefixmatch(self, xpath, name, value):
- if value:
- xpath.add_condition('%s and starts-with(%s, %s)' % (
- name, name, self.xpath_literal(value)))
- else:
- xpath.add_condition('0')
- return xpath
-
- def xpath_attrib_suffixmatch(self, xpath, name, value):
- if value:
- # Oddly there is a starts-with in XPath 1.0, but not ends-with
- xpath.add_condition(
- '%s and substring(%s, string-length(%s)-%s) = %s'
- % (name, name, name, len(value)-1, self.xpath_literal(value)))
- else:
- xpath.add_condition('0')
- return xpath
-
- def xpath_attrib_substringmatch(self, xpath, name, value):
- if value:
- # Attribute selectors are case sensitive
- xpath.add_condition('%s and contains(%s, %s)' % (
- name, name, self.xpath_literal(value)))
- else:
- xpath.add_condition('0')
- return xpath
-
-
-class HTMLTranslator(GenericTranslator):
- """
- Translator for (X)HTML documents.
-
- Has a more useful implementation of some pseudo-classes based on
- HTML-specific element names and attribute names, as described in
- the `HTML5 specification`_. It assumes no-quirks mode.
- The API is the same as :class:`GenericTranslator`.
-
- .. _HTML5 specification: http://www.w3.org/TR/html5/links.html#selectors
-
- :param xhtml:
- If false (the default), element names and attribute names
- are case-insensitive.
-
- """
-
- lang_attribute = 'lang'
-
- def __init__(self, xhtml=False):
- self.xhtml = xhtml # Might be useful for sub-classes?
- if not xhtml:
- # See their definition in GenericTranslator.
- self.lower_case_element_names = True
- self.lower_case_attribute_names = True
-
- def xpath_checked_pseudo(self, xpath):
- # FIXME: is this really all the elements?
- return xpath.add_condition(
- "(@selected and name(.) = 'option') or "
- "(@checked "
- "and (name(.) = 'input' or name(.) = 'command')"
- "and (@type = 'checkbox' or @type = 'radio'))")
-
- def xpath_lang_function(self, xpath, function):
- if function.argument_types() not in (['STRING'], ['IDENT']):
- raise ExpressionError(
- "Expected a single string or ident for :lang(), got %r"
- % function.arguments)
- value = function.arguments[0].value
- return xpath.add_condition(
- "ancestor-or-self::*[@lang][1][starts-with(concat("
- # XPath 1.0 has no lower-case function...
- "translate(@%s, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', "
- "'abcdefghijklmnopqrstuvwxyz'), "
- "'-'), %s)]"
- % (self.lang_attribute, self.xpath_literal(value.lower() + '-')))
-
- def xpath_link_pseudo(self, xpath):
- return xpath.add_condition("@href and "
- "(name(.) = 'a' or name(.) = 'link' or name(.) = 'area')")
-
- # Links are never visited, the implementation for :visited is the same
- # as in GenericTranslator
-
- def xpath_disabled_pseudo(self, xpath):
- # http://www.w3.org/TR/html5/section-index.html#attributes-1
- return xpath.add_condition('''
- (
- @disabled and
- (
- (name(.) = 'input' and @type != 'hidden') or
- name(.) = 'button' or
- name(.) = 'select' or
- name(.) = 'textarea' or
- name(.) = 'command' or
- name(.) = 'fieldset' or
- name(.) = 'optgroup' or
- name(.) = 'option'
- )
- ) or (
- (
- (name(.) = 'input' and @type != 'hidden') or
- name(.) = 'button' or
- name(.) = 'select' or
- name(.) = 'textarea'
- )
- and ancestor::fieldset[@disabled]
- )
- ''')
- # FIXME: in the second half, add "and is not a descendant of that
- # fieldset element's first legend element child, if any."
-
- def xpath_enabled_pseudo(self, xpath):
- # http://www.w3.org/TR/html5/section-index.html#attributes-1
- return xpath.add_condition('''
- (
- @href and (
- name(.) = 'a' or
- name(.) = 'link' or
- name(.) = 'area'
- )
- ) or (
- (
- name(.) = 'command' or
- name(.) = 'fieldset' or
- name(.) = 'optgroup'
- )
- and not(@disabled)
- ) or (
- (
- (name(.) = 'input' and @type != 'hidden') or
- name(.) = 'button' or
- name(.) = 'select' or
- name(.) = 'textarea' or
- name(.) = 'keygen'
- )
- and not (@disabled or ancestor::fieldset[@disabled])
- ) or (
- name(.) = 'option' and not(
- @disabled or ancestor::optgroup[@disabled]
- )
- )
- ''')
- # FIXME: ... or "li elements that are children of menu elements,
- # and that have a child element that defines a command, if the first
- # such element's Disabled State facet is false (not disabled)".
- # FIXME: after ancestor::fieldset[@disabled], add "and is not a
- # descendant of that fieldset element's first legend element child,
- # if any."
diff --git a/lib/dateutil/__init__.py b/lib/dateutil/__init__.py
deleted file mode 100644
index 796ef3dfca..0000000000
--- a/lib/dateutil/__init__.py
+++ /dev/null
@@ -1,2 +0,0 @@
-# -*- coding: utf-8 -*-
-from ._version import VERSION as __version__
diff --git a/lib/dateutil/_common.py b/lib/dateutil/_common.py
deleted file mode 100644
index e8b4af71e5..0000000000
--- a/lib/dateutil/_common.py
+++ /dev/null
@@ -1,34 +0,0 @@
-"""
-Common code used in multiple modules.
-"""
-
-
-class weekday(object):
- __slots__ = ["weekday", "n"]
-
- def __init__(self, weekday, n=None):
- self.weekday = weekday
- self.n = n
-
- def __call__(self, n):
- if n == self.n:
- return self
- else:
- return self.__class__(self.weekday, n)
-
- def __eq__(self, other):
- try:
- if self.weekday != other.weekday or self.n != other.n:
- return False
- except AttributeError:
- return False
- return True
-
- __hash__ = None
-
- def __repr__(self):
- s = ("MO", "TU", "WE", "TH", "FR", "SA", "SU")[self.weekday]
- if not self.n:
- return s
- else:
- return "%s(%+d)" % (s, self.n)
diff --git a/lib/dateutil/_version.py b/lib/dateutil/_version.py
deleted file mode 100644
index c1a0357bab..0000000000
--- a/lib/dateutil/_version.py
+++ /dev/null
@@ -1,10 +0,0 @@
-"""
-Contains information about the dateutil version.
-"""
-
-VERSION_MAJOR = 2
-VERSION_MINOR = 6
-VERSION_PATCH = 1
-
-VERSION_TUPLE = (VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH)
-VERSION = '.'.join(map(str, VERSION_TUPLE))
diff --git a/lib/dateutil/easter.py b/lib/dateutil/easter.py
deleted file mode 100644
index e4def97f96..0000000000
--- a/lib/dateutil/easter.py
+++ /dev/null
@@ -1,89 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
-This module offers a generic easter computing method for any given year, using
-Western, Orthodox or Julian algorithms.
-"""
-
-import datetime
-
-__all__ = ["easter", "EASTER_JULIAN", "EASTER_ORTHODOX", "EASTER_WESTERN"]
-
-EASTER_JULIAN = 1
-EASTER_ORTHODOX = 2
-EASTER_WESTERN = 3
-
-
-def easter(year, method=EASTER_WESTERN):
- """
- This method was ported from the work done by GM Arts,
- on top of the algorithm by Claus Tondering, which was
- based in part on the algorithm of Ouding (1940), as
- quoted in "Explanatory Supplement to the Astronomical
- Almanac", P. Kenneth Seidelmann, editor.
-
- This algorithm implements three different easter
- calculation methods:
-
- 1 - Original calculation in Julian calendar, valid in
- dates after 326 AD
- 2 - Original method, with date converted to Gregorian
- calendar, valid in years 1583 to 4099
- 3 - Revised method, in Gregorian calendar, valid in
- years 1583 to 4099 as well
-
- These methods are represented by the constants:
-
- * ``EASTER_JULIAN = 1``
- * ``EASTER_ORTHODOX = 2``
- * ``EASTER_WESTERN = 3``
-
- The default method is method 3.
-
- More about the algorithm may be found at:
-
- http://users.chariot.net.au/~gmarts/eastalg.htm
-
- and
-
- http://www.tondering.dk/claus/calendar.html
-
- """
-
- if not (1 <= method <= 3):
- raise ValueError("invalid method")
-
- # g - Golden year - 1
- # c - Century
- # h - (23 - Epact) mod 30
- # i - Number of days from March 21 to Paschal Full Moon
- # j - Weekday for PFM (0=Sunday, etc)
- # p - Number of days from March 21 to Sunday on or before PFM
- # (-6 to 28 methods 1 & 3, to 56 for method 2)
- # e - Extra days to add for method 2 (converting Julian
- # date to Gregorian date)
-
- y = year
- g = y % 19
- e = 0
- if method < 3:
- # Old method
- i = (19*g + 15) % 30
- j = (y + y//4 + i) % 7
- if method == 2:
- # Extra dates to convert Julian to Gregorian date
- e = 10
- if y > 1600:
- e = e + y//100 - 16 - (y//100 - 16)//4
- else:
- # New method
- c = y//100
- h = (c - c//4 - (8*c + 13)//25 + 19*g + 15) % 30
- i = h - (h//28)*(1 - (h//28)*(29//(h + 1))*((21 - g)//11))
- j = (y + y//4 + i + 2 - c + c//4) % 7
-
- # p can be from -6 to 56 corresponding to dates 22 March to 23 May
- # (later dates apply to method 2, although 23 May never actually occurs)
- p = i - j + e
- d = 1 + (p + 27 + (p + 6)//40) % 31
- m = 3 + (p + 26)//30
- return datetime.date(int(y), int(m), int(d))
diff --git a/lib/dateutil/parser.py b/lib/dateutil/parser.py
deleted file mode 100644
index 595331f641..0000000000
--- a/lib/dateutil/parser.py
+++ /dev/null
@@ -1,1374 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
-This module offers a generic date/time string parser which is able to parse
-most known formats to represent a date and/or time.
-
-This module attempts to be forgiving with regards to unlikely input formats,
-returning a datetime object even for dates which are ambiguous. If an element
-of a date/time stamp is omitted, the following rules are applied:
-- If AM or PM is left unspecified, a 24-hour clock is assumed, however, an hour
- on a 12-hour clock (``0 <= hour <= 12``) *must* be specified if AM or PM is
- specified.
-- If a time zone is omitted, a timezone-naive datetime is returned.
-
-If any other elements are missing, they are taken from the
-:class:`datetime.datetime` object passed to the parameter ``default``. If this
-results in a day number exceeding the valid number of days per month, the
-value falls back to the end of the month.
-
-Additional resources about date/time string formats can be found below:
-
-- `A summary of the international standard date and time notation
- `_
-- `W3C Date and Time Formats `_
-- `Time Formats (Planetary Rings Node) `_
-- `CPAN ParseDate module
- `_
-- `Java SimpleDateFormat Class
- `_
-"""
-from __future__ import unicode_literals
-
-import datetime
-import string
-import time
-import collections
-import re
-from io import StringIO
-from calendar import monthrange
-
-from six import text_type, binary_type, integer_types
-
-from . import relativedelta
-from . import tz
-
-__all__ = ["parse", "parserinfo"]
-
-
-class _timelex(object):
- # Fractional seconds are sometimes split by a comma
- _split_decimal = re.compile("([.,])")
-
- def __init__(self, instream):
- if isinstance(instream, binary_type):
- instream = instream.decode()
-
- if isinstance(instream, text_type):
- instream = StringIO(instream)
-
- if getattr(instream, 'read', None) is None:
- raise TypeError('Parser must be a string or character stream, not '
- '{itype}'.format(itype=instream.__class__.__name__))
-
- self.instream = instream
- self.charstack = []
- self.tokenstack = []
- self.eof = False
-
- def get_token(self):
- """
- This function breaks the time string into lexical units (tokens), which
- can be parsed by the parser. Lexical units are demarcated by changes in
- the character set, so any continuous string of letters is considered
- one unit, any continuous string of numbers is considered one unit.
-
- The main complication arises from the fact that dots ('.') can be used
- both as separators (e.g. "Sep.20.2009") or decimal points (e.g.
- "4:30:21.447"). As such, it is necessary to read the full context of
- any dot-separated strings before breaking it into tokens; as such, this
- function maintains a "token stack", for when the ambiguous context
- demands that multiple tokens be parsed at once.
- """
- if self.tokenstack:
- return self.tokenstack.pop(0)
-
- seenletters = False
- token = None
- state = None
-
- while not self.eof:
- # We only realize that we've reached the end of a token when we
- # find a character that's not part of the current token - since
- # that character may be part of the next token, it's stored in the
- # charstack.
- if self.charstack:
- nextchar = self.charstack.pop(0)
- else:
- nextchar = self.instream.read(1)
- while nextchar == '\x00':
- nextchar = self.instream.read(1)
-
- if not nextchar:
- self.eof = True
- break
- elif not state:
- # First character of the token - determines if we're starting
- # to parse a word, a number or something else.
- token = nextchar
- if self.isword(nextchar):
- state = 'a'
- elif self.isnum(nextchar):
- state = '0'
- elif self.isspace(nextchar):
- token = ' '
- break # emit token
- else:
- break # emit token
- elif state == 'a':
- # If we've already started reading a word, we keep reading
- # letters until we find something that's not part of a word.
- seenletters = True
- if self.isword(nextchar):
- token += nextchar
- elif nextchar == '.':
- token += nextchar
- state = 'a.'
- else:
- self.charstack.append(nextchar)
- break # emit token
- elif state == '0':
- # If we've already started reading a number, we keep reading
- # numbers until we find something that doesn't fit.
- if self.isnum(nextchar):
- token += nextchar
- elif nextchar == '.' or (nextchar == ',' and len(token) >= 2):
- token += nextchar
- state = '0.'
- else:
- self.charstack.append(nextchar)
- break # emit token
- elif state == 'a.':
- # If we've seen some letters and a dot separator, continue
- # parsing, and the tokens will be broken up later.
- seenletters = True
- if nextchar == '.' or self.isword(nextchar):
- token += nextchar
- elif self.isnum(nextchar) and token[-1] == '.':
- token += nextchar
- state = '0.'
- else:
- self.charstack.append(nextchar)
- break # emit token
- elif state == '0.':
- # If we've seen at least one dot separator, keep going, we'll
- # break up the tokens later.
- if nextchar == '.' or self.isnum(nextchar):
- token += nextchar
- elif self.isword(nextchar) and token[-1] == '.':
- token += nextchar
- state = 'a.'
- else:
- self.charstack.append(nextchar)
- break # emit token
-
- if (state in ('a.', '0.') and (seenletters or token.count('.') > 1 or
- token[-1] in '.,')):
- l = self._split_decimal.split(token)
- token = l[0]
- for tok in l[1:]:
- if tok:
- self.tokenstack.append(tok)
-
- if state == '0.' and token.count('.') == 0:
- token = token.replace(',', '.')
-
- return token
-
- def __iter__(self):
- return self
-
- def __next__(self):
- token = self.get_token()
- if token is None:
- raise StopIteration
-
- return token
-
- def next(self):
- return self.__next__() # Python 2.x support
-
- @classmethod
- def split(cls, s):
- return list(cls(s))
-
- @classmethod
- def isword(cls, nextchar):
- """ Whether or not the next character is part of a word """
- return nextchar.isalpha()
-
- @classmethod
- def isnum(cls, nextchar):
- """ Whether the next character is part of a number """
- return nextchar.isdigit()
-
- @classmethod
- def isspace(cls, nextchar):
- """ Whether the next character is whitespace """
- return nextchar.isspace()
-
-
-class _resultbase(object):
-
- def __init__(self):
- for attr in self.__slots__:
- setattr(self, attr, None)
-
- def _repr(self, classname):
- l = []
- for attr in self.__slots__:
- value = getattr(self, attr)
- if value is not None:
- l.append("%s=%s" % (attr, repr(value)))
- return "%s(%s)" % (classname, ", ".join(l))
-
- def __len__(self):
- return (sum(getattr(self, attr) is not None
- for attr in self.__slots__))
-
- def __repr__(self):
- return self._repr(self.__class__.__name__)
-
-
-class parserinfo(object):
- """
- Class which handles what inputs are accepted. Subclass this to customize
- the language and acceptable values for each parameter.
-
- :param dayfirst:
- Whether to interpret the first value in an ambiguous 3-integer date
- (e.g. 01/05/09) as the day (``True``) or month (``False``). If
- ``yearfirst`` is set to ``True``, this distinguishes between YDM
- and YMD. Default is ``False``.
-
- :param yearfirst:
- Whether to interpret the first value in an ambiguous 3-integer date
- (e.g. 01/05/09) as the year. If ``True``, the first number is taken
- to be the year, otherwise the last number is taken to be the year.
- Default is ``False``.
- """
-
- # m from a.m/p.m, t from ISO T separator
- JUMP = [" ", ".", ",", ";", "-", "/", "'",
- "at", "on", "and", "ad", "m", "t", "of",
- "st", "nd", "rd", "th"]
-
- WEEKDAYS = [("Mon", "Monday"),
- ("Tue", "Tuesday"),
- ("Wed", "Wednesday"),
- ("Thu", "Thursday"),
- ("Fri", "Friday"),
- ("Sat", "Saturday"),
- ("Sun", "Sunday")]
- MONTHS = [("Jan", "January"),
- ("Feb", "February"),
- ("Mar", "March"),
- ("Apr", "April"),
- ("May", "May"),
- ("Jun", "June"),
- ("Jul", "July"),
- ("Aug", "August"),
- ("Sep", "Sept", "September"),
- ("Oct", "October"),
- ("Nov", "November"),
- ("Dec", "December")]
- HMS = [("h", "hour", "hours"),
- ("m", "minute", "minutes"),
- ("s", "second", "seconds")]
- AMPM = [("am", "a"),
- ("pm", "p")]
- UTCZONE = ["UTC", "GMT", "Z"]
- PERTAIN = ["of"]
- TZOFFSET = {}
-
- def __init__(self, dayfirst=False, yearfirst=False):
- self._jump = self._convert(self.JUMP)
- self._weekdays = self._convert(self.WEEKDAYS)
- self._months = self._convert(self.MONTHS)
- self._hms = self._convert(self.HMS)
- self._ampm = self._convert(self.AMPM)
- self._utczone = self._convert(self.UTCZONE)
- self._pertain = self._convert(self.PERTAIN)
-
- self.dayfirst = dayfirst
- self.yearfirst = yearfirst
-
- self._year = time.localtime().tm_year
- self._century = self._year // 100 * 100
-
- def _convert(self, lst):
- dct = {}
- for i, v in enumerate(lst):
- if isinstance(v, tuple):
- for v in v:
- dct[v.lower()] = i
- else:
- dct[v.lower()] = i
- return dct
-
- def jump(self, name):
- return name.lower() in self._jump
-
- def weekday(self, name):
- if len(name) >= min(len(n) for n in self._weekdays.keys()):
- try:
- return self._weekdays[name.lower()]
- except KeyError:
- pass
- return None
-
- def month(self, name):
- if len(name) >= min(len(n) for n in self._months.keys()):
- try:
- return self._months[name.lower()] + 1
- except KeyError:
- pass
- return None
-
- def hms(self, name):
- try:
- return self._hms[name.lower()]
- except KeyError:
- return None
-
- def ampm(self, name):
- try:
- return self._ampm[name.lower()]
- except KeyError:
- return None
-
- def pertain(self, name):
- return name.lower() in self._pertain
-
- def utczone(self, name):
- return name.lower() in self._utczone
-
- def tzoffset(self, name):
- if name in self._utczone:
- return 0
-
- return self.TZOFFSET.get(name)
-
- def convertyear(self, year, century_specified=False):
- if year < 100 and not century_specified:
- year += self._century
- if abs(year - self._year) >= 50:
- if year < self._year:
- year += 100
- else:
- year -= 100
- return year
-
- def validate(self, res):
- # move to info
- if res.year is not None:
- res.year = self.convertyear(res.year, res.century_specified)
-
- if res.tzoffset == 0 and not res.tzname or res.tzname == 'Z':
- res.tzname = "UTC"
- res.tzoffset = 0
- elif res.tzoffset != 0 and res.tzname and self.utczone(res.tzname):
- res.tzoffset = 0
- return True
-
-
-class _ymd(list):
- def __init__(self, tzstr, *args, **kwargs):
- super(self.__class__, self).__init__(*args, **kwargs)
- self.century_specified = False
- self.tzstr = tzstr
-
- @staticmethod
- def token_could_be_year(token, year):
- try:
- return int(token) == year
- except ValueError:
- return False
-
- @staticmethod
- def find_potential_year_tokens(year, tokens):
- return [token for token in tokens if _ymd.token_could_be_year(token, year)]
-
- def find_probable_year_index(self, tokens):
- """
- attempt to deduce if a pre 100 year was lost
- due to padded zeros being taken off
- """
- for index, token in enumerate(self):
- potential_year_tokens = _ymd.find_potential_year_tokens(token, tokens)
- if len(potential_year_tokens) == 1 and len(potential_year_tokens[0]) > 2:
- return index
-
- def append(self, val):
- if hasattr(val, '__len__'):
- if val.isdigit() and len(val) > 2:
- self.century_specified = True
- elif val > 100:
- self.century_specified = True
-
- super(self.__class__, self).append(int(val))
-
- def resolve_ymd(self, mstridx, yearfirst, dayfirst):
- len_ymd = len(self)
- year, month, day = (None, None, None)
-
- if len_ymd > 3:
- raise ValueError("More than three YMD values")
- elif len_ymd == 1 or (mstridx != -1 and len_ymd == 2):
- # One member, or two members with a month string
- if mstridx != -1:
- month = self[mstridx]
- del self[mstridx]
-
- if len_ymd > 1 or mstridx == -1:
- if self[0] > 31:
- year = self[0]
- else:
- day = self[0]
-
- elif len_ymd == 2:
- # Two members with numbers
- if self[0] > 31:
- # 99-01
- year, month = self
- elif self[1] > 31:
- # 01-99
- month, year = self
- elif dayfirst and self[1] <= 12:
- # 13-01
- day, month = self
- else:
- # 01-13
- month, day = self
-
- elif len_ymd == 3:
- # Three members
- if mstridx == 0:
- month, day, year = self
- elif mstridx == 1:
- if self[0] > 31 or (yearfirst and self[2] <= 31):
- # 99-Jan-01
- year, month, day = self
- else:
- # 01-Jan-01
- # Give precendence to day-first, since
- # two-digit years is usually hand-written.
- day, month, year = self
-
- elif mstridx == 2:
- # WTF!?
- if self[1] > 31:
- # 01-99-Jan
- day, year, month = self
- else:
- # 99-01-Jan
- year, day, month = self
-
- else:
- if self[0] > 31 or \
- self.find_probable_year_index(_timelex.split(self.tzstr)) == 0 or \
- (yearfirst and self[1] <= 12 and self[2] <= 31):
- # 99-01-01
- if dayfirst and self[2] <= 12:
- year, day, month = self
- else:
- year, month, day = self
- elif self[0] > 12 or (dayfirst and self[1] <= 12):
- # 13-01-01
- day, month, year = self
- else:
- # 01-13-01
- month, day, year = self
-
- return year, month, day
-
-
-class parser(object):
- def __init__(self, info=None):
- self.info = info or parserinfo()
-
- def parse(self, timestr, default=None, ignoretz=False, tzinfos=None, **kwargs):
- """
- Parse the date/time string into a :class:`datetime.datetime` object.
-
- :param timestr:
- Any date/time string using the supported formats.
-
- :param default:
- The default datetime object, if this is a datetime object and not
- ``None``, elements specified in ``timestr`` replace elements in the
- default object.
-
- :param ignoretz:
- If set ``True``, time zones in parsed strings are ignored and a
- naive :class:`datetime.datetime` object is returned.
-
- :param tzinfos:
- Additional time zone names / aliases which may be present in the
- string. This argument maps time zone names (and optionally offsets
- from those time zones) to time zones. This parameter can be a
- dictionary with timezone aliases mapping time zone names to time
- zones or a function taking two parameters (``tzname`` and
- ``tzoffset``) and returning a time zone.
-
- The timezones to which the names are mapped can be an integer
- offset from UTC in minutes or a :class:`tzinfo` object.
-
- .. doctest::
- :options: +NORMALIZE_WHITESPACE
-
- >>> from dateutil.parser import parse
- >>> from dateutil.tz import gettz
- >>> tzinfos = {"BRST": -10800, "CST": gettz("America/Chicago")}
- >>> parse("2012-01-19 17:21:00 BRST", tzinfos=tzinfos)
- datetime.datetime(2012, 1, 19, 17, 21, tzinfo=tzoffset(u'BRST', -10800))
- >>> parse("2012-01-19 17:21:00 CST", tzinfos=tzinfos)
- datetime.datetime(2012, 1, 19, 17, 21,
- tzinfo=tzfile('/usr/share/zoneinfo/America/Chicago'))
-
- This parameter is ignored if ``ignoretz`` is set.
-
- :param **kwargs:
- Keyword arguments as passed to ``_parse()``.
-
- :return:
- Returns a :class:`datetime.datetime` object or, if the
- ``fuzzy_with_tokens`` option is ``True``, returns a tuple, the
- first element being a :class:`datetime.datetime` object, the second
- a tuple containing the fuzzy tokens.
-
- :raises ValueError:
- Raised for invalid or unknown string format, if the provided
- :class:`tzinfo` is not in a valid format, or if an invalid date
- would be created.
-
- :raises TypeError:
- Raised for non-string or character stream input.
-
- :raises OverflowError:
- Raised if the parsed date exceeds the largest valid C integer on
- your system.
- """
-
- if default is None:
- default = datetime.datetime.now().replace(hour=0, minute=0,
- second=0, microsecond=0)
-
- res, skipped_tokens = self._parse(timestr, **kwargs)
-
- if res is None:
- raise ValueError("Unknown string format")
-
- if len(res) == 0:
- raise ValueError("String does not contain a date.")
-
- repl = {}
- for attr in ("year", "month", "day", "hour",
- "minute", "second", "microsecond"):
- value = getattr(res, attr)
- if value is not None:
- repl[attr] = value
-
- if 'day' not in repl:
- # If the default day exceeds the last day of the month, fall back to
- # the end of the month.
- cyear = default.year if res.year is None else res.year
- cmonth = default.month if res.month is None else res.month
- cday = default.day if res.day is None else res.day
-
- if cday > monthrange(cyear, cmonth)[1]:
- repl['day'] = monthrange(cyear, cmonth)[1]
-
- ret = default.replace(**repl)
-
- if res.weekday is not None and not res.day:
- ret = ret+relativedelta.relativedelta(weekday=res.weekday)
-
- if not ignoretz:
- if (isinstance(tzinfos, collections.Callable) or
- tzinfos and res.tzname in tzinfos):
-
- if isinstance(tzinfos, collections.Callable):
- tzdata = tzinfos(res.tzname, res.tzoffset)
- else:
- tzdata = tzinfos.get(res.tzname)
-
- if isinstance(tzdata, datetime.tzinfo):
- tzinfo = tzdata
- elif isinstance(tzdata, text_type):
- tzinfo = tz.tzstr(tzdata)
- elif isinstance(tzdata, integer_types):
- tzinfo = tz.tzoffset(res.tzname, tzdata)
- else:
- raise ValueError("Offset must be tzinfo subclass, "
- "tz string, or int offset.")
- ret = ret.replace(tzinfo=tzinfo)
- elif res.tzname and res.tzname in time.tzname:
- ret = ret.replace(tzinfo=tz.tzlocal())
- elif res.tzoffset == 0:
- ret = ret.replace(tzinfo=tz.tzutc())
- elif res.tzoffset:
- ret = ret.replace(tzinfo=tz.tzoffset(res.tzname, res.tzoffset))
-
- if kwargs.get('fuzzy_with_tokens', False):
- return ret, skipped_tokens
- else:
- return ret
-
- class _result(_resultbase):
- __slots__ = ["year", "month", "day", "weekday",
- "hour", "minute", "second", "microsecond",
- "tzname", "tzoffset", "ampm"]
-
- def _parse(self, timestr, dayfirst=None, yearfirst=None, fuzzy=False,
- fuzzy_with_tokens=False):
- """
- Private method which performs the heavy lifting of parsing, called from
- ``parse()``, which passes on its ``kwargs`` to this function.
-
- :param timestr:
- The string to parse.
-
- :param dayfirst:
- Whether to interpret the first value in an ambiguous 3-integer date
- (e.g. 01/05/09) as the day (``True``) or month (``False``). If
- ``yearfirst`` is set to ``True``, this distinguishes between YDM
- and YMD. If set to ``None``, this value is retrieved from the
- current :class:`parserinfo` object (which itself defaults to
- ``False``).
-
- :param yearfirst:
- Whether to interpret the first value in an ambiguous 3-integer date
- (e.g. 01/05/09) as the year. If ``True``, the first number is taken
- to be the year, otherwise the last number is taken to be the year.
- If this is set to ``None``, the value is retrieved from the current
- :class:`parserinfo` object (which itself defaults to ``False``).
-
- :param fuzzy:
- Whether to allow fuzzy parsing, allowing for string like "Today is
- January 1, 2047 at 8:21:00AM".
-
- :param fuzzy_with_tokens:
- If ``True``, ``fuzzy`` is automatically set to True, and the parser
- will return a tuple where the first element is the parsed
- :class:`datetime.datetime` datetimestamp and the second element is
- a tuple containing the portions of the string which were ignored:
-
- .. doctest::
-
- >>> from dateutil.parser import parse
- >>> parse("Today is January 1, 2047 at 8:21:00AM", fuzzy_with_tokens=True)
- (datetime.datetime(2047, 1, 1, 8, 21), (u'Today is ', u' ', u'at '))
-
- """
- if fuzzy_with_tokens:
- fuzzy = True
-
- info = self.info
-
- if dayfirst is None:
- dayfirst = info.dayfirst
-
- if yearfirst is None:
- yearfirst = info.yearfirst
-
- res = self._result()
- l = _timelex.split(timestr) # Splits the timestr into tokens
-
- # keep up with the last token skipped so we can recombine
- # consecutively skipped tokens (-2 for when i begins at 0).
- last_skipped_token_i = -2
- skipped_tokens = list()
-
- try:
- # year/month/day list
- ymd = _ymd(timestr)
-
- # Index of the month string in ymd
- mstridx = -1
-
- len_l = len(l)
- i = 0
- while i < len_l:
-
- # Check if it's a number
- try:
- value_repr = l[i]
- value = float(value_repr)
- except ValueError:
- value = None
-
- if value is not None:
- # Token is a number
- len_li = len(l[i])
- i += 1
-
- if (len(ymd) == 3 and len_li in (2, 4)
- and res.hour is None and (i >= len_l or (l[i] != ':' and
- info.hms(l[i]) is None))):
- # 19990101T23[59]
- s = l[i-1]
- res.hour = int(s[:2])
-
- if len_li == 4:
- res.minute = int(s[2:])
-
- elif len_li == 6 or (len_li > 6 and l[i-1].find('.') == 6):
- # YYMMDD or HHMMSS[.ss]
- s = l[i-1]
-
- if not ymd and l[i-1].find('.') == -1:
- #ymd.append(info.convertyear(int(s[:2])))
-
- ymd.append(s[:2])
- ymd.append(s[2:4])
- ymd.append(s[4:])
- else:
- # 19990101T235959[.59]
- res.hour = int(s[:2])
- res.minute = int(s[2:4])
- res.second, res.microsecond = _parsems(s[4:])
-
- elif len_li in (8, 12, 14):
- # YYYYMMDD
- s = l[i-1]
- ymd.append(s[:4])
- ymd.append(s[4:6])
- ymd.append(s[6:8])
-
- if len_li > 8:
- res.hour = int(s[8:10])
- res.minute = int(s[10:12])
-
- if len_li > 12:
- res.second = int(s[12:])
-
- elif ((i < len_l and info.hms(l[i]) is not None) or
- (i+1 < len_l and l[i] == ' ' and
- info.hms(l[i+1]) is not None)):
-
- # HH[ ]h or MM[ ]m or SS[.ss][ ]s
- if l[i] == ' ':
- i += 1
-
- idx = info.hms(l[i])
-
- while True:
- if idx == 0:
- res.hour = int(value)
-
- if value % 1:
- res.minute = int(60*(value % 1))
-
- elif idx == 1:
- res.minute = int(value)
-
- if value % 1:
- res.second = int(60*(value % 1))
-
- elif idx == 2:
- res.second, res.microsecond = \
- _parsems(value_repr)
-
- i += 1
-
- if i >= len_l or idx == 2:
- break
-
- # 12h00
- try:
- value_repr = l[i]
- value = float(value_repr)
- except ValueError:
- break
- else:
- i += 1
- idx += 1
-
- if i < len_l:
- newidx = info.hms(l[i])
-
- if newidx is not None:
- idx = newidx
-
- elif (i == len_l and l[i-2] == ' ' and
- info.hms(l[i-3]) is not None):
- # X h MM or X m SS
- idx = info.hms(l[i-3])
-
- if idx == 0: # h
- res.minute = int(value)
-
- sec_remainder = value % 1
- if sec_remainder:
- res.second = int(60 * sec_remainder)
- elif idx == 1: # m
- res.second, res.microsecond = \
- _parsems(value_repr)
-
- # We don't need to advance the tokens here because the
- # i == len_l call indicates that we're looking at all
- # the tokens already.
-
- elif i+1 < len_l and l[i] == ':':
- # HH:MM[:SS[.ss]]
- res.hour = int(value)
- i += 1
- value = float(l[i])
- res.minute = int(value)
-
- if value % 1:
- res.second = int(60*(value % 1))
-
- i += 1
-
- if i < len_l and l[i] == ':':
- res.second, res.microsecond = _parsems(l[i+1])
- i += 2
-
- elif i < len_l and l[i] in ('-', '/', '.'):
- sep = l[i]
- ymd.append(value_repr)
- i += 1
-
- if i < len_l and not info.jump(l[i]):
- try:
- # 01-01[-01]
- ymd.append(l[i])
- except ValueError:
- # 01-Jan[-01]
- value = info.month(l[i])
-
- if value is not None:
- ymd.append(value)
- assert mstridx == -1
- mstridx = len(ymd)-1
- else:
- return None, None
-
- i += 1
-
- if i < len_l and l[i] == sep:
- # We have three members
- i += 1
- value = info.month(l[i])
-
- if value is not None:
- ymd.append(value)
- mstridx = len(ymd)-1
- assert mstridx == -1
- else:
- ymd.append(l[i])
-
- i += 1
- elif i >= len_l or info.jump(l[i]):
- if i+1 < len_l and info.ampm(l[i+1]) is not None:
- # 12 am
- res.hour = int(value)
-
- if res.hour < 12 and info.ampm(l[i+1]) == 1:
- res.hour += 12
- elif res.hour == 12 and info.ampm(l[i+1]) == 0:
- res.hour = 0
-
- i += 1
- else:
- # Year, month or day
- ymd.append(value)
- i += 1
- elif info.ampm(l[i]) is not None:
-
- # 12am
- res.hour = int(value)
-
- if res.hour < 12 and info.ampm(l[i]) == 1:
- res.hour += 12
- elif res.hour == 12 and info.ampm(l[i]) == 0:
- res.hour = 0
- i += 1
-
- elif not fuzzy:
- return None, None
- else:
- i += 1
- continue
-
- # Check weekday
- value = info.weekday(l[i])
- if value is not None:
- res.weekday = value
- i += 1
- continue
-
- # Check month name
- value = info.month(l[i])
- if value is not None:
- ymd.append(value)
- assert mstridx == -1
- mstridx = len(ymd)-1
-
- i += 1
- if i < len_l:
- if l[i] in ('-', '/'):
- # Jan-01[-99]
- sep = l[i]
- i += 1
- ymd.append(l[i])
- i += 1
-
- if i < len_l and l[i] == sep:
- # Jan-01-99
- i += 1
- ymd.append(l[i])
- i += 1
-
- elif (i+3 < len_l and l[i] == l[i+2] == ' '
- and info.pertain(l[i+1])):
- # Jan of 01
- # In this case, 01 is clearly year
- try:
- value = int(l[i+3])
- except ValueError:
- # Wrong guess
- pass
- else:
- # Convert it here to become unambiguous
- ymd.append(str(info.convertyear(value)))
- i += 4
- continue
-
- # Check am/pm
- value = info.ampm(l[i])
- if value is not None:
- # For fuzzy parsing, 'a' or 'am' (both valid English words)
- # may erroneously trigger the AM/PM flag. Deal with that
- # here.
- val_is_ampm = True
-
- # If there's already an AM/PM flag, this one isn't one.
- if fuzzy and res.ampm is not None:
- val_is_ampm = False
-
- # If AM/PM is found and hour is not, raise a ValueError
- if res.hour is None:
- if fuzzy:
- val_is_ampm = False
- else:
- raise ValueError('No hour specified with ' +
- 'AM or PM flag.')
- elif not 0 <= res.hour <= 12:
- # If AM/PM is found, it's a 12 hour clock, so raise
- # an error for invalid range
- if fuzzy:
- val_is_ampm = False
- else:
- raise ValueError('Invalid hour specified for ' +
- '12-hour clock.')
-
- if val_is_ampm:
- if value == 1 and res.hour < 12:
- res.hour += 12
- elif value == 0 and res.hour == 12:
- res.hour = 0
-
- res.ampm = value
-
- elif fuzzy:
- last_skipped_token_i = self._skip_token(skipped_tokens,
- last_skipped_token_i, i, l)
- i += 1
- continue
-
- # Check for a timezone name
- if (res.hour is not None and len(l[i]) <= 5 and
- res.tzname is None and res.tzoffset is None and
- not [x for x in l[i] if x not in
- string.ascii_uppercase]):
- res.tzname = l[i]
- res.tzoffset = info.tzoffset(res.tzname)
- i += 1
-
- # Check for something like GMT+3, or BRST+3. Notice
- # that it doesn't mean "I am 3 hours after GMT", but
- # "my time +3 is GMT". If found, we reverse the
- # logic so that timezone parsing code will get it
- # right.
- if i < len_l and l[i] in ('+', '-'):
- l[i] = ('+', '-')[l[i] == '+']
- res.tzoffset = None
- if info.utczone(res.tzname):
- # With something like GMT+3, the timezone
- # is *not* GMT.
- res.tzname = None
-
- continue
-
- # Check for a numbered timezone
- if res.hour is not None and l[i] in ('+', '-'):
- signal = (-1, 1)[l[i] == '+']
- i += 1
- len_li = len(l[i])
-
- if len_li == 4:
- # -0300
- res.tzoffset = int(l[i][:2])*3600+int(l[i][2:])*60
- elif i+1 < len_l and l[i+1] == ':':
- # -03:00
- res.tzoffset = int(l[i])*3600+int(l[i+2])*60
- i += 2
- elif len_li <= 2:
- # -[0]3
- res.tzoffset = int(l[i][:2])*3600
- else:
- return None, None
- i += 1
-
- res.tzoffset *= signal
-
- # Look for a timezone name between parenthesis
- if (i+3 < len_l and
- info.jump(l[i]) and l[i+1] == '(' and l[i+3] == ')' and
- 3 <= len(l[i+2]) <= 5 and
- not [x for x in l[i+2]
- if x not in string.ascii_uppercase]):
- # -0300 (BRST)
- res.tzname = l[i+2]
- i += 4
- continue
-
- # Check jumps
- if not (info.jump(l[i]) or fuzzy):
- return None, None
-
- last_skipped_token_i = self._skip_token(skipped_tokens,
- last_skipped_token_i, i, l)
- i += 1
-
- # Process year/month/day
- year, month, day = ymd.resolve_ymd(mstridx, yearfirst, dayfirst)
- if year is not None:
- res.year = year
- res.century_specified = ymd.century_specified
-
- if month is not None:
- res.month = month
-
- if day is not None:
- res.day = day
-
- except (IndexError, ValueError, AssertionError):
- return None, None
-
- if not info.validate(res):
- return None, None
-
- if fuzzy_with_tokens:
- return res, tuple(skipped_tokens)
- else:
- return res, None
-
- @staticmethod
- def _skip_token(skipped_tokens, last_skipped_token_i, i, l):
- if last_skipped_token_i == i - 1:
- # recombine the tokens
- skipped_tokens[-1] += l[i]
- else:
- # just append
- skipped_tokens.append(l[i])
- last_skipped_token_i = i
- return last_skipped_token_i
-
-
-DEFAULTPARSER = parser()
-
-
-def parse(timestr, parserinfo=None, **kwargs):
- """
-
- Parse a string in one of the supported formats, using the
- ``parserinfo`` parameters.
-
- :param timestr:
- A string containing a date/time stamp.
-
- :param parserinfo:
- A :class:`parserinfo` object containing parameters for the parser.
- If ``None``, the default arguments to the :class:`parserinfo`
- constructor are used.
-
- The ``**kwargs`` parameter takes the following keyword arguments:
-
- :param default:
- The default datetime object, if this is a datetime object and not
- ``None``, elements specified in ``timestr`` replace elements in the
- default object.
-
- :param ignoretz:
- If set ``True``, time zones in parsed strings are ignored and a naive
- :class:`datetime` object is returned.
-
- :param tzinfos:
- Additional time zone names / aliases which may be present in the
- string. This argument maps time zone names (and optionally offsets
- from those time zones) to time zones. This parameter can be a
- dictionary with timezone aliases mapping time zone names to time
- zones or a function taking two parameters (``tzname`` and
- ``tzoffset``) and returning a time zone.
-
- The timezones to which the names are mapped can be an integer
- offset from UTC in minutes or a :class:`tzinfo` object.
-
- .. doctest::
- :options: +NORMALIZE_WHITESPACE
-
- >>> from dateutil.parser import parse
- >>> from dateutil.tz import gettz
- >>> tzinfos = {"BRST": -10800, "CST": gettz("America/Chicago")}
- >>> parse("2012-01-19 17:21:00 BRST", tzinfos=tzinfos)
- datetime.datetime(2012, 1, 19, 17, 21, tzinfo=tzoffset(u'BRST', -10800))
- >>> parse("2012-01-19 17:21:00 CST", tzinfos=tzinfos)
- datetime.datetime(2012, 1, 19, 17, 21,
- tzinfo=tzfile('/usr/share/zoneinfo/America/Chicago'))
-
- This parameter is ignored if ``ignoretz`` is set.
-
- :param dayfirst:
- Whether to interpret the first value in an ambiguous 3-integer date
- (e.g. 01/05/09) as the day (``True``) or month (``False``). If
- ``yearfirst`` is set to ``True``, this distinguishes between YDM and
- YMD. If set to ``None``, this value is retrieved from the current
- :class:`parserinfo` object (which itself defaults to ``False``).
-
- :param yearfirst:
- Whether to interpret the first value in an ambiguous 3-integer date
- (e.g. 01/05/09) as the year. If ``True``, the first number is taken to
- be the year, otherwise the last number is taken to be the year. If
- this is set to ``None``, the value is retrieved from the current
- :class:`parserinfo` object (which itself defaults to ``False``).
-
- :param fuzzy:
- Whether to allow fuzzy parsing, allowing for string like "Today is
- January 1, 2047 at 8:21:00AM".
-
- :param fuzzy_with_tokens:
- If ``True``, ``fuzzy`` is automatically set to True, and the parser
- will return a tuple where the first element is the parsed
- :class:`datetime.datetime` datetimestamp and the second element is
- a tuple containing the portions of the string which were ignored:
-
- .. doctest::
-
- >>> from dateutil.parser import parse
- >>> parse("Today is January 1, 2047 at 8:21:00AM", fuzzy_with_tokens=True)
- (datetime.datetime(2047, 1, 1, 8, 21), (u'Today is ', u' ', u'at '))
-
- :return:
- Returns a :class:`datetime.datetime` object or, if the
- ``fuzzy_with_tokens`` option is ``True``, returns a tuple, the
- first element being a :class:`datetime.datetime` object, the second
- a tuple containing the fuzzy tokens.
-
- :raises ValueError:
- Raised for invalid or unknown string format, if the provided
- :class:`tzinfo` is not in a valid format, or if an invalid date
- would be created.
-
- :raises OverflowError:
- Raised if the parsed date exceeds the largest valid C integer on
- your system.
- """
- if parserinfo:
- return parser(parserinfo).parse(timestr, **kwargs)
- else:
- return DEFAULTPARSER.parse(timestr, **kwargs)
-
-
-class _tzparser(object):
-
- class _result(_resultbase):
-
- __slots__ = ["stdabbr", "stdoffset", "dstabbr", "dstoffset",
- "start", "end"]
-
- class _attr(_resultbase):
- __slots__ = ["month", "week", "weekday",
- "yday", "jyday", "day", "time"]
-
- def __repr__(self):
- return self._repr("")
-
- def __init__(self):
- _resultbase.__init__(self)
- self.start = self._attr()
- self.end = self._attr()
-
- def parse(self, tzstr):
- res = self._result()
- l = _timelex.split(tzstr)
- try:
-
- len_l = len(l)
-
- i = 0
- while i < len_l:
- # BRST+3[BRDT[+2]]
- j = i
- while j < len_l and not [x for x in l[j]
- if x in "0123456789:,-+"]:
- j += 1
- if j != i:
- if not res.stdabbr:
- offattr = "stdoffset"
- res.stdabbr = "".join(l[i:j])
- else:
- offattr = "dstoffset"
- res.dstabbr = "".join(l[i:j])
- i = j
- if (i < len_l and (l[i] in ('+', '-') or l[i][0] in
- "0123456789")):
- if l[i] in ('+', '-'):
- # Yes, that's right. See the TZ variable
- # documentation.
- signal = (1, -1)[l[i] == '+']
- i += 1
- else:
- signal = -1
- len_li = len(l[i])
- if len_li == 4:
- # -0300
- setattr(res, offattr, (int(l[i][:2])*3600 +
- int(l[i][2:])*60)*signal)
- elif i+1 < len_l and l[i+1] == ':':
- # -03:00
- setattr(res, offattr,
- (int(l[i])*3600+int(l[i+2])*60)*signal)
- i += 2
- elif len_li <= 2:
- # -[0]3
- setattr(res, offattr,
- int(l[i][:2])*3600*signal)
- else:
- return None
- i += 1
- if res.dstabbr:
- break
- else:
- break
-
- if i < len_l:
- for j in range(i, len_l):
- if l[j] == ';':
- l[j] = ','
-
- assert l[i] == ','
-
- i += 1
-
- if i >= len_l:
- pass
- elif (8 <= l.count(',') <= 9 and
- not [y for x in l[i:] if x != ','
- for y in x if y not in "0123456789"]):
- # GMT0BST,3,0,30,3600,10,0,26,7200[,3600]
- for x in (res.start, res.end):
- x.month = int(l[i])
- i += 2
- if l[i] == '-':
- value = int(l[i+1])*-1
- i += 1
- else:
- value = int(l[i])
- i += 2
- if value:
- x.week = value
- x.weekday = (int(l[i])-1) % 7
- else:
- x.day = int(l[i])
- i += 2
- x.time = int(l[i])
- i += 2
- if i < len_l:
- if l[i] in ('-', '+'):
- signal = (-1, 1)[l[i] == "+"]
- i += 1
- else:
- signal = 1
- res.dstoffset = (res.stdoffset+int(l[i]))*signal
- elif (l.count(',') == 2 and l[i:].count('/') <= 2 and
- not [y for x in l[i:] if x not in (',', '/', 'J', 'M',
- '.', '-', ':')
- for y in x if y not in "0123456789"]):
- for x in (res.start, res.end):
- if l[i] == 'J':
- # non-leap year day (1 based)
- i += 1
- x.jyday = int(l[i])
- elif l[i] == 'M':
- # month[-.]week[-.]weekday
- i += 1
- x.month = int(l[i])
- i += 1
- assert l[i] in ('-', '.')
- i += 1
- x.week = int(l[i])
- if x.week == 5:
- x.week = -1
- i += 1
- assert l[i] in ('-', '.')
- i += 1
- x.weekday = (int(l[i])-1) % 7
- else:
- # year day (zero based)
- x.yday = int(l[i])+1
-
- i += 1
-
- if i < len_l and l[i] == '/':
- i += 1
- # start time
- len_li = len(l[i])
- if len_li == 4:
- # -0300
- x.time = (int(l[i][:2])*3600+int(l[i][2:])*60)
- elif i+1 < len_l and l[i+1] == ':':
- # -03:00
- x.time = int(l[i])*3600+int(l[i+2])*60
- i += 2
- if i+1 < len_l and l[i+1] == ':':
- i += 2
- x.time += int(l[i])
- elif len_li <= 2:
- # -[0]3
- x.time = (int(l[i][:2])*3600)
- else:
- return None
- i += 1
-
- assert i == len_l or l[i] == ','
-
- i += 1
-
- assert i >= len_l
-
- except (IndexError, ValueError, AssertionError):
- return None
-
- return res
-
-
-DEFAULTTZPARSER = _tzparser()
-
-
-def _parsetz(tzstr):
- return DEFAULTTZPARSER.parse(tzstr)
-
-
-def _parsems(value):
- """Parse a I[.F] seconds value into (seconds, microseconds)."""
- if "." not in value:
- return int(value), 0
- else:
- i, f = value.split(".")
- return int(i), int(f.ljust(6, "0")[:6])
-
-
-# vim:ts=4:sw=4:et
diff --git a/lib/dateutil/relativedelta.py b/lib/dateutil/relativedelta.py
deleted file mode 100644
index 0e66afc4a6..0000000000
--- a/lib/dateutil/relativedelta.py
+++ /dev/null
@@ -1,549 +0,0 @@
-# -*- coding: utf-8 -*-
-import datetime
-import calendar
-
-import operator
-from math import copysign
-
-from six import integer_types
-from warnings import warn
-
-from ._common import weekday
-
-MO, TU, WE, TH, FR, SA, SU = weekdays = tuple(weekday(x) for x in range(7))
-
-__all__ = ["relativedelta", "MO", "TU", "WE", "TH", "FR", "SA", "SU"]
-
-
-class relativedelta(object):
- """
- The relativedelta type is based on the specification of the excellent
- work done by M.-A. Lemburg in his
- `mx.DateTime `_ extension.
- However, notice that this type does *NOT* implement the same algorithm as
- his work. Do *NOT* expect it to behave like mx.DateTime's counterpart.
-
- There are two different ways to build a relativedelta instance. The
- first one is passing it two date/datetime classes::
-
- relativedelta(datetime1, datetime2)
-
- The second one is passing it any number of the following keyword arguments::
-
- relativedelta(arg1=x,arg2=y,arg3=z...)
-
- year, month, day, hour, minute, second, microsecond:
- Absolute information (argument is singular); adding or subtracting a
- relativedelta with absolute information does not perform an aritmetic
- operation, but rather REPLACES the corresponding value in the
- original datetime with the value(s) in relativedelta.
-
- years, months, weeks, days, hours, minutes, seconds, microseconds:
- Relative information, may be negative (argument is plural); adding
- or subtracting a relativedelta with relative information performs
- the corresponding aritmetic operation on the original datetime value
- with the information in the relativedelta.
-
- weekday:
- One of the weekday instances (MO, TU, etc). These instances may
- receive a parameter N, specifying the Nth weekday, which could
- be positive or negative (like MO(+1) or MO(-2). Not specifying
- it is the same as specifying +1. You can also use an integer,
- where 0=MO.
-
- leapdays:
- Will add given days to the date found, if year is a leap
- year, and the date found is post 28 of february.
-
- yearday, nlyearday:
- Set the yearday or the non-leap year day (jump leap days).
- These are converted to day/month/leapdays information.
-
- Here is the behavior of operations with relativedelta:
-
- 1. Calculate the absolute year, using the 'year' argument, or the
- original datetime year, if the argument is not present.
-
- 2. Add the relative 'years' argument to the absolute year.
-
- 3. Do steps 1 and 2 for month/months.
-
- 4. Calculate the absolute day, using the 'day' argument, or the
- original datetime day, if the argument is not present. Then,
- subtract from the day until it fits in the year and month
- found after their operations.
-
- 5. Add the relative 'days' argument to the absolute day. Notice
- that the 'weeks' argument is multiplied by 7 and added to
- 'days'.
-
- 6. Do steps 1 and 2 for hour/hours, minute/minutes, second/seconds,
- microsecond/microseconds.
-
- 7. If the 'weekday' argument is present, calculate the weekday,
- with the given (wday, nth) tuple. wday is the index of the
- weekday (0-6, 0=Mon), and nth is the number of weeks to add
- forward or backward, depending on its signal. Notice that if
- the calculated date is already Monday, for example, using
- (0, 1) or (0, -1) won't change the day.
- """
-
- def __init__(self, dt1=None, dt2=None,
- years=0, months=0, days=0, leapdays=0, weeks=0,
- hours=0, minutes=0, seconds=0, microseconds=0,
- year=None, month=None, day=None, weekday=None,
- yearday=None, nlyearday=None,
- hour=None, minute=None, second=None, microsecond=None):
-
- # Check for non-integer values in integer-only quantities
- if any(x is not None and x != int(x) for x in (years, months)):
- raise ValueError("Non-integer years and months are "
- "ambiguous and not currently supported.")
-
- if dt1 and dt2:
- # datetime is a subclass of date. So both must be date
- if not (isinstance(dt1, datetime.date) and
- isinstance(dt2, datetime.date)):
- raise TypeError("relativedelta only diffs datetime/date")
-
- # We allow two dates, or two datetimes, so we coerce them to be
- # of the same type
- if (isinstance(dt1, datetime.datetime) !=
- isinstance(dt2, datetime.datetime)):
- if not isinstance(dt1, datetime.datetime):
- dt1 = datetime.datetime.fromordinal(dt1.toordinal())
- elif not isinstance(dt2, datetime.datetime):
- dt2 = datetime.datetime.fromordinal(dt2.toordinal())
-
- self.years = 0
- self.months = 0
- self.days = 0
- self.leapdays = 0
- self.hours = 0
- self.minutes = 0
- self.seconds = 0
- self.microseconds = 0
- self.year = None
- self.month = None
- self.day = None
- self.weekday = None
- self.hour = None
- self.minute = None
- self.second = None
- self.microsecond = None
- self._has_time = 0
-
- # Get year / month delta between the two
- months = (dt1.year - dt2.year) * 12 + (dt1.month - dt2.month)
- self._set_months(months)
-
- # Remove the year/month delta so the timedelta is just well-defined
- # time units (seconds, days and microseconds)
- dtm = self.__radd__(dt2)
-
- # If we've overshot our target, make an adjustment
- if dt1 < dt2:
- compare = operator.gt
- increment = 1
- else:
- compare = operator.lt
- increment = -1
-
- while compare(dt1, dtm):
- months += increment
- self._set_months(months)
- dtm = self.__radd__(dt2)
-
- # Get the timedelta between the "months-adjusted" date and dt1
- delta = dt1 - dtm
- self.seconds = delta.seconds + delta.days * 86400
- self.microseconds = delta.microseconds
- else:
- # Relative information
- self.years = years
- self.months = months
- self.days = days + weeks * 7
- self.leapdays = leapdays
- self.hours = hours
- self.minutes = minutes
- self.seconds = seconds
- self.microseconds = microseconds
-
- # Absolute information
- self.year = year
- self.month = month
- self.day = day
- self.hour = hour
- self.minute = minute
- self.second = second
- self.microsecond = microsecond
-
- if any(x is not None and int(x) != x
- for x in (year, month, day, hour,
- minute, second, microsecond)):
- # For now we'll deprecate floats - later it'll be an error.
- warn("Non-integer value passed as absolute information. " +
- "This is not a well-defined condition and will raise " +
- "errors in future versions.", DeprecationWarning)
-
- if isinstance(weekday, integer_types):
- self.weekday = weekdays[weekday]
- else:
- self.weekday = weekday
-
- yday = 0
- if nlyearday:
- yday = nlyearday
- elif yearday:
- yday = yearday
- if yearday > 59:
- self.leapdays = -1
- if yday:
- ydayidx = [31, 59, 90, 120, 151, 181, 212,
- 243, 273, 304, 334, 366]
- for idx, ydays in enumerate(ydayidx):
- if yday <= ydays:
- self.month = idx+1
- if idx == 0:
- self.day = yday
- else:
- self.day = yday-ydayidx[idx-1]
- break
- else:
- raise ValueError("invalid year day (%d)" % yday)
-
- self._fix()
-
- def _fix(self):
- if abs(self.microseconds) > 999999:
- s = _sign(self.microseconds)
- div, mod = divmod(self.microseconds * s, 1000000)
- self.microseconds = mod * s
- self.seconds += div * s
- if abs(self.seconds) > 59:
- s = _sign(self.seconds)
- div, mod = divmod(self.seconds * s, 60)
- self.seconds = mod * s
- self.minutes += div * s
- if abs(self.minutes) > 59:
- s = _sign(self.minutes)
- div, mod = divmod(self.minutes * s, 60)
- self.minutes = mod * s
- self.hours += div * s
- if abs(self.hours) > 23:
- s = _sign(self.hours)
- div, mod = divmod(self.hours * s, 24)
- self.hours = mod * s
- self.days += div * s
- if abs(self.months) > 11:
- s = _sign(self.months)
- div, mod = divmod(self.months * s, 12)
- self.months = mod * s
- self.years += div * s
- if (self.hours or self.minutes or self.seconds or self.microseconds
- or self.hour is not None or self.minute is not None or
- self.second is not None or self.microsecond is not None):
- self._has_time = 1
- else:
- self._has_time = 0
-
- @property
- def weeks(self):
- return self.days // 7
-
- @weeks.setter
- def weeks(self, value):
- self.days = self.days - (self.weeks * 7) + value * 7
-
- def _set_months(self, months):
- self.months = months
- if abs(self.months) > 11:
- s = _sign(self.months)
- div, mod = divmod(self.months * s, 12)
- self.months = mod * s
- self.years = div * s
- else:
- self.years = 0
-
- def normalized(self):
- """
- Return a version of this object represented entirely using integer
- values for the relative attributes.
-
- >>> relativedelta(days=1.5, hours=2).normalized()
- relativedelta(days=1, hours=14)
-
- :return:
- Returns a :class:`dateutil.relativedelta.relativedelta` object.
- """
- # Cascade remainders down (rounding each to roughly nearest microsecond)
- days = int(self.days)
-
- hours_f = round(self.hours + 24 * (self.days - days), 11)
- hours = int(hours_f)
-
- minutes_f = round(self.minutes + 60 * (hours_f - hours), 10)
- minutes = int(minutes_f)
-
- seconds_f = round(self.seconds + 60 * (minutes_f - minutes), 8)
- seconds = int(seconds_f)
-
- microseconds = round(self.microseconds + 1e6 * (seconds_f - seconds))
-
- # Constructor carries overflow back up with call to _fix()
- return self.__class__(years=self.years, months=self.months,
- days=days, hours=hours, minutes=minutes,
- seconds=seconds, microseconds=microseconds,
- leapdays=self.leapdays, year=self.year,
- month=self.month, day=self.day,
- weekday=self.weekday, hour=self.hour,
- minute=self.minute, second=self.second,
- microsecond=self.microsecond)
-
- def __add__(self, other):
- if isinstance(other, relativedelta):
- return self.__class__(years=other.years + self.years,
- months=other.months + self.months,
- days=other.days + self.days,
- hours=other.hours + self.hours,
- minutes=other.minutes + self.minutes,
- seconds=other.seconds + self.seconds,
- microseconds=(other.microseconds +
- self.microseconds),
- leapdays=other.leapdays or self.leapdays,
- year=(other.year if other.year is not None
- else self.year),
- month=(other.month if other.month is not None
- else self.month),
- day=(other.day if other.day is not None
- else self.day),
- weekday=(other.weekday if other.weekday is not None
- else self.weekday),
- hour=(other.hour if other.hour is not None
- else self.hour),
- minute=(other.minute if other.minute is not None
- else self.minute),
- second=(other.second if other.second is not None
- else self.second),
- microsecond=(other.microsecond if other.microsecond
- is not None else
- self.microsecond))
- if isinstance(other, datetime.timedelta):
- return self.__class__(years=self.years,
- months=self.months,
- days=self.days + other.days,
- hours=self.hours,
- minutes=self.minutes,
- seconds=self.seconds + other.seconds,
- microseconds=self.microseconds + other.microseconds,
- leapdays=self.leapdays,
- year=self.year,
- month=self.month,
- day=self.day,
- weekday=self.weekday,
- hour=self.hour,
- minute=self.minute,
- second=self.second,
- microsecond=self.microsecond)
- if not isinstance(other, datetime.date):
- return NotImplemented
- elif self._has_time and not isinstance(other, datetime.datetime):
- other = datetime.datetime.fromordinal(other.toordinal())
- year = (self.year or other.year)+self.years
- month = self.month or other.month
- if self.months:
- assert 1 <= abs(self.months) <= 12
- month += self.months
- if month > 12:
- year += 1
- month -= 12
- elif month < 1:
- year -= 1
- month += 12
- day = min(calendar.monthrange(year, month)[1],
- self.day or other.day)
- repl = {"year": year, "month": month, "day": day}
- for attr in ["hour", "minute", "second", "microsecond"]:
- value = getattr(self, attr)
- if value is not None:
- repl[attr] = value
- days = self.days
- if self.leapdays and month > 2 and calendar.isleap(year):
- days += self.leapdays
- ret = (other.replace(**repl)
- + datetime.timedelta(days=days,
- hours=self.hours,
- minutes=self.minutes,
- seconds=self.seconds,
- microseconds=self.microseconds))
- if self.weekday:
- weekday, nth = self.weekday.weekday, self.weekday.n or 1
- jumpdays = (abs(nth) - 1) * 7
- if nth > 0:
- jumpdays += (7 - ret.weekday() + weekday) % 7
- else:
- jumpdays += (ret.weekday() - weekday) % 7
- jumpdays *= -1
- ret += datetime.timedelta(days=jumpdays)
- return ret
-
- def __radd__(self, other):
- return self.__add__(other)
-
- def __rsub__(self, other):
- return self.__neg__().__radd__(other)
-
- def __sub__(self, other):
- if not isinstance(other, relativedelta):
- return NotImplemented # In case the other object defines __rsub__
- return self.__class__(years=self.years - other.years,
- months=self.months - other.months,
- days=self.days - other.days,
- hours=self.hours - other.hours,
- minutes=self.minutes - other.minutes,
- seconds=self.seconds - other.seconds,
- microseconds=self.microseconds - other.microseconds,
- leapdays=self.leapdays or other.leapdays,
- year=(self.year if self.year is not None
- else other.year),
- month=(self.month if self.month is not None else
- other.month),
- day=(self.day if self.day is not None else
- other.day),
- weekday=(self.weekday if self.weekday is not None else
- other.weekday),
- hour=(self.hour if self.hour is not None else
- other.hour),
- minute=(self.minute if self.minute is not None else
- other.minute),
- second=(self.second if self.second is not None else
- other.second),
- microsecond=(self.microsecond if self.microsecond
- is not None else
- other.microsecond))
-
- def __neg__(self):
- return self.__class__(years=-self.years,
- months=-self.months,
- days=-self.days,
- hours=-self.hours,
- minutes=-self.minutes,
- seconds=-self.seconds,
- microseconds=-self.microseconds,
- leapdays=self.leapdays,
- year=self.year,
- month=self.month,
- day=self.day,
- weekday=self.weekday,
- hour=self.hour,
- minute=self.minute,
- second=self.second,
- microsecond=self.microsecond)
-
- def __bool__(self):
- return not (not self.years and
- not self.months and
- not self.days and
- not self.hours and
- not self.minutes and
- not self.seconds and
- not self.microseconds and
- not self.leapdays and
- self.year is None and
- self.month is None and
- self.day is None and
- self.weekday is None and
- self.hour is None and
- self.minute is None and
- self.second is None and
- self.microsecond is None)
- # Compatibility with Python 2.x
- __nonzero__ = __bool__
-
- def __mul__(self, other):
- try:
- f = float(other)
- except TypeError:
- return NotImplemented
-
- return self.__class__(years=int(self.years * f),
- months=int(self.months * f),
- days=int(self.days * f),
- hours=int(self.hours * f),
- minutes=int(self.minutes * f),
- seconds=int(self.seconds * f),
- microseconds=int(self.microseconds * f),
- leapdays=self.leapdays,
- year=self.year,
- month=self.month,
- day=self.day,
- weekday=self.weekday,
- hour=self.hour,
- minute=self.minute,
- second=self.second,
- microsecond=self.microsecond)
-
- __rmul__ = __mul__
-
- def __eq__(self, other):
- if not isinstance(other, relativedelta):
- return NotImplemented
- if self.weekday or other.weekday:
- if not self.weekday or not other.weekday:
- return False
- if self.weekday.weekday != other.weekday.weekday:
- return False
- n1, n2 = self.weekday.n, other.weekday.n
- if n1 != n2 and not ((not n1 or n1 == 1) and (not n2 or n2 == 1)):
- return False
- return (self.years == other.years and
- self.months == other.months and
- self.days == other.days and
- self.hours == other.hours and
- self.minutes == other.minutes and
- self.seconds == other.seconds and
- self.microseconds == other.microseconds and
- self.leapdays == other.leapdays and
- self.year == other.year and
- self.month == other.month and
- self.day == other.day and
- self.hour == other.hour and
- self.minute == other.minute and
- self.second == other.second and
- self.microsecond == other.microsecond)
-
- __hash__ = None
-
- def __ne__(self, other):
- return not self.__eq__(other)
-
- def __div__(self, other):
- try:
- reciprocal = 1 / float(other)
- except TypeError:
- return NotImplemented
-
- return self.__mul__(reciprocal)
-
- __truediv__ = __div__
-
- def __repr__(self):
- l = []
- for attr in ["years", "months", "days", "leapdays",
- "hours", "minutes", "seconds", "microseconds"]:
- value = getattr(self, attr)
- if value:
- l.append("{attr}={value:+g}".format(attr=attr, value=value))
- for attr in ["year", "month", "day", "weekday",
- "hour", "minute", "second", "microsecond"]:
- value = getattr(self, attr)
- if value is not None:
- l.append("{attr}={value}".format(attr=attr, value=repr(value)))
- return "{classname}({attrs})".format(classname=self.__class__.__name__,
- attrs=", ".join(l))
-
-
-def _sign(x):
- return int(copysign(1, x))
-
-# vim:ts=4:sw=4:et
diff --git a/lib/dateutil/rrule.py b/lib/dateutil/rrule.py
deleted file mode 100644
index 429f8fc8b3..0000000000
--- a/lib/dateutil/rrule.py
+++ /dev/null
@@ -1,1610 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
-The rrule module offers a small, complete, and very fast, implementation of
-the recurrence rules documented in the
-`iCalendar RFC `_,
-including support for caching of results.
-"""
-import itertools
-import datetime
-import calendar
-import sys
-
-try:
- from math import gcd
-except ImportError:
- from fractions import gcd
-
-from six import advance_iterator, integer_types
-from six.moves import _thread, range
-import heapq
-
-from ._common import weekday as weekdaybase
-
-# For warning about deprecation of until and count
-from warnings import warn
-
-__all__ = ["rrule", "rruleset", "rrulestr",
- "YEARLY", "MONTHLY", "WEEKLY", "DAILY",
- "HOURLY", "MINUTELY", "SECONDLY",
- "MO", "TU", "WE", "TH", "FR", "SA", "SU"]
-
-# Every mask is 7 days longer to handle cross-year weekly periods.
-M366MASK = tuple([1]*31+[2]*29+[3]*31+[4]*30+[5]*31+[6]*30 +
- [7]*31+[8]*31+[9]*30+[10]*31+[11]*30+[12]*31+[1]*7)
-M365MASK = list(M366MASK)
-M29, M30, M31 = list(range(1, 30)), list(range(1, 31)), list(range(1, 32))
-MDAY366MASK = tuple(M31+M29+M31+M30+M31+M30+M31+M31+M30+M31+M30+M31+M31[:7])
-MDAY365MASK = list(MDAY366MASK)
-M29, M30, M31 = list(range(-29, 0)), list(range(-30, 0)), list(range(-31, 0))
-NMDAY366MASK = tuple(M31+M29+M31+M30+M31+M30+M31+M31+M30+M31+M30+M31+M31[:7])
-NMDAY365MASK = list(NMDAY366MASK)
-M366RANGE = (0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366)
-M365RANGE = (0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365)
-WDAYMASK = [0, 1, 2, 3, 4, 5, 6]*55
-del M29, M30, M31, M365MASK[59], MDAY365MASK[59], NMDAY365MASK[31]
-MDAY365MASK = tuple(MDAY365MASK)
-M365MASK = tuple(M365MASK)
-
-FREQNAMES = ['YEARLY', 'MONTHLY', 'WEEKLY', 'DAILY', 'HOURLY', 'MINUTELY', 'SECONDLY']
-
-(YEARLY,
- MONTHLY,
- WEEKLY,
- DAILY,
- HOURLY,
- MINUTELY,
- SECONDLY) = list(range(7))
-
-# Imported on demand.
-easter = None
-parser = None
-
-
-class weekday(weekdaybase):
- """
- This version of weekday does not allow n = 0.
- """
- def __init__(self, wkday, n=None):
- if n == 0:
- raise ValueError("Can't create weekday with n==0")
-
- super(weekday, self).__init__(wkday, n)
-
-
-MO, TU, WE, TH, FR, SA, SU = weekdays = tuple(weekday(x) for x in range(7))
-
-
-def _invalidates_cache(f):
- """
- Decorator for rruleset methods which may invalidate the
- cached length.
- """
- def inner_func(self, *args, **kwargs):
- rv = f(self, *args, **kwargs)
- self._invalidate_cache()
- return rv
-
- return inner_func
-
-
-class rrulebase(object):
- def __init__(self, cache=False):
- if cache:
- self._cache = []
- self._cache_lock = _thread.allocate_lock()
- self._invalidate_cache()
- else:
- self._cache = None
- self._cache_complete = False
- self._len = None
-
- def __iter__(self):
- if self._cache_complete:
- return iter(self._cache)
- elif self._cache is None:
- return self._iter()
- else:
- return self._iter_cached()
-
- def _invalidate_cache(self):
- if self._cache is not None:
- self._cache = []
- self._cache_complete = False
- self._cache_gen = self._iter()
-
- if self._cache_lock.locked():
- self._cache_lock.release()
-
- self._len = None
-
- def _iter_cached(self):
- i = 0
- gen = self._cache_gen
- cache = self._cache
- acquire = self._cache_lock.acquire
- release = self._cache_lock.release
- while gen:
- if i == len(cache):
- acquire()
- if self._cache_complete:
- break
- try:
- for j in range(10):
- cache.append(advance_iterator(gen))
- except StopIteration:
- self._cache_gen = gen = None
- self._cache_complete = True
- break
- release()
- yield cache[i]
- i += 1
- while i < self._len:
- yield cache[i]
- i += 1
-
- def __getitem__(self, item):
- if self._cache_complete:
- return self._cache[item]
- elif isinstance(item, slice):
- if item.step and item.step < 0:
- return list(iter(self))[item]
- else:
- return list(itertools.islice(self,
- item.start or 0,
- item.stop or sys.maxsize,
- item.step or 1))
- elif item >= 0:
- gen = iter(self)
- try:
- for i in range(item+1):
- res = advance_iterator(gen)
- except StopIteration:
- raise IndexError
- return res
- else:
- return list(iter(self))[item]
-
- def __contains__(self, item):
- if self._cache_complete:
- return item in self._cache
- else:
- for i in self:
- if i == item:
- return True
- elif i > item:
- return False
- return False
-
- # __len__() introduces a large performance penality.
- def count(self):
- """ Returns the number of recurrences in this set. It will have go
- trough the whole recurrence, if this hasn't been done before. """
- if self._len is None:
- for x in self:
- pass
- return self._len
-
- def before(self, dt, inc=False):
- """ Returns the last recurrence before the given datetime instance. The
- inc keyword defines what happens if dt is an occurrence. With
- inc=True, if dt itself is an occurrence, it will be returned. """
- if self._cache_complete:
- gen = self._cache
- else:
- gen = self
- last = None
- if inc:
- for i in gen:
- if i > dt:
- break
- last = i
- else:
- for i in gen:
- if i >= dt:
- break
- last = i
- return last
-
- def after(self, dt, inc=False):
- """ Returns the first recurrence after the given datetime instance. The
- inc keyword defines what happens if dt is an occurrence. With
- inc=True, if dt itself is an occurrence, it will be returned. """
- if self._cache_complete:
- gen = self._cache
- else:
- gen = self
- if inc:
- for i in gen:
- if i >= dt:
- return i
- else:
- for i in gen:
- if i > dt:
- return i
- return None
-
- def xafter(self, dt, count=None, inc=False):
- """
- Generator which yields up to `count` recurrences after the given
- datetime instance, equivalent to `after`.
-
- :param dt:
- The datetime at which to start generating recurrences.
-
- :param count:
- The maximum number of recurrences to generate. If `None` (default),
- dates are generated until the recurrence rule is exhausted.
-
- :param inc:
- If `dt` is an instance of the rule and `inc` is `True`, it is
- included in the output.
-
- :yields: Yields a sequence of `datetime` objects.
- """
-
- if self._cache_complete:
- gen = self._cache
- else:
- gen = self
-
- # Select the comparison function
- if inc:
- comp = lambda dc, dtc: dc >= dtc
- else:
- comp = lambda dc, dtc: dc > dtc
-
- # Generate dates
- n = 0
- for d in gen:
- if comp(d, dt):
- if count is not None:
- n += 1
- if n > count:
- break
-
- yield d
-
- def between(self, after, before, inc=False, count=1):
- """ Returns all the occurrences of the rrule between after and before.
- The inc keyword defines what happens if after and/or before are
- themselves occurrences. With inc=True, they will be included in the
- list, if they are found in the recurrence set. """
- if self._cache_complete:
- gen = self._cache
- else:
- gen = self
- started = False
- l = []
- if inc:
- for i in gen:
- if i > before:
- break
- elif not started:
- if i >= after:
- started = True
- l.append(i)
- else:
- l.append(i)
- else:
- for i in gen:
- if i >= before:
- break
- elif not started:
- if i > after:
- started = True
- l.append(i)
- else:
- l.append(i)
- return l
-
-
-class rrule(rrulebase):
- """
- That's the base of the rrule operation. It accepts all the keywords
- defined in the RFC as its constructor parameters (except byday,
- which was renamed to byweekday) and more. The constructor prototype is::
-
- rrule(freq)
-
- Where freq must be one of YEARLY, MONTHLY, WEEKLY, DAILY, HOURLY, MINUTELY,
- or SECONDLY.
-
- .. note::
- Per RFC section 3.3.10, recurrence instances falling on invalid dates
- and times are ignored rather than coerced:
-
- Recurrence rules may generate recurrence instances with an invalid
- date (e.g., February 30) or nonexistent local time (e.g., 1:30 AM
- on a day where the local time is moved forward by an hour at 1:00
- AM). Such recurrence instances MUST be ignored and MUST NOT be
- counted as part of the recurrence set.
-
- This can lead to possibly surprising behavior when, for example, the
- start date occurs at the end of the month:
-
- >>> from dateutil.rrule import rrule, MONTHLY
- >>> from datetime import datetime
- >>> start_date = datetime(2014, 12, 31)
- >>> list(rrule(freq=MONTHLY, count=4, dtstart=start_date))
- ... # doctest: +NORMALIZE_WHITESPACE
- [datetime.datetime(2014, 12, 31, 0, 0),
- datetime.datetime(2015, 1, 31, 0, 0),
- datetime.datetime(2015, 3, 31, 0, 0),
- datetime.datetime(2015, 5, 31, 0, 0)]
-
- Additionally, it supports the following keyword arguments:
-
- :param cache:
- If given, it must be a boolean value specifying to enable or disable
- caching of results. If you will use the same rrule instance multiple
- times, enabling caching will improve the performance considerably.
- :param dtstart:
- The recurrence start. Besides being the base for the recurrence,
- missing parameters in the final recurrence instances will also be
- extracted from this date. If not given, datetime.now() will be used
- instead.
- :param interval:
- The interval between each freq iteration. For example, when using
- YEARLY, an interval of 2 means once every two years, but with HOURLY,
- it means once every two hours. The default interval is 1.
- :param wkst:
- The week start day. Must be one of the MO, TU, WE constants, or an
- integer, specifying the first day of the week. This will affect
- recurrences based on weekly periods. The default week start is got
- from calendar.firstweekday(), and may be modified by
- calendar.setfirstweekday().
- :param count:
- How many occurrences will be generated.
-
- .. note::
- As of version 2.5.0, the use of the ``until`` keyword together
- with the ``count`` keyword is deprecated per RFC-2445 Sec. 4.3.10.
- :param until:
- If given, this must be a datetime instance, that will specify the
- limit of the recurrence. The last recurrence in the rule is the greatest
- datetime that is less than or equal to the value specified in the
- ``until`` parameter.
-
- .. note::
- As of version 2.5.0, the use of the ``until`` keyword together
- with the ``count`` keyword is deprecated per RFC-2445 Sec. 4.3.10.
- :param bysetpos:
- If given, it must be either an integer, or a sequence of integers,
- positive or negative. Each given integer will specify an occurrence
- number, corresponding to the nth occurrence of the rule inside the
- frequency period. For example, a bysetpos of -1 if combined with a
- MONTHLY frequency, and a byweekday of (MO, TU, WE, TH, FR), will
- result in the last work day of every month.
- :param bymonth:
- If given, it must be either an integer, or a sequence of integers,
- meaning the months to apply the recurrence to.
- :param bymonthday:
- If given, it must be either an integer, or a sequence of integers,
- meaning the month days to apply the recurrence to.
- :param byyearday:
- If given, it must be either an integer, or a sequence of integers,
- meaning the year days to apply the recurrence to.
- :param byweekno:
- If given, it must be either an integer, or a sequence of integers,
- meaning the week numbers to apply the recurrence to. Week numbers
- have the meaning described in ISO8601, that is, the first week of
- the year is that containing at least four days of the new year.
- :param byweekday:
- If given, it must be either an integer (0 == MO), a sequence of
- integers, one of the weekday constants (MO, TU, etc), or a sequence
- of these constants. When given, these variables will define the
- weekdays where the recurrence will be applied. It's also possible to
- use an argument n for the weekday instances, which will mean the nth
- occurrence of this weekday in the period. For example, with MONTHLY,
- or with YEARLY and BYMONTH, using FR(+1) in byweekday will specify the
- first friday of the month where the recurrence happens. Notice that in
- the RFC documentation, this is specified as BYDAY, but was renamed to
- avoid the ambiguity of that keyword.
- :param byhour:
- If given, it must be either an integer, or a sequence of integers,
- meaning the hours to apply the recurrence to.
- :param byminute:
- If given, it must be either an integer, or a sequence of integers,
- meaning the minutes to apply the recurrence to.
- :param bysecond:
- If given, it must be either an integer, or a sequence of integers,
- meaning the seconds to apply the recurrence to.
- :param byeaster:
- If given, it must be either an integer, or a sequence of integers,
- positive or negative. Each integer will define an offset from the
- Easter Sunday. Passing the offset 0 to byeaster will yield the Easter
- Sunday itself. This is an extension to the RFC specification.
- """
- def __init__(self, freq, dtstart=None,
- interval=1, wkst=None, count=None, until=None, bysetpos=None,
- bymonth=None, bymonthday=None, byyearday=None, byeaster=None,
- byweekno=None, byweekday=None,
- byhour=None, byminute=None, bysecond=None,
- cache=False):
- super(rrule, self).__init__(cache)
- global easter
- if not dtstart:
- dtstart = datetime.datetime.now().replace(microsecond=0)
- elif not isinstance(dtstart, datetime.datetime):
- dtstart = datetime.datetime.fromordinal(dtstart.toordinal())
- else:
- dtstart = dtstart.replace(microsecond=0)
- self._dtstart = dtstart
- self._tzinfo = dtstart.tzinfo
- self._freq = freq
- self._interval = interval
- self._count = count
-
- # Cache the original byxxx rules, if they are provided, as the _byxxx
- # attributes do not necessarily map to the inputs, and this can be
- # a problem in generating the strings. Only store things if they've
- # been supplied (the string retrieval will just use .get())
- self._original_rule = {}
-
- if until and not isinstance(until, datetime.datetime):
- until = datetime.datetime.fromordinal(until.toordinal())
- self._until = until
-
- if count is not None and until:
- warn("Using both 'count' and 'until' is inconsistent with RFC 2445"
- " and has been deprecated in dateutil. Future versions will "
- "raise an error.", DeprecationWarning)
-
- if wkst is None:
- self._wkst = calendar.firstweekday()
- elif isinstance(wkst, integer_types):
- self._wkst = wkst
- else:
- self._wkst = wkst.weekday
-
- if bysetpos is None:
- self._bysetpos = None
- elif isinstance(bysetpos, integer_types):
- if bysetpos == 0 or not (-366 <= bysetpos <= 366):
- raise ValueError("bysetpos must be between 1 and 366, "
- "or between -366 and -1")
- self._bysetpos = (bysetpos,)
- else:
- self._bysetpos = tuple(bysetpos)
- for pos in self._bysetpos:
- if pos == 0 or not (-366 <= pos <= 366):
- raise ValueError("bysetpos must be between 1 and 366, "
- "or between -366 and -1")
-
- if self._bysetpos:
- self._original_rule['bysetpos'] = self._bysetpos
-
- if (byweekno is None and byyearday is None and bymonthday is None and
- byweekday is None and byeaster is None):
- if freq == YEARLY:
- if bymonth is None:
- bymonth = dtstart.month
- self._original_rule['bymonth'] = None
- bymonthday = dtstart.day
- self._original_rule['bymonthday'] = None
- elif freq == MONTHLY:
- bymonthday = dtstart.day
- self._original_rule['bymonthday'] = None
- elif freq == WEEKLY:
- byweekday = dtstart.weekday()
- self._original_rule['byweekday'] = None
-
- # bymonth
- if bymonth is None:
- self._bymonth = None
- else:
- if isinstance(bymonth, integer_types):
- bymonth = (bymonth,)
-
- self._bymonth = tuple(sorted(set(bymonth)))
-
- if 'bymonth' not in self._original_rule:
- self._original_rule['bymonth'] = self._bymonth
-
- # byyearday
- if byyearday is None:
- self._byyearday = None
- else:
- if isinstance(byyearday, integer_types):
- byyearday = (byyearday,)
-
- self._byyearday = tuple(sorted(set(byyearday)))
- self._original_rule['byyearday'] = self._byyearday
-
- # byeaster
- if byeaster is not None:
- if not easter:
- from dateutil import easter
- if isinstance(byeaster, integer_types):
- self._byeaster = (byeaster,)
- else:
- self._byeaster = tuple(sorted(byeaster))
-
- self._original_rule['byeaster'] = self._byeaster
- else:
- self._byeaster = None
-
- # bymonthday
- if bymonthday is None:
- self._bymonthday = ()
- self._bynmonthday = ()
- else:
- if isinstance(bymonthday, integer_types):
- bymonthday = (bymonthday,)
-
- bymonthday = set(bymonthday) # Ensure it's unique
-
- self._bymonthday = tuple(sorted(x for x in bymonthday if x > 0))
- self._bynmonthday = tuple(sorted(x for x in bymonthday if x < 0))
-
- # Storing positive numbers first, then negative numbers
- if 'bymonthday' not in self._original_rule:
- self._original_rule['bymonthday'] = tuple(
- itertools.chain(self._bymonthday, self._bynmonthday))
-
- # byweekno
- if byweekno is None:
- self._byweekno = None
- else:
- if isinstance(byweekno, integer_types):
- byweekno = (byweekno,)
-
- self._byweekno = tuple(sorted(set(byweekno)))
-
- self._original_rule['byweekno'] = self._byweekno
-
- # byweekday / bynweekday
- if byweekday is None:
- self._byweekday = None
- self._bynweekday = None
- else:
- # If it's one of the valid non-sequence types, convert to a
- # single-element sequence before the iterator that builds the
- # byweekday set.
- if isinstance(byweekday, integer_types) or hasattr(byweekday, "n"):
- byweekday = (byweekday,)
-
- self._byweekday = set()
- self._bynweekday = set()
- for wday in byweekday:
- if isinstance(wday, integer_types):
- self._byweekday.add(wday)
- elif not wday.n or freq > MONTHLY:
- self._byweekday.add(wday.weekday)
- else:
- self._bynweekday.add((wday.weekday, wday.n))
-
- if not self._byweekday:
- self._byweekday = None
- elif not self._bynweekday:
- self._bynweekday = None
-
- if self._byweekday is not None:
- self._byweekday = tuple(sorted(self._byweekday))
- orig_byweekday = [weekday(x) for x in self._byweekday]
- else:
- orig_byweekday = tuple()
-
- if self._bynweekday is not None:
- self._bynweekday = tuple(sorted(self._bynweekday))
- orig_bynweekday = [weekday(*x) for x in self._bynweekday]
- else:
- orig_bynweekday = tuple()
-
- if 'byweekday' not in self._original_rule:
- self._original_rule['byweekday'] = tuple(itertools.chain(
- orig_byweekday, orig_bynweekday))
-
- # byhour
- if byhour is None:
- if freq < HOURLY:
- self._byhour = set((dtstart.hour,))
- else:
- self._byhour = None
- else:
- if isinstance(byhour, integer_types):
- byhour = (byhour,)
-
- if freq == HOURLY:
- self._byhour = self.__construct_byset(start=dtstart.hour,
- byxxx=byhour,
- base=24)
- else:
- self._byhour = set(byhour)
-
- self._byhour = tuple(sorted(self._byhour))
- self._original_rule['byhour'] = self._byhour
-
- # byminute
- if byminute is None:
- if freq < MINUTELY:
- self._byminute = set((dtstart.minute,))
- else:
- self._byminute = None
- else:
- if isinstance(byminute, integer_types):
- byminute = (byminute,)
-
- if freq == MINUTELY:
- self._byminute = self.__construct_byset(start=dtstart.minute,
- byxxx=byminute,
- base=60)
- else:
- self._byminute = set(byminute)
-
- self._byminute = tuple(sorted(self._byminute))
- self._original_rule['byminute'] = self._byminute
-
- # bysecond
- if bysecond is None:
- if freq < SECONDLY:
- self._bysecond = ((dtstart.second,))
- else:
- self._bysecond = None
- else:
- if isinstance(bysecond, integer_types):
- bysecond = (bysecond,)
-
- self._bysecond = set(bysecond)
-
- if freq == SECONDLY:
- self._bysecond = self.__construct_byset(start=dtstart.second,
- byxxx=bysecond,
- base=60)
- else:
- self._bysecond = set(bysecond)
-
- self._bysecond = tuple(sorted(self._bysecond))
- self._original_rule['bysecond'] = self._bysecond
-
- if self._freq >= HOURLY:
- self._timeset = None
- else:
- self._timeset = []
- for hour in self._byhour:
- for minute in self._byminute:
- for second in self._bysecond:
- self._timeset.append(
- datetime.time(hour, minute, second,
- tzinfo=self._tzinfo))
- self._timeset.sort()
- self._timeset = tuple(self._timeset)
-
- def __str__(self):
- """
- Output a string that would generate this RRULE if passed to rrulestr.
- This is mostly compatible with RFC2445, except for the
- dateutil-specific extension BYEASTER.
- """
-
- output = []
- h, m, s = [None] * 3
- if self._dtstart:
- output.append(self._dtstart.strftime('DTSTART:%Y%m%dT%H%M%S'))
- h, m, s = self._dtstart.timetuple()[3:6]
-
- parts = ['FREQ=' + FREQNAMES[self._freq]]
- if self._interval != 1:
- parts.append('INTERVAL=' + str(self._interval))
-
- if self._wkst:
- parts.append('WKST=' + repr(weekday(self._wkst))[0:2])
-
- if self._count is not None:
- parts.append('COUNT=' + str(self._count))
-
- if self._until:
- parts.append(self._until.strftime('UNTIL=%Y%m%dT%H%M%S'))
-
- if self._original_rule.get('byweekday') is not None:
- # The str() method on weekday objects doesn't generate
- # RFC2445-compliant strings, so we should modify that.
- original_rule = dict(self._original_rule)
- wday_strings = []
- for wday in original_rule['byweekday']:
- if wday.n:
- wday_strings.append('{n:+d}{wday}'.format(
- n=wday.n,
- wday=repr(wday)[0:2]))
- else:
- wday_strings.append(repr(wday))
-
- original_rule['byweekday'] = wday_strings
- else:
- original_rule = self._original_rule
-
- partfmt = '{name}={vals}'
- for name, key in [('BYSETPOS', 'bysetpos'),
- ('BYMONTH', 'bymonth'),
- ('BYMONTHDAY', 'bymonthday'),
- ('BYYEARDAY', 'byyearday'),
- ('BYWEEKNO', 'byweekno'),
- ('BYDAY', 'byweekday'),
- ('BYHOUR', 'byhour'),
- ('BYMINUTE', 'byminute'),
- ('BYSECOND', 'bysecond'),
- ('BYEASTER', 'byeaster')]:
- value = original_rule.get(key)
- if value:
- parts.append(partfmt.format(name=name, vals=(','.join(str(v)
- for v in value))))
-
- output.append(';'.join(parts))
- return '\n'.join(output)
-
- def replace(self, **kwargs):
- """Return new rrule with same attributes except for those attributes given new
- values by whichever keyword arguments are specified."""
- new_kwargs = {"interval": self._interval,
- "count": self._count,
- "dtstart": self._dtstart,
- "freq": self._freq,
- "until": self._until,
- "wkst": self._wkst,
- "cache": False if self._cache is None else True }
- new_kwargs.update(self._original_rule)
- new_kwargs.update(kwargs)
- return rrule(**new_kwargs)
-
- def _iter(self):
- year, month, day, hour, minute, second, weekday, yearday, _ = \
- self._dtstart.timetuple()
-
- # Some local variables to speed things up a bit
- freq = self._freq
- interval = self._interval
- wkst = self._wkst
- until = self._until
- bymonth = self._bymonth
- byweekno = self._byweekno
- byyearday = self._byyearday
- byweekday = self._byweekday
- byeaster = self._byeaster
- bymonthday = self._bymonthday
- bynmonthday = self._bynmonthday
- bysetpos = self._bysetpos
- byhour = self._byhour
- byminute = self._byminute
- bysecond = self._bysecond
-
- ii = _iterinfo(self)
- ii.rebuild(year, month)
-
- getdayset = {YEARLY: ii.ydayset,
- MONTHLY: ii.mdayset,
- WEEKLY: ii.wdayset,
- DAILY: ii.ddayset,
- HOURLY: ii.ddayset,
- MINUTELY: ii.ddayset,
- SECONDLY: ii.ddayset}[freq]
-
- if freq < HOURLY:
- timeset = self._timeset
- else:
- gettimeset = {HOURLY: ii.htimeset,
- MINUTELY: ii.mtimeset,
- SECONDLY: ii.stimeset}[freq]
- if ((freq >= HOURLY and
- self._byhour and hour not in self._byhour) or
- (freq >= MINUTELY and
- self._byminute and minute not in self._byminute) or
- (freq >= SECONDLY and
- self._bysecond and second not in self._bysecond)):
- timeset = ()
- else:
- timeset = gettimeset(hour, minute, second)
-
- total = 0
- count = self._count
- while True:
- # Get dayset with the right frequency
- dayset, start, end = getdayset(year, month, day)
-
- # Do the "hard" work ;-)
- filtered = False
- for i in dayset[start:end]:
- if ((bymonth and ii.mmask[i] not in bymonth) or
- (byweekno and not ii.wnomask[i]) or
- (byweekday and ii.wdaymask[i] not in byweekday) or
- (ii.nwdaymask and not ii.nwdaymask[i]) or
- (byeaster and not ii.eastermask[i]) or
- ((bymonthday or bynmonthday) and
- ii.mdaymask[i] not in bymonthday and
- ii.nmdaymask[i] not in bynmonthday) or
- (byyearday and
- ((i < ii.yearlen and i+1 not in byyearday and
- -ii.yearlen+i not in byyearday) or
- (i >= ii.yearlen and i+1-ii.yearlen not in byyearday and
- -ii.nextyearlen+i-ii.yearlen not in byyearday)))):
- dayset[i] = None
- filtered = True
-
- # Output results
- if bysetpos and timeset:
- poslist = []
- for pos in bysetpos:
- if pos < 0:
- daypos, timepos = divmod(pos, len(timeset))
- else:
- daypos, timepos = divmod(pos-1, len(timeset))
- try:
- i = [x for x in dayset[start:end]
- if x is not None][daypos]
- time = timeset[timepos]
- except IndexError:
- pass
- else:
- date = datetime.date.fromordinal(ii.yearordinal+i)
- res = datetime.datetime.combine(date, time)
- if res not in poslist:
- poslist.append(res)
- poslist.sort()
- for res in poslist:
- if until and res > until:
- self._len = total
- return
- elif res >= self._dtstart:
- if count is not None:
- count -= 1
- if count < 0:
- self._len = total
- return
- total += 1
- yield res
- else:
- for i in dayset[start:end]:
- if i is not None:
- date = datetime.date.fromordinal(ii.yearordinal + i)
- for time in timeset:
- res = datetime.datetime.combine(date, time)
- if until and res > until:
- self._len = total
- return
- elif res >= self._dtstart:
- if count is not None:
- count -= 1
- if count < 0:
- self._len = total
- return
-
- total += 1
- yield res
-
- # Handle frequency and interval
- fixday = False
- if freq == YEARLY:
- year += interval
- if year > datetime.MAXYEAR:
- self._len = total
- return
- ii.rebuild(year, month)
- elif freq == MONTHLY:
- month += interval
- if month > 12:
- div, mod = divmod(month, 12)
- month = mod
- year += div
- if month == 0:
- month = 12
- year -= 1
- if year > datetime.MAXYEAR:
- self._len = total
- return
- ii.rebuild(year, month)
- elif freq == WEEKLY:
- if wkst > weekday:
- day += -(weekday+1+(6-wkst))+self._interval*7
- else:
- day += -(weekday-wkst)+self._interval*7
- weekday = wkst
- fixday = True
- elif freq == DAILY:
- day += interval
- fixday = True
- elif freq == HOURLY:
- if filtered:
- # Jump to one iteration before next day
- hour += ((23-hour)//interval)*interval
-
- if byhour:
- ndays, hour = self.__mod_distance(value=hour,
- byxxx=self._byhour,
- base=24)
- else:
- ndays, hour = divmod(hour+interval, 24)
-
- if ndays:
- day += ndays
- fixday = True
-
- timeset = gettimeset(hour, minute, second)
- elif freq == MINUTELY:
- if filtered:
- # Jump to one iteration before next day
- minute += ((1439-(hour*60+minute))//interval)*interval
-
- valid = False
- rep_rate = (24*60)
- for j in range(rep_rate // gcd(interval, rep_rate)):
- if byminute:
- nhours, minute = \
- self.__mod_distance(value=minute,
- byxxx=self._byminute,
- base=60)
- else:
- nhours, minute = divmod(minute+interval, 60)
-
- div, hour = divmod(hour+nhours, 24)
- if div:
- day += div
- fixday = True
- filtered = False
-
- if not byhour or hour in byhour:
- valid = True
- break
-
- if not valid:
- raise ValueError('Invalid combination of interval and ' +
- 'byhour resulting in empty rule.')
-
- timeset = gettimeset(hour, minute, second)
- elif freq == SECONDLY:
- if filtered:
- # Jump to one iteration before next day
- second += (((86399 - (hour * 3600 + minute * 60 + second))
- // interval) * interval)
-
- rep_rate = (24 * 3600)
- valid = False
- for j in range(0, rep_rate // gcd(interval, rep_rate)):
- if bysecond:
- nminutes, second = \
- self.__mod_distance(value=second,
- byxxx=self._bysecond,
- base=60)
- else:
- nminutes, second = divmod(second+interval, 60)
-
- div, minute = divmod(minute+nminutes, 60)
- if div:
- hour += div
- div, hour = divmod(hour, 24)
- if div:
- day += div
- fixday = True
-
- if ((not byhour or hour in byhour) and
- (not byminute or minute in byminute) and
- (not bysecond or second in bysecond)):
- valid = True
- break
-
- if not valid:
- raise ValueError('Invalid combination of interval, ' +
- 'byhour and byminute resulting in empty' +
- ' rule.')
-
- timeset = gettimeset(hour, minute, second)
-
- if fixday and day > 28:
- daysinmonth = calendar.monthrange(year, month)[1]
- if day > daysinmonth:
- while day > daysinmonth:
- day -= daysinmonth
- month += 1
- if month == 13:
- month = 1
- year += 1
- if year > datetime.MAXYEAR:
- self._len = total
- return
- daysinmonth = calendar.monthrange(year, month)[1]
- ii.rebuild(year, month)
-
- def __construct_byset(self, start, byxxx, base):
- """
- If a `BYXXX` sequence is passed to the constructor at the same level as
- `FREQ` (e.g. `FREQ=HOURLY,BYHOUR={2,4,7},INTERVAL=3`), there are some
- specifications which cannot be reached given some starting conditions.
-
- This occurs whenever the interval is not coprime with the base of a
- given unit and the difference between the starting position and the
- ending position is not coprime with the greatest common denominator
- between the interval and the base. For example, with a FREQ of hourly
- starting at 17:00 and an interval of 4, the only valid values for
- BYHOUR would be {21, 1, 5, 9, 13, 17}, because 4 and 24 are not
- coprime.
-
- :param start:
- Specifies the starting position.
- :param byxxx:
- An iterable containing the list of allowed values.
- :param base:
- The largest allowable value for the specified frequency (e.g.
- 24 hours, 60 minutes).
-
- This does not preserve the type of the iterable, returning a set, since
- the values should be unique and the order is irrelevant, this will
- speed up later lookups.
-
- In the event of an empty set, raises a :exception:`ValueError`, as this
- results in an empty rrule.
- """
-
- cset = set()
-
- # Support a single byxxx value.
- if isinstance(byxxx, integer_types):
- byxxx = (byxxx, )
-
- for num in byxxx:
- i_gcd = gcd(self._interval, base)
- # Use divmod rather than % because we need to wrap negative nums.
- if i_gcd == 1 or divmod(num - start, i_gcd)[1] == 0:
- cset.add(num)
-
- if len(cset) == 0:
- raise ValueError("Invalid rrule byxxx generates an empty set.")
-
- return cset
-
- def __mod_distance(self, value, byxxx, base):
- """
- Calculates the next value in a sequence where the `FREQ` parameter is
- specified along with a `BYXXX` parameter at the same "level"
- (e.g. `HOURLY` specified with `BYHOUR`).
-
- :param value:
- The old value of the component.
- :param byxxx:
- The `BYXXX` set, which should have been generated by
- `rrule._construct_byset`, or something else which checks that a
- valid rule is present.
- :param base:
- The largest allowable value for the specified frequency (e.g.
- 24 hours, 60 minutes).
-
- If a valid value is not found after `base` iterations (the maximum
- number before the sequence would start to repeat), this raises a
- :exception:`ValueError`, as no valid values were found.
-
- This returns a tuple of `divmod(n*interval, base)`, where `n` is the
- smallest number of `interval` repetitions until the next specified
- value in `byxxx` is found.
- """
- accumulator = 0
- for ii in range(1, base + 1):
- # Using divmod() over % to account for negative intervals
- div, value = divmod(value + self._interval, base)
- accumulator += div
- if value in byxxx:
- return (accumulator, value)
-
-
-class _iterinfo(object):
- __slots__ = ["rrule", "lastyear", "lastmonth",
- "yearlen", "nextyearlen", "yearordinal", "yearweekday",
- "mmask", "mrange", "mdaymask", "nmdaymask",
- "wdaymask", "wnomask", "nwdaymask", "eastermask"]
-
- def __init__(self, rrule):
- for attr in self.__slots__:
- setattr(self, attr, None)
- self.rrule = rrule
-
- def rebuild(self, year, month):
- # Every mask is 7 days longer to handle cross-year weekly periods.
- rr = self.rrule
- if year != self.lastyear:
- self.yearlen = 365 + calendar.isleap(year)
- self.nextyearlen = 365 + calendar.isleap(year + 1)
- firstyday = datetime.date(year, 1, 1)
- self.yearordinal = firstyday.toordinal()
- self.yearweekday = firstyday.weekday()
-
- wday = datetime.date(year, 1, 1).weekday()
- if self.yearlen == 365:
- self.mmask = M365MASK
- self.mdaymask = MDAY365MASK
- self.nmdaymask = NMDAY365MASK
- self.wdaymask = WDAYMASK[wday:]
- self.mrange = M365RANGE
- else:
- self.mmask = M366MASK
- self.mdaymask = MDAY366MASK
- self.nmdaymask = NMDAY366MASK
- self.wdaymask = WDAYMASK[wday:]
- self.mrange = M366RANGE
-
- if not rr._byweekno:
- self.wnomask = None
- else:
- self.wnomask = [0]*(self.yearlen+7)
- # no1wkst = firstwkst = self.wdaymask.index(rr._wkst)
- no1wkst = firstwkst = (7-self.yearweekday+rr._wkst) % 7
- if no1wkst >= 4:
- no1wkst = 0
- # Number of days in the year, plus the days we got
- # from last year.
- wyearlen = self.yearlen+(self.yearweekday-rr._wkst) % 7
- else:
- # Number of days in the year, minus the days we
- # left in last year.
- wyearlen = self.yearlen-no1wkst
- div, mod = divmod(wyearlen, 7)
- numweeks = div+mod//4
- for n in rr._byweekno:
- if n < 0:
- n += numweeks+1
- if not (0 < n <= numweeks):
- continue
- if n > 1:
- i = no1wkst+(n-1)*7
- if no1wkst != firstwkst:
- i -= 7-firstwkst
- else:
- i = no1wkst
- for j in range(7):
- self.wnomask[i] = 1
- i += 1
- if self.wdaymask[i] == rr._wkst:
- break
- if 1 in rr._byweekno:
- # Check week number 1 of next year as well
- # TODO: Check -numweeks for next year.
- i = no1wkst+numweeks*7
- if no1wkst != firstwkst:
- i -= 7-firstwkst
- if i < self.yearlen:
- # If week starts in next year, we
- # don't care about it.
- for j in range(7):
- self.wnomask[i] = 1
- i += 1
- if self.wdaymask[i] == rr._wkst:
- break
- if no1wkst:
- # Check last week number of last year as
- # well. If no1wkst is 0, either the year
- # started on week start, or week number 1
- # got days from last year, so there are no
- # days from last year's last week number in
- # this year.
- if -1 not in rr._byweekno:
- lyearweekday = datetime.date(year-1, 1, 1).weekday()
- lno1wkst = (7-lyearweekday+rr._wkst) % 7
- lyearlen = 365+calendar.isleap(year-1)
- if lno1wkst >= 4:
- lno1wkst = 0
- lnumweeks = 52+(lyearlen +
- (lyearweekday-rr._wkst) % 7) % 7//4
- else:
- lnumweeks = 52+(self.yearlen-no1wkst) % 7//4
- else:
- lnumweeks = -1
- if lnumweeks in rr._byweekno:
- for i in range(no1wkst):
- self.wnomask[i] = 1
-
- if (rr._bynweekday and (month != self.lastmonth or
- year != self.lastyear)):
- ranges = []
- if rr._freq == YEARLY:
- if rr._bymonth:
- for month in rr._bymonth:
- ranges.append(self.mrange[month-1:month+1])
- else:
- ranges = [(0, self.yearlen)]
- elif rr._freq == MONTHLY:
- ranges = [self.mrange[month-1:month+1]]
- if ranges:
- # Weekly frequency won't get here, so we may not
- # care about cross-year weekly periods.
- self.nwdaymask = [0]*self.yearlen
- for first, last in ranges:
- last -= 1
- for wday, n in rr._bynweekday:
- if n < 0:
- i = last+(n+1)*7
- i -= (self.wdaymask[i]-wday) % 7
- else:
- i = first+(n-1)*7
- i += (7-self.wdaymask[i]+wday) % 7
- if first <= i <= last:
- self.nwdaymask[i] = 1
-
- if rr._byeaster:
- self.eastermask = [0]*(self.yearlen+7)
- eyday = easter.easter(year).toordinal()-self.yearordinal
- for offset in rr._byeaster:
- self.eastermask[eyday+offset] = 1
-
- self.lastyear = year
- self.lastmonth = month
-
- def ydayset(self, year, month, day):
- return list(range(self.yearlen)), 0, self.yearlen
-
- def mdayset(self, year, month, day):
- dset = [None]*self.yearlen
- start, end = self.mrange[month-1:month+1]
- for i in range(start, end):
- dset[i] = i
- return dset, start, end
-
- def wdayset(self, year, month, day):
- # We need to handle cross-year weeks here.
- dset = [None]*(self.yearlen+7)
- i = datetime.date(year, month, day).toordinal()-self.yearordinal
- start = i
- for j in range(7):
- dset[i] = i
- i += 1
- # if (not (0 <= i < self.yearlen) or
- # self.wdaymask[i] == self.rrule._wkst):
- # This will cross the year boundary, if necessary.
- if self.wdaymask[i] == self.rrule._wkst:
- break
- return dset, start, i
-
- def ddayset(self, year, month, day):
- dset = [None] * self.yearlen
- i = datetime.date(year, month, day).toordinal() - self.yearordinal
- dset[i] = i
- return dset, i, i + 1
-
- def htimeset(self, hour, minute, second):
- tset = []
- rr = self.rrule
- for minute in rr._byminute:
- for second in rr._bysecond:
- tset.append(datetime.time(hour, minute, second,
- tzinfo=rr._tzinfo))
- tset.sort()
- return tset
-
- def mtimeset(self, hour, minute, second):
- tset = []
- rr = self.rrule
- for second in rr._bysecond:
- tset.append(datetime.time(hour, minute, second, tzinfo=rr._tzinfo))
- tset.sort()
- return tset
-
- def stimeset(self, hour, minute, second):
- return (datetime.time(hour, minute, second,
- tzinfo=self.rrule._tzinfo),)
-
-
-class rruleset(rrulebase):
- """ The rruleset type allows more complex recurrence setups, mixing
- multiple rules, dates, exclusion rules, and exclusion dates. The type
- constructor takes the following keyword arguments:
-
- :param cache: If True, caching of results will be enabled, improving
- performance of multiple queries considerably. """
-
- class _genitem(object):
- def __init__(self, genlist, gen):
- try:
- self.dt = advance_iterator(gen)
- genlist.append(self)
- except StopIteration:
- pass
- self.genlist = genlist
- self.gen = gen
-
- def __next__(self):
- try:
- self.dt = advance_iterator(self.gen)
- except StopIteration:
- if self.genlist[0] is self:
- heapq.heappop(self.genlist)
- else:
- self.genlist.remove(self)
- heapq.heapify(self.genlist)
-
- next = __next__
-
- def __lt__(self, other):
- return self.dt < other.dt
-
- def __gt__(self, other):
- return self.dt > other.dt
-
- def __eq__(self, other):
- return self.dt == other.dt
-
- def __ne__(self, other):
- return self.dt != other.dt
-
- def __init__(self, cache=False):
- super(rruleset, self).__init__(cache)
- self._rrule = []
- self._rdate = []
- self._exrule = []
- self._exdate = []
-
- @_invalidates_cache
- def rrule(self, rrule):
- """ Include the given :py:class:`rrule` instance in the recurrence set
- generation. """
- self._rrule.append(rrule)
-
- @_invalidates_cache
- def rdate(self, rdate):
- """ Include the given :py:class:`datetime` instance in the recurrence
- set generation. """
- self._rdate.append(rdate)
-
- @_invalidates_cache
- def exrule(self, exrule):
- """ Include the given rrule instance in the recurrence set exclusion
- list. Dates which are part of the given recurrence rules will not
- be generated, even if some inclusive rrule or rdate matches them.
- """
- self._exrule.append(exrule)
-
- @_invalidates_cache
- def exdate(self, exdate):
- """ Include the given datetime instance in the recurrence set
- exclusion list. Dates included that way will not be generated,
- even if some inclusive rrule or rdate matches them. """
- self._exdate.append(exdate)
-
- def _iter(self):
- rlist = []
- self._rdate.sort()
- self._genitem(rlist, iter(self._rdate))
- for gen in [iter(x) for x in self._rrule]:
- self._genitem(rlist, gen)
- exlist = []
- self._exdate.sort()
- self._genitem(exlist, iter(self._exdate))
- for gen in [iter(x) for x in self._exrule]:
- self._genitem(exlist, gen)
- lastdt = None
- total = 0
- heapq.heapify(rlist)
- heapq.heapify(exlist)
- while rlist:
- ritem = rlist[0]
- if not lastdt or lastdt != ritem.dt:
- while exlist and exlist[0] < ritem:
- exitem = exlist[0]
- advance_iterator(exitem)
- if exlist and exlist[0] is exitem:
- heapq.heapreplace(exlist, exitem)
- if not exlist or ritem != exlist[0]:
- total += 1
- yield ritem.dt
- lastdt = ritem.dt
- advance_iterator(ritem)
- if rlist and rlist[0] is ritem:
- heapq.heapreplace(rlist, ritem)
- self._len = total
-
-
-class _rrulestr(object):
-
- _freq_map = {"YEARLY": YEARLY,
- "MONTHLY": MONTHLY,
- "WEEKLY": WEEKLY,
- "DAILY": DAILY,
- "HOURLY": HOURLY,
- "MINUTELY": MINUTELY,
- "SECONDLY": SECONDLY}
-
- _weekday_map = {"MO": 0, "TU": 1, "WE": 2, "TH": 3,
- "FR": 4, "SA": 5, "SU": 6}
-
- def _handle_int(self, rrkwargs, name, value, **kwargs):
- rrkwargs[name.lower()] = int(value)
-
- def _handle_int_list(self, rrkwargs, name, value, **kwargs):
- rrkwargs[name.lower()] = [int(x) for x in value.split(',')]
-
- _handle_INTERVAL = _handle_int
- _handle_COUNT = _handle_int
- _handle_BYSETPOS = _handle_int_list
- _handle_BYMONTH = _handle_int_list
- _handle_BYMONTHDAY = _handle_int_list
- _handle_BYYEARDAY = _handle_int_list
- _handle_BYEASTER = _handle_int_list
- _handle_BYWEEKNO = _handle_int_list
- _handle_BYHOUR = _handle_int_list
- _handle_BYMINUTE = _handle_int_list
- _handle_BYSECOND = _handle_int_list
-
- def _handle_FREQ(self, rrkwargs, name, value, **kwargs):
- rrkwargs["freq"] = self._freq_map[value]
-
- def _handle_UNTIL(self, rrkwargs, name, value, **kwargs):
- global parser
- if not parser:
- from dateutil import parser
- try:
- rrkwargs["until"] = parser.parse(value,
- ignoretz=kwargs.get("ignoretz"),
- tzinfos=kwargs.get("tzinfos"))
- except ValueError:
- raise ValueError("invalid until date")
-
- def _handle_WKST(self, rrkwargs, name, value, **kwargs):
- rrkwargs["wkst"] = self._weekday_map[value]
-
- def _handle_BYWEEKDAY(self, rrkwargs, name, value, **kwargs):
- """
- Two ways to specify this: +1MO or MO(+1)
- """
- l = []
- for wday in value.split(','):
- if '(' in wday:
- # If it's of the form TH(+1), etc.
- splt = wday.split('(')
- w = splt[0]
- n = int(splt[1][:-1])
- elif len(wday):
- # If it's of the form +1MO
- for i in range(len(wday)):
- if wday[i] not in '+-0123456789':
- break
- n = wday[:i] or None
- w = wday[i:]
- if n:
- n = int(n)
- else:
- raise ValueError("Invalid (empty) BYDAY specification.")
-
- l.append(weekdays[self._weekday_map[w]](n))
- rrkwargs["byweekday"] = l
-
- _handle_BYDAY = _handle_BYWEEKDAY
-
- def _parse_rfc_rrule(self, line,
- dtstart=None,
- cache=False,
- ignoretz=False,
- tzinfos=None):
- if line.find(':') != -1:
- name, value = line.split(':')
- if name != "RRULE":
- raise ValueError("unknown parameter name")
- else:
- value = line
- rrkwargs = {}
- for pair in value.split(';'):
- name, value = pair.split('=')
- name = name.upper()
- value = value.upper()
- try:
- getattr(self, "_handle_"+name)(rrkwargs, name, value,
- ignoretz=ignoretz,
- tzinfos=tzinfos)
- except AttributeError:
- raise ValueError("unknown parameter '%s'" % name)
- except (KeyError, ValueError):
- raise ValueError("invalid '%s': %s" % (name, value))
- return rrule(dtstart=dtstart, cache=cache, **rrkwargs)
-
- def _parse_rfc(self, s,
- dtstart=None,
- cache=False,
- unfold=False,
- forceset=False,
- compatible=False,
- ignoretz=False,
- tzinfos=None):
- global parser
- if compatible:
- forceset = True
- unfold = True
- s = s.upper()
- if not s.strip():
- raise ValueError("empty string")
- if unfold:
- lines = s.splitlines()
- i = 0
- while i < len(lines):
- line = lines[i].rstrip()
- if not line:
- del lines[i]
- elif i > 0 and line[0] == " ":
- lines[i-1] += line[1:]
- del lines[i]
- else:
- i += 1
- else:
- lines = s.split()
- if (not forceset and len(lines) == 1 and (s.find(':') == -1 or
- s.startswith('RRULE:'))):
- return self._parse_rfc_rrule(lines[0], cache=cache,
- dtstart=dtstart, ignoretz=ignoretz,
- tzinfos=tzinfos)
- else:
- rrulevals = []
- rdatevals = []
- exrulevals = []
- exdatevals = []
- for line in lines:
- if not line:
- continue
- if line.find(':') == -1:
- name = "RRULE"
- value = line
- else:
- name, value = line.split(':', 1)
- parms = name.split(';')
- if not parms:
- raise ValueError("empty property name")
- name = parms[0]
- parms = parms[1:]
- if name == "RRULE":
- for parm in parms:
- raise ValueError("unsupported RRULE parm: "+parm)
- rrulevals.append(value)
- elif name == "RDATE":
- for parm in parms:
- if parm != "VALUE=DATE-TIME":
- raise ValueError("unsupported RDATE parm: "+parm)
- rdatevals.append(value)
- elif name == "EXRULE":
- for parm in parms:
- raise ValueError("unsupported EXRULE parm: "+parm)
- exrulevals.append(value)
- elif name == "EXDATE":
- for parm in parms:
- if parm != "VALUE=DATE-TIME":
- raise ValueError("unsupported EXDATE parm: "+parm)
- exdatevals.append(value)
- elif name == "DTSTART":
- for parm in parms:
- raise ValueError("unsupported DTSTART parm: "+parm)
- if not parser:
- from dateutil import parser
- dtstart = parser.parse(value, ignoretz=ignoretz,
- tzinfos=tzinfos)
- else:
- raise ValueError("unsupported property: "+name)
- if (forceset or len(rrulevals) > 1 or rdatevals
- or exrulevals or exdatevals):
- if not parser and (rdatevals or exdatevals):
- from dateutil import parser
- rset = rruleset(cache=cache)
- for value in rrulevals:
- rset.rrule(self._parse_rfc_rrule(value, dtstart=dtstart,
- ignoretz=ignoretz,
- tzinfos=tzinfos))
- for value in rdatevals:
- for datestr in value.split(','):
- rset.rdate(parser.parse(datestr,
- ignoretz=ignoretz,
- tzinfos=tzinfos))
- for value in exrulevals:
- rset.exrule(self._parse_rfc_rrule(value, dtstart=dtstart,
- ignoretz=ignoretz,
- tzinfos=tzinfos))
- for value in exdatevals:
- for datestr in value.split(','):
- rset.exdate(parser.parse(datestr,
- ignoretz=ignoretz,
- tzinfos=tzinfos))
- if compatible and dtstart:
- rset.rdate(dtstart)
- return rset
- else:
- return self._parse_rfc_rrule(rrulevals[0],
- dtstart=dtstart,
- cache=cache,
- ignoretz=ignoretz,
- tzinfos=tzinfos)
-
- def __call__(self, s, **kwargs):
- return self._parse_rfc(s, **kwargs)
-
-
-rrulestr = _rrulestr()
-
-# vim:ts=4:sw=4:et
diff --git a/lib/dateutil/tz/__init__.py b/lib/dateutil/tz/__init__.py
deleted file mode 100644
index b0a5043c76..0000000000
--- a/lib/dateutil/tz/__init__.py
+++ /dev/null
@@ -1,5 +0,0 @@
-from .tz import *
-
-__all__ = ["tzutc", "tzoffset", "tzlocal", "tzfile", "tzrange",
- "tzstr", "tzical", "tzwin", "tzwinlocal", "gettz",
- "enfold", "datetime_ambiguous", "datetime_exists"]
diff --git a/lib/dateutil/tz/_common.py b/lib/dateutil/tz/_common.py
deleted file mode 100644
index f1cf2afbd5..0000000000
--- a/lib/dateutil/tz/_common.py
+++ /dev/null
@@ -1,394 +0,0 @@
-from six import PY3
-
-from functools import wraps
-
-from datetime import datetime, timedelta, tzinfo
-
-
-ZERO = timedelta(0)
-
-__all__ = ['tzname_in_python2', 'enfold']
-
-
-def tzname_in_python2(namefunc):
- """Change unicode output into bytestrings in Python 2
-
- tzname() API changed in Python 3. It used to return bytes, but was changed
- to unicode strings
- """
- def adjust_encoding(*args, **kwargs):
- name = namefunc(*args, **kwargs)
- if name is not None and not PY3:
- name = name.encode()
-
- return name
-
- return adjust_encoding
-
-
-# The following is adapted from Alexander Belopolsky's tz library
-# https://github.com/abalkin/tz
-if hasattr(datetime, 'fold'):
- # This is the pre-python 3.6 fold situation
- def enfold(dt, fold=1):
- """
- Provides a unified interface for assigning the ``fold`` attribute to
- datetimes both before and after the implementation of PEP-495.
-
- :param fold:
- The value for the ``fold`` attribute in the returned datetime. This
- should be either 0 or 1.
-
- :return:
- Returns an object for which ``getattr(dt, 'fold', 0)`` returns
- ``fold`` for all versions of Python. In versions prior to
- Python 3.6, this is a ``_DatetimeWithFold`` object, which is a
- subclass of :py:class:`datetime.datetime` with the ``fold``
- attribute added, if ``fold`` is 1.
-
- .. versionadded:: 2.6.0
- """
- return dt.replace(fold=fold)
-
-else:
- class _DatetimeWithFold(datetime):
- """
- This is a class designed to provide a PEP 495-compliant interface for
- Python versions before 3.6. It is used only for dates in a fold, so
- the ``fold`` attribute is fixed at ``1``.
-
- .. versionadded:: 2.6.0
- """
- __slots__ = ()
-
- @property
- def fold(self):
- return 1
-
- def enfold(dt, fold=1):
- """
- Provides a unified interface for assigning the ``fold`` attribute to
- datetimes both before and after the implementation of PEP-495.
-
- :param fold:
- The value for the ``fold`` attribute in the returned datetime. This
- should be either 0 or 1.
-
- :return:
- Returns an object for which ``getattr(dt, 'fold', 0)`` returns
- ``fold`` for all versions of Python. In versions prior to
- Python 3.6, this is a ``_DatetimeWithFold`` object, which is a
- subclass of :py:class:`datetime.datetime` with the ``fold``
- attribute added, if ``fold`` is 1.
-
- .. versionadded:: 2.6.0
- """
- if getattr(dt, 'fold', 0) == fold:
- return dt
-
- args = dt.timetuple()[:6]
- args += (dt.microsecond, dt.tzinfo)
-
- if fold:
- return _DatetimeWithFold(*args)
- else:
- return datetime(*args)
-
-
-def _validate_fromutc_inputs(f):
- """
- The CPython version of ``fromutc`` checks that the input is a ``datetime``
- object and that ``self`` is attached as its ``tzinfo``.
- """
- @wraps(f)
- def fromutc(self, dt):
- if not isinstance(dt, datetime):
- raise TypeError("fromutc() requires a datetime argument")
- if dt.tzinfo is not self:
- raise ValueError("dt.tzinfo is not self")
-
- return f(self, dt)
-
- return fromutc
-
-
-class _tzinfo(tzinfo):
- """
- Base class for all ``dateutil`` ``tzinfo`` objects.
- """
-
- def is_ambiguous(self, dt):
- """
- Whether or not the "wall time" of a given datetime is ambiguous in this
- zone.
-
- :param dt:
- A :py:class:`datetime.datetime`, naive or time zone aware.
-
-
- :return:
- Returns ``True`` if ambiguous, ``False`` otherwise.
-
- .. versionadded:: 2.6.0
- """
-
- dt = dt.replace(tzinfo=self)
-
- wall_0 = enfold(dt, fold=0)
- wall_1 = enfold(dt, fold=1)
-
- same_offset = wall_0.utcoffset() == wall_1.utcoffset()
- same_dt = wall_0.replace(tzinfo=None) == wall_1.replace(tzinfo=None)
-
- return same_dt and not same_offset
-
- def _fold_status(self, dt_utc, dt_wall):
- """
- Determine the fold status of a "wall" datetime, given a representation
- of the same datetime as a (naive) UTC datetime. This is calculated based
- on the assumption that ``dt.utcoffset() - dt.dst()`` is constant for all
- datetimes, and that this offset is the actual number of hours separating
- ``dt_utc`` and ``dt_wall``.
-
- :param dt_utc:
- Representation of the datetime as UTC
-
- :param dt_wall:
- Representation of the datetime as "wall time". This parameter must
- either have a `fold` attribute or have a fold-naive
- :class:`datetime.tzinfo` attached, otherwise the calculation may
- fail.
- """
- if self.is_ambiguous(dt_wall):
- delta_wall = dt_wall - dt_utc
- _fold = int(delta_wall == (dt_utc.utcoffset() - dt_utc.dst()))
- else:
- _fold = 0
-
- return _fold
-
- def _fold(self, dt):
- return getattr(dt, 'fold', 0)
-
- def _fromutc(self, dt):
- """
- Given a timezone-aware datetime in a given timezone, calculates a
- timezone-aware datetime in a new timezone.
-
- Since this is the one time that we *know* we have an unambiguous
- datetime object, we take this opportunity to determine whether the
- datetime is ambiguous and in a "fold" state (e.g. if it's the first
- occurence, chronologically, of the ambiguous datetime).
-
- :param dt:
- A timezone-aware :class:`datetime.datetime` object.
- """
-
- # Re-implement the algorithm from Python's datetime.py
- dtoff = dt.utcoffset()
- if dtoff is None:
- raise ValueError("fromutc() requires a non-None utcoffset() "
- "result")
-
- # The original datetime.py code assumes that `dst()` defaults to
- # zero during ambiguous times. PEP 495 inverts this presumption, so
- # for pre-PEP 495 versions of python, we need to tweak the algorithm.
- dtdst = dt.dst()
- if dtdst is None:
- raise ValueError("fromutc() requires a non-None dst() result")
- delta = dtoff - dtdst
-
- dt += delta
- # Set fold=1 so we can default to being in the fold for
- # ambiguous dates.
- dtdst = enfold(dt, fold=1).dst()
- if dtdst is None:
- raise ValueError("fromutc(): dt.dst gave inconsistent "
- "results; cannot convert")
- return dt + dtdst
-
- @_validate_fromutc_inputs
- def fromutc(self, dt):
- """
- Given a timezone-aware datetime in a given timezone, calculates a
- timezone-aware datetime in a new timezone.
-
- Since this is the one time that we *know* we have an unambiguous
- datetime object, we take this opportunity to determine whether the
- datetime is ambiguous and in a "fold" state (e.g. if it's the first
- occurance, chronologically, of the ambiguous datetime).
-
- :param dt:
- A timezone-aware :class:`datetime.datetime` object.
- """
- dt_wall = self._fromutc(dt)
-
- # Calculate the fold status given the two datetimes.
- _fold = self._fold_status(dt, dt_wall)
-
- # Set the default fold value for ambiguous dates
- return enfold(dt_wall, fold=_fold)
-
-
-class tzrangebase(_tzinfo):
- """
- This is an abstract base class for time zones represented by an annual
- transition into and out of DST. Child classes should implement the following
- methods:
-
- * ``__init__(self, *args, **kwargs)``
- * ``transitions(self, year)`` - this is expected to return a tuple of
- datetimes representing the DST on and off transitions in standard
- time.
-
- A fully initialized ``tzrangebase`` subclass should also provide the
- following attributes:
- * ``hasdst``: Boolean whether or not the zone uses DST.
- * ``_dst_offset`` / ``_std_offset``: :class:`datetime.timedelta` objects
- representing the respective UTC offsets.
- * ``_dst_abbr`` / ``_std_abbr``: Strings representing the timezone short
- abbreviations in DST and STD, respectively.
- * ``_hasdst``: Whether or not the zone has DST.
-
- .. versionadded:: 2.6.0
- """
- def __init__(self):
- raise NotImplementedError('tzrangebase is an abstract base class')
-
- def utcoffset(self, dt):
- isdst = self._isdst(dt)
-
- if isdst is None:
- return None
- elif isdst:
- return self._dst_offset
- else:
- return self._std_offset
-
- def dst(self, dt):
- isdst = self._isdst(dt)
-
- if isdst is None:
- return None
- elif isdst:
- return self._dst_base_offset
- else:
- return ZERO
-
- @tzname_in_python2
- def tzname(self, dt):
- if self._isdst(dt):
- return self._dst_abbr
- else:
- return self._std_abbr
-
- def fromutc(self, dt):
- """ Given a datetime in UTC, return local time """
- if not isinstance(dt, datetime):
- raise TypeError("fromutc() requires a datetime argument")
-
- if dt.tzinfo is not self:
- raise ValueError("dt.tzinfo is not self")
-
- # Get transitions - if there are none, fixed offset
- transitions = self.transitions(dt.year)
- if transitions is None:
- return dt + self.utcoffset(dt)
-
- # Get the transition times in UTC
- dston, dstoff = transitions
-
- dston -= self._std_offset
- dstoff -= self._std_offset
-
- utc_transitions = (dston, dstoff)
- dt_utc = dt.replace(tzinfo=None)
-
- isdst = self._naive_isdst(dt_utc, utc_transitions)
-
- if isdst:
- dt_wall = dt + self._dst_offset
- else:
- dt_wall = dt + self._std_offset
-
- _fold = int(not isdst and self.is_ambiguous(dt_wall))
-
- return enfold(dt_wall, fold=_fold)
-
- def is_ambiguous(self, dt):
- """
- Whether or not the "wall time" of a given datetime is ambiguous in this
- zone.
-
- :param dt:
- A :py:class:`datetime.datetime`, naive or time zone aware.
-
-
- :return:
- Returns ``True`` if ambiguous, ``False`` otherwise.
-
- .. versionadded:: 2.6.0
- """
- if not self.hasdst:
- return False
-
- start, end = self.transitions(dt.year)
-
- dt = dt.replace(tzinfo=None)
- return (end <= dt < end + self._dst_base_offset)
-
- def _isdst(self, dt):
- if not self.hasdst:
- return False
- elif dt is None:
- return None
-
- transitions = self.transitions(dt.year)
-
- if transitions is None:
- return False
-
- dt = dt.replace(tzinfo=None)
-
- isdst = self._naive_isdst(dt, transitions)
-
- # Handle ambiguous dates
- if not isdst and self.is_ambiguous(dt):
- return not self._fold(dt)
- else:
- return isdst
-
- def _naive_isdst(self, dt, transitions):
- dston, dstoff = transitions
-
- dt = dt.replace(tzinfo=None)
-
- if dston < dstoff:
- isdst = dston <= dt < dstoff
- else:
- isdst = not dstoff <= dt < dston
-
- return isdst
-
- @property
- def _dst_base_offset(self):
- return self._dst_offset - self._std_offset
-
- __hash__ = None
-
- def __ne__(self, other):
- return not (self == other)
-
- def __repr__(self):
- return "%s(...)" % self.__class__.__name__
-
- __reduce__ = object.__reduce__
-
-
-def _total_seconds(td):
- # Python 2.6 doesn't have a total_seconds() method on timedelta objects
- return ((td.seconds + td.days * 86400) * 1000000 +
- td.microseconds) // 1000000
-
-
-_total_seconds = getattr(timedelta, 'total_seconds', _total_seconds)
diff --git a/lib/dateutil/tz/tz.py b/lib/dateutil/tz/tz.py
deleted file mode 100644
index 9468282990..0000000000
--- a/lib/dateutil/tz/tz.py
+++ /dev/null
@@ -1,1511 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
-This module offers timezone implementations subclassing the abstract
-:py:`datetime.tzinfo` type. There are classes to handle tzfile format files
-(usually are in :file:`/etc/localtime`, :file:`/usr/share/zoneinfo`, etc), TZ
-environment string (in all known formats), given ranges (with help from
-relative deltas), local machine timezone, fixed offset timezone, and UTC
-timezone.
-"""
-import datetime
-import struct
-import time
-import sys
-import os
-import bisect
-
-from six import string_types
-from ._common import tzname_in_python2, _tzinfo, _total_seconds
-from ._common import tzrangebase, enfold
-from ._common import _validate_fromutc_inputs
-
-try:
- from .win import tzwin, tzwinlocal
-except ImportError:
- tzwin = tzwinlocal = None
-
-ZERO = datetime.timedelta(0)
-EPOCH = datetime.datetime.utcfromtimestamp(0)
-EPOCHORDINAL = EPOCH.toordinal()
-
-
-class tzutc(datetime.tzinfo):
- """
- This is a tzinfo object that represents the UTC time zone.
- """
- def utcoffset(self, dt):
- return ZERO
-
- def dst(self, dt):
- return ZERO
-
- @tzname_in_python2
- def tzname(self, dt):
- return "UTC"
-
- def is_ambiguous(self, dt):
- """
- Whether or not the "wall time" of a given datetime is ambiguous in this
- zone.
-
- :param dt:
- A :py:class:`datetime.datetime`, naive or time zone aware.
-
-
- :return:
- Returns ``True`` if ambiguous, ``False`` otherwise.
-
- .. versionadded:: 2.6.0
- """
- return False
-
- @_validate_fromutc_inputs
- def fromutc(self, dt):
- """
- Fast track version of fromutc() returns the original ``dt`` object for
- any valid :py:class:`datetime.datetime` object.
- """
- return dt
-
- def __eq__(self, other):
- if not isinstance(other, (tzutc, tzoffset)):
- return NotImplemented
-
- return (isinstance(other, tzutc) or
- (isinstance(other, tzoffset) and other._offset == ZERO))
-
- __hash__ = None
-
- def __ne__(self, other):
- return not (self == other)
-
- def __repr__(self):
- return "%s()" % self.__class__.__name__
-
- __reduce__ = object.__reduce__
-
-
-class tzoffset(datetime.tzinfo):
- """
- A simple class for representing a fixed offset from UTC.
-
- :param name:
- The timezone name, to be returned when ``tzname()`` is called.
-
- :param offset:
- The time zone offset in seconds, or (since version 2.6.0, represented
- as a :py:class:`datetime.timedelta` object.
- """
- def __init__(self, name, offset):
- self._name = name
-
- try:
- # Allow a timedelta
- offset = _total_seconds(offset)
- except (TypeError, AttributeError):
- pass
- self._offset = datetime.timedelta(seconds=offset)
-
- def utcoffset(self, dt):
- return self._offset
-
- def dst(self, dt):
- return ZERO
-
- @tzname_in_python2
- def tzname(self, dt):
- return self._name
-
- @_validate_fromutc_inputs
- def fromutc(self, dt):
- return dt + self._offset
-
- def is_ambiguous(self, dt):
- """
- Whether or not the "wall time" of a given datetime is ambiguous in this
- zone.
-
- :param dt:
- A :py:class:`datetime.datetime`, naive or time zone aware.
-
-
- :return:
- Returns ``True`` if ambiguous, ``False`` otherwise.
-
- .. versionadded:: 2.6.0
- """
- return False
-
- def __eq__(self, other):
- if not isinstance(other, tzoffset):
- return NotImplemented
-
- return self._offset == other._offset
-
- __hash__ = None
-
- def __ne__(self, other):
- return not (self == other)
-
- def __repr__(self):
- return "%s(%s, %s)" % (self.__class__.__name__,
- repr(self._name),
- int(_total_seconds(self._offset)))
-
- __reduce__ = object.__reduce__
-
-
-class tzlocal(_tzinfo):
- """
- A :class:`tzinfo` subclass built around the ``time`` timezone functions.
- """
- def __init__(self):
- super(tzlocal, self).__init__()
-
- self._std_offset = datetime.timedelta(seconds=-time.timezone)
- if time.daylight:
- self._dst_offset = datetime.timedelta(seconds=-time.altzone)
- else:
- self._dst_offset = self._std_offset
-
- self._dst_saved = self._dst_offset - self._std_offset
- self._hasdst = bool(self._dst_saved)
-
- def utcoffset(self, dt):
- if dt is None and self._hasdst:
- return None
-
- if self._isdst(dt):
- return self._dst_offset
- else:
- return self._std_offset
-
- def dst(self, dt):
- if dt is None and self._hasdst:
- return None
-
- if self._isdst(dt):
- return self._dst_offset - self._std_offset
- else:
- return ZERO
-
- @tzname_in_python2
- def tzname(self, dt):
- return time.tzname[self._isdst(dt)]
-
- def is_ambiguous(self, dt):
- """
- Whether or not the "wall time" of a given datetime is ambiguous in this
- zone.
-
- :param dt:
- A :py:class:`datetime.datetime`, naive or time zone aware.
-
-
- :return:
- Returns ``True`` if ambiguous, ``False`` otherwise.
-
- .. versionadded:: 2.6.0
- """
- naive_dst = self._naive_is_dst(dt)
- return (not naive_dst and
- (naive_dst != self._naive_is_dst(dt - self._dst_saved)))
-
- def _naive_is_dst(self, dt):
- timestamp = _datetime_to_timestamp(dt)
- return time.localtime(timestamp + time.timezone).tm_isdst
-
- def _isdst(self, dt, fold_naive=True):
- # We can't use mktime here. It is unstable when deciding if
- # the hour near to a change is DST or not.
- #
- # timestamp = time.mktime((dt.year, dt.month, dt.day, dt.hour,
- # dt.minute, dt.second, dt.weekday(), 0, -1))
- # return time.localtime(timestamp).tm_isdst
- #
- # The code above yields the following result:
- #
- # >>> import tz, datetime
- # >>> t = tz.tzlocal()
- # >>> datetime.datetime(2003,2,15,23,tzinfo=t).tzname()
- # 'BRDT'
- # >>> datetime.datetime(2003,2,16,0,tzinfo=t).tzname()
- # 'BRST'
- # >>> datetime.datetime(2003,2,15,23,tzinfo=t).tzname()
- # 'BRST'
- # >>> datetime.datetime(2003,2,15,22,tzinfo=t).tzname()
- # 'BRDT'
- # >>> datetime.datetime(2003,2,15,23,tzinfo=t).tzname()
- # 'BRDT'
- #
- # Here is a more stable implementation:
- #
- if not self._hasdst:
- return False
-
- # Check for ambiguous times:
- dstval = self._naive_is_dst(dt)
- fold = getattr(dt, 'fold', None)
-
- if self.is_ambiguous(dt):
- if fold is not None:
- return not self._fold(dt)
- else:
- return True
-
- return dstval
-
- def __eq__(self, other):
- if not isinstance(other, tzlocal):
- return NotImplemented
-
- return (self._std_offset == other._std_offset and
- self._dst_offset == other._dst_offset)
-
- __hash__ = None
-
- def __ne__(self, other):
- return not (self == other)
-
- def __repr__(self):
- return "%s()" % self.__class__.__name__
-
- __reduce__ = object.__reduce__
-
-
-class _ttinfo(object):
- __slots__ = ["offset", "delta", "isdst", "abbr",
- "isstd", "isgmt", "dstoffset"]
-
- def __init__(self):
- for attr in self.__slots__:
- setattr(self, attr, None)
-
- def __repr__(self):
- l = []
- for attr in self.__slots__:
- value = getattr(self, attr)
- if value is not None:
- l.append("%s=%s" % (attr, repr(value)))
- return "%s(%s)" % (self.__class__.__name__, ", ".join(l))
-
- def __eq__(self, other):
- if not isinstance(other, _ttinfo):
- return NotImplemented
-
- return (self.offset == other.offset and
- self.delta == other.delta and
- self.isdst == other.isdst and
- self.abbr == other.abbr and
- self.isstd == other.isstd and
- self.isgmt == other.isgmt and
- self.dstoffset == other.dstoffset)
-
- __hash__ = None
-
- def __ne__(self, other):
- return not (self == other)
-
- def __getstate__(self):
- state = {}
- for name in self.__slots__:
- state[name] = getattr(self, name, None)
- return state
-
- def __setstate__(self, state):
- for name in self.__slots__:
- if name in state:
- setattr(self, name, state[name])
-
-
-class _tzfile(object):
- """
- Lightweight class for holding the relevant transition and time zone
- information read from binary tzfiles.
- """
- attrs = ['trans_list', 'trans_list_utc', 'trans_idx', 'ttinfo_list',
- 'ttinfo_std', 'ttinfo_dst', 'ttinfo_before', 'ttinfo_first']
-
- def __init__(self, **kwargs):
- for attr in self.attrs:
- setattr(self, attr, kwargs.get(attr, None))
-
-
-class tzfile(_tzinfo):
- """
- This is a ``tzinfo`` subclass thant allows one to use the ``tzfile(5)``
- format timezone files to extract current and historical zone information.
-
- :param fileobj:
- This can be an opened file stream or a file name that the time zone
- information can be read from.
-
- :param filename:
- This is an optional parameter specifying the source of the time zone
- information in the event that ``fileobj`` is a file object. If omitted
- and ``fileobj`` is a file stream, this parameter will be set either to
- ``fileobj``'s ``name`` attribute or to ``repr(fileobj)``.
-
- See `Sources for Time Zone and Daylight Saving Time Data
- `_ for more information. Time zone
- files can be compiled from the `IANA Time Zone database files
- `_ with the `zic time zone compiler
- `_
- """
-
- def __init__(self, fileobj, filename=None):
- super(tzfile, self).__init__()
-
- file_opened_here = False
- if isinstance(fileobj, string_types):
- self._filename = fileobj
- fileobj = open(fileobj, 'rb')
- file_opened_here = True
- elif filename is not None:
- self._filename = filename
- elif hasattr(fileobj, "name"):
- self._filename = fileobj.name
- else:
- self._filename = repr(fileobj)
-
- if fileobj is not None:
- if not file_opened_here:
- fileobj = _ContextWrapper(fileobj)
-
- with fileobj as file_stream:
- tzobj = self._read_tzfile(file_stream)
-
- self._set_tzdata(tzobj)
-
- def _set_tzdata(self, tzobj):
- """ Set the time zone data of this object from a _tzfile object """
- # Copy the relevant attributes over as private attributes
- for attr in _tzfile.attrs:
- setattr(self, '_' + attr, getattr(tzobj, attr))
-
- def _read_tzfile(self, fileobj):
- out = _tzfile()
-
- # From tzfile(5):
- #
- # The time zone information files used by tzset(3)
- # begin with the magic characters "TZif" to identify
- # them as time zone information files, followed by
- # sixteen bytes reserved for future use, followed by
- # six four-byte values of type long, written in a
- # ``standard'' byte order (the high-order byte
- # of the value is written first).
- if fileobj.read(4).decode() != "TZif":
- raise ValueError("magic not found")
-
- fileobj.read(16)
-
- (
- # The number of UTC/local indicators stored in the file.
- ttisgmtcnt,
-
- # The number of standard/wall indicators stored in the file.
- ttisstdcnt,
-
- # The number of leap seconds for which data is
- # stored in the file.
- leapcnt,
-
- # The number of "transition times" for which data
- # is stored in the file.
- timecnt,
-
- # The number of "local time types" for which data
- # is stored in the file (must not be zero).
- typecnt,
-
- # The number of characters of "time zone
- # abbreviation strings" stored in the file.
- charcnt,
-
- ) = struct.unpack(">6l", fileobj.read(24))
-
- # The above header is followed by tzh_timecnt four-byte
- # values of type long, sorted in ascending order.
- # These values are written in ``standard'' byte order.
- # Each is used as a transition time (as returned by
- # time(2)) at which the rules for computing local time
- # change.
-
- if timecnt:
- out.trans_list_utc = list(struct.unpack(">%dl" % timecnt,
- fileobj.read(timecnt*4)))
- else:
- out.trans_list_utc = []
-
- # Next come tzh_timecnt one-byte values of type unsigned
- # char; each one tells which of the different types of
- # ``local time'' types described in the file is associated
- # with the same-indexed transition time. These values
- # serve as indices into an array of ttinfo structures that
- # appears next in the file.
-
- if timecnt:
- out.trans_idx = struct.unpack(">%dB" % timecnt,
- fileobj.read(timecnt))
- else:
- out.trans_idx = []
-
- # Each ttinfo structure is written as a four-byte value
- # for tt_gmtoff of type long, in a standard byte
- # order, followed by a one-byte value for tt_isdst
- # and a one-byte value for tt_abbrind. In each
- # structure, tt_gmtoff gives the number of
- # seconds to be added to UTC, tt_isdst tells whether
- # tm_isdst should be set by localtime(3), and
- # tt_abbrind serves as an index into the array of
- # time zone abbreviation characters that follow the
- # ttinfo structure(s) in the file.
-
- ttinfo = []
-
- for i in range(typecnt):
- ttinfo.append(struct.unpack(">lbb", fileobj.read(6)))
-
- abbr = fileobj.read(charcnt).decode()
-
- # Then there are tzh_leapcnt pairs of four-byte
- # values, written in standard byte order; the
- # first value of each pair gives the time (as
- # returned by time(2)) at which a leap second
- # occurs; the second gives the total number of
- # leap seconds to be applied after the given time.
- # The pairs of values are sorted in ascending order
- # by time.
-
- # Not used, for now (but seek for correct file position)
- if leapcnt:
- fileobj.seek(leapcnt * 8, os.SEEK_CUR)
-
- # Then there are tzh_ttisstdcnt standard/wall
- # indicators, each stored as a one-byte value;
- # they tell whether the transition times associated
- # with local time types were specified as standard
- # time or wall clock time, and are used when
- # a time zone file is used in handling POSIX-style
- # time zone environment variables.
-
- if ttisstdcnt:
- isstd = struct.unpack(">%db" % ttisstdcnt,
- fileobj.read(ttisstdcnt))
-
- # Finally, there are tzh_ttisgmtcnt UTC/local
- # indicators, each stored as a one-byte value;
- # they tell whether the transition times associated
- # with local time types were specified as UTC or
- # local time, and are used when a time zone file
- # is used in handling POSIX-style time zone envi-
- # ronment variables.
-
- if ttisgmtcnt:
- isgmt = struct.unpack(">%db" % ttisgmtcnt,
- fileobj.read(ttisgmtcnt))
-
- # Build ttinfo list
- out.ttinfo_list = []
- for i in range(typecnt):
- gmtoff, isdst, abbrind = ttinfo[i]
- # Round to full-minutes if that's not the case. Python's
- # datetime doesn't accept sub-minute timezones. Check
- # http://python.org/sf/1447945 for some information.
- gmtoff = 60 * ((gmtoff + 30) // 60)
- tti = _ttinfo()
- tti.offset = gmtoff
- tti.dstoffset = datetime.timedelta(0)
- tti.delta = datetime.timedelta(seconds=gmtoff)
- tti.isdst = isdst
- tti.abbr = abbr[abbrind:abbr.find('\x00', abbrind)]
- tti.isstd = (ttisstdcnt > i and isstd[i] != 0)
- tti.isgmt = (ttisgmtcnt > i and isgmt[i] != 0)
- out.ttinfo_list.append(tti)
-
- # Replace ttinfo indexes for ttinfo objects.
- out.trans_idx = [out.ttinfo_list[idx] for idx in out.trans_idx]
-
- # Set standard, dst, and before ttinfos. before will be
- # used when a given time is before any transitions,
- # and will be set to the first non-dst ttinfo, or to
- # the first dst, if all of them are dst.
- out.ttinfo_std = None
- out.ttinfo_dst = None
- out.ttinfo_before = None
- if out.ttinfo_list:
- if not out.trans_list_utc:
- out.ttinfo_std = out.ttinfo_first = out.ttinfo_list[0]
- else:
- for i in range(timecnt-1, -1, -1):
- tti = out.trans_idx[i]
- if not out.ttinfo_std and not tti.isdst:
- out.ttinfo_std = tti
- elif not out.ttinfo_dst and tti.isdst:
- out.ttinfo_dst = tti
-
- if out.ttinfo_std and out.ttinfo_dst:
- break
- else:
- if out.ttinfo_dst and not out.ttinfo_std:
- out.ttinfo_std = out.ttinfo_dst
-
- for tti in out.ttinfo_list:
- if not tti.isdst:
- out.ttinfo_before = tti
- break
- else:
- out.ttinfo_before = out.ttinfo_list[0]
-
- # Now fix transition times to become relative to wall time.
- #
- # I'm not sure about this. In my tests, the tz source file
- # is setup to wall time, and in the binary file isstd and
- # isgmt are off, so it should be in wall time. OTOH, it's
- # always in gmt time. Let me know if you have comments
- # about this.
- laststdoffset = None
- out.trans_list = []
- for i, tti in enumerate(out.trans_idx):
- if not tti.isdst:
- offset = tti.offset
- laststdoffset = offset
- else:
- if laststdoffset is not None:
- # Store the DST offset as well and update it in the list
- tti.dstoffset = tti.offset - laststdoffset
- out.trans_idx[i] = tti
-
- offset = laststdoffset or 0
-
- out.trans_list.append(out.trans_list_utc[i] + offset)
-
- # In case we missed any DST offsets on the way in for some reason, make
- # a second pass over the list, looking for the /next/ DST offset.
- laststdoffset = None
- for i in reversed(range(len(out.trans_idx))):
- tti = out.trans_idx[i]
- if tti.isdst:
- if not (tti.dstoffset or laststdoffset is None):
- tti.dstoffset = tti.offset - laststdoffset
- else:
- laststdoffset = tti.offset
-
- if not isinstance(tti.dstoffset, datetime.timedelta):
- tti.dstoffset = datetime.timedelta(seconds=tti.dstoffset)
-
- out.trans_idx[i] = tti
-
- out.trans_idx = tuple(out.trans_idx)
- out.trans_list = tuple(out.trans_list)
- out.trans_list_utc = tuple(out.trans_list_utc)
-
- return out
-
- def _find_last_transition(self, dt, in_utc=False):
- # If there's no list, there are no transitions to find
- if not self._trans_list:
- return None
-
- timestamp = _datetime_to_timestamp(dt)
-
- # Find where the timestamp fits in the transition list - if the
- # timestamp is a transition time, it's part of the "after" period.
- trans_list = self._trans_list_utc if in_utc else self._trans_list
- idx = bisect.bisect_right(trans_list, timestamp)
-
- # We want to know when the previous transition was, so subtract off 1
- return idx - 1
-
- def _get_ttinfo(self, idx):
- # For no list or after the last transition, default to _ttinfo_std
- if idx is None or (idx + 1) >= len(self._trans_list):
- return self._ttinfo_std
-
- # If there is a list and the time is before it, return _ttinfo_before
- if idx < 0:
- return self._ttinfo_before
-
- return self._trans_idx[idx]
-
- def _find_ttinfo(self, dt):
- idx = self._resolve_ambiguous_time(dt)
-
- return self._get_ttinfo(idx)
-
- def fromutc(self, dt):
- """
- The ``tzfile`` implementation of :py:func:`datetime.tzinfo.fromutc`.
-
- :param dt:
- A :py:class:`datetime.datetime` object.
-
- :raises TypeError:
- Raised if ``dt`` is not a :py:class:`datetime.datetime` object.
-
- :raises ValueError:
- Raised if this is called with a ``dt`` which does not have this
- ``tzinfo`` attached.
-
- :return:
- Returns a :py:class:`datetime.datetime` object representing the
- wall time in ``self``'s time zone.
- """
- # These isinstance checks are in datetime.tzinfo, so we'll preserve
- # them, even if we don't care about duck typing.
- if not isinstance(dt, datetime.datetime):
- raise TypeError("fromutc() requires a datetime argument")
-
- if dt.tzinfo is not self:
- raise ValueError("dt.tzinfo is not self")
-
- # First treat UTC as wall time and get the transition we're in.
- idx = self._find_last_transition(dt, in_utc=True)
- tti = self._get_ttinfo(idx)
-
- dt_out = dt + datetime.timedelta(seconds=tti.offset)
-
- fold = self.is_ambiguous(dt_out, idx=idx)
-
- return enfold(dt_out, fold=int(fold))
-
- def is_ambiguous(self, dt, idx=None):
- """
- Whether or not the "wall time" of a given datetime is ambiguous in this
- zone.
-
- :param dt:
- A :py:class:`datetime.datetime`, naive or time zone aware.
-
-
- :return:
- Returns ``True`` if ambiguous, ``False`` otherwise.
-
- .. versionadded:: 2.6.0
- """
- if idx is None:
- idx = self._find_last_transition(dt)
-
- # Calculate the difference in offsets from current to previous
- timestamp = _datetime_to_timestamp(dt)
- tti = self._get_ttinfo(idx)
-
- if idx is None or idx <= 0:
- return False
-
- od = self._get_ttinfo(idx - 1).offset - tti.offset
- tt = self._trans_list[idx] # Transition time
-
- return timestamp < tt + od
-
- def _resolve_ambiguous_time(self, dt):
- idx = self._find_last_transition(dt)
-
- # If we have no transitions, return the index
- _fold = self._fold(dt)
- if idx is None or idx == 0:
- return idx
-
- # If it's ambiguous and we're in a fold, shift to a different index.
- idx_offset = int(not _fold and self.is_ambiguous(dt, idx))
-
- return idx - idx_offset
-
- def utcoffset(self, dt):
- if dt is None:
- return None
-
- if not self._ttinfo_std:
- return ZERO
-
- return self._find_ttinfo(dt).delta
-
- def dst(self, dt):
- if dt is None:
- return None
-
- if not self._ttinfo_dst:
- return ZERO
-
- tti = self._find_ttinfo(dt)
-
- if not tti.isdst:
- return ZERO
-
- # The documentation says that utcoffset()-dst() must
- # be constant for every dt.
- return tti.dstoffset
-
- @tzname_in_python2
- def tzname(self, dt):
- if not self._ttinfo_std or dt is None:
- return None
- return self._find_ttinfo(dt).abbr
-
- def __eq__(self, other):
- if not isinstance(other, tzfile):
- return NotImplemented
- return (self._trans_list == other._trans_list and
- self._trans_idx == other._trans_idx and
- self._ttinfo_list == other._ttinfo_list)
-
- __hash__ = None
-
- def __ne__(self, other):
- return not (self == other)
-
- def __repr__(self):
- return "%s(%s)" % (self.__class__.__name__, repr(self._filename))
-
- def __reduce__(self):
- return self.__reduce_ex__(None)
-
- def __reduce_ex__(self, protocol):
- return (self.__class__, (None, self._filename), self.__dict__)
-
-
-class tzrange(tzrangebase):
- """
- The ``tzrange`` object is a time zone specified by a set of offsets and
- abbreviations, equivalent to the way the ``TZ`` variable can be specified
- in POSIX-like systems, but using Python delta objects to specify DST
- start, end and offsets.
-
- :param stdabbr:
- The abbreviation for standard time (e.g. ``'EST'``).
-
- :param stdoffset:
- An integer or :class:`datetime.timedelta` object or equivalent
- specifying the base offset from UTC.
-
- If unspecified, +00:00 is used.
-
- :param dstabbr:
- The abbreviation for DST / "Summer" time (e.g. ``'EDT'``).
-
- If specified, with no other DST information, DST is assumed to occur
- and the default behavior or ``dstoffset``, ``start`` and ``end`` is
- used. If unspecified and no other DST information is specified, it
- is assumed that this zone has no DST.
-
- If this is unspecified and other DST information is *is* specified,
- DST occurs in the zone but the time zone abbreviation is left
- unchanged.
-
- :param dstoffset:
- A an integer or :class:`datetime.timedelta` object or equivalent
- specifying the UTC offset during DST. If unspecified and any other DST
- information is specified, it is assumed to be the STD offset +1 hour.
-
- :param start:
- A :class:`relativedelta.relativedelta` object or equivalent specifying
- the time and time of year that daylight savings time starts. To specify,
- for example, that DST starts at 2AM on the 2nd Sunday in March, pass:
-
- ``relativedelta(hours=2, month=3, day=1, weekday=SU(+2))``
-
- If unspecified and any other DST information is specified, the default
- value is 2 AM on the first Sunday in April.
-
- :param end:
- A :class:`relativedelta.relativedelta` object or equivalent representing
- the time and time of year that daylight savings time ends, with the
- same specification method as in ``start``. One note is that this should
- point to the first time in the *standard* zone, so if a transition
- occurs at 2AM in the DST zone and the clocks are set back 1 hour to 1AM,
- set the `hours` parameter to +1.
-
-
- **Examples:**
-
- .. testsetup:: tzrange
-
- from dateutil.tz import tzrange, tzstr
-
- .. doctest:: tzrange
-
- >>> tzstr('EST5EDT') == tzrange("EST", -18000, "EDT")
- True
-
- >>> from dateutil.relativedelta import *
- >>> range1 = tzrange("EST", -18000, "EDT")
- >>> range2 = tzrange("EST", -18000, "EDT", -14400,
- ... relativedelta(hours=+2, month=4, day=1,
- ... weekday=SU(+1)),
- ... relativedelta(hours=+1, month=10, day=31,
- ... weekday=SU(-1)))
- >>> tzstr('EST5EDT') == range1 == range2
- True
-
- """
- def __init__(self, stdabbr, stdoffset=None,
- dstabbr=None, dstoffset=None,
- start=None, end=None):
-
- global relativedelta
- from dateutil import relativedelta
-
- self._std_abbr = stdabbr
- self._dst_abbr = dstabbr
-
- try:
- stdoffset = _total_seconds(stdoffset)
- except (TypeError, AttributeError):
- pass
-
- try:
- dstoffset = _total_seconds(dstoffset)
- except (TypeError, AttributeError):
- pass
-
- if stdoffset is not None:
- self._std_offset = datetime.timedelta(seconds=stdoffset)
- else:
- self._std_offset = ZERO
-
- if dstoffset is not None:
- self._dst_offset = datetime.timedelta(seconds=dstoffset)
- elif dstabbr and stdoffset is not None:
- self._dst_offset = self._std_offset + datetime.timedelta(hours=+1)
- else:
- self._dst_offset = ZERO
-
- if dstabbr and start is None:
- self._start_delta = relativedelta.relativedelta(
- hours=+2, month=4, day=1, weekday=relativedelta.SU(+1))
- else:
- self._start_delta = start
-
- if dstabbr and end is None:
- self._end_delta = relativedelta.relativedelta(
- hours=+1, month=10, day=31, weekday=relativedelta.SU(-1))
- else:
- self._end_delta = end
-
- self._dst_base_offset_ = self._dst_offset - self._std_offset
- self.hasdst = bool(self._start_delta)
-
- def transitions(self, year):
- """
- For a given year, get the DST on and off transition times, expressed
- always on the standard time side. For zones with no transitions, this
- function returns ``None``.
-
- :param year:
- The year whose transitions you would like to query.
-
- :return:
- Returns a :class:`tuple` of :class:`datetime.datetime` objects,
- ``(dston, dstoff)`` for zones with an annual DST transition, or
- ``None`` for fixed offset zones.
- """
- if not self.hasdst:
- return None
-
- base_year = datetime.datetime(year, 1, 1)
-
- start = base_year + self._start_delta
- end = base_year + self._end_delta
-
- return (start, end)
-
- def __eq__(self, other):
- if not isinstance(other, tzrange):
- return NotImplemented
-
- return (self._std_abbr == other._std_abbr and
- self._dst_abbr == other._dst_abbr and
- self._std_offset == other._std_offset and
- self._dst_offset == other._dst_offset and
- self._start_delta == other._start_delta and
- self._end_delta == other._end_delta)
-
- @property
- def _dst_base_offset(self):
- return self._dst_base_offset_
-
-
-class tzstr(tzrange):
- """
- ``tzstr`` objects are time zone objects specified by a time-zone string as
- it would be passed to a ``TZ`` variable on POSIX-style systems (see
- the `GNU C Library: TZ Variable`_ for more details).
-
- There is one notable exception, which is that POSIX-style time zones use an
- inverted offset format, so normally ``GMT+3`` would be parsed as an offset
- 3 hours *behind* GMT. The ``tzstr`` time zone object will parse this as an
- offset 3 hours *ahead* of GMT. If you would like to maintain the POSIX
- behavior, pass a ``True`` value to ``posix_offset``.
-
- The :class:`tzrange` object provides the same functionality, but is
- specified using :class:`relativedelta.relativedelta` objects. rather than
- strings.
-
- :param s:
- A time zone string in ``TZ`` variable format. This can be a
- :class:`bytes` (2.x: :class:`str`), :class:`str` (2.x: :class:`unicode`)
- or a stream emitting unicode characters (e.g. :class:`StringIO`).
-
- :param posix_offset:
- Optional. If set to ``True``, interpret strings such as ``GMT+3`` or
- ``UTC+3`` as being 3 hours *behind* UTC rather than ahead, per the
- POSIX standard.
-
- .. _`GNU C Library: TZ Variable`:
- https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html
- """
- def __init__(self, s, posix_offset=False):
- global parser
- from dateutil import parser
-
- self._s = s
-
- res = parser._parsetz(s)
- if res is None:
- raise ValueError("unknown string format")
-
- # Here we break the compatibility with the TZ variable handling.
- # GMT-3 actually *means* the timezone -3.
- if res.stdabbr in ("GMT", "UTC") and not posix_offset:
- res.stdoffset *= -1
-
- # We must initialize it first, since _delta() needs
- # _std_offset and _dst_offset set. Use False in start/end
- # to avoid building it two times.
- tzrange.__init__(self, res.stdabbr, res.stdoffset,
- res.dstabbr, res.dstoffset,
- start=False, end=False)
-
- if not res.dstabbr:
- self._start_delta = None
- self._end_delta = None
- else:
- self._start_delta = self._delta(res.start)
- if self._start_delta:
- self._end_delta = self._delta(res.end, isend=1)
-
- self.hasdst = bool(self._start_delta)
-
- def _delta(self, x, isend=0):
- from dateutil import relativedelta
- kwargs = {}
- if x.month is not None:
- kwargs["month"] = x.month
- if x.weekday is not None:
- kwargs["weekday"] = relativedelta.weekday(x.weekday, x.week)
- if x.week > 0:
- kwargs["day"] = 1
- else:
- kwargs["day"] = 31
- elif x.day:
- kwargs["day"] = x.day
- elif x.yday is not None:
- kwargs["yearday"] = x.yday
- elif x.jyday is not None:
- kwargs["nlyearday"] = x.jyday
- if not kwargs:
- # Default is to start on first sunday of april, and end
- # on last sunday of october.
- if not isend:
- kwargs["month"] = 4
- kwargs["day"] = 1
- kwargs["weekday"] = relativedelta.SU(+1)
- else:
- kwargs["month"] = 10
- kwargs["day"] = 31
- kwargs["weekday"] = relativedelta.SU(-1)
- if x.time is not None:
- kwargs["seconds"] = x.time
- else:
- # Default is 2AM.
- kwargs["seconds"] = 7200
- if isend:
- # Convert to standard time, to follow the documented way
- # of working with the extra hour. See the documentation
- # of the tzinfo class.
- delta = self._dst_offset - self._std_offset
- kwargs["seconds"] -= delta.seconds + delta.days * 86400
- return relativedelta.relativedelta(**kwargs)
-
- def __repr__(self):
- return "%s(%s)" % (self.__class__.__name__, repr(self._s))
-
-
-class _tzicalvtzcomp(object):
- def __init__(self, tzoffsetfrom, tzoffsetto, isdst,
- tzname=None, rrule=None):
- self.tzoffsetfrom = datetime.timedelta(seconds=tzoffsetfrom)
- self.tzoffsetto = datetime.timedelta(seconds=tzoffsetto)
- self.tzoffsetdiff = self.tzoffsetto - self.tzoffsetfrom
- self.isdst = isdst
- self.tzname = tzname
- self.rrule = rrule
-
-
-class _tzicalvtz(_tzinfo):
- def __init__(self, tzid, comps=[]):
- super(_tzicalvtz, self).__init__()
-
- self._tzid = tzid
- self._comps = comps
- self._cachedate = []
- self._cachecomp = []
-
- def _find_comp(self, dt):
- if len(self._comps) == 1:
- return self._comps[0]
-
- dt = dt.replace(tzinfo=None)
-
- try:
- return self._cachecomp[self._cachedate.index((dt, self._fold(dt)))]
- except ValueError:
- pass
-
- lastcompdt = None
- lastcomp = None
-
- for comp in self._comps:
- compdt = self._find_compdt(comp, dt)
-
- if compdt and (not lastcompdt or lastcompdt < compdt):
- lastcompdt = compdt
- lastcomp = comp
-
- if not lastcomp:
- # RFC says nothing about what to do when a given
- # time is before the first onset date. We'll look for the
- # first standard component, or the first component, if
- # none is found.
- for comp in self._comps:
- if not comp.isdst:
- lastcomp = comp
- break
- else:
- lastcomp = comp[0]
-
- self._cachedate.insert(0, (dt, self._fold(dt)))
- self._cachecomp.insert(0, lastcomp)
-
- if len(self._cachedate) > 10:
- self._cachedate.pop()
- self._cachecomp.pop()
-
- return lastcomp
-
- def _find_compdt(self, comp, dt):
- if comp.tzoffsetdiff < ZERO and self._fold(dt):
- dt -= comp.tzoffsetdiff
-
- compdt = comp.rrule.before(dt, inc=True)
-
- return compdt
-
- def utcoffset(self, dt):
- if dt is None:
- return None
-
- return self._find_comp(dt).tzoffsetto
-
- def dst(self, dt):
- comp = self._find_comp(dt)
- if comp.isdst:
- return comp.tzoffsetdiff
- else:
- return ZERO
-
- @tzname_in_python2
- def tzname(self, dt):
- return self._find_comp(dt).tzname
-
- def __repr__(self):
- return "" % repr(self._tzid)
-
- __reduce__ = object.__reduce__
-
-
-class tzical(object):
- """
- This object is designed to parse an iCalendar-style ``VTIMEZONE`` structure
- as set out in `RFC 2445`_ Section 4.6.5 into one or more `tzinfo` objects.
-
- :param `fileobj`:
- A file or stream in iCalendar format, which should be UTF-8 encoded
- with CRLF endings.
-
- .. _`RFC 2445`: https://www.ietf.org/rfc/rfc2445.txt
- """
- def __init__(self, fileobj):
- global rrule
- from dateutil import rrule
-
- if isinstance(fileobj, string_types):
- self._s = fileobj
- # ical should be encoded in UTF-8 with CRLF
- fileobj = open(fileobj, 'r')
- else:
- self._s = getattr(fileobj, 'name', repr(fileobj))
- fileobj = _ContextWrapper(fileobj)
-
- self._vtz = {}
-
- with fileobj as fobj:
- self._parse_rfc(fobj.read())
-
- def keys(self):
- """
- Retrieves the available time zones as a list.
- """
- return list(self._vtz.keys())
-
- def get(self, tzid=None):
- """
- Retrieve a :py:class:`datetime.tzinfo` object by its ``tzid``.
-
- :param tzid:
- If there is exactly one time zone available, omitting ``tzid``
- or passing :py:const:`None` value returns it. Otherwise a valid
- key (which can be retrieved from :func:`keys`) is required.
-
- :raises ValueError:
- Raised if ``tzid`` is not specified but there are either more
- or fewer than 1 zone defined.
-
- :returns:
- Returns either a :py:class:`datetime.tzinfo` object representing
- the relevant time zone or :py:const:`None` if the ``tzid`` was
- not found.
- """
- if tzid is None:
- if len(self._vtz) == 0:
- raise ValueError("no timezones defined")
- elif len(self._vtz) > 1:
- raise ValueError("more than one timezone available")
- tzid = next(iter(self._vtz))
-
- return self._vtz.get(tzid)
-
- def _parse_offset(self, s):
- s = s.strip()
- if not s:
- raise ValueError("empty offset")
- if s[0] in ('+', '-'):
- signal = (-1, +1)[s[0] == '+']
- s = s[1:]
- else:
- signal = +1
- if len(s) == 4:
- return (int(s[:2]) * 3600 + int(s[2:]) * 60) * signal
- elif len(s) == 6:
- return (int(s[:2]) * 3600 + int(s[2:4]) * 60 + int(s[4:])) * signal
- else:
- raise ValueError("invalid offset: " + s)
-
- def _parse_rfc(self, s):
- lines = s.splitlines()
- if not lines:
- raise ValueError("empty string")
-
- # Unfold
- i = 0
- while i < len(lines):
- line = lines[i].rstrip()
- if not line:
- del lines[i]
- elif i > 0 and line[0] == " ":
- lines[i-1] += line[1:]
- del lines[i]
- else:
- i += 1
-
- tzid = None
- comps = []
- invtz = False
- comptype = None
- for line in lines:
- if not line:
- continue
- name, value = line.split(':', 1)
- parms = name.split(';')
- if not parms:
- raise ValueError("empty property name")
- name = parms[0].upper()
- parms = parms[1:]
- if invtz:
- if name == "BEGIN":
- if value in ("STANDARD", "DAYLIGHT"):
- # Process component
- pass
- else:
- raise ValueError("unknown component: "+value)
- comptype = value
- founddtstart = False
- tzoffsetfrom = None
- tzoffsetto = None
- rrulelines = []
- tzname = None
- elif name == "END":
- if value == "VTIMEZONE":
- if comptype:
- raise ValueError("component not closed: "+comptype)
- if not tzid:
- raise ValueError("mandatory TZID not found")
- if not comps:
- raise ValueError(
- "at least one component is needed")
- # Process vtimezone
- self._vtz[tzid] = _tzicalvtz(tzid, comps)
- invtz = False
- elif value == comptype:
- if not founddtstart:
- raise ValueError("mandatory DTSTART not found")
- if tzoffsetfrom is None:
- raise ValueError(
- "mandatory TZOFFSETFROM not found")
- if tzoffsetto is None:
- raise ValueError(
- "mandatory TZOFFSETFROM not found")
- # Process component
- rr = None
- if rrulelines:
- rr = rrule.rrulestr("\n".join(rrulelines),
- compatible=True,
- ignoretz=True,
- cache=True)
- comp = _tzicalvtzcomp(tzoffsetfrom, tzoffsetto,
- (comptype == "DAYLIGHT"),
- tzname, rr)
- comps.append(comp)
- comptype = None
- else:
- raise ValueError("invalid component end: "+value)
- elif comptype:
- if name == "DTSTART":
- rrulelines.append(line)
- founddtstart = True
- elif name in ("RRULE", "RDATE", "EXRULE", "EXDATE"):
- rrulelines.append(line)
- elif name == "TZOFFSETFROM":
- if parms:
- raise ValueError(
- "unsupported %s parm: %s " % (name, parms[0]))
- tzoffsetfrom = self._parse_offset(value)
- elif name == "TZOFFSETTO":
- if parms:
- raise ValueError(
- "unsupported TZOFFSETTO parm: "+parms[0])
- tzoffsetto = self._parse_offset(value)
- elif name == "TZNAME":
- if parms:
- raise ValueError(
- "unsupported TZNAME parm: "+parms[0])
- tzname = value
- elif name == "COMMENT":
- pass
- else:
- raise ValueError("unsupported property: "+name)
- else:
- if name == "TZID":
- if parms:
- raise ValueError(
- "unsupported TZID parm: "+parms[0])
- tzid = value
- elif name in ("TZURL", "LAST-MODIFIED", "COMMENT"):
- pass
- else:
- raise ValueError("unsupported property: "+name)
- elif name == "BEGIN" and value == "VTIMEZONE":
- tzid = None
- comps = []
- invtz = True
-
- def __repr__(self):
- return "%s(%s)" % (self.__class__.__name__, repr(self._s))
-
-
-if sys.platform != "win32":
- TZFILES = ["/etc/localtime", "localtime"]
- TZPATHS = ["/usr/share/zoneinfo",
- "/usr/lib/zoneinfo",
- "/usr/share/lib/zoneinfo",
- "/etc/zoneinfo"]
-else:
- TZFILES = []
- TZPATHS = []
-
-
-def gettz(name=None):
- tz = None
- if not name:
- try:
- name = os.environ["TZ"]
- except KeyError:
- pass
- if name is None or name == ":":
- for filepath in TZFILES:
- if not os.path.isabs(filepath):
- filename = filepath
- for path in TZPATHS:
- filepath = os.path.join(path, filename)
- if os.path.isfile(filepath):
- break
- else:
- continue
- if os.path.isfile(filepath):
- try:
- tz = tzfile(filepath)
- break
- except (IOError, OSError, ValueError):
- pass
- else:
- tz = tzlocal()
- else:
- if name.startswith(":"):
- name = name[:-1]
- if os.path.isabs(name):
- if os.path.isfile(name):
- tz = tzfile(name)
- else:
- tz = None
- else:
- for path in TZPATHS:
- filepath = os.path.join(path, name)
- if not os.path.isfile(filepath):
- filepath = filepath.replace(' ', '_')
- if not os.path.isfile(filepath):
- continue
- try:
- tz = tzfile(filepath)
- break
- except (IOError, OSError, ValueError):
- pass
- else:
- tz = None
- if tzwin is not None:
- try:
- tz = tzwin(name)
- except WindowsError:
- tz = None
-
- if not tz:
- from dateutil.zoneinfo import get_zonefile_instance
- tz = get_zonefile_instance().get(name)
-
- if not tz:
- for c in name:
- # name must have at least one offset to be a tzstr
- if c in "0123456789":
- try:
- tz = tzstr(name)
- except ValueError:
- pass
- break
- else:
- if name in ("GMT", "UTC"):
- tz = tzutc()
- elif name in time.tzname:
- tz = tzlocal()
- return tz
-
-
-def datetime_exists(dt, tz=None):
- """
- Given a datetime and a time zone, determine whether or not a given datetime
- would fall in a gap.
-
- :param dt:
- A :class:`datetime.datetime` (whose time zone will be ignored if ``tz``
- is provided.)
-
- :param tz:
- A :class:`datetime.tzinfo` with support for the ``fold`` attribute. If
- ``None`` or not provided, the datetime's own time zone will be used.
-
- :return:
- Returns a boolean value whether or not the "wall time" exists in ``tz``.
- """
- if tz is None:
- if dt.tzinfo is None:
- raise ValueError('Datetime is naive and no time zone provided.')
- tz = dt.tzinfo
-
- dt = dt.replace(tzinfo=None)
-
- # This is essentially a test of whether or not the datetime can survive
- # a round trip to UTC.
- dt_rt = dt.replace(tzinfo=tz).astimezone(tzutc()).astimezone(tz)
- dt_rt = dt_rt.replace(tzinfo=None)
-
- return dt == dt_rt
-
-
-def datetime_ambiguous(dt, tz=None):
- """
- Given a datetime and a time zone, determine whether or not a given datetime
- is ambiguous (i.e if there are two times differentiated only by their DST
- status).
-
- :param dt:
- A :class:`datetime.datetime` (whose time zone will be ignored if ``tz``
- is provided.)
-
- :param tz:
- A :class:`datetime.tzinfo` with support for the ``fold`` attribute. If
- ``None`` or not provided, the datetime's own time zone will be used.
-
- :return:
- Returns a boolean value whether or not the "wall time" is ambiguous in
- ``tz``.
-
- .. versionadded:: 2.6.0
- """
- if tz is None:
- if dt.tzinfo is None:
- raise ValueError('Datetime is naive and no time zone provided.')
-
- tz = dt.tzinfo
-
- # If a time zone defines its own "is_ambiguous" function, we'll use that.
- is_ambiguous_fn = getattr(tz, 'is_ambiguous', None)
- if is_ambiguous_fn is not None:
- try:
- return tz.is_ambiguous(dt)
- except:
- pass
-
- # If it doesn't come out and tell us it's ambiguous, we'll just check if
- # the fold attribute has any effect on this particular date and time.
- dt = dt.replace(tzinfo=tz)
- wall_0 = enfold(dt, fold=0)
- wall_1 = enfold(dt, fold=1)
-
- same_offset = wall_0.utcoffset() == wall_1.utcoffset()
- same_dst = wall_0.dst() == wall_1.dst()
-
- return not (same_offset and same_dst)
-
-
-def _datetime_to_timestamp(dt):
- """
- Convert a :class:`datetime.datetime` object to an epoch timestamp in seconds
- since January 1, 1970, ignoring the time zone.
- """
- return _total_seconds((dt.replace(tzinfo=None) - EPOCH))
-
-
-class _ContextWrapper(object):
- """
- Class for wrapping contexts so that they are passed through in a
- with statement.
- """
- def __init__(self, context):
- self.context = context
-
- def __enter__(self):
- return self.context
-
- def __exit__(*args, **kwargs):
- pass
-
-# vim:ts=4:sw=4:et
diff --git a/lib/dateutil/tz/win.py b/lib/dateutil/tz/win.py
deleted file mode 100644
index 36a1c263ac..0000000000
--- a/lib/dateutil/tz/win.py
+++ /dev/null
@@ -1,332 +0,0 @@
-# This code was originally contributed by Jeffrey Harris.
-import datetime
-import struct
-
-from six.moves import winreg
-from six import text_type
-
-try:
- import ctypes
- from ctypes import wintypes
-except ValueError:
- # ValueError is raised on non-Windows systems for some horrible reason.
- raise ImportError("Running tzwin on non-Windows system")
-
-from ._common import tzrangebase
-
-__all__ = ["tzwin", "tzwinlocal", "tzres"]
-
-ONEWEEK = datetime.timedelta(7)
-
-TZKEYNAMENT = r"SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones"
-TZKEYNAME9X = r"SOFTWARE\Microsoft\Windows\CurrentVersion\Time Zones"
-TZLOCALKEYNAME = r"SYSTEM\CurrentControlSet\Control\TimeZoneInformation"
-
-
-def _settzkeyname():
- handle = winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE)
- try:
- winreg.OpenKey(handle, TZKEYNAMENT).Close()
- TZKEYNAME = TZKEYNAMENT
- except WindowsError:
- TZKEYNAME = TZKEYNAME9X
- handle.Close()
- return TZKEYNAME
-
-
-TZKEYNAME = _settzkeyname()
-
-
-class tzres(object):
- """
- Class for accessing `tzres.dll`, which contains timezone name related
- resources.
-
- .. versionadded:: 2.5.0
- """
- p_wchar = ctypes.POINTER(wintypes.WCHAR) # Pointer to a wide char
-
- def __init__(self, tzres_loc='tzres.dll'):
- # Load the user32 DLL so we can load strings from tzres
- user32 = ctypes.WinDLL('user32')
-
- # Specify the LoadStringW function
- user32.LoadStringW.argtypes = (wintypes.HINSTANCE,
- wintypes.UINT,
- wintypes.LPWSTR,
- ctypes.c_int)
-
- self.LoadStringW = user32.LoadStringW
- self._tzres = ctypes.WinDLL(tzres_loc)
- self.tzres_loc = tzres_loc
-
- def load_name(self, offset):
- """
- Load a timezone name from a DLL offset (integer).
-
- >>> from dateutil.tzwin import tzres
- >>> tzr = tzres()
- >>> print(tzr.load_name(112))
- 'Eastern Standard Time'
-
- :param offset:
- A positive integer value referring to a string from the tzres dll.
-
- ..note:
- Offsets found in the registry are generally of the form
- `@tzres.dll,-114`. The offset in this case if 114, not -114.
-
- """
- resource = self.p_wchar()
- lpBuffer = ctypes.cast(ctypes.byref(resource), wintypes.LPWSTR)
- nchar = self.LoadStringW(self._tzres._handle, offset, lpBuffer, 0)
- return resource[:nchar]
-
- def name_from_string(self, tzname_str):
- """
- Parse strings as returned from the Windows registry into the time zone
- name as defined in the registry.
-
- >>> from dateutil.tzwin import tzres
- >>> tzr = tzres()
- >>> print(tzr.name_from_string('@tzres.dll,-251'))
- 'Dateline Daylight Time'
- >>> print(tzr.name_from_string('Eastern Standard Time'))
- 'Eastern Standard Time'
-
- :param tzname_str:
- A timezone name string as returned from a Windows registry key.
-
- :return:
- Returns the localized timezone string from tzres.dll if the string
- is of the form `@tzres.dll,-offset`, else returns the input string.
- """
- if not tzname_str.startswith('@'):
- return tzname_str
-
- name_splt = tzname_str.split(',-')
- try:
- offset = int(name_splt[1])
- except:
- raise ValueError("Malformed timezone string.")
-
- return self.load_name(offset)
-
-
-class tzwinbase(tzrangebase):
- """tzinfo class based on win32's timezones available in the registry."""
- def __init__(self):
- raise NotImplementedError('tzwinbase is an abstract base class')
-
- def __eq__(self, other):
- # Compare on all relevant dimensions, including name.
- if not isinstance(other, tzwinbase):
- return NotImplemented
-
- return (self._std_offset == other._std_offset and
- self._dst_offset == other._dst_offset and
- self._stddayofweek == other._stddayofweek and
- self._dstdayofweek == other._dstdayofweek and
- self._stdweeknumber == other._stdweeknumber and
- self._dstweeknumber == other._dstweeknumber and
- self._stdhour == other._stdhour and
- self._dsthour == other._dsthour and
- self._stdminute == other._stdminute and
- self._dstminute == other._dstminute and
- self._std_abbr == other._std_abbr and
- self._dst_abbr == other._dst_abbr)
-
- @staticmethod
- def list():
- """Return a list of all time zones known to the system."""
- with winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE) as handle:
- with winreg.OpenKey(handle, TZKEYNAME) as tzkey:
- result = [winreg.EnumKey(tzkey, i)
- for i in range(winreg.QueryInfoKey(tzkey)[0])]
- return result
-
- def display(self):
- return self._display
-
- def transitions(self, year):
- """
- For a given year, get the DST on and off transition times, expressed
- always on the standard time side. For zones with no transitions, this
- function returns ``None``.
-
- :param year:
- The year whose transitions you would like to query.
-
- :return:
- Returns a :class:`tuple` of :class:`datetime.datetime` objects,
- ``(dston, dstoff)`` for zones with an annual DST transition, or
- ``None`` for fixed offset zones.
- """
-
- if not self.hasdst:
- return None
-
- dston = picknthweekday(year, self._dstmonth, self._dstdayofweek,
- self._dsthour, self._dstminute,
- self._dstweeknumber)
-
- dstoff = picknthweekday(year, self._stdmonth, self._stddayofweek,
- self._stdhour, self._stdminute,
- self._stdweeknumber)
-
- # Ambiguous dates default to the STD side
- dstoff -= self._dst_base_offset
-
- return dston, dstoff
-
- def _get_hasdst(self):
- return self._dstmonth != 0
-
- @property
- def _dst_base_offset(self):
- return self._dst_base_offset_
-
-
-class tzwin(tzwinbase):
-
- def __init__(self, name):
- self._name = name
-
- # multiple contexts only possible in 2.7 and 3.1, we still support 2.6
- with winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE) as handle:
- tzkeyname = text_type("{kn}\\{name}").format(kn=TZKEYNAME, name=name)
- with winreg.OpenKey(handle, tzkeyname) as tzkey:
- keydict = valuestodict(tzkey)
-
- self._std_abbr = keydict["Std"]
- self._dst_abbr = keydict["Dlt"]
-
- self._display = keydict["Display"]
-
- # See http://ww_winreg.jsiinc.com/SUBA/tip0300/rh0398.htm
- tup = struct.unpack("=3l16h", keydict["TZI"])
- stdoffset = -tup[0]-tup[1] # Bias + StandardBias * -1
- dstoffset = stdoffset-tup[2] # + DaylightBias * -1
- self._std_offset = datetime.timedelta(minutes=stdoffset)
- self._dst_offset = datetime.timedelta(minutes=dstoffset)
-
- # for the meaning see the win32 TIME_ZONE_INFORMATION structure docs
- # http://msdn.microsoft.com/en-us/library/windows/desktop/ms725481(v=vs.85).aspx
- (self._stdmonth,
- self._stddayofweek, # Sunday = 0
- self._stdweeknumber, # Last = 5
- self._stdhour,
- self._stdminute) = tup[4:9]
-
- (self._dstmonth,
- self._dstdayofweek, # Sunday = 0
- self._dstweeknumber, # Last = 5
- self._dsthour,
- self._dstminute) = tup[12:17]
-
- self._dst_base_offset_ = self._dst_offset - self._std_offset
- self.hasdst = self._get_hasdst()
-
- def __repr__(self):
- return "tzwin(%s)" % repr(self._name)
-
- def __reduce__(self):
- return (self.__class__, (self._name,))
-
-
-class tzwinlocal(tzwinbase):
- def __init__(self):
- with winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE) as handle:
- with winreg.OpenKey(handle, TZLOCALKEYNAME) as tzlocalkey:
- keydict = valuestodict(tzlocalkey)
-
- self._std_abbr = keydict["StandardName"]
- self._dst_abbr = keydict["DaylightName"]
-
- try:
- tzkeyname = text_type('{kn}\\{sn}').format(kn=TZKEYNAME,
- sn=self._std_abbr)
- with winreg.OpenKey(handle, tzkeyname) as tzkey:
- _keydict = valuestodict(tzkey)
- self._display = _keydict["Display"]
- except OSError:
- self._display = None
-
- stdoffset = -keydict["Bias"]-keydict["StandardBias"]
- dstoffset = stdoffset-keydict["DaylightBias"]
-
- self._std_offset = datetime.timedelta(minutes=stdoffset)
- self._dst_offset = datetime.timedelta(minutes=dstoffset)
-
- # For reasons unclear, in this particular key, the day of week has been
- # moved to the END of the SYSTEMTIME structure.
- tup = struct.unpack("=8h", keydict["StandardStart"])
-
- (self._stdmonth,
- self._stdweeknumber, # Last = 5
- self._stdhour,
- self._stdminute) = tup[1:5]
-
- self._stddayofweek = tup[7]
-
- tup = struct.unpack("=8h", keydict["DaylightStart"])
-
- (self._dstmonth,
- self._dstweeknumber, # Last = 5
- self._dsthour,
- self._dstminute) = tup[1:5]
-
- self._dstdayofweek = tup[7]
-
- self._dst_base_offset_ = self._dst_offset - self._std_offset
- self.hasdst = self._get_hasdst()
-
- def __repr__(self):
- return "tzwinlocal()"
-
- def __str__(self):
- # str will return the standard name, not the daylight name.
- return "tzwinlocal(%s)" % repr(self._std_abbr)
-
- def __reduce__(self):
- return (self.__class__, ())
-
-
-def picknthweekday(year, month, dayofweek, hour, minute, whichweek):
- """ dayofweek == 0 means Sunday, whichweek 5 means last instance """
- first = datetime.datetime(year, month, 1, hour, minute)
-
- # This will work if dayofweek is ISO weekday (1-7) or Microsoft-style (0-6),
- # Because 7 % 7 = 0
- weekdayone = first.replace(day=((dayofweek - first.isoweekday()) % 7) + 1)
- wd = weekdayone + ((whichweek - 1) * ONEWEEK)
- if (wd.month != month):
- wd -= ONEWEEK
-
- return wd
-
-
-def valuestodict(key):
- """Convert a registry key's values to a dictionary."""
- dout = {}
- size = winreg.QueryInfoKey(key)[1]
- tz_res = None
-
- for i in range(size):
- key_name, value, dtype = winreg.EnumValue(key, i)
- if dtype == winreg.REG_DWORD or dtype == winreg.REG_DWORD_LITTLE_ENDIAN:
- # If it's a DWORD (32-bit integer), it's stored as unsigned - convert
- # that to a proper signed integer
- if value & (1 << 31):
- value = value - (1 << 32)
- elif dtype == winreg.REG_SZ:
- # If it's a reference to the tzres DLL, load the actual string
- if value.startswith('@tzres'):
- tz_res = tz_res or tzres()
- value = tz_res.name_from_string(value)
-
- value = value.rstrip('\x00') # Remove trailing nulls
-
- dout[key_name] = value
-
- return dout
diff --git a/lib/dateutil/tzwin.py b/lib/dateutil/tzwin.py
deleted file mode 100644
index cebc673e40..0000000000
--- a/lib/dateutil/tzwin.py
+++ /dev/null
@@ -1,2 +0,0 @@
-# tzwin has moved to dateutil.tz.win
-from .tz.win import *
diff --git a/lib/dateutil/zoneinfo/__init__.py b/lib/dateutil/zoneinfo/__init__.py
deleted file mode 100644
index a2ed4f9d61..0000000000
--- a/lib/dateutil/zoneinfo/__init__.py
+++ /dev/null
@@ -1,183 +0,0 @@
-# -*- coding: utf-8 -*-
-import warnings
-import json
-
-from tarfile import TarFile
-from pkgutil import get_data
-from io import BytesIO
-from contextlib import closing
-
-from dateutil.tz import tzfile
-
-__all__ = ["get_zonefile_instance", "gettz", "gettz_db_metadata", "rebuild"]
-
-ZONEFILENAME = "dateutil-zoneinfo.tar.gz"
-METADATA_FN = 'METADATA'
-
-# python2.6 compatability. Note that TarFile.__exit__ != TarFile.close, but
-# it's close enough for python2.6
-tar_open = TarFile.open
-if not hasattr(TarFile, '__exit__'):
- def tar_open(*args, **kwargs):
- return closing(TarFile.open(*args, **kwargs))
-
-
-class tzfile(tzfile):
- def __reduce__(self):
- return (gettz, (self._filename,))
-
-
-def getzoneinfofile_stream():
- try:
- return BytesIO(get_data(__name__, ZONEFILENAME))
- except IOError as e: # TODO switch to FileNotFoundError?
- warnings.warn("I/O error({0}): {1}".format(e.errno, e.strerror))
- return None
-
-
-class ZoneInfoFile(object):
- def __init__(self, zonefile_stream=None):
- if zonefile_stream is not None:
- with tar_open(fileobj=zonefile_stream, mode='r') as tf:
- # dict comprehension does not work on python2.6
- # TODO: get back to the nicer syntax when we ditch python2.6
- # self.zones = {zf.name: tzfile(tf.extractfile(zf),
- # filename = zf.name)
- # for zf in tf.getmembers() if zf.isfile()}
- self.zones = dict((zf.name, tzfile(tf.extractfile(zf),
- filename=zf.name))
- for zf in tf.getmembers()
- if zf.isfile() and zf.name != METADATA_FN)
- # deal with links: They'll point to their parent object. Less
- # waste of memory
- # links = {zl.name: self.zones[zl.linkname]
- # for zl in tf.getmembers() if zl.islnk() or zl.issym()}
- links = dict((zl.name, self.zones[zl.linkname])
- for zl in tf.getmembers() if
- zl.islnk() or zl.issym())
- self.zones.update(links)
- try:
- metadata_json = tf.extractfile(tf.getmember(METADATA_FN))
- metadata_str = metadata_json.read().decode('UTF-8')
- self.metadata = json.loads(metadata_str)
- except KeyError:
- # no metadata in tar file
- self.metadata = None
- else:
- self.zones = dict()
- self.metadata = None
-
- def get(self, name, default=None):
- """
- Wrapper for :func:`ZoneInfoFile.zones.get`. This is a convenience method
- for retrieving zones from the zone dictionary.
-
- :param name:
- The name of the zone to retrieve. (Generally IANA zone names)
-
- :param default:
- The value to return in the event of a missing key.
-
- .. versionadded:: 2.6.0
-
- """
- return self.zones.get(name, default)
-
-
-# The current API has gettz as a module function, although in fact it taps into
-# a stateful class. So as a workaround for now, without changing the API, we
-# will create a new "global" class instance the first time a user requests a
-# timezone. Ugly, but adheres to the api.
-#
-# TODO: Remove after deprecation period.
-_CLASS_ZONE_INSTANCE = list()
-
-
-def get_zonefile_instance(new_instance=False):
- """
- This is a convenience function which provides a :class:`ZoneInfoFile`
- instance using the data provided by the ``dateutil`` package. By default, it
- caches a single instance of the ZoneInfoFile object and returns that.
-
- :param new_instance:
- If ``True``, a new instance of :class:`ZoneInfoFile` is instantiated and
- used as the cached instance for the next call. Otherwise, new instances
- are created only as necessary.
-
- :return:
- Returns a :class:`ZoneInfoFile` object.
-
- .. versionadded:: 2.6
- """
- if new_instance:
- zif = None
- else:
- zif = getattr(get_zonefile_instance, '_cached_instance', None)
-
- if zif is None:
- zif = ZoneInfoFile(getzoneinfofile_stream())
-
- get_zonefile_instance._cached_instance = zif
-
- return zif
-
-
-def gettz(name):
- """
- This retrieves a time zone from the local zoneinfo tarball that is packaged
- with dateutil.
-
- :param name:
- An IANA-style time zone name, as found in the zoneinfo file.
-
- :return:
- Returns a :class:`dateutil.tz.tzfile` time zone object.
-
- .. warning::
- It is generally inadvisable to use this function, and it is only
- provided for API compatibility with earlier versions. This is *not*
- equivalent to ``dateutil.tz.gettz()``, which selects an appropriate
- time zone based on the inputs, favoring system zoneinfo. This is ONLY
- for accessing the dateutil-specific zoneinfo (which may be out of
- date compared to the system zoneinfo).
-
- .. deprecated:: 2.6
- If you need to use a specific zoneinfofile over the system zoneinfo,
- instantiate a :class:`dateutil.zoneinfo.ZoneInfoFile` object and call
- :func:`dateutil.zoneinfo.ZoneInfoFile.get(name)` instead.
-
- Use :func:`get_zonefile_instance` to retrieve an instance of the
- dateutil-provided zoneinfo.
- """
- warnings.warn("zoneinfo.gettz() will be removed in future versions, "
- "to use the dateutil-provided zoneinfo files, instantiate a "
- "ZoneInfoFile object and use ZoneInfoFile.zones.get() "
- "instead. See the documentation for details.",
- DeprecationWarning)
-
- if len(_CLASS_ZONE_INSTANCE) == 0:
- _CLASS_ZONE_INSTANCE.append(ZoneInfoFile(getzoneinfofile_stream()))
- return _CLASS_ZONE_INSTANCE[0].zones.get(name)
-
-
-def gettz_db_metadata():
- """ Get the zonefile metadata
-
- See `zonefile_metadata`_
-
- :returns:
- A dictionary with the database metadata
-
- .. deprecated:: 2.6
- See deprecation warning in :func:`zoneinfo.gettz`. To get metadata,
- query the attribute ``zoneinfo.ZoneInfoFile.metadata``.
- """
- warnings.warn("zoneinfo.gettz_db_metadata() will be removed in future "
- "versions, to use the dateutil-provided zoneinfo files, "
- "ZoneInfoFile object and query the 'metadata' attribute "
- "instead. See the documentation for details.",
- DeprecationWarning)
-
- if len(_CLASS_ZONE_INSTANCE) == 0:
- _CLASS_ZONE_INSTANCE.append(ZoneInfoFile(getzoneinfofile_stream()))
- return _CLASS_ZONE_INSTANCE[0].metadata
diff --git a/lib/dateutil/zoneinfo/dateutil-zoneinfo.tar.gz b/lib/dateutil/zoneinfo/dateutil-zoneinfo.tar.gz
deleted file mode 100644
index 613c0ff3b4..0000000000
Binary files a/lib/dateutil/zoneinfo/dateutil-zoneinfo.tar.gz and /dev/null differ
diff --git a/lib/dateutil/zoneinfo/rebuild.py b/lib/dateutil/zoneinfo/rebuild.py
deleted file mode 100644
index 9d53bb8807..0000000000
--- a/lib/dateutil/zoneinfo/rebuild.py
+++ /dev/null
@@ -1,52 +0,0 @@
-import logging
-import os
-import tempfile
-import shutil
-import json
-from subprocess import check_call
-
-from dateutil.zoneinfo import tar_open, METADATA_FN, ZONEFILENAME
-
-
-def rebuild(filename, tag=None, format="gz", zonegroups=[], metadata=None):
- """Rebuild the internal timezone info in dateutil/zoneinfo/zoneinfo*tar*
-
- filename is the timezone tarball from ftp.iana.org/tz.
-
- """
- tmpdir = tempfile.mkdtemp()
- zonedir = os.path.join(tmpdir, "zoneinfo")
- moduledir = os.path.dirname(__file__)
- try:
- with tar_open(filename) as tf:
- for name in zonegroups:
- tf.extract(name, tmpdir)
- filepaths = [os.path.join(tmpdir, n) for n in zonegroups]
- try:
- check_call(["zic", "-d", zonedir] + filepaths)
- except OSError as e:
- _print_on_nosuchfile(e)
- raise
- # write metadata file
- with open(os.path.join(zonedir, METADATA_FN), 'w') as f:
- json.dump(metadata, f, indent=4, sort_keys=True)
- target = os.path.join(moduledir, ZONEFILENAME)
- with tar_open(target, "w:%s" % format) as tf:
- for entry in os.listdir(zonedir):
- entrypath = os.path.join(zonedir, entry)
- tf.add(entrypath, entry)
- finally:
- shutil.rmtree(tmpdir)
-
-
-def _print_on_nosuchfile(e):
- """Print helpful troubleshooting message
-
- e is an exception raised by subprocess.check_call()
-
- """
- if e.errno == 2:
- logging.error(
- "Could not find zic. Perhaps you need to install "
- "libc-bin or some other package that provides it, "
- "or it's not in your PATH?")
diff --git a/lib/dry_attr.py b/lib/dry_attr.py
deleted file mode 100644
index 329c032e31..0000000000
--- a/lib/dry_attr.py
+++ /dev/null
@@ -1,54 +0,0 @@
-'''
-Simple decorator to set attributes of target function or class in a DRY way.
-
-Usage example:
-
- # Django proposes:
- def my_calculated_field(...
- my_calculated_field.short_description = 'Field'
- my_calculated_field.admin_order_field = 'real_field'
-
- # DRY:
- @attr(short_description='Field', admin_order_field='real_field')
- def my_calculated_field(...
-
-Get it:
-
- sudo pip install attr
- from attr import attr
-
-New popular http://attrs.org used by https://pytest.org defines another "attr" package that shadows this "attr" module.
-Please use "dry_attr" alias to unshadow it:
-
- from dry_attr import attr
- from dry_attr import dry_attr
-
-attr version 0.3.1
-Copyright (C) 2013-2017 by Denis Ryzhkov
-MIT License, see http://opensource.org/licenses/MIT
-'''
-
-def attr(**names_values):
- def set_target(target):
- for name, value in names_values.items():
- setattr(target, name, value)
- return target
- return set_target
-
-dry_attr = attr
-
-def test():
-
- @attr(a=1, b=2)
- def f(): pass
-
- @attr(a=1, b=2)
- class C(object): pass
-
- assert f.a == C.a == 1
- assert f.b == C.b == 2
-
- print('OK')
-
-if __name__ == '__main__':
- test()
diff --git a/lib/easy_install.py b/lib/easy_install.py
deleted file mode 100644
index d87e984034..0000000000
--- a/lib/easy_install.py
+++ /dev/null
@@ -1,5 +0,0 @@
-"""Run the EasyInstall command"""
-
-if __name__ == '__main__':
- from setuptools.command.easy_install import main
- main()
diff --git a/lib/enum/LICENSE b/lib/enum/LICENSE
deleted file mode 100644
index 9003b8850e..0000000000
--- a/lib/enum/LICENSE
+++ /dev/null
@@ -1,32 +0,0 @@
-Copyright (c) 2013, Ethan Furman.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
- Redistributions of source code must retain the above
- copyright notice, this list of conditions and the
- following disclaimer.
-
- Redistributions in binary form must reproduce the above
- copyright notice, this list of conditions and the following
- disclaimer in the documentation and/or other materials
- provided with the distribution.
-
- Neither the name Ethan Furman nor the names of any
- contributors may be used to endorse or promote products
- derived from this software without specific prior written
- permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
diff --git a/lib/enum/README b/lib/enum/README
deleted file mode 100644
index aa2333d8df..0000000000
--- a/lib/enum/README
+++ /dev/null
@@ -1,3 +0,0 @@
-enum34 is the new Python stdlib enum module available in Python 3.4
-backported for previous versions of Python from 2.4 to 3.3.
-tested on 2.6, 2.7, and 3.3+
diff --git a/lib/enum/__init__.py b/lib/enum/__init__.py
deleted file mode 100644
index d6ffb3a40f..0000000000
--- a/lib/enum/__init__.py
+++ /dev/null
@@ -1,837 +0,0 @@
-"""Python Enumerations"""
-
-import sys as _sys
-
-__all__ = ['Enum', 'IntEnum', 'unique']
-
-version = 1, 1, 6
-
-pyver = float('%s.%s' % _sys.version_info[:2])
-
-try:
- any
-except NameError:
- def any(iterable):
- for element in iterable:
- if element:
- return True
- return False
-
-try:
- from collections import OrderedDict
-except ImportError:
- OrderedDict = None
-
-try:
- basestring
-except NameError:
- # In Python 2 basestring is the ancestor of both str and unicode
- # in Python 3 it's just str, but was missing in 3.1
- basestring = str
-
-try:
- unicode
-except NameError:
- # In Python 3 unicode no longer exists (it's just str)
- unicode = str
-
-class _RouteClassAttributeToGetattr(object):
- """Route attribute access on a class to __getattr__.
-
- This is a descriptor, used to define attributes that act differently when
- accessed through an instance and through a class. Instance access remains
- normal, but access to an attribute through a class will be routed to the
- class's __getattr__ method; this is done by raising AttributeError.
-
- """
- def __init__(self, fget=None):
- self.fget = fget
-
- def __get__(self, instance, ownerclass=None):
- if instance is None:
- raise AttributeError()
- return self.fget(instance)
-
- def __set__(self, instance, value):
- raise AttributeError("can't set attribute")
-
- def __delete__(self, instance):
- raise AttributeError("can't delete attribute")
-
-
-def _is_descriptor(obj):
- """Returns True if obj is a descriptor, False otherwise."""
- return (
- hasattr(obj, '__get__') or
- hasattr(obj, '__set__') or
- hasattr(obj, '__delete__'))
-
-
-def _is_dunder(name):
- """Returns True if a __dunder__ name, False otherwise."""
- return (name[:2] == name[-2:] == '__' and
- name[2:3] != '_' and
- name[-3:-2] != '_' and
- len(name) > 4)
-
-
-def _is_sunder(name):
- """Returns True if a _sunder_ name, False otherwise."""
- return (name[0] == name[-1] == '_' and
- name[1:2] != '_' and
- name[-2:-1] != '_' and
- len(name) > 2)
-
-
-def _make_class_unpicklable(cls):
- """Make the given class un-picklable."""
- def _break_on_call_reduce(self, protocol=None):
- raise TypeError('%r cannot be pickled' % self)
- cls.__reduce_ex__ = _break_on_call_reduce
- cls.__module__ = ''
-
-
-class _EnumDict(dict):
- """Track enum member order and ensure member names are not reused.
-
- EnumMeta will use the names found in self._member_names as the
- enumeration member names.
-
- """
- def __init__(self):
- super(_EnumDict, self).__init__()
- self._member_names = []
-
- def __setitem__(self, key, value):
- """Changes anything not dundered or not a descriptor.
-
- If a descriptor is added with the same name as an enum member, the name
- is removed from _member_names (this may leave a hole in the numerical
- sequence of values).
-
- If an enum member name is used twice, an error is raised; duplicate
- values are not checked for.
-
- Single underscore (sunder) names are reserved.
-
- Note: in 3.x __order__ is simply discarded as a not necessary piece
- leftover from 2.x
-
- """
- if pyver >= 3.0 and key in ('_order_', '__order__'):
- return
- elif key == '__order__':
- key = '_order_'
- if _is_sunder(key):
- if key != '_order_':
- raise ValueError('_names_ are reserved for future Enum use')
- elif _is_dunder(key):
- pass
- elif key in self._member_names:
- # descriptor overwriting an enum?
- raise TypeError('Attempted to reuse key: %r' % key)
- elif not _is_descriptor(value):
- if key in self:
- # enum overwriting a descriptor?
- raise TypeError('Key already defined as: %r' % self[key])
- self._member_names.append(key)
- super(_EnumDict, self).__setitem__(key, value)
-
-
-# Dummy value for Enum as EnumMeta explicity checks for it, but of course until
-# EnumMeta finishes running the first time the Enum class doesn't exist. This
-# is also why there are checks in EnumMeta like `if Enum is not None`
-Enum = None
-
-
-class EnumMeta(type):
- """Metaclass for Enum"""
- @classmethod
- def __prepare__(metacls, cls, bases):
- return _EnumDict()
-
- def __new__(metacls, cls, bases, classdict):
- # an Enum class is final once enumeration items have been defined; it
- # cannot be mixed with other types (int, float, etc.) if it has an
- # inherited __new__ unless a new __new__ is defined (or the resulting
- # class will fail).
- if type(classdict) is dict:
- original_dict = classdict
- classdict = _EnumDict()
- for k, v in original_dict.items():
- classdict[k] = v
-
- member_type, first_enum = metacls._get_mixins_(bases)
- __new__, save_new, use_args = metacls._find_new_(classdict, member_type,
- first_enum)
- # save enum items into separate mapping so they don't get baked into
- # the new class
- members = dict((k, classdict[k]) for k in classdict._member_names)
- for name in classdict._member_names:
- del classdict[name]
-
- # py2 support for definition order
- _order_ = classdict.get('_order_')
- if _order_ is None:
- if pyver < 3.0:
- try:
- _order_ = [name for (name, value) in sorted(members.items(), key=lambda item: item[1])]
- except TypeError:
- _order_ = [name for name in sorted(members.keys())]
- else:
- _order_ = classdict._member_names
- else:
- del classdict['_order_']
- if pyver < 3.0:
- _order_ = _order_.replace(',', ' ').split()
- aliases = [name for name in members if name not in _order_]
- _order_ += aliases
-
- # check for illegal enum names (any others?)
- invalid_names = set(members) & set(['mro'])
- if invalid_names:
- raise ValueError('Invalid enum member name(s): %s' % (
- ', '.join(invalid_names), ))
-
- # save attributes from super classes so we know if we can take
- # the shortcut of storing members in the class dict
- base_attributes = set([a for b in bases for a in b.__dict__])
- # create our new Enum type
- enum_class = super(EnumMeta, metacls).__new__(metacls, cls, bases, classdict)
- enum_class._member_names_ = [] # names in random order
- if OrderedDict is not None:
- enum_class._member_map_ = OrderedDict()
- else:
- enum_class._member_map_ = {} # name->value map
- enum_class._member_type_ = member_type
-
- # Reverse value->name map for hashable values.
- enum_class._value2member_map_ = {}
-
- # instantiate them, checking for duplicates as we go
- # we instantiate first instead of checking for duplicates first in case
- # a custom __new__ is doing something funky with the values -- such as
- # auto-numbering ;)
- if __new__ is None:
- __new__ = enum_class.__new__
- for member_name in _order_:
- value = members[member_name]
- if not isinstance(value, tuple):
- args = (value, )
- else:
- args = value
- if member_type is tuple: # special case for tuple enums
- args = (args, ) # wrap it one more time
- if not use_args or not args:
- enum_member = __new__(enum_class)
- if not hasattr(enum_member, '_value_'):
- enum_member._value_ = value
- else:
- enum_member = __new__(enum_class, *args)
- if not hasattr(enum_member, '_value_'):
- enum_member._value_ = member_type(*args)
- value = enum_member._value_
- enum_member._name_ = member_name
- enum_member.__objclass__ = enum_class
- enum_member.__init__(*args)
- # If another member with the same value was already defined, the
- # new member becomes an alias to the existing one.
- for name, canonical_member in enum_class._member_map_.items():
- if canonical_member.value == enum_member._value_:
- enum_member = canonical_member
- break
- else:
- # Aliases don't appear in member names (only in __members__).
- enum_class._member_names_.append(member_name)
- # performance boost for any member that would not shadow
- # a DynamicClassAttribute (aka _RouteClassAttributeToGetattr)
- if member_name not in base_attributes:
- setattr(enum_class, member_name, enum_member)
- # now add to _member_map_
- enum_class._member_map_[member_name] = enum_member
- try:
- # This may fail if value is not hashable. We can't add the value
- # to the map, and by-value lookups for this value will be
- # linear.
- enum_class._value2member_map_[value] = enum_member
- except TypeError:
- pass
-
-
- # If a custom type is mixed into the Enum, and it does not know how
- # to pickle itself, pickle.dumps will succeed but pickle.loads will
- # fail. Rather than have the error show up later and possibly far
- # from the source, sabotage the pickle protocol for this class so
- # that pickle.dumps also fails.
- #
- # However, if the new class implements its own __reduce_ex__, do not
- # sabotage -- it's on them to make sure it works correctly. We use
- # __reduce_ex__ instead of any of the others as it is preferred by
- # pickle over __reduce__, and it handles all pickle protocols.
- unpicklable = False
- if '__reduce_ex__' not in classdict:
- if member_type is not object:
- methods = ('__getnewargs_ex__', '__getnewargs__',
- '__reduce_ex__', '__reduce__')
- if not any(m in member_type.__dict__ for m in methods):
- _make_class_unpicklable(enum_class)
- unpicklable = True
-
-
- # double check that repr and friends are not the mixin's or various
- # things break (such as pickle)
- for name in ('__repr__', '__str__', '__format__', '__reduce_ex__'):
- class_method = getattr(enum_class, name)
- obj_method = getattr(member_type, name, None)
- enum_method = getattr(first_enum, name, None)
- if name not in classdict and class_method is not enum_method:
- if name == '__reduce_ex__' and unpicklable:
- continue
- setattr(enum_class, name, enum_method)
-
- # method resolution and int's are not playing nice
- # Python's less than 2.6 use __cmp__
-
- if pyver < 2.6:
-
- if issubclass(enum_class, int):
- setattr(enum_class, '__cmp__', getattr(int, '__cmp__'))
-
- elif pyver < 3.0:
-
- if issubclass(enum_class, int):
- for method in (
- '__le__',
- '__lt__',
- '__gt__',
- '__ge__',
- '__eq__',
- '__ne__',
- '__hash__',
- ):
- setattr(enum_class, method, getattr(int, method))
-
- # replace any other __new__ with our own (as long as Enum is not None,
- # anyway) -- again, this is to support pickle
- if Enum is not None:
- # if the user defined their own __new__, save it before it gets
- # clobbered in case they subclass later
- if save_new:
- setattr(enum_class, '__member_new__', enum_class.__dict__['__new__'])
- setattr(enum_class, '__new__', Enum.__dict__['__new__'])
- return enum_class
-
- def __bool__(cls):
- """
- classes/types should always be True.
- """
- return True
-
- def __call__(cls, value, names=None, module=None, type=None, start=1):
- """Either returns an existing member, or creates a new enum class.
-
- This method is used both when an enum class is given a value to match
- to an enumeration member (i.e. Color(3)) and for the functional API
- (i.e. Color = Enum('Color', names='red green blue')).
-
- When used for the functional API: `module`, if set, will be stored in
- the new class' __module__ attribute; `type`, if set, will be mixed in
- as the first base class.
-
- Note: if `module` is not set this routine will attempt to discover the
- calling module by walking the frame stack; if this is unsuccessful
- the resulting class will not be pickleable.
-
- """
- if names is None: # simple value lookup
- return cls.__new__(cls, value)
- # otherwise, functional API: we're creating a new Enum type
- return cls._create_(value, names, module=module, type=type, start=start)
-
- def __contains__(cls, member):
- return isinstance(member, cls) and member.name in cls._member_map_
-
- def __delattr__(cls, attr):
- # nicer error message when someone tries to delete an attribute
- # (see issue19025).
- if attr in cls._member_map_:
- raise AttributeError(
- "%s: cannot delete Enum member." % cls.__name__)
- super(EnumMeta, cls).__delattr__(attr)
-
- def __dir__(self):
- return (['__class__', '__doc__', '__members__', '__module__'] +
- self._member_names_)
-
- @property
- def __members__(cls):
- """Returns a mapping of member name->value.
-
- This mapping lists all enum members, including aliases. Note that this
- is a copy of the internal mapping.
-
- """
- return cls._member_map_.copy()
-
- def __getattr__(cls, name):
- """Return the enum member matching `name`
-
- We use __getattr__ instead of descriptors or inserting into the enum
- class' __dict__ in order to support `name` and `value` being both
- properties for enum members (which live in the class' __dict__) and
- enum members themselves.
-
- """
- if _is_dunder(name):
- raise AttributeError(name)
- try:
- return cls._member_map_[name]
- except KeyError:
- raise AttributeError(name)
-
- def __getitem__(cls, name):
- return cls._member_map_[name]
-
- def __iter__(cls):
- return (cls._member_map_[name] for name in cls._member_names_)
-
- def __reversed__(cls):
- return (cls._member_map_[name] for name in reversed(cls._member_names_))
-
- def __len__(cls):
- return len(cls._member_names_)
-
- __nonzero__ = __bool__
-
- def __repr__(cls):
- return "" % cls.__name__
-
- def __setattr__(cls, name, value):
- """Block attempts to reassign Enum members.
-
- A simple assignment to the class namespace only changes one of the
- several possible ways to get an Enum member from the Enum class,
- resulting in an inconsistent Enumeration.
-
- """
- member_map = cls.__dict__.get('_member_map_', {})
- if name in member_map:
- raise AttributeError('Cannot reassign members.')
- super(EnumMeta, cls).__setattr__(name, value)
-
- def _create_(cls, class_name, names=None, module=None, type=None, start=1):
- """Convenience method to create a new Enum class.
-
- `names` can be:
-
- * A string containing member names, separated either with spaces or
- commas. Values are auto-numbered from 1.
- * An iterable of member names. Values are auto-numbered from 1.
- * An iterable of (member name, value) pairs.
- * A mapping of member name -> value.
-
- """
- if pyver < 3.0:
- # if class_name is unicode, attempt a conversion to ASCII
- if isinstance(class_name, unicode):
- try:
- class_name = class_name.encode('ascii')
- except UnicodeEncodeError:
- raise TypeError('%r is not representable in ASCII' % class_name)
- metacls = cls.__class__
- if type is None:
- bases = (cls, )
- else:
- bases = (type, cls)
- classdict = metacls.__prepare__(class_name, bases)
- _order_ = []
-
- # special processing needed for names?
- if isinstance(names, basestring):
- names = names.replace(',', ' ').split()
- if isinstance(names, (tuple, list)) and isinstance(names[0], basestring):
- names = [(e, i+start) for (i, e) in enumerate(names)]
-
- # Here, names is either an iterable of (name, value) or a mapping.
- item = None # in case names is empty
- for item in names:
- if isinstance(item, basestring):
- member_name, member_value = item, names[item]
- else:
- member_name, member_value = item
- classdict[member_name] = member_value
- _order_.append(member_name)
- # only set _order_ in classdict if name/value was not from a mapping
- if not isinstance(item, basestring):
- classdict['_order_'] = ' '.join(_order_)
- enum_class = metacls.__new__(metacls, class_name, bases, classdict)
-
- # TODO: replace the frame hack if a blessed way to know the calling
- # module is ever developed
- if module is None:
- try:
- module = _sys._getframe(2).f_globals['__name__']
- except (AttributeError, ValueError):
- pass
- if module is None:
- _make_class_unpicklable(enum_class)
- else:
- enum_class.__module__ = module
-
- return enum_class
-
- @staticmethod
- def _get_mixins_(bases):
- """Returns the type for creating enum members, and the first inherited
- enum class.
-
- bases: the tuple of bases that was given to __new__
-
- """
- if not bases or Enum is None:
- return object, Enum
-
-
- # double check that we are not subclassing a class with existing
- # enumeration members; while we're at it, see if any other data
- # type has been mixed in so we can use the correct __new__
- member_type = first_enum = None
- for base in bases:
- if (base is not Enum and
- issubclass(base, Enum) and
- base._member_names_):
- raise TypeError("Cannot extend enumerations")
- # base is now the last base in bases
- if not issubclass(base, Enum):
- raise TypeError("new enumerations must be created as "
- "`ClassName([mixin_type,] enum_type)`")
-
- # get correct mix-in type (either mix-in type of Enum subclass, or
- # first base if last base is Enum)
- if not issubclass(bases[0], Enum):
- member_type = bases[0] # first data type
- first_enum = bases[-1] # enum type
- else:
- for base in bases[0].__mro__:
- # most common: (IntEnum, int, Enum, object)
- # possible: (, ,
- # , ,
- # )
- if issubclass(base, Enum):
- if first_enum is None:
- first_enum = base
- else:
- if member_type is None:
- member_type = base
-
- return member_type, first_enum
-
- if pyver < 3.0:
- @staticmethod
- def _find_new_(classdict, member_type, first_enum):
- """Returns the __new__ to be used for creating the enum members.
-
- classdict: the class dictionary given to __new__
- member_type: the data type whose __new__ will be used by default
- first_enum: enumeration to check for an overriding __new__
-
- """
- # now find the correct __new__, checking to see of one was defined
- # by the user; also check earlier enum classes in case a __new__ was
- # saved as __member_new__
- __new__ = classdict.get('__new__', None)
- if __new__:
- return None, True, True # __new__, save_new, use_args
-
- N__new__ = getattr(None, '__new__')
- O__new__ = getattr(object, '__new__')
- if Enum is None:
- E__new__ = N__new__
- else:
- E__new__ = Enum.__dict__['__new__']
- # check all possibles for __member_new__ before falling back to
- # __new__
- for method in ('__member_new__', '__new__'):
- for possible in (member_type, first_enum):
- try:
- target = possible.__dict__[method]
- except (AttributeError, KeyError):
- target = getattr(possible, method, None)
- if target not in [
- None,
- N__new__,
- O__new__,
- E__new__,
- ]:
- if method == '__member_new__':
- classdict['__new__'] = target
- return None, False, True
- if isinstance(target, staticmethod):
- target = target.__get__(member_type)
- __new__ = target
- break
- if __new__ is not None:
- break
- else:
- __new__ = object.__new__
-
- # if a non-object.__new__ is used then whatever value/tuple was
- # assigned to the enum member name will be passed to __new__ and to the
- # new enum member's __init__
- if __new__ is object.__new__:
- use_args = False
- else:
- use_args = True
-
- return __new__, False, use_args
- else:
- @staticmethod
- def _find_new_(classdict, member_type, first_enum):
- """Returns the __new__ to be used for creating the enum members.
-
- classdict: the class dictionary given to __new__
- member_type: the data type whose __new__ will be used by default
- first_enum: enumeration to check for an overriding __new__
-
- """
- # now find the correct __new__, checking to see of one was defined
- # by the user; also check earlier enum classes in case a __new__ was
- # saved as __member_new__
- __new__ = classdict.get('__new__', None)
-
- # should __new__ be saved as __member_new__ later?
- save_new = __new__ is not None
-
- if __new__ is None:
- # check all possibles for __member_new__ before falling back to
- # __new__
- for method in ('__member_new__', '__new__'):
- for possible in (member_type, first_enum):
- target = getattr(possible, method, None)
- if target not in (
- None,
- None.__new__,
- object.__new__,
- Enum.__new__,
- ):
- __new__ = target
- break
- if __new__ is not None:
- break
- else:
- __new__ = object.__new__
-
- # if a non-object.__new__ is used then whatever value/tuple was
- # assigned to the enum member name will be passed to __new__ and to the
- # new enum member's __init__
- if __new__ is object.__new__:
- use_args = False
- else:
- use_args = True
-
- return __new__, save_new, use_args
-
-
-########################################################
-# In order to support Python 2 and 3 with a single
-# codebase we have to create the Enum methods separately
-# and then use the `type(name, bases, dict)` method to
-# create the class.
-########################################################
-temp_enum_dict = {}
-temp_enum_dict['__doc__'] = "Generic enumeration.\n\n Derive from this class to define new enumerations.\n\n"
-
-def __new__(cls, value):
- # all enum instances are actually created during class construction
- # without calling this method; this method is called by the metaclass'
- # __call__ (i.e. Color(3) ), and by pickle
- if type(value) is cls:
- # For lookups like Color(Color.red)
- value = value.value
- #return value
- # by-value search for a matching enum member
- # see if it's in the reverse mapping (for hashable values)
- try:
- if value in cls._value2member_map_:
- return cls._value2member_map_[value]
- except TypeError:
- # not there, now do long search -- O(n) behavior
- for member in cls._member_map_.values():
- if member.value == value:
- return member
- raise ValueError("%s is not a valid %s" % (value, cls.__name__))
-temp_enum_dict['__new__'] = __new__
-del __new__
-
-def __repr__(self):
- return "<%s.%s: %r>" % (
- self.__class__.__name__, self._name_, self._value_)
-temp_enum_dict['__repr__'] = __repr__
-del __repr__
-
-def __str__(self):
- return "%s.%s" % (self.__class__.__name__, self._name_)
-temp_enum_dict['__str__'] = __str__
-del __str__
-
-if pyver >= 3.0:
- def __dir__(self):
- added_behavior = [
- m
- for cls in self.__class__.mro()
- for m in cls.__dict__
- if m[0] != '_' and m not in self._member_map_
- ]
- return (['__class__', '__doc__', '__module__', ] + added_behavior)
- temp_enum_dict['__dir__'] = __dir__
- del __dir__
-
-def __format__(self, format_spec):
- # mixed-in Enums should use the mixed-in type's __format__, otherwise
- # we can get strange results with the Enum name showing up instead of
- # the value
-
- # pure Enum branch
- if self._member_type_ is object:
- cls = str
- val = str(self)
- # mix-in branch
- else:
- cls = self._member_type_
- val = self.value
- return cls.__format__(val, format_spec)
-temp_enum_dict['__format__'] = __format__
-del __format__
-
-
-####################################
-# Python's less than 2.6 use __cmp__
-
-if pyver < 2.6:
-
- def __cmp__(self, other):
- if type(other) is self.__class__:
- if self is other:
- return 0
- return -1
- return NotImplemented
- raise TypeError("unorderable types: %s() and %s()" % (self.__class__.__name__, other.__class__.__name__))
- temp_enum_dict['__cmp__'] = __cmp__
- del __cmp__
-
-else:
-
- def __le__(self, other):
- raise TypeError("unorderable types: %s() <= %s()" % (self.__class__.__name__, other.__class__.__name__))
- temp_enum_dict['__le__'] = __le__
- del __le__
-
- def __lt__(self, other):
- raise TypeError("unorderable types: %s() < %s()" % (self.__class__.__name__, other.__class__.__name__))
- temp_enum_dict['__lt__'] = __lt__
- del __lt__
-
- def __ge__(self, other):
- raise TypeError("unorderable types: %s() >= %s()" % (self.__class__.__name__, other.__class__.__name__))
- temp_enum_dict['__ge__'] = __ge__
- del __ge__
-
- def __gt__(self, other):
- raise TypeError("unorderable types: %s() > %s()" % (self.__class__.__name__, other.__class__.__name__))
- temp_enum_dict['__gt__'] = __gt__
- del __gt__
-
-
-def __eq__(self, other):
- if type(other) is self.__class__:
- return self is other
- return NotImplemented
-temp_enum_dict['__eq__'] = __eq__
-del __eq__
-
-def __ne__(self, other):
- if type(other) is self.__class__:
- return self is not other
- return NotImplemented
-temp_enum_dict['__ne__'] = __ne__
-del __ne__
-
-def __hash__(self):
- return hash(self._name_)
-temp_enum_dict['__hash__'] = __hash__
-del __hash__
-
-def __reduce_ex__(self, proto):
- return self.__class__, (self._value_, )
-temp_enum_dict['__reduce_ex__'] = __reduce_ex__
-del __reduce_ex__
-
-# _RouteClassAttributeToGetattr is used to provide access to the `name`
-# and `value` properties of enum members while keeping some measure of
-# protection from modification, while still allowing for an enumeration
-# to have members named `name` and `value`. This works because enumeration
-# members are not set directly on the enum class -- __getattr__ is
-# used to look them up.
-
-@_RouteClassAttributeToGetattr
-def name(self):
- return self._name_
-temp_enum_dict['name'] = name
-del name
-
-@_RouteClassAttributeToGetattr
-def value(self):
- return self._value_
-temp_enum_dict['value'] = value
-del value
-
-@classmethod
-def _convert(cls, name, module, filter, source=None):
- """
- Create a new Enum subclass that replaces a collection of global constants
- """
- # convert all constants from source (or module) that pass filter() to
- # a new Enum called name, and export the enum and its members back to
- # module;
- # also, replace the __reduce_ex__ method so unpickling works in
- # previous Python versions
- module_globals = vars(_sys.modules[module])
- if source:
- source = vars(source)
- else:
- source = module_globals
- members = dict((name, value) for name, value in source.items() if filter(name))
- cls = cls(name, members, module=module)
- cls.__reduce_ex__ = _reduce_ex_by_name
- module_globals.update(cls.__members__)
- module_globals[name] = cls
- return cls
-temp_enum_dict['_convert'] = _convert
-del _convert
-
-Enum = EnumMeta('Enum', (object, ), temp_enum_dict)
-del temp_enum_dict
-
-# Enum has now been created
-###########################
-
-class IntEnum(int, Enum):
- """Enum where members are also (and must be) ints"""
-
-def _reduce_ex_by_name(self, proto):
- return self.name
-
-def unique(enumeration):
- """Class decorator that ensures only unique members exist in an enumeration."""
- duplicates = []
- for name, member in enumeration.__members__.items():
- if name != member.name:
- duplicates.append((name, member.name))
- if duplicates:
- duplicate_names = ', '.join(
- ["%s -> %s" % (alias, name) for (alias, name) in duplicates]
- )
- raise ValueError('duplicate names found in %r: %s' %
- (enumeration, duplicate_names)
- )
- return enumeration
diff --git a/lib/enum34-1.1.6.dist-info/DESCRIPTION.rst b/lib/enum34-1.1.6.dist-info/DESCRIPTION.rst
deleted file mode 100644
index ff89b8dbe1..0000000000
--- a/lib/enum34-1.1.6.dist-info/DESCRIPTION.rst
+++ /dev/null
@@ -1,41 +0,0 @@
-enum --- support for enumerations
-========================================
-
-An enumeration is a set of symbolic names (members) bound to unique, constant
-values. Within an enumeration, the members can be compared by identity, and
-the enumeration itself can be iterated over.
-
- from enum import Enum
-
- class Fruit(Enum):
- apple = 1
- banana = 2
- orange = 3
-
- list(Fruit)
- # [, , ]
-
- len(Fruit)
- # 3
-
- Fruit.banana
- #
-
- Fruit['banana']
- #
-
- Fruit(2)
- #
-
- Fruit.banana is Fruit['banana'] is Fruit(2)
- # True
-
- Fruit.banana.name
- # 'banana'
-
- Fruit.banana.value
- # 2
-
-Repository and Issue Tracker at https://bitbucket.org/stoneleaf/enum34.
-
-
diff --git a/lib/enum34-1.1.6.dist-info/INSTALLER b/lib/enum34-1.1.6.dist-info/INSTALLER
deleted file mode 100644
index a1b589e38a..0000000000
--- a/lib/enum34-1.1.6.dist-info/INSTALLER
+++ /dev/null
@@ -1 +0,0 @@
-pip
diff --git a/lib/enum34-1.1.6.dist-info/METADATA b/lib/enum34-1.1.6.dist-info/METADATA
deleted file mode 100644
index 49ee3e58a3..0000000000
--- a/lib/enum34-1.1.6.dist-info/METADATA
+++ /dev/null
@@ -1,64 +0,0 @@
-Metadata-Version: 2.0
-Name: enum34
-Version: 1.1.6
-Summary: Python 3.4 Enum backported to 3.3, 3.2, 3.1, 2.7, 2.6, 2.5, and 2.4
-Home-page: https://bitbucket.org/stoneleaf/enum34
-Author: Ethan Furman
-Author-email: ethan@stoneleaf.us
-License: BSD License
-Platform: UNKNOWN
-Classifier: Development Status :: 5 - Production/Stable
-Classifier: Intended Audience :: Developers
-Classifier: License :: OSI Approved :: BSD License
-Classifier: Programming Language :: Python
-Classifier: Topic :: Software Development
-Classifier: Programming Language :: Python :: 2.4
-Classifier: Programming Language :: Python :: 2.5
-Classifier: Programming Language :: Python :: 2.6
-Classifier: Programming Language :: Python :: 2.7
-Classifier: Programming Language :: Python :: 3.3
-Classifier: Programming Language :: Python :: 3.4
-Classifier: Programming Language :: Python :: 3.5
-Provides: enum
-
-enum --- support for enumerations
-========================================
-
-An enumeration is a set of symbolic names (members) bound to unique, constant
-values. Within an enumeration, the members can be compared by identity, and
-the enumeration itself can be iterated over.
-
- from enum import Enum
-
- class Fruit(Enum):
- apple = 1
- banana = 2
- orange = 3
-
- list(Fruit)
- # [, , ]
-
- len(Fruit)
- # 3
-
- Fruit.banana
- #
-
- Fruit['banana']
- #
-
- Fruit(2)
- #
-
- Fruit.banana is Fruit['banana'] is Fruit(2)
- # True
-
- Fruit.banana.name
- # 'banana'
-
- Fruit.banana.value
- # 2
-
-Repository and Issue Tracker at https://bitbucket.org/stoneleaf/enum34.
-
-
diff --git a/lib/enum34-1.1.6.dist-info/RECORD b/lib/enum34-1.1.6.dist-info/RECORD
deleted file mode 100644
index e6f6ccb1ac..0000000000
--- a/lib/enum34-1.1.6.dist-info/RECORD
+++ /dev/null
@@ -1,11 +0,0 @@
-enum/LICENSE,sha256=iOxqbI6vo7l1fnRXg5OL7z9eTV48drHbV2qjq1IOXh0,1508
-enum/README,sha256=fyStyG6c3wxR2bHyZhLPNtc_ASDxGw-l8G6LzVxmkig,157
-enum/__init__.py,sha256=JSdYSXeZ1QSp67gjfI24quiePPtrlNXhXvm-pav8nuQ,31054
-enum/__init__.pyc,,
-enum34-1.1.6.dist-info/DESCRIPTION.rst,sha256=d1LpTdx9M07jJN0AmT-p6AAwLrX2guxOfmetcp_jljY,817
-enum34-1.1.6.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
-enum34-1.1.6.dist-info/METADATA,sha256=p3ABlAtPlmU7-55UMHiwAd8o-wwS4EfZMsQWNoH1klg,1689
-enum34-1.1.6.dist-info/RECORD,,
-enum34-1.1.6.dist-info/WHEEL,sha256=bee59qcPjkyXfMaxNWjl2CGotqfumWx9pC1hlVLr2mM,92
-enum34-1.1.6.dist-info/metadata.json,sha256=1su5Y0gBxpWTAdey-06LrBSQzh-B1vAixlBxx4DJMOI,972
-enum34-1.1.6.dist-info/top_level.txt,sha256=jayVFfXRwPLUdgRN9GzacnFrOtEKQaAScXIY8mwgP8g,5
diff --git a/lib/enum34-1.1.6.dist-info/WHEEL b/lib/enum34-1.1.6.dist-info/WHEEL
deleted file mode 100644
index 511d954ae2..0000000000
--- a/lib/enum34-1.1.6.dist-info/WHEEL
+++ /dev/null
@@ -1,5 +0,0 @@
-Wheel-Version: 1.0
-Generator: bdist_wheel (0.29.0)
-Root-Is-Purelib: true
-Tag: py2-none-any
-
diff --git a/lib/enum34-1.1.6.dist-info/metadata.json b/lib/enum34-1.1.6.dist-info/metadata.json
deleted file mode 100644
index 6a1cc20a5c..0000000000
--- a/lib/enum34-1.1.6.dist-info/metadata.json
+++ /dev/null
@@ -1 +0,0 @@
-{"classifiers": ["Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Topic :: Software Development", "Programming Language :: Python :: 2.4", "Programming Language :: Python :: 2.5", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5"], "extensions": {"python.details": {"contacts": [{"email": "ethan@stoneleaf.us", "name": "Ethan Furman", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst"}, "project_urls": {"Home": "https://bitbucket.org/stoneleaf/enum34"}}}, "generator": "bdist_wheel (0.29.0)", "license": "BSD License", "metadata_version": "2.0", "name": "enum34", "provides": "enum", "summary": "Python 3.4 Enum backported to 3.3, 3.2, 3.1, 2.7, 2.6, 2.5, and 2.4", "version": "1.1.6"}
\ No newline at end of file
diff --git a/lib/enum34-1.1.6.dist-info/top_level.txt b/lib/enum34-1.1.6.dist-info/top_level.txt
deleted file mode 100644
index e3caefb45c..0000000000
--- a/lib/enum34-1.1.6.dist-info/top_level.txt
+++ /dev/null
@@ -1 +0,0 @@
-enum
diff --git a/lib/flask/__init__.py b/lib/flask/__init__.py
deleted file mode 100644
index ded1982240..0000000000
--- a/lib/flask/__init__.py
+++ /dev/null
@@ -1,49 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- flask
- ~~~~~
-
- A microframework based on Werkzeug. It's extensively documented
- and follows best practice patterns.
-
- :copyright: © 2010 by the Pallets team.
- :license: BSD, see LICENSE for more details.
-"""
-
-__version__ = '1.0.2'
-
-# utilities we import from Werkzeug and Jinja2 that are unused
-# in the module but are exported as public interface.
-from werkzeug.exceptions import abort
-from werkzeug.utils import redirect
-from jinja2 import Markup, escape
-
-from .app import Flask, Request, Response
-from .config import Config
-from .helpers import url_for, flash, send_file, send_from_directory, \
- get_flashed_messages, get_template_attribute, make_response, safe_join, \
- stream_with_context
-from .globals import current_app, g, request, session, _request_ctx_stack, \
- _app_ctx_stack
-from .ctx import has_request_context, has_app_context, \
- after_this_request, copy_current_request_context
-from .blueprints import Blueprint
-from .templating import render_template, render_template_string
-
-# the signals
-from .signals import signals_available, template_rendered, request_started, \
- request_finished, got_request_exception, request_tearing_down, \
- appcontext_tearing_down, appcontext_pushed, \
- appcontext_popped, message_flashed, before_render_template
-
-# We're not exposing the actual json module but a convenient wrapper around
-# it.
-from . import json
-
-# This was the only thing that Flask used to export at one point and it had
-# a more generic name.
-jsonify = json.jsonify
-
-# backwards compat, goes away in 1.0
-from .sessions import SecureCookieSession as Session
-json_available = True
diff --git a/lib/flask/__main__.py b/lib/flask/__main__.py
deleted file mode 100644
index 4aee654374..0000000000
--- a/lib/flask/__main__.py
+++ /dev/null
@@ -1,14 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- flask.__main__
- ~~~~~~~~~~~~~~
-
- Alias for flask.run for the command line.
-
- :copyright: © 2010 by the Pallets team.
- :license: BSD, see LICENSE for more details.
-"""
-
-if __name__ == '__main__':
- from .cli import main
- main(as_module=True)
diff --git a/lib/flask/_compat.py b/lib/flask/_compat.py
deleted file mode 100644
index a3b5b9c1c9..0000000000
--- a/lib/flask/_compat.py
+++ /dev/null
@@ -1,99 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- flask._compat
- ~~~~~~~~~~~~~
-
- Some py2/py3 compatibility support based on a stripped down
- version of six so we don't have to depend on a specific version
- of it.
-
- :copyright: © 2010 by the Pallets team.
- :license: BSD, see LICENSE for more details.
-"""
-
-import sys
-
-PY2 = sys.version_info[0] == 2
-_identity = lambda x: x
-
-
-if not PY2:
- text_type = str
- string_types = (str,)
- integer_types = (int,)
-
- iterkeys = lambda d: iter(d.keys())
- itervalues = lambda d: iter(d.values())
- iteritems = lambda d: iter(d.items())
-
- from inspect import getfullargspec as getargspec
- from io import StringIO
-
- def reraise(tp, value, tb=None):
- if value.__traceback__ is not tb:
- raise value.with_traceback(tb)
- raise value
-
- implements_to_string = _identity
-
-else:
- text_type = unicode
- string_types = (str, unicode)
- integer_types = (int, long)
-
- iterkeys = lambda d: d.iterkeys()
- itervalues = lambda d: d.itervalues()
- iteritems = lambda d: d.iteritems()
-
- from inspect import getargspec
- from cStringIO import StringIO
-
- exec('def reraise(tp, value, tb=None):\n raise tp, value, tb')
-
- def implements_to_string(cls):
- cls.__unicode__ = cls.__str__
- cls.__str__ = lambda x: x.__unicode__().encode('utf-8')
- return cls
-
-
-def with_metaclass(meta, *bases):
- """Create a base class with a metaclass."""
- # This requires a bit of explanation: the basic idea is to make a
- # dummy metaclass for one level of class instantiation that replaces
- # itself with the actual metaclass.
- class metaclass(type):
- def __new__(cls, name, this_bases, d):
- return meta(name, bases, d)
- return type.__new__(metaclass, 'temporary_class', (), {})
-
-
-# Certain versions of pypy have a bug where clearing the exception stack
-# breaks the __exit__ function in a very peculiar way. The second level of
-# exception blocks is necessary because pypy seems to forget to check if an
-# exception happened until the next bytecode instruction?
-#
-# Relevant PyPy bugfix commit:
-# https://bitbucket.org/pypy/pypy/commits/77ecf91c635a287e88e60d8ddb0f4e9df4003301
-# According to ronan on #pypy IRC, it is released in PyPy2 2.3 and later
-# versions.
-#
-# Ubuntu 14.04 has PyPy 2.2.1, which does exhibit this bug.
-BROKEN_PYPY_CTXMGR_EXIT = False
-if hasattr(sys, 'pypy_version_info'):
- class _Mgr(object):
- def __enter__(self):
- return self
- def __exit__(self, *args):
- if hasattr(sys, 'exc_clear'):
- # Python 3 (PyPy3) doesn't have exc_clear
- sys.exc_clear()
- try:
- try:
- with _Mgr():
- raise AssertionError()
- except:
- raise
- except TypeError:
- BROKEN_PYPY_CTXMGR_EXIT = True
- except AssertionError:
- pass
diff --git a/lib/flask/app.py b/lib/flask/app.py
deleted file mode 100644
index 87c5900348..0000000000
--- a/lib/flask/app.py
+++ /dev/null
@@ -1,2315 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- flask.app
- ~~~~~~~~~
-
- This module implements the central WSGI application object.
-
- :copyright: © 2010 by the Pallets team.
- :license: BSD, see LICENSE for more details.
-"""
-
-import os
-import sys
-import warnings
-from datetime import timedelta
-from functools import update_wrapper
-from itertools import chain
-from threading import Lock
-
-from werkzeug.datastructures import Headers, ImmutableDict
-from werkzeug.exceptions import BadRequest, BadRequestKeyError, HTTPException, \
- InternalServerError, MethodNotAllowed, default_exceptions
-from werkzeug.routing import BuildError, Map, RequestRedirect, Rule
-
-from . import cli, json
-from ._compat import integer_types, reraise, string_types, text_type
-from .config import Config, ConfigAttribute
-from .ctx import AppContext, RequestContext, _AppCtxGlobals
-from .globals import _request_ctx_stack, g, request, session
-from .helpers import (
- _PackageBoundObject,
- _endpoint_from_view_func, find_package, get_env, get_debug_flag,
- get_flashed_messages, locked_cached_property, url_for, get_load_dotenv
-)
-from .logging import create_logger
-from .sessions import SecureCookieSessionInterface
-from .signals import appcontext_tearing_down, got_request_exception, \
- request_finished, request_started, request_tearing_down
-from .templating import DispatchingJinjaLoader, Environment, \
- _default_template_ctx_processor
-from .wrappers import Request, Response
-
-# a singleton sentinel value for parameter defaults
-_sentinel = object()
-
-
-def _make_timedelta(value):
- if not isinstance(value, timedelta):
- return timedelta(seconds=value)
- return value
-
-
-def setupmethod(f):
- """Wraps a method so that it performs a check in debug mode if the
- first request was already handled.
- """
- def wrapper_func(self, *args, **kwargs):
- if self.debug and self._got_first_request:
- raise AssertionError('A setup function was called after the '
- 'first request was handled. This usually indicates a bug '
- 'in the application where a module was not imported '
- 'and decorators or other functionality was called too late.\n'
- 'To fix this make sure to import all your view modules, '
- 'database models and everything related at a central place '
- 'before the application starts serving requests.')
- return f(self, *args, **kwargs)
- return update_wrapper(wrapper_func, f)
-
-
-class Flask(_PackageBoundObject):
- """The flask object implements a WSGI application and acts as the central
- object. It is passed the name of the module or package of the
- application. Once it is created it will act as a central registry for
- the view functions, the URL rules, template configuration and much more.
-
- The name of the package is used to resolve resources from inside the
- package or the folder the module is contained in depending on if the
- package parameter resolves to an actual python package (a folder with
- an :file:`__init__.py` file inside) or a standard module (just a ``.py`` file).
-
- For more information about resource loading, see :func:`open_resource`.
-
- Usually you create a :class:`Flask` instance in your main module or
- in the :file:`__init__.py` file of your package like this::
-
- from flask import Flask
- app = Flask(__name__)
-
- .. admonition:: About the First Parameter
-
- The idea of the first parameter is to give Flask an idea of what
- belongs to your application. This name is used to find resources
- on the filesystem, can be used by extensions to improve debugging
- information and a lot more.
-
- So it's important what you provide there. If you are using a single
- module, `__name__` is always the correct value. If you however are
- using a package, it's usually recommended to hardcode the name of
- your package there.
-
- For example if your application is defined in :file:`yourapplication/app.py`
- you should create it with one of the two versions below::
-
- app = Flask('yourapplication')
- app = Flask(__name__.split('.')[0])
-
- Why is that? The application will work even with `__name__`, thanks
- to how resources are looked up. However it will make debugging more
- painful. Certain extensions can make assumptions based on the
- import name of your application. For example the Flask-SQLAlchemy
- extension will look for the code in your application that triggered
- an SQL query in debug mode. If the import name is not properly set
- up, that debugging information is lost. (For example it would only
- pick up SQL queries in `yourapplication.app` and not
- `yourapplication.views.frontend`)
-
- .. versionadded:: 0.7
- The `static_url_path`, `static_folder`, and `template_folder`
- parameters were added.
-
- .. versionadded:: 0.8
- The `instance_path` and `instance_relative_config` parameters were
- added.
-
- .. versionadded:: 0.11
- The `root_path` parameter was added.
-
- .. versionadded:: 1.0
- The ``host_matching`` and ``static_host`` parameters were added.
-
- .. versionadded:: 1.0
- The ``subdomain_matching`` parameter was added. Subdomain
- matching needs to be enabled manually now. Setting
- :data:`SERVER_NAME` does not implicitly enable it.
-
- :param import_name: the name of the application package
- :param static_url_path: can be used to specify a different path for the
- static files on the web. Defaults to the name
- of the `static_folder` folder.
- :param static_folder: the folder with static files that should be served
- at `static_url_path`. Defaults to the ``'static'``
- folder in the root path of the application.
- :param static_host: the host to use when adding the static route.
- Defaults to None. Required when using ``host_matching=True``
- with a ``static_folder`` configured.
- :param host_matching: set ``url_map.host_matching`` attribute.
- Defaults to False.
- :param subdomain_matching: consider the subdomain relative to
- :data:`SERVER_NAME` when matching routes. Defaults to False.
- :param template_folder: the folder that contains the templates that should
- be used by the application. Defaults to
- ``'templates'`` folder in the root path of the
- application.
- :param instance_path: An alternative instance path for the application.
- By default the folder ``'instance'`` next to the
- package or module is assumed to be the instance
- path.
- :param instance_relative_config: if set to ``True`` relative filenames
- for loading the config are assumed to
- be relative to the instance path instead
- of the application root.
- :param root_path: Flask by default will automatically calculate the path
- to the root of the application. In certain situations
- this cannot be achieved (for instance if the package
- is a Python 3 namespace package) and needs to be
- manually defined.
- """
-
- #: The class that is used for request objects. See :class:`~flask.Request`
- #: for more information.
- request_class = Request
-
- #: The class that is used for response objects. See
- #: :class:`~flask.Response` for more information.
- response_class = Response
-
- #: The class that is used for the Jinja environment.
- #:
- #: .. versionadded:: 0.11
- jinja_environment = Environment
-
- #: The class that is used for the :data:`~flask.g` instance.
- #:
- #: Example use cases for a custom class:
- #:
- #: 1. Store arbitrary attributes on flask.g.
- #: 2. Add a property for lazy per-request database connectors.
- #: 3. Return None instead of AttributeError on unexpected attributes.
- #: 4. Raise exception if an unexpected attr is set, a "controlled" flask.g.
- #:
- #: In Flask 0.9 this property was called `request_globals_class` but it
- #: was changed in 0.10 to :attr:`app_ctx_globals_class` because the
- #: flask.g object is now application context scoped.
- #:
- #: .. versionadded:: 0.10
- app_ctx_globals_class = _AppCtxGlobals
-
- #: The class that is used for the ``config`` attribute of this app.
- #: Defaults to :class:`~flask.Config`.
- #:
- #: Example use cases for a custom class:
- #:
- #: 1. Default values for certain config options.
- #: 2. Access to config values through attributes in addition to keys.
- #:
- #: .. versionadded:: 0.11
- config_class = Config
-
- #: The testing flag. Set this to ``True`` to enable the test mode of
- #: Flask extensions (and in the future probably also Flask itself).
- #: For example this might activate test helpers that have an
- #: additional runtime cost which should not be enabled by default.
- #:
- #: If this is enabled and PROPAGATE_EXCEPTIONS is not changed from the
- #: default it's implicitly enabled.
- #:
- #: This attribute can also be configured from the config with the
- #: ``TESTING`` configuration key. Defaults to ``False``.
- testing = ConfigAttribute('TESTING')
-
- #: If a secret key is set, cryptographic components can use this to
- #: sign cookies and other things. Set this to a complex random value
- #: when you want to use the secure cookie for instance.
- #:
- #: This attribute can also be configured from the config with the
- #: :data:`SECRET_KEY` configuration key. Defaults to ``None``.
- secret_key = ConfigAttribute('SECRET_KEY')
-
- #: The secure cookie uses this for the name of the session cookie.
- #:
- #: This attribute can also be configured from the config with the
- #: ``SESSION_COOKIE_NAME`` configuration key. Defaults to ``'session'``
- session_cookie_name = ConfigAttribute('SESSION_COOKIE_NAME')
-
- #: A :class:`~datetime.timedelta` which is used to set the expiration
- #: date of a permanent session. The default is 31 days which makes a
- #: permanent session survive for roughly one month.
- #:
- #: This attribute can also be configured from the config with the
- #: ``PERMANENT_SESSION_LIFETIME`` configuration key. Defaults to
- #: ``timedelta(days=31)``
- permanent_session_lifetime = ConfigAttribute('PERMANENT_SESSION_LIFETIME',
- get_converter=_make_timedelta)
-
- #: A :class:`~datetime.timedelta` which is used as default cache_timeout
- #: for the :func:`send_file` functions. The default is 12 hours.
- #:
- #: This attribute can also be configured from the config with the
- #: ``SEND_FILE_MAX_AGE_DEFAULT`` configuration key. This configuration
- #: variable can also be set with an integer value used as seconds.
- #: Defaults to ``timedelta(hours=12)``
- send_file_max_age_default = ConfigAttribute('SEND_FILE_MAX_AGE_DEFAULT',
- get_converter=_make_timedelta)
-
- #: Enable this if you want to use the X-Sendfile feature. Keep in
- #: mind that the server has to support this. This only affects files
- #: sent with the :func:`send_file` method.
- #:
- #: .. versionadded:: 0.2
- #:
- #: This attribute can also be configured from the config with the
- #: ``USE_X_SENDFILE`` configuration key. Defaults to ``False``.
- use_x_sendfile = ConfigAttribute('USE_X_SENDFILE')
-
- #: The JSON encoder class to use. Defaults to :class:`~flask.json.JSONEncoder`.
- #:
- #: .. versionadded:: 0.10
- json_encoder = json.JSONEncoder
-
- #: The JSON decoder class to use. Defaults to :class:`~flask.json.JSONDecoder`.
- #:
- #: .. versionadded:: 0.10
- json_decoder = json.JSONDecoder
-
- #: Options that are passed directly to the Jinja2 environment.
- jinja_options = ImmutableDict(
- extensions=['jinja2.ext.autoescape', 'jinja2.ext.with_']
- )
-
- #: Default configuration parameters.
- default_config = ImmutableDict({
- 'ENV': None,
- 'DEBUG': None,
- 'TESTING': False,
- 'PROPAGATE_EXCEPTIONS': None,
- 'PRESERVE_CONTEXT_ON_EXCEPTION': None,
- 'SECRET_KEY': None,
- 'PERMANENT_SESSION_LIFETIME': timedelta(days=31),
- 'USE_X_SENDFILE': False,
- 'SERVER_NAME': None,
- 'APPLICATION_ROOT': '/',
- 'SESSION_COOKIE_NAME': 'session',
- 'SESSION_COOKIE_DOMAIN': None,
- 'SESSION_COOKIE_PATH': None,
- 'SESSION_COOKIE_HTTPONLY': True,
- 'SESSION_COOKIE_SECURE': False,
- 'SESSION_COOKIE_SAMESITE': None,
- 'SESSION_REFRESH_EACH_REQUEST': True,
- 'MAX_CONTENT_LENGTH': None,
- 'SEND_FILE_MAX_AGE_DEFAULT': timedelta(hours=12),
- 'TRAP_BAD_REQUEST_ERRORS': None,
- 'TRAP_HTTP_EXCEPTIONS': False,
- 'EXPLAIN_TEMPLATE_LOADING': False,
- 'PREFERRED_URL_SCHEME': 'http',
- 'JSON_AS_ASCII': True,
- 'JSON_SORT_KEYS': True,
- 'JSONIFY_PRETTYPRINT_REGULAR': False,
- 'JSONIFY_MIMETYPE': 'application/json',
- 'TEMPLATES_AUTO_RELOAD': None,
- 'MAX_COOKIE_SIZE': 4093,
- })
-
- #: The rule object to use for URL rules created. This is used by
- #: :meth:`add_url_rule`. Defaults to :class:`werkzeug.routing.Rule`.
- #:
- #: .. versionadded:: 0.7
- url_rule_class = Rule
-
- #: the test client that is used with when `test_client` is used.
- #:
- #: .. versionadded:: 0.7
- test_client_class = None
-
- #: The :class:`~click.testing.CliRunner` subclass, by default
- #: :class:`~flask.testing.FlaskCliRunner` that is used by
- #: :meth:`test_cli_runner`. Its ``__init__`` method should take a
- #: Flask app object as the first argument.
- #:
- #: .. versionadded:: 1.0
- test_cli_runner_class = None
-
- #: the session interface to use. By default an instance of
- #: :class:`~flask.sessions.SecureCookieSessionInterface` is used here.
- #:
- #: .. versionadded:: 0.8
- session_interface = SecureCookieSessionInterface()
-
- # TODO remove the next three attrs when Sphinx :inherited-members: works
- # https://github.com/sphinx-doc/sphinx/issues/741
-
- #: The name of the package or module that this app belongs to. Do not
- #: change this once it is set by the constructor.
- import_name = None
-
- #: Location of the template files to be added to the template lookup.
- #: ``None`` if templates should not be added.
- template_folder = None
-
- #: Absolute path to the package on the filesystem. Used to look up
- #: resources contained in the package.
- root_path = None
-
- def __init__(
- self,
- import_name,
- static_url_path=None,
- static_folder='static',
- static_host=None,
- host_matching=False,
- subdomain_matching=False,
- template_folder='templates',
- instance_path=None,
- instance_relative_config=False,
- root_path=None
- ):
- _PackageBoundObject.__init__(
- self,
- import_name,
- template_folder=template_folder,
- root_path=root_path
- )
-
- if static_url_path is not None:
- self.static_url_path = static_url_path
-
- if static_folder is not None:
- self.static_folder = static_folder
-
- if instance_path is None:
- instance_path = self.auto_find_instance_path()
- elif not os.path.isabs(instance_path):
- raise ValueError(
- 'If an instance path is provided it must be absolute.'
- ' A relative path was given instead.'
- )
-
- #: Holds the path to the instance folder.
- #:
- #: .. versionadded:: 0.8
- self.instance_path = instance_path
-
- #: The configuration dictionary as :class:`Config`. This behaves
- #: exactly like a regular dictionary but supports additional methods
- #: to load a config from files.
- self.config = self.make_config(instance_relative_config)
-
- #: A dictionary of all view functions registered. The keys will
- #: be function names which are also used to generate URLs and
- #: the values are the function objects themselves.
- #: To register a view function, use the :meth:`route` decorator.
- self.view_functions = {}
-
- #: A dictionary of all registered error handlers. The key is ``None``
- #: for error handlers active on the application, otherwise the key is
- #: the name of the blueprint. Each key points to another dictionary
- #: where the key is the status code of the http exception. The
- #: special key ``None`` points to a list of tuples where the first item
- #: is the class for the instance check and the second the error handler
- #: function.
- #:
- #: To register an error handler, use the :meth:`errorhandler`
- #: decorator.
- self.error_handler_spec = {}
-
- #: A list of functions that are called when :meth:`url_for` raises a
- #: :exc:`~werkzeug.routing.BuildError`. Each function registered here
- #: is called with `error`, `endpoint` and `values`. If a function
- #: returns ``None`` or raises a :exc:`BuildError` the next function is
- #: tried.
- #:
- #: .. versionadded:: 0.9
- self.url_build_error_handlers = []
-
- #: A dictionary with lists of functions that will be called at the
- #: beginning of each request. The key of the dictionary is the name of
- #: the blueprint this function is active for, or ``None`` for all
- #: requests. To register a function, use the :meth:`before_request`
- #: decorator.
- self.before_request_funcs = {}
-
- #: A list of functions that will be called at the beginning of the
- #: first request to this instance. To register a function, use the
- #: :meth:`before_first_request` decorator.
- #:
- #: .. versionadded:: 0.8
- self.before_first_request_funcs = []
-
- #: A dictionary with lists of functions that should be called after
- #: each request. The key of the dictionary is the name of the blueprint
- #: this function is active for, ``None`` for all requests. This can for
- #: example be used to close database connections. To register a function
- #: here, use the :meth:`after_request` decorator.
- self.after_request_funcs = {}
-
- #: A dictionary with lists of functions that are called after
- #: each request, even if an exception has occurred. The key of the
- #: dictionary is the name of the blueprint this function is active for,
- #: ``None`` for all requests. These functions are not allowed to modify
- #: the request, and their return values are ignored. If an exception
- #: occurred while processing the request, it gets passed to each
- #: teardown_request function. To register a function here, use the
- #: :meth:`teardown_request` decorator.
- #:
- #: .. versionadded:: 0.7
- self.teardown_request_funcs = {}
-
- #: A list of functions that are called when the application context
- #: is destroyed. Since the application context is also torn down
- #: if the request ends this is the place to store code that disconnects
- #: from databases.
- #:
- #: .. versionadded:: 0.9
- self.teardown_appcontext_funcs = []
-
- #: A dictionary with lists of functions that are called before the
- #: :attr:`before_request_funcs` functions. The key of the dictionary is
- #: the name of the blueprint this function is active for, or ``None``
- #: for all requests. To register a function, use
- #: :meth:`url_value_preprocessor`.
- #:
- #: .. versionadded:: 0.7
- self.url_value_preprocessors = {}
-
- #: A dictionary with lists of functions that can be used as URL value
- #: preprocessors. The key ``None`` here is used for application wide
- #: callbacks, otherwise the key is the name of the blueprint.
- #: Each of these functions has the chance to modify the dictionary
- #: of URL values before they are used as the keyword arguments of the
- #: view function. For each function registered this one should also
- #: provide a :meth:`url_defaults` function that adds the parameters
- #: automatically again that were removed that way.
- #:
- #: .. versionadded:: 0.7
- self.url_default_functions = {}
-
- #: A dictionary with list of functions that are called without argument
- #: to populate the template context. The key of the dictionary is the
- #: name of the blueprint this function is active for, ``None`` for all
- #: requests. Each returns a dictionary that the template context is
- #: updated with. To register a function here, use the
- #: :meth:`context_processor` decorator.
- self.template_context_processors = {
- None: [_default_template_ctx_processor]
- }
-
- #: A list of shell context processor functions that should be run
- #: when a shell context is created.
- #:
- #: .. versionadded:: 0.11
- self.shell_context_processors = []
-
- #: all the attached blueprints in a dictionary by name. Blueprints
- #: can be attached multiple times so this dictionary does not tell
- #: you how often they got attached.
- #:
- #: .. versionadded:: 0.7
- self.blueprints = {}
- self._blueprint_order = []
-
- #: a place where extensions can store application specific state. For
- #: example this is where an extension could store database engines and
- #: similar things. For backwards compatibility extensions should register
- #: themselves like this::
- #:
- #: if not hasattr(app, 'extensions'):
- #: app.extensions = {}
- #: app.extensions['extensionname'] = SomeObject()
- #:
- #: The key must match the name of the extension module. For example in
- #: case of a "Flask-Foo" extension in `flask_foo`, the key would be
- #: ``'foo'``.
- #:
- #: .. versionadded:: 0.7
- self.extensions = {}
-
- #: The :class:`~werkzeug.routing.Map` for this instance. You can use
- #: this to change the routing converters after the class was created
- #: but before any routes are connected. Example::
- #:
- #: from werkzeug.routing import BaseConverter
- #:
- #: class ListConverter(BaseConverter):
- #: def to_python(self, value):
- #: return value.split(',')
- #: def to_url(self, values):
- #: return ','.join(super(ListConverter, self).to_url(value)
- #: for value in values)
- #:
- #: app = Flask(__name__)
- #: app.url_map.converters['list'] = ListConverter
- self.url_map = Map()
-
- self.url_map.host_matching = host_matching
- self.subdomain_matching = subdomain_matching
-
- # tracks internally if the application already handled at least one
- # request.
- self._got_first_request = False
- self._before_request_lock = Lock()
-
- # Add a static route using the provided static_url_path, static_host,
- # and static_folder if there is a configured static_folder.
- # Note we do this without checking if static_folder exists.
- # For one, it might be created while the server is running (e.g. during
- # development). Also, Google App Engine stores static files somewhere
- if self.has_static_folder:
- assert bool(static_host) == host_matching, 'Invalid static_host/host_matching combination'
- self.add_url_rule(
- self.static_url_path + '/',
- endpoint='static',
- host=static_host,
- view_func=self.send_static_file
- )
-
- #: The click command line context for this application. Commands
- #: registered here show up in the :command:`flask` command once the
- #: application has been discovered. The default commands are
- #: provided by Flask itself and can be overridden.
- #:
- #: This is an instance of a :class:`click.Group` object.
- self.cli = cli.AppGroup(self.name)
-
- @locked_cached_property
- def name(self):
- """The name of the application. This is usually the import name
- with the difference that it's guessed from the run file if the
- import name is main. This name is used as a display name when
- Flask needs the name of the application. It can be set and overridden
- to change the value.
-
- .. versionadded:: 0.8
- """
- if self.import_name == '__main__':
- fn = getattr(sys.modules['__main__'], '__file__', None)
- if fn is None:
- return '__main__'
- return os.path.splitext(os.path.basename(fn))[0]
- return self.import_name
-
- @property
- def propagate_exceptions(self):
- """Returns the value of the ``PROPAGATE_EXCEPTIONS`` configuration
- value in case it's set, otherwise a sensible default is returned.
-
- .. versionadded:: 0.7
- """
- rv = self.config['PROPAGATE_EXCEPTIONS']
- if rv is not None:
- return rv
- return self.testing or self.debug
-
- @property
- def preserve_context_on_exception(self):
- """Returns the value of the ``PRESERVE_CONTEXT_ON_EXCEPTION``
- configuration value in case it's set, otherwise a sensible default
- is returned.
-
- .. versionadded:: 0.7
- """
- rv = self.config['PRESERVE_CONTEXT_ON_EXCEPTION']
- if rv is not None:
- return rv
- return self.debug
-
- @locked_cached_property
- def logger(self):
- """The ``'flask.app'`` logger, a standard Python
- :class:`~logging.Logger`.
-
- In debug mode, the logger's :attr:`~logging.Logger.level` will be set
- to :data:`~logging.DEBUG`.
-
- If there are no handlers configured, a default handler will be added.
- See :ref:`logging` for more information.
-
- .. versionchanged:: 1.0
- Behavior was simplified. The logger is always named
- ``flask.app``. The level is only set during configuration, it
- doesn't check ``app.debug`` each time. Only one format is used,
- not different ones depending on ``app.debug``. No handlers are
- removed, and a handler is only added if no handlers are already
- configured.
-
- .. versionadded:: 0.3
- """
- return create_logger(self)
-
- @locked_cached_property
- def jinja_env(self):
- """The Jinja2 environment used to load templates."""
- return self.create_jinja_environment()
-
- @property
- def got_first_request(self):
- """This attribute is set to ``True`` if the application started
- handling the first request.
-
- .. versionadded:: 0.8
- """
- return self._got_first_request
-
- def make_config(self, instance_relative=False):
- """Used to create the config attribute by the Flask constructor.
- The `instance_relative` parameter is passed in from the constructor
- of Flask (there named `instance_relative_config`) and indicates if
- the config should be relative to the instance path or the root path
- of the application.
-
- .. versionadded:: 0.8
- """
- root_path = self.root_path
- if instance_relative:
- root_path = self.instance_path
- defaults = dict(self.default_config)
- defaults['ENV'] = get_env()
- defaults['DEBUG'] = get_debug_flag()
- return self.config_class(root_path, defaults)
-
- def auto_find_instance_path(self):
- """Tries to locate the instance path if it was not provided to the
- constructor of the application class. It will basically calculate
- the path to a folder named ``instance`` next to your main file or
- the package.
-
- .. versionadded:: 0.8
- """
- prefix, package_path = find_package(self.import_name)
- if prefix is None:
- return os.path.join(package_path, 'instance')
- return os.path.join(prefix, 'var', self.name + '-instance')
-
- def open_instance_resource(self, resource, mode='rb'):
- """Opens a resource from the application's instance folder
- (:attr:`instance_path`). Otherwise works like
- :meth:`open_resource`. Instance resources can also be opened for
- writing.
-
- :param resource: the name of the resource. To access resources within
- subfolders use forward slashes as separator.
- :param mode: resource file opening mode, default is 'rb'.
- """
- return open(os.path.join(self.instance_path, resource), mode)
-
- def _get_templates_auto_reload(self):
- """Reload templates when they are changed. Used by
- :meth:`create_jinja_environment`.
-
- This attribute can be configured with :data:`TEMPLATES_AUTO_RELOAD`. If
- not set, it will be enabled in debug mode.
-
- .. versionadded:: 1.0
- This property was added but the underlying config and behavior
- already existed.
- """
- rv = self.config['TEMPLATES_AUTO_RELOAD']
- return rv if rv is not None else self.debug
-
- def _set_templates_auto_reload(self, value):
- self.config['TEMPLATES_AUTO_RELOAD'] = value
-
- templates_auto_reload = property(
- _get_templates_auto_reload, _set_templates_auto_reload
- )
- del _get_templates_auto_reload, _set_templates_auto_reload
-
- def create_jinja_environment(self):
- """Creates the Jinja2 environment based on :attr:`jinja_options`
- and :meth:`select_jinja_autoescape`. Since 0.7 this also adds
- the Jinja2 globals and filters after initialization. Override
- this function to customize the behavior.
-
- .. versionadded:: 0.5
- .. versionchanged:: 0.11
- ``Environment.auto_reload`` set in accordance with
- ``TEMPLATES_AUTO_RELOAD`` configuration option.
- """
- options = dict(self.jinja_options)
-
- if 'autoescape' not in options:
- options['autoescape'] = self.select_jinja_autoescape
-
- if 'auto_reload' not in options:
- options['auto_reload'] = self.templates_auto_reload
-
- rv = self.jinja_environment(self, **options)
- rv.globals.update(
- url_for=url_for,
- get_flashed_messages=get_flashed_messages,
- config=self.config,
- # request, session and g are normally added with the
- # context processor for efficiency reasons but for imported
- # templates we also want the proxies in there.
- request=request,
- session=session,
- g=g
- )
- rv.filters['tojson'] = json.tojson_filter
- return rv
-
- def create_global_jinja_loader(self):
- """Creates the loader for the Jinja2 environment. Can be used to
- override just the loader and keeping the rest unchanged. It's
- discouraged to override this function. Instead one should override
- the :meth:`jinja_loader` function instead.
-
- The global loader dispatches between the loaders of the application
- and the individual blueprints.
-
- .. versionadded:: 0.7
- """
- return DispatchingJinjaLoader(self)
-
- def select_jinja_autoescape(self, filename):
- """Returns ``True`` if autoescaping should be active for the given
- template name. If no template name is given, returns `True`.
-
- .. versionadded:: 0.5
- """
- if filename is None:
- return True
- return filename.endswith(('.html', '.htm', '.xml', '.xhtml'))
-
- def update_template_context(self, context):
- """Update the template context with some commonly used variables.
- This injects request, session, config and g into the template
- context as well as everything template context processors want
- to inject. Note that the as of Flask 0.6, the original values
- in the context will not be overridden if a context processor
- decides to return a value with the same key.
-
- :param context: the context as a dictionary that is updated in place
- to add extra variables.
- """
- funcs = self.template_context_processors[None]
- reqctx = _request_ctx_stack.top
- if reqctx is not None:
- bp = reqctx.request.blueprint
- if bp is not None and bp in self.template_context_processors:
- funcs = chain(funcs, self.template_context_processors[bp])
- orig_ctx = context.copy()
- for func in funcs:
- context.update(func())
- # make sure the original values win. This makes it possible to
- # easier add new variables in context processors without breaking
- # existing views.
- context.update(orig_ctx)
-
- def make_shell_context(self):
- """Returns the shell context for an interactive shell for this
- application. This runs all the registered shell context
- processors.
-
- .. versionadded:: 0.11
- """
- rv = {'app': self, 'g': g}
- for processor in self.shell_context_processors:
- rv.update(processor())
- return rv
-
- #: What environment the app is running in. Flask and extensions may
- #: enable behaviors based on the environment, such as enabling debug
- #: mode. This maps to the :data:`ENV` config key. This is set by the
- #: :envvar:`FLASK_ENV` environment variable and may not behave as
- #: expected if set in code.
- #:
- #: **Do not enable development when deploying in production.**
- #:
- #: Default: ``'production'``
- env = ConfigAttribute('ENV')
-
- def _get_debug(self):
- return self.config['DEBUG']
-
- def _set_debug(self, value):
- self.config['DEBUG'] = value
- self.jinja_env.auto_reload = self.templates_auto_reload
-
- #: Whether debug mode is enabled. When using ``flask run`` to start
- #: the development server, an interactive debugger will be shown for
- #: unhandled exceptions, and the server will be reloaded when code
- #: changes. This maps to the :data:`DEBUG` config key. This is
- #: enabled when :attr:`env` is ``'development'`` and is overridden
- #: by the ``FLASK_DEBUG`` environment variable. It may not behave as
- #: expected if set in code.
- #:
- #: **Do not enable debug mode when deploying in production.**
- #:
- #: Default: ``True`` if :attr:`env` is ``'development'``, or
- #: ``False`` otherwise.
- debug = property(_get_debug, _set_debug)
- del _get_debug, _set_debug
-
- def run(self, host=None, port=None, debug=None,
- load_dotenv=True, **options):
- """Runs the application on a local development server.
-
- Do not use ``run()`` in a production setting. It is not intended to
- meet security and performance requirements for a production server.
- Instead, see :ref:`deployment` for WSGI server recommendations.
-
- If the :attr:`debug` flag is set the server will automatically reload
- for code changes and show a debugger in case an exception happened.
-
- If you want to run the application in debug mode, but disable the
- code execution on the interactive debugger, you can pass
- ``use_evalex=False`` as parameter. This will keep the debugger's
- traceback screen active, but disable code execution.
-
- It is not recommended to use this function for development with
- automatic reloading as this is badly supported. Instead you should
- be using the :command:`flask` command line script's ``run`` support.
-
- .. admonition:: Keep in Mind
-
- Flask will suppress any server error with a generic error page
- unless it is in debug mode. As such to enable just the
- interactive debugger without the code reloading, you have to
- invoke :meth:`run` with ``debug=True`` and ``use_reloader=False``.
- Setting ``use_debugger`` to ``True`` without being in debug mode
- won't catch any exceptions because there won't be any to
- catch.
-
- :param host: the hostname to listen on. Set this to ``'0.0.0.0'`` to
- have the server available externally as well. Defaults to
- ``'127.0.0.1'`` or the host in the ``SERVER_NAME`` config variable
- if present.
- :param port: the port of the webserver. Defaults to ``5000`` or the
- port defined in the ``SERVER_NAME`` config variable if present.
- :param debug: if given, enable or disable debug mode. See
- :attr:`debug`.
- :param load_dotenv: Load the nearest :file:`.env` and :file:`.flaskenv`
- files to set environment variables. Will also change the working
- directory to the directory containing the first file found.
- :param options: the options to be forwarded to the underlying Werkzeug
- server. See :func:`werkzeug.serving.run_simple` for more
- information.
-
- .. versionchanged:: 1.0
- If installed, python-dotenv will be used to load environment
- variables from :file:`.env` and :file:`.flaskenv` files.
-
- If set, the :envvar:`FLASK_ENV` and :envvar:`FLASK_DEBUG`
- environment variables will override :attr:`env` and
- :attr:`debug`.
-
- Threaded mode is enabled by default.
-
- .. versionchanged:: 0.10
- The default port is now picked from the ``SERVER_NAME``
- variable.
- """
- # Change this into a no-op if the server is invoked from the
- # command line. Have a look at cli.py for more information.
- if os.environ.get('FLASK_RUN_FROM_CLI') == 'true':
- from .debughelpers import explain_ignored_app_run
- explain_ignored_app_run()
- return
-
- if get_load_dotenv(load_dotenv):
- cli.load_dotenv()
-
- # if set, let env vars override previous values
- if 'FLASK_ENV' in os.environ:
- self.env = get_env()
- self.debug = get_debug_flag()
- elif 'FLASK_DEBUG' in os.environ:
- self.debug = get_debug_flag()
-
- # debug passed to method overrides all other sources
- if debug is not None:
- self.debug = bool(debug)
-
- _host = '127.0.0.1'
- _port = 5000
- server_name = self.config.get('SERVER_NAME')
- sn_host, sn_port = None, None
-
- if server_name:
- sn_host, _, sn_port = server_name.partition(':')
-
- host = host or sn_host or _host
- port = int(port or sn_port or _port)
-
- options.setdefault('use_reloader', self.debug)
- options.setdefault('use_debugger', self.debug)
- options.setdefault('threaded', True)
-
- cli.show_server_banner(self.env, self.debug, self.name, False)
-
- from werkzeug.serving import run_simple
-
- try:
- run_simple(host, port, self, **options)
- finally:
- # reset the first request information if the development server
- # reset normally. This makes it possible to restart the server
- # without reloader and that stuff from an interactive shell.
- self._got_first_request = False
-
- def test_client(self, use_cookies=True, **kwargs):
- """Creates a test client for this application. For information
- about unit testing head over to :ref:`testing`.
-
- Note that if you are testing for assertions or exceptions in your
- application code, you must set ``app.testing = True`` in order for the
- exceptions to propagate to the test client. Otherwise, the exception
- will be handled by the application (not visible to the test client) and
- the only indication of an AssertionError or other exception will be a
- 500 status code response to the test client. See the :attr:`testing`
- attribute. For example::
-
- app.testing = True
- client = app.test_client()
-
- The test client can be used in a ``with`` block to defer the closing down
- of the context until the end of the ``with`` block. This is useful if
- you want to access the context locals for testing::
-
- with app.test_client() as c:
- rv = c.get('/?vodka=42')
- assert request.args['vodka'] == '42'
-
- Additionally, you may pass optional keyword arguments that will then
- be passed to the application's :attr:`test_client_class` constructor.
- For example::
-
- from flask.testing import FlaskClient
-
- class CustomClient(FlaskClient):
- def __init__(self, *args, **kwargs):
- self._authentication = kwargs.pop("authentication")
- super(CustomClient,self).__init__( *args, **kwargs)
-
- app.test_client_class = CustomClient
- client = app.test_client(authentication='Basic ....')
-
- See :class:`~flask.testing.FlaskClient` for more information.
-
- .. versionchanged:: 0.4
- added support for ``with`` block usage for the client.
-
- .. versionadded:: 0.7
- The `use_cookies` parameter was added as well as the ability
- to override the client to be used by setting the
- :attr:`test_client_class` attribute.
-
- .. versionchanged:: 0.11
- Added `**kwargs` to support passing additional keyword arguments to
- the constructor of :attr:`test_client_class`.
- """
- cls = self.test_client_class
- if cls is None:
- from flask.testing import FlaskClient as cls
- return cls(self, self.response_class, use_cookies=use_cookies, **kwargs)
-
- def test_cli_runner(self, **kwargs):
- """Create a CLI runner for testing CLI commands.
- See :ref:`testing-cli`.
-
- Returns an instance of :attr:`test_cli_runner_class`, by default
- :class:`~flask.testing.FlaskCliRunner`. The Flask app object is
- passed as the first argument.
-
- .. versionadded:: 1.0
- """
- cls = self.test_cli_runner_class
-
- if cls is None:
- from flask.testing import FlaskCliRunner as cls
-
- return cls(self, **kwargs)
-
- def open_session(self, request):
- """Creates or opens a new session. Default implementation stores all
- session data in a signed cookie. This requires that the
- :attr:`secret_key` is set. Instead of overriding this method
- we recommend replacing the :class:`session_interface`.
-
- .. deprecated: 1.0
- Will be removed in 1.1. Use ``session_interface.open_session``
- instead.
-
- :param request: an instance of :attr:`request_class`.
- """
-
- warnings.warn(DeprecationWarning(
- '"open_session" is deprecated and will be removed in 1.1. Use'
- ' "session_interface.open_session" instead.'
- ))
- return self.session_interface.open_session(self, request)
-
- def save_session(self, session, response):
- """Saves the session if it needs updates. For the default
- implementation, check :meth:`open_session`. Instead of overriding this
- method we recommend replacing the :class:`session_interface`.
-
- .. deprecated: 1.0
- Will be removed in 1.1. Use ``session_interface.save_session``
- instead.
-
- :param session: the session to be saved (a
- :class:`~werkzeug.contrib.securecookie.SecureCookie`
- object)
- :param response: an instance of :attr:`response_class`
- """
-
- warnings.warn(DeprecationWarning(
- '"save_session" is deprecated and will be removed in 1.1. Use'
- ' "session_interface.save_session" instead.'
- ))
- return self.session_interface.save_session(self, session, response)
-
- def make_null_session(self):
- """Creates a new instance of a missing session. Instead of overriding
- this method we recommend replacing the :class:`session_interface`.
-
- .. deprecated: 1.0
- Will be removed in 1.1. Use ``session_interface.make_null_session``
- instead.
-
- .. versionadded:: 0.7
- """
-
- warnings.warn(DeprecationWarning(
- '"make_null_session" is deprecated and will be removed in 1.1. Use'
- ' "session_interface.make_null_session" instead.'
- ))
- return self.session_interface.make_null_session(self)
-
- @setupmethod
- def register_blueprint(self, blueprint, **options):
- """Register a :class:`~flask.Blueprint` on the application. Keyword
- arguments passed to this method will override the defaults set on the
- blueprint.
-
- Calls the blueprint's :meth:`~flask.Blueprint.register` method after
- recording the blueprint in the application's :attr:`blueprints`.
-
- :param blueprint: The blueprint to register.
- :param url_prefix: Blueprint routes will be prefixed with this.
- :param subdomain: Blueprint routes will match on this subdomain.
- :param url_defaults: Blueprint routes will use these default values for
- view arguments.
- :param options: Additional keyword arguments are passed to
- :class:`~flask.blueprints.BlueprintSetupState`. They can be
- accessed in :meth:`~flask.Blueprint.record` callbacks.
-
- .. versionadded:: 0.7
- """
- first_registration = False
-
- if blueprint.name in self.blueprints:
- assert self.blueprints[blueprint.name] is blueprint, (
- 'A name collision occurred between blueprints %r and %r. Both'
- ' share the same name "%s". Blueprints that are created on the'
- ' fly need unique names.' % (
- blueprint, self.blueprints[blueprint.name], blueprint.name
- )
- )
- else:
- self.blueprints[blueprint.name] = blueprint
- self._blueprint_order.append(blueprint)
- first_registration = True
-
- blueprint.register(self, options, first_registration)
-
- def iter_blueprints(self):
- """Iterates over all blueprints by the order they were registered.
-
- .. versionadded:: 0.11
- """
- return iter(self._blueprint_order)
-
- @setupmethod
- def add_url_rule(self, rule, endpoint=None, view_func=None,
- provide_automatic_options=None, **options):
- """Connects a URL rule. Works exactly like the :meth:`route`
- decorator. If a view_func is provided it will be registered with the
- endpoint.
-
- Basically this example::
-
- @app.route('/')
- def index():
- pass
-
- Is equivalent to the following::
-
- def index():
- pass
- app.add_url_rule('/', 'index', index)
-
- If the view_func is not provided you will need to connect the endpoint
- to a view function like so::
-
- app.view_functions['index'] = index
-
- Internally :meth:`route` invokes :meth:`add_url_rule` so if you want
- to customize the behavior via subclassing you only need to change
- this method.
-
- For more information refer to :ref:`url-route-registrations`.
-
- .. versionchanged:: 0.2
- `view_func` parameter added.
-
- .. versionchanged:: 0.6
- ``OPTIONS`` is added automatically as method.
-
- :param rule: the URL rule as string
- :param endpoint: the endpoint for the registered URL rule. Flask
- itself assumes the name of the view function as
- endpoint
- :param view_func: the function to call when serving a request to the
- provided endpoint
- :param provide_automatic_options: controls whether the ``OPTIONS``
- method should be added automatically. This can also be controlled
- by setting the ``view_func.provide_automatic_options = False``
- before adding the rule.
- :param options: the options to be forwarded to the underlying
- :class:`~werkzeug.routing.Rule` object. A change
- to Werkzeug is handling of method options. methods
- is a list of methods this rule should be limited
- to (``GET``, ``POST`` etc.). By default a rule
- just listens for ``GET`` (and implicitly ``HEAD``).
- Starting with Flask 0.6, ``OPTIONS`` is implicitly
- added and handled by the standard request handling.
- """
- if endpoint is None:
- endpoint = _endpoint_from_view_func(view_func)
- options['endpoint'] = endpoint
- methods = options.pop('methods', None)
-
- # if the methods are not given and the view_func object knows its
- # methods we can use that instead. If neither exists, we go with
- # a tuple of only ``GET`` as default.
- if methods is None:
- methods = getattr(view_func, 'methods', None) or ('GET',)
- if isinstance(methods, string_types):
- raise TypeError('Allowed methods have to be iterables of strings, '
- 'for example: @app.route(..., methods=["POST"])')
- methods = set(item.upper() for item in methods)
-
- # Methods that should always be added
- required_methods = set(getattr(view_func, 'required_methods', ()))
-
- # starting with Flask 0.8 the view_func object can disable and
- # force-enable the automatic options handling.
- if provide_automatic_options is None:
- provide_automatic_options = getattr(view_func,
- 'provide_automatic_options', None)
-
- if provide_automatic_options is None:
- if 'OPTIONS' not in methods:
- provide_automatic_options = True
- required_methods.add('OPTIONS')
- else:
- provide_automatic_options = False
-
- # Add the required methods now.
- methods |= required_methods
-
- rule = self.url_rule_class(rule, methods=methods, **options)
- rule.provide_automatic_options = provide_automatic_options
-
- self.url_map.add(rule)
- if view_func is not None:
- old_func = self.view_functions.get(endpoint)
- if old_func is not None and old_func != view_func:
- raise AssertionError('View function mapping is overwriting an '
- 'existing endpoint function: %s' % endpoint)
- self.view_functions[endpoint] = view_func
-
- def route(self, rule, **options):
- """A decorator that is used to register a view function for a
- given URL rule. This does the same thing as :meth:`add_url_rule`
- but is intended for decorator usage::
-
- @app.route('/')
- def index():
- return 'Hello World'
-
- For more information refer to :ref:`url-route-registrations`.
-
- :param rule: the URL rule as string
- :param endpoint: the endpoint for the registered URL rule. Flask
- itself assumes the name of the view function as
- endpoint
- :param options: the options to be forwarded to the underlying
- :class:`~werkzeug.routing.Rule` object. A change
- to Werkzeug is handling of method options. methods
- is a list of methods this rule should be limited
- to (``GET``, ``POST`` etc.). By default a rule
- just listens for ``GET`` (and implicitly ``HEAD``).
- Starting with Flask 0.6, ``OPTIONS`` is implicitly
- added and handled by the standard request handling.
- """
- def decorator(f):
- endpoint = options.pop('endpoint', None)
- self.add_url_rule(rule, endpoint, f, **options)
- return f
- return decorator
-
- @setupmethod
- def endpoint(self, endpoint):
- """A decorator to register a function as an endpoint.
- Example::
-
- @app.endpoint('example.endpoint')
- def example():
- return "example"
-
- :param endpoint: the name of the endpoint
- """
- def decorator(f):
- self.view_functions[endpoint] = f
- return f
- return decorator
-
- @staticmethod
- def _get_exc_class_and_code(exc_class_or_code):
- """Ensure that we register only exceptions as handler keys"""
- if isinstance(exc_class_or_code, integer_types):
- exc_class = default_exceptions[exc_class_or_code]
- else:
- exc_class = exc_class_or_code
-
- assert issubclass(exc_class, Exception)
-
- if issubclass(exc_class, HTTPException):
- return exc_class, exc_class.code
- else:
- return exc_class, None
-
- @setupmethod
- def errorhandler(self, code_or_exception):
- """Register a function to handle errors by code or exception class.
-
- A decorator that is used to register a function given an
- error code. Example::
-
- @app.errorhandler(404)
- def page_not_found(error):
- return 'This page does not exist', 404
-
- You can also register handlers for arbitrary exceptions::
-
- @app.errorhandler(DatabaseError)
- def special_exception_handler(error):
- return 'Database connection failed', 500
-
- .. versionadded:: 0.7
- Use :meth:`register_error_handler` instead of modifying
- :attr:`error_handler_spec` directly, for application wide error
- handlers.
-
- .. versionadded:: 0.7
- One can now additionally also register custom exception types
- that do not necessarily have to be a subclass of the
- :class:`~werkzeug.exceptions.HTTPException` class.
-
- :param code_or_exception: the code as integer for the handler, or
- an arbitrary exception
- """
- def decorator(f):
- self._register_error_handler(None, code_or_exception, f)
- return f
- return decorator
-
- @setupmethod
- def register_error_handler(self, code_or_exception, f):
- """Alternative error attach function to the :meth:`errorhandler`
- decorator that is more straightforward to use for non decorator
- usage.
-
- .. versionadded:: 0.7
- """
- self._register_error_handler(None, code_or_exception, f)
-
- @setupmethod
- def _register_error_handler(self, key, code_or_exception, f):
- """
- :type key: None|str
- :type code_or_exception: int|T<=Exception
- :type f: callable
- """
- if isinstance(code_or_exception, HTTPException): # old broken behavior
- raise ValueError(
- 'Tried to register a handler for an exception instance {0!r}.'
- ' Handlers can only be registered for exception classes or'
- ' HTTP error codes.'.format(code_or_exception)
- )
-
- try:
- exc_class, code = self._get_exc_class_and_code(code_or_exception)
- except KeyError:
- raise KeyError(
- "'{0}' is not a recognized HTTP error code. Use a subclass of"
- " HTTPException with that code instead.".format(code_or_exception)
- )
-
- handlers = self.error_handler_spec.setdefault(key, {}).setdefault(code, {})
- handlers[exc_class] = f
-
- @setupmethod
- def template_filter(self, name=None):
- """A decorator that is used to register custom template filter.
- You can specify a name for the filter, otherwise the function
- name will be used. Example::
-
- @app.template_filter()
- def reverse(s):
- return s[::-1]
-
- :param name: the optional name of the filter, otherwise the
- function name will be used.
- """
- def decorator(f):
- self.add_template_filter(f, name=name)
- return f
- return decorator
-
- @setupmethod
- def add_template_filter(self, f, name=None):
- """Register a custom template filter. Works exactly like the
- :meth:`template_filter` decorator.
-
- :param name: the optional name of the filter, otherwise the
- function name will be used.
- """
- self.jinja_env.filters[name or f.__name__] = f
-
- @setupmethod
- def template_test(self, name=None):
- """A decorator that is used to register custom template test.
- You can specify a name for the test, otherwise the function
- name will be used. Example::
-
- @app.template_test()
- def is_prime(n):
- if n == 2:
- return True
- for i in range(2, int(math.ceil(math.sqrt(n))) + 1):
- if n % i == 0:
- return False
- return True
-
- .. versionadded:: 0.10
-
- :param name: the optional name of the test, otherwise the
- function name will be used.
- """
- def decorator(f):
- self.add_template_test(f, name=name)
- return f
- return decorator
-
- @setupmethod
- def add_template_test(self, f, name=None):
- """Register a custom template test. Works exactly like the
- :meth:`template_test` decorator.
-
- .. versionadded:: 0.10
-
- :param name: the optional name of the test, otherwise the
- function name will be used.
- """
- self.jinja_env.tests[name or f.__name__] = f
-
- @setupmethod
- def template_global(self, name=None):
- """A decorator that is used to register a custom template global function.
- You can specify a name for the global function, otherwise the function
- name will be used. Example::
-
- @app.template_global()
- def double(n):
- return 2 * n
-
- .. versionadded:: 0.10
-
- :param name: the optional name of the global function, otherwise the
- function name will be used.
- """
- def decorator(f):
- self.add_template_global(f, name=name)
- return f
- return decorator
-
- @setupmethod
- def add_template_global(self, f, name=None):
- """Register a custom template global function. Works exactly like the
- :meth:`template_global` decorator.
-
- .. versionadded:: 0.10
-
- :param name: the optional name of the global function, otherwise the
- function name will be used.
- """
- self.jinja_env.globals[name or f.__name__] = f
-
- @setupmethod
- def before_request(self, f):
- """Registers a function to run before each request.
-
- For example, this can be used to open a database connection, or to load
- the logged in user from the session.
-
- The function will be called without any arguments. If it returns a
- non-None value, the value is handled as if it was the return value from
- the view, and further request handling is stopped.
- """
- self.before_request_funcs.setdefault(None, []).append(f)
- return f
-
- @setupmethod
- def before_first_request(self, f):
- """Registers a function to be run before the first request to this
- instance of the application.
-
- The function will be called without any arguments and its return
- value is ignored.
-
- .. versionadded:: 0.8
- """
- self.before_first_request_funcs.append(f)
- return f
-
- @setupmethod
- def after_request(self, f):
- """Register a function to be run after each request.
-
- Your function must take one parameter, an instance of
- :attr:`response_class` and return a new response object or the
- same (see :meth:`process_response`).
-
- As of Flask 0.7 this function might not be executed at the end of the
- request in case an unhandled exception occurred.
- """
- self.after_request_funcs.setdefault(None, []).append(f)
- return f
-
- @setupmethod
- def teardown_request(self, f):
- """Register a function to be run at the end of each request,
- regardless of whether there was an exception or not. These functions
- are executed when the request context is popped, even if not an
- actual request was performed.
-
- Example::
-
- ctx = app.test_request_context()
- ctx.push()
- ...
- ctx.pop()
-
- When ``ctx.pop()`` is executed in the above example, the teardown
- functions are called just before the request context moves from the
- stack of active contexts. This becomes relevant if you are using
- such constructs in tests.
-
- Generally teardown functions must take every necessary step to avoid
- that they will fail. If they do execute code that might fail they
- will have to surround the execution of these code by try/except
- statements and log occurring errors.
-
- When a teardown function was called because of an exception it will
- be passed an error object.
-
- The return values of teardown functions are ignored.
-
- .. admonition:: Debug Note
-
- In debug mode Flask will not tear down a request on an exception
- immediately. Instead it will keep it alive so that the interactive
- debugger can still access it. This behavior can be controlled
- by the ``PRESERVE_CONTEXT_ON_EXCEPTION`` configuration variable.
- """
- self.teardown_request_funcs.setdefault(None, []).append(f)
- return f
-
- @setupmethod
- def teardown_appcontext(self, f):
- """Registers a function to be called when the application context
- ends. These functions are typically also called when the request
- context is popped.
-
- Example::
-
- ctx = app.app_context()
- ctx.push()
- ...
- ctx.pop()
-
- When ``ctx.pop()`` is executed in the above example, the teardown
- functions are called just before the app context moves from the
- stack of active contexts. This becomes relevant if you are using
- such constructs in tests.
-
- Since a request context typically also manages an application
- context it would also be called when you pop a request context.
-
- When a teardown function was called because of an unhandled exception
- it will be passed an error object. If an :meth:`errorhandler` is
- registered, it will handle the exception and the teardown will not
- receive it.
-
- The return values of teardown functions are ignored.
-
- .. versionadded:: 0.9
- """
- self.teardown_appcontext_funcs.append(f)
- return f
-
- @setupmethod
- def context_processor(self, f):
- """Registers a template context processor function."""
- self.template_context_processors[None].append(f)
- return f
-
- @setupmethod
- def shell_context_processor(self, f):
- """Registers a shell context processor function.
-
- .. versionadded:: 0.11
- """
- self.shell_context_processors.append(f)
- return f
-
- @setupmethod
- def url_value_preprocessor(self, f):
- """Register a URL value preprocessor function for all view
- functions in the application. These functions will be called before the
- :meth:`before_request` functions.
-
- The function can modify the values captured from the matched url before
- they are passed to the view. For example, this can be used to pop a
- common language code value and place it in ``g`` rather than pass it to
- every view.
-
- The function is passed the endpoint name and values dict. The return
- value is ignored.
- """
- self.url_value_preprocessors.setdefault(None, []).append(f)
- return f
-
- @setupmethod
- def url_defaults(self, f):
- """Callback function for URL defaults for all view functions of the
- application. It's called with the endpoint and values and should
- update the values passed in place.
- """
- self.url_default_functions.setdefault(None, []).append(f)
- return f
-
- def _find_error_handler(self, e):
- """Return a registered error handler for an exception in this order:
- blueprint handler for a specific code, app handler for a specific code,
- blueprint handler for an exception class, app handler for an exception
- class, or ``None`` if a suitable handler is not found.
- """
- exc_class, code = self._get_exc_class_and_code(type(e))
-
- for name, c in (
- (request.blueprint, code), (None, code),
- (request.blueprint, None), (None, None)
- ):
- handler_map = self.error_handler_spec.setdefault(name, {}).get(c)
-
- if not handler_map:
- continue
-
- for cls in exc_class.__mro__:
- handler = handler_map.get(cls)
-
- if handler is not None:
- return handler
-
- def handle_http_exception(self, e):
- """Handles an HTTP exception. By default this will invoke the
- registered error handlers and fall back to returning the
- exception as response.
-
- .. versionadded:: 0.3
- """
- # Proxy exceptions don't have error codes. We want to always return
- # those unchanged as errors
- if e.code is None:
- return e
-
- handler = self._find_error_handler(e)
- if handler is None:
- return e
- return handler(e)
-
- def trap_http_exception(self, e):
- """Checks if an HTTP exception should be trapped or not. By default
- this will return ``False`` for all exceptions except for a bad request
- key error if ``TRAP_BAD_REQUEST_ERRORS`` is set to ``True``. It
- also returns ``True`` if ``TRAP_HTTP_EXCEPTIONS`` is set to ``True``.
-
- This is called for all HTTP exceptions raised by a view function.
- If it returns ``True`` for any exception the error handler for this
- exception is not called and it shows up as regular exception in the
- traceback. This is helpful for debugging implicitly raised HTTP
- exceptions.
-
- .. versionchanged:: 1.0
- Bad request errors are not trapped by default in debug mode.
-
- .. versionadded:: 0.8
- """
- if self.config['TRAP_HTTP_EXCEPTIONS']:
- return True
-
- trap_bad_request = self.config['TRAP_BAD_REQUEST_ERRORS']
-
- # if unset, trap key errors in debug mode
- if (
- trap_bad_request is None and self.debug
- and isinstance(e, BadRequestKeyError)
- ):
- return True
-
- if trap_bad_request:
- return isinstance(e, BadRequest)
-
- return False
-
- def handle_user_exception(self, e):
- """This method is called whenever an exception occurs that should be
- handled. A special case are
- :class:`~werkzeug.exception.HTTPException`\s which are forwarded by
- this function to the :meth:`handle_http_exception` method. This
- function will either return a response value or reraise the
- exception with the same traceback.
-
- .. versionchanged:: 1.0
- Key errors raised from request data like ``form`` show the the bad
- key in debug mode rather than a generic bad request message.
-
- .. versionadded:: 0.7
- """
- exc_type, exc_value, tb = sys.exc_info()
- assert exc_value is e
- # ensure not to trash sys.exc_info() at that point in case someone
- # wants the traceback preserved in handle_http_exception. Of course
- # we cannot prevent users from trashing it themselves in a custom
- # trap_http_exception method so that's their fault then.
-
- # MultiDict passes the key to the exception, but that's ignored
- # when generating the response message. Set an informative
- # description for key errors in debug mode or when trapping errors.
- if (
- (self.debug or self.config['TRAP_BAD_REQUEST_ERRORS'])
- and isinstance(e, BadRequestKeyError)
- # only set it if it's still the default description
- and e.description is BadRequestKeyError.description
- ):
- e.description = "KeyError: '{0}'".format(*e.args)
-
- if isinstance(e, HTTPException) and not self.trap_http_exception(e):
- return self.handle_http_exception(e)
-
- handler = self._find_error_handler(e)
-
- if handler is None:
- reraise(exc_type, exc_value, tb)
- return handler(e)
-
- def handle_exception(self, e):
- """Default exception handling that kicks in when an exception
- occurs that is not caught. In debug mode the exception will
- be re-raised immediately, otherwise it is logged and the handler
- for a 500 internal server error is used. If no such handler
- exists, a default 500 internal server error message is displayed.
-
- .. versionadded:: 0.3
- """
- exc_type, exc_value, tb = sys.exc_info()
-
- got_request_exception.send(self, exception=e)
- handler = self._find_error_handler(InternalServerError())
-
- if self.propagate_exceptions:
- # if we want to repropagate the exception, we can attempt to
- # raise it with the whole traceback in case we can do that
- # (the function was actually called from the except part)
- # otherwise, we just raise the error again
- if exc_value is e:
- reraise(exc_type, exc_value, tb)
- else:
- raise e
-
- self.log_exception((exc_type, exc_value, tb))
- if handler is None:
- return InternalServerError()
- return self.finalize_request(handler(e), from_error_handler=True)
-
- def log_exception(self, exc_info):
- """Logs an exception. This is called by :meth:`handle_exception`
- if debugging is disabled and right before the handler is called.
- The default implementation logs the exception as error on the
- :attr:`logger`.
-
- .. versionadded:: 0.8
- """
- self.logger.error('Exception on %s [%s]' % (
- request.path,
- request.method
- ), exc_info=exc_info)
-
- def raise_routing_exception(self, request):
- """Exceptions that are recording during routing are reraised with
- this method. During debug we are not reraising redirect requests
- for non ``GET``, ``HEAD``, or ``OPTIONS`` requests and we're raising
- a different error instead to help debug situations.
-
- :internal:
- """
- if not self.debug \
- or not isinstance(request.routing_exception, RequestRedirect) \
- or request.method in ('GET', 'HEAD', 'OPTIONS'):
- raise request.routing_exception
-
- from .debughelpers import FormDataRoutingRedirect
- raise FormDataRoutingRedirect(request)
-
- def dispatch_request(self):
- """Does the request dispatching. Matches the URL and returns the
- return value of the view or error handler. This does not have to
- be a response object. In order to convert the return value to a
- proper response object, call :func:`make_response`.
-
- .. versionchanged:: 0.7
- This no longer does the exception handling, this code was
- moved to the new :meth:`full_dispatch_request`.
- """
- req = _request_ctx_stack.top.request
- if req.routing_exception is not None:
- self.raise_routing_exception(req)
- rule = req.url_rule
- # if we provide automatic options for this URL and the
- # request came with the OPTIONS method, reply automatically
- if getattr(rule, 'provide_automatic_options', False) \
- and req.method == 'OPTIONS':
- return self.make_default_options_response()
- # otherwise dispatch to the handler for that endpoint
- return self.view_functions[rule.endpoint](**req.view_args)
-
- def full_dispatch_request(self):
- """Dispatches the request and on top of that performs request
- pre and postprocessing as well as HTTP exception catching and
- error handling.
-
- .. versionadded:: 0.7
- """
- self.try_trigger_before_first_request_functions()
- try:
- request_started.send(self)
- rv = self.preprocess_request()
- if rv is None:
- rv = self.dispatch_request()
- except Exception as e:
- rv = self.handle_user_exception(e)
- return self.finalize_request(rv)
-
- def finalize_request(self, rv, from_error_handler=False):
- """Given the return value from a view function this finalizes
- the request by converting it into a response and invoking the
- postprocessing functions. This is invoked for both normal
- request dispatching as well as error handlers.
-
- Because this means that it might be called as a result of a
- failure a special safe mode is available which can be enabled
- with the `from_error_handler` flag. If enabled, failures in
- response processing will be logged and otherwise ignored.
-
- :internal:
- """
- response = self.make_response(rv)
- try:
- response = self.process_response(response)
- request_finished.send(self, response=response)
- except Exception:
- if not from_error_handler:
- raise
- self.logger.exception('Request finalizing failed with an '
- 'error while handling an error')
- return response
-
- def try_trigger_before_first_request_functions(self):
- """Called before each request and will ensure that it triggers
- the :attr:`before_first_request_funcs` and only exactly once per
- application instance (which means process usually).
-
- :internal:
- """
- if self._got_first_request:
- return
- with self._before_request_lock:
- if self._got_first_request:
- return
- for func in self.before_first_request_funcs:
- func()
- self._got_first_request = True
-
- def make_default_options_response(self):
- """This method is called to create the default ``OPTIONS`` response.
- This can be changed through subclassing to change the default
- behavior of ``OPTIONS`` responses.
-
- .. versionadded:: 0.7
- """
- adapter = _request_ctx_stack.top.url_adapter
- if hasattr(adapter, 'allowed_methods'):
- methods = adapter.allowed_methods()
- else:
- # fallback for Werkzeug < 0.7
- methods = []
- try:
- adapter.match(method='--')
- except MethodNotAllowed as e:
- methods = e.valid_methods
- except HTTPException as e:
- pass
- rv = self.response_class()
- rv.allow.update(methods)
- return rv
-
- def should_ignore_error(self, error):
- """This is called to figure out if an error should be ignored
- or not as far as the teardown system is concerned. If this
- function returns ``True`` then the teardown handlers will not be
- passed the error.
-
- .. versionadded:: 0.10
- """
- return False
-
- def make_response(self, rv):
- """Convert the return value from a view function to an instance of
- :attr:`response_class`.
-
- :param rv: the return value from the view function. The view function
- must return a response. Returning ``None``, or the view ending
- without returning, is not allowed. The following types are allowed
- for ``view_rv``:
-
- ``str`` (``unicode`` in Python 2)
- A response object is created with the string encoded to UTF-8
- as the body.
-
- ``bytes`` (``str`` in Python 2)
- A response object is created with the bytes as the body.
-
- ``tuple``
- Either ``(body, status, headers)``, ``(body, status)``, or
- ``(body, headers)``, where ``body`` is any of the other types
- allowed here, ``status`` is a string or an integer, and
- ``headers`` is a dictionary or a list of ``(key, value)``
- tuples. If ``body`` is a :attr:`response_class` instance,
- ``status`` overwrites the exiting value and ``headers`` are
- extended.
-
- :attr:`response_class`
- The object is returned unchanged.
-
- other :class:`~werkzeug.wrappers.Response` class
- The object is coerced to :attr:`response_class`.
-
- :func:`callable`
- The function is called as a WSGI application. The result is
- used to create a response object.
-
- .. versionchanged:: 0.9
- Previously a tuple was interpreted as the arguments for the
- response object.
- """
-
- status = headers = None
-
- # unpack tuple returns
- if isinstance(rv, tuple):
- len_rv = len(rv)
-
- # a 3-tuple is unpacked directly
- if len_rv == 3:
- rv, status, headers = rv
- # decide if a 2-tuple has status or headers
- elif len_rv == 2:
- if isinstance(rv[1], (Headers, dict, tuple, list)):
- rv, headers = rv
- else:
- rv, status = rv
- # other sized tuples are not allowed
- else:
- raise TypeError(
- 'The view function did not return a valid response tuple.'
- ' The tuple must have the form (body, status, headers),'
- ' (body, status), or (body, headers).'
- )
-
- # the body must not be None
- if rv is None:
- raise TypeError(
- 'The view function did not return a valid response. The'
- ' function either returned None or ended without a return'
- ' statement.'
- )
-
- # make sure the body is an instance of the response class
- if not isinstance(rv, self.response_class):
- if isinstance(rv, (text_type, bytes, bytearray)):
- # let the response class set the status and headers instead of
- # waiting to do it manually, so that the class can handle any
- # special logic
- rv = self.response_class(rv, status=status, headers=headers)
- status = headers = None
- else:
- # evaluate a WSGI callable, or coerce a different response
- # class to the correct type
- try:
- rv = self.response_class.force_type(rv, request.environ)
- except TypeError as e:
- new_error = TypeError(
- '{e}\nThe view function did not return a valid'
- ' response. The return type must be a string, tuple,'
- ' Response instance, or WSGI callable, but it was a'
- ' {rv.__class__.__name__}.'.format(e=e, rv=rv)
- )
- reraise(TypeError, new_error, sys.exc_info()[2])
-
- # prefer the status if it was provided
- if status is not None:
- if isinstance(status, (text_type, bytes, bytearray)):
- rv.status = status
- else:
- rv.status_code = status
-
- # extend existing headers with provided headers
- if headers:
- rv.headers.extend(headers)
-
- return rv
-
- def create_url_adapter(self, request):
- """Creates a URL adapter for the given request. The URL adapter
- is created at a point where the request context is not yet set
- up so the request is passed explicitly.
-
- .. versionadded:: 0.6
-
- .. versionchanged:: 0.9
- This can now also be called without a request object when the
- URL adapter is created for the application context.
-
- .. versionchanged:: 1.0
- :data:`SERVER_NAME` no longer implicitly enables subdomain
- matching. Use :attr:`subdomain_matching` instead.
- """
- if request is not None:
- # If subdomain matching is disabled (the default), use the
- # default subdomain in all cases. This should be the default
- # in Werkzeug but it currently does not have that feature.
- subdomain = ((self.url_map.default_subdomain or None)
- if not self.subdomain_matching else None)
- return self.url_map.bind_to_environ(
- request.environ,
- server_name=self.config['SERVER_NAME'],
- subdomain=subdomain)
- # We need at the very least the server name to be set for this
- # to work.
- if self.config['SERVER_NAME'] is not None:
- return self.url_map.bind(
- self.config['SERVER_NAME'],
- script_name=self.config['APPLICATION_ROOT'],
- url_scheme=self.config['PREFERRED_URL_SCHEME'])
-
- def inject_url_defaults(self, endpoint, values):
- """Injects the URL defaults for the given endpoint directly into
- the values dictionary passed. This is used internally and
- automatically called on URL building.
-
- .. versionadded:: 0.7
- """
- funcs = self.url_default_functions.get(None, ())
- if '.' in endpoint:
- bp = endpoint.rsplit('.', 1)[0]
- funcs = chain(funcs, self.url_default_functions.get(bp, ()))
- for func in funcs:
- func(endpoint, values)
-
- def handle_url_build_error(self, error, endpoint, values):
- """Handle :class:`~werkzeug.routing.BuildError` on :meth:`url_for`.
- """
- exc_type, exc_value, tb = sys.exc_info()
- for handler in self.url_build_error_handlers:
- try:
- rv = handler(error, endpoint, values)
- if rv is not None:
- return rv
- except BuildError as e:
- # make error available outside except block (py3)
- error = e
-
- # At this point we want to reraise the exception. If the error is
- # still the same one we can reraise it with the original traceback,
- # otherwise we raise it from here.
- if error is exc_value:
- reraise(exc_type, exc_value, tb)
- raise error
-
- def preprocess_request(self):
- """Called before the request is dispatched. Calls
- :attr:`url_value_preprocessors` registered with the app and the
- current blueprint (if any). Then calls :attr:`before_request_funcs`
- registered with the app and the blueprint.
-
- If any :meth:`before_request` handler returns a non-None value, the
- value is handled as if it was the return value from the view, and
- further request handling is stopped.
- """
-
- bp = _request_ctx_stack.top.request.blueprint
-
- funcs = self.url_value_preprocessors.get(None, ())
- if bp is not None and bp in self.url_value_preprocessors:
- funcs = chain(funcs, self.url_value_preprocessors[bp])
- for func in funcs:
- func(request.endpoint, request.view_args)
-
- funcs = self.before_request_funcs.get(None, ())
- if bp is not None and bp in self.before_request_funcs:
- funcs = chain(funcs, self.before_request_funcs[bp])
- for func in funcs:
- rv = func()
- if rv is not None:
- return rv
-
- def process_response(self, response):
- """Can be overridden in order to modify the response object
- before it's sent to the WSGI server. By default this will
- call all the :meth:`after_request` decorated functions.
-
- .. versionchanged:: 0.5
- As of Flask 0.5 the functions registered for after request
- execution are called in reverse order of registration.
-
- :param response: a :attr:`response_class` object.
- :return: a new response object or the same, has to be an
- instance of :attr:`response_class`.
- """
- ctx = _request_ctx_stack.top
- bp = ctx.request.blueprint
- funcs = ctx._after_request_functions
- if bp is not None and bp in self.after_request_funcs:
- funcs = chain(funcs, reversed(self.after_request_funcs[bp]))
- if None in self.after_request_funcs:
- funcs = chain(funcs, reversed(self.after_request_funcs[None]))
- for handler in funcs:
- response = handler(response)
- if not self.session_interface.is_null_session(ctx.session):
- self.session_interface.save_session(self, ctx.session, response)
- return response
-
- def do_teardown_request(self, exc=_sentinel):
- """Called after the request is dispatched and the response is
- returned, right before the request context is popped.
-
- This calls all functions decorated with
- :meth:`teardown_request`, and :meth:`Blueprint.teardown_request`
- if a blueprint handled the request. Finally, the
- :data:`request_tearing_down` signal is sent.
-
- This is called by
- :meth:`RequestContext.pop() `,
- which may be delayed during testing to maintain access to
- resources.
-
- :param exc: An unhandled exception raised while dispatching the
- request. Detected from the current exception information if
- not passed. Passed to each teardown function.
-
- .. versionchanged:: 0.9
- Added the ``exc`` argument.
- """
- if exc is _sentinel:
- exc = sys.exc_info()[1]
- funcs = reversed(self.teardown_request_funcs.get(None, ()))
- bp = _request_ctx_stack.top.request.blueprint
- if bp is not None and bp in self.teardown_request_funcs:
- funcs = chain(funcs, reversed(self.teardown_request_funcs[bp]))
- for func in funcs:
- func(exc)
- request_tearing_down.send(self, exc=exc)
-
- def do_teardown_appcontext(self, exc=_sentinel):
- """Called right before the application context is popped.
-
- When handling a request, the application context is popped
- after the request context. See :meth:`do_teardown_request`.
-
- This calls all functions decorated with
- :meth:`teardown_appcontext`. Then the
- :data:`appcontext_tearing_down` signal is sent.
-
- This is called by
- :meth:`AppContext.pop() `.
-
- .. versionadded:: 0.9
- """
- if exc is _sentinel:
- exc = sys.exc_info()[1]
- for func in reversed(self.teardown_appcontext_funcs):
- func(exc)
- appcontext_tearing_down.send(self, exc=exc)
-
- def app_context(self):
- """Create an :class:`~flask.ctx.AppContext`. Use as a ``with``
- block to push the context, which will make :data:`current_app`
- point at this application.
-
- An application context is automatically pushed by
- :meth:`RequestContext.push() `
- when handling a request, and when running a CLI command. Use
- this to manually create a context outside of these situations.
-
- ::
-
- with app.app_context():
- init_db()
-
- See :doc:`/appcontext`.
-
- .. versionadded:: 0.9
- """
- return AppContext(self)
-
- def request_context(self, environ):
- """Create a :class:`~flask.ctx.RequestContext` representing a
- WSGI environment. Use a ``with`` block to push the context,
- which will make :data:`request` point at this request.
-
- See :doc:`/reqcontext`.
-
- Typically you should not call this from your own code. A request
- context is automatically pushed by the :meth:`wsgi_app` when
- handling a request. Use :meth:`test_request_context` to create
- an environment and context instead of this method.
-
- :param environ: a WSGI environment
- """
- return RequestContext(self, environ)
-
- def test_request_context(self, *args, **kwargs):
- """Create a :class:`~flask.ctx.RequestContext` for a WSGI
- environment created from the given values. This is mostly useful
- during testing, where you may want to run a function that uses
- request data without dispatching a full request.
-
- See :doc:`/reqcontext`.
-
- Use a ``with`` block to push the context, which will make
- :data:`request` point at the request for the created
- environment. ::
-
- with test_request_context(...):
- generate_report()
-
- When using the shell, it may be easier to push and pop the
- context manually to avoid indentation. ::
-
- ctx = app.test_request_context(...)
- ctx.push()
- ...
- ctx.pop()
-
- Takes the same arguments as Werkzeug's
- :class:`~werkzeug.test.EnvironBuilder`, with some defaults from
- the application. See the linked Werkzeug docs for most of the
- available arguments. Flask-specific behavior is listed here.
-
- :param path: URL path being requested.
- :param base_url: Base URL where the app is being served, which
- ``path`` is relative to. If not given, built from
- :data:`PREFERRED_URL_SCHEME`, ``subdomain``,
- :data:`SERVER_NAME`, and :data:`APPLICATION_ROOT`.
- :param subdomain: Subdomain name to append to
- :data:`SERVER_NAME`.
- :param url_scheme: Scheme to use instead of
- :data:`PREFERRED_URL_SCHEME`.
- :param data: The request body, either as a string or a dict of
- form keys and values.
- :param json: If given, this is serialized as JSON and passed as
- ``data``. Also defaults ``content_type`` to
- ``application/json``.
- :param args: other positional arguments passed to
- :class:`~werkzeug.test.EnvironBuilder`.
- :param kwargs: other keyword arguments passed to
- :class:`~werkzeug.test.EnvironBuilder`.
- """
- from flask.testing import make_test_environ_builder
-
- builder = make_test_environ_builder(self, *args, **kwargs)
-
- try:
- return self.request_context(builder.get_environ())
- finally:
- builder.close()
-
- def wsgi_app(self, environ, start_response):
- """The actual WSGI application. This is not implemented in
- :meth:`__call__` so that middlewares can be applied without
- losing a reference to the app object. Instead of doing this::
-
- app = MyMiddleware(app)
-
- It's a better idea to do this instead::
-
- app.wsgi_app = MyMiddleware(app.wsgi_app)
-
- Then you still have the original application object around and
- can continue to call methods on it.
-
- .. versionchanged:: 0.7
- Teardown events for the request and app contexts are called
- even if an unhandled error occurs. Other events may not be
- called depending on when an error occurs during dispatch.
- See :ref:`callbacks-and-errors`.
-
- :param environ: A WSGI environment.
- :param start_response: A callable accepting a status code,
- a list of headers, and an optional exception context to
- start the response.
- """
- ctx = self.request_context(environ)
- error = None
- try:
- try:
- ctx.push()
- response = self.full_dispatch_request()
- except Exception as e:
- error = e
- response = self.handle_exception(e)
- except:
- error = sys.exc_info()[1]
- raise
- return response(environ, start_response)
- finally:
- if self.should_ignore_error(error):
- error = None
- ctx.auto_pop(error)
-
- def __call__(self, environ, start_response):
- """The WSGI server calls the Flask application object as the
- WSGI application. This calls :meth:`wsgi_app` which can be
- wrapped to applying middleware."""
- return self.wsgi_app(environ, start_response)
-
- def __repr__(self):
- return '<%s %r>' % (
- self.__class__.__name__,
- self.name,
- )
diff --git a/lib/flask/blueprints.py b/lib/flask/blueprints.py
deleted file mode 100644
index 5ce5561e4e..0000000000
--- a/lib/flask/blueprints.py
+++ /dev/null
@@ -1,448 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- flask.blueprints
- ~~~~~~~~~~~~~~~~
-
- Blueprints are the recommended way to implement larger or more
- pluggable applications in Flask 0.7 and later.
-
- :copyright: © 2010 by the Pallets team.
- :license: BSD, see LICENSE for more details.
-"""
-from functools import update_wrapper
-from werkzeug.urls import url_join
-
-from .helpers import _PackageBoundObject, _endpoint_from_view_func
-
-
-class BlueprintSetupState(object):
- """Temporary holder object for registering a blueprint with the
- application. An instance of this class is created by the
- :meth:`~flask.Blueprint.make_setup_state` method and later passed
- to all register callback functions.
- """
-
- def __init__(self, blueprint, app, options, first_registration):
- #: a reference to the current application
- self.app = app
-
- #: a reference to the blueprint that created this setup state.
- self.blueprint = blueprint
-
- #: a dictionary with all options that were passed to the
- #: :meth:`~flask.Flask.register_blueprint` method.
- self.options = options
-
- #: as blueprints can be registered multiple times with the
- #: application and not everything wants to be registered
- #: multiple times on it, this attribute can be used to figure
- #: out if the blueprint was registered in the past already.
- self.first_registration = first_registration
-
- subdomain = self.options.get('subdomain')
- if subdomain is None:
- subdomain = self.blueprint.subdomain
-
- #: The subdomain that the blueprint should be active for, ``None``
- #: otherwise.
- self.subdomain = subdomain
-
- url_prefix = self.options.get('url_prefix')
- if url_prefix is None:
- url_prefix = self.blueprint.url_prefix
- #: The prefix that should be used for all URLs defined on the
- #: blueprint.
- self.url_prefix = url_prefix
-
- #: A dictionary with URL defaults that is added to each and every
- #: URL that was defined with the blueprint.
- self.url_defaults = dict(self.blueprint.url_values_defaults)
- self.url_defaults.update(self.options.get('url_defaults', ()))
-
- def add_url_rule(self, rule, endpoint=None, view_func=None, **options):
- """A helper method to register a rule (and optionally a view function)
- to the application. The endpoint is automatically prefixed with the
- blueprint's name.
- """
- if self.url_prefix is not None:
- if rule:
- rule = '/'.join((
- self.url_prefix.rstrip('/'), rule.lstrip('/')))
- else:
- rule = self.url_prefix
- options.setdefault('subdomain', self.subdomain)
- if endpoint is None:
- endpoint = _endpoint_from_view_func(view_func)
- defaults = self.url_defaults
- if 'defaults' in options:
- defaults = dict(defaults, **options.pop('defaults'))
- self.app.add_url_rule(rule, '%s.%s' % (self.blueprint.name, endpoint),
- view_func, defaults=defaults, **options)
-
-
-class Blueprint(_PackageBoundObject):
- """Represents a blueprint. A blueprint is an object that records
- functions that will be called with the
- :class:`~flask.blueprints.BlueprintSetupState` later to register functions
- or other things on the main application. See :ref:`blueprints` for more
- information.
-
- .. versionadded:: 0.7
- """
-
- warn_on_modifications = False
- _got_registered_once = False
-
- #: Blueprint local JSON decoder class to use.
- #: Set to ``None`` to use the app's :class:`~flask.app.Flask.json_encoder`.
- json_encoder = None
- #: Blueprint local JSON decoder class to use.
- #: Set to ``None`` to use the app's :class:`~flask.app.Flask.json_decoder`.
- json_decoder = None
-
- # TODO remove the next three attrs when Sphinx :inherited-members: works
- # https://github.com/sphinx-doc/sphinx/issues/741
-
- #: The name of the package or module that this app belongs to. Do not
- #: change this once it is set by the constructor.
- import_name = None
-
- #: Location of the template files to be added to the template lookup.
- #: ``None`` if templates should not be added.
- template_folder = None
-
- #: Absolute path to the package on the filesystem. Used to look up
- #: resources contained in the package.
- root_path = None
-
- def __init__(self, name, import_name, static_folder=None,
- static_url_path=None, template_folder=None,
- url_prefix=None, subdomain=None, url_defaults=None,
- root_path=None):
- _PackageBoundObject.__init__(self, import_name, template_folder,
- root_path=root_path)
- self.name = name
- self.url_prefix = url_prefix
- self.subdomain = subdomain
- self.static_folder = static_folder
- self.static_url_path = static_url_path
- self.deferred_functions = []
- if url_defaults is None:
- url_defaults = {}
- self.url_values_defaults = url_defaults
-
- def record(self, func):
- """Registers a function that is called when the blueprint is
- registered on the application. This function is called with the
- state as argument as returned by the :meth:`make_setup_state`
- method.
- """
- if self._got_registered_once and self.warn_on_modifications:
- from warnings import warn
- warn(Warning('The blueprint was already registered once '
- 'but is getting modified now. These changes '
- 'will not show up.'))
- self.deferred_functions.append(func)
-
- def record_once(self, func):
- """Works like :meth:`record` but wraps the function in another
- function that will ensure the function is only called once. If the
- blueprint is registered a second time on the application, the
- function passed is not called.
- """
- def wrapper(state):
- if state.first_registration:
- func(state)
- return self.record(update_wrapper(wrapper, func))
-
- def make_setup_state(self, app, options, first_registration=False):
- """Creates an instance of :meth:`~flask.blueprints.BlueprintSetupState`
- object that is later passed to the register callback functions.
- Subclasses can override this to return a subclass of the setup state.
- """
- return BlueprintSetupState(self, app, options, first_registration)
-
- def register(self, app, options, first_registration=False):
- """Called by :meth:`Flask.register_blueprint` to register all views
- and callbacks registered on the blueprint with the application. Creates
- a :class:`.BlueprintSetupState` and calls each :meth:`record` callback
- with it.
-
- :param app: The application this blueprint is being registered with.
- :param options: Keyword arguments forwarded from
- :meth:`~Flask.register_blueprint`.
- :param first_registration: Whether this is the first time this
- blueprint has been registered on the application.
- """
- self._got_registered_once = True
- state = self.make_setup_state(app, options, first_registration)
-
- if self.has_static_folder:
- state.add_url_rule(
- self.static_url_path + '/',
- view_func=self.send_static_file, endpoint='static'
- )
-
- for deferred in self.deferred_functions:
- deferred(state)
-
- def route(self, rule, **options):
- """Like :meth:`Flask.route` but for a blueprint. The endpoint for the
- :func:`url_for` function is prefixed with the name of the blueprint.
- """
- def decorator(f):
- endpoint = options.pop("endpoint", f.__name__)
- self.add_url_rule(rule, endpoint, f, **options)
- return f
- return decorator
-
- def add_url_rule(self, rule, endpoint=None, view_func=None, **options):
- """Like :meth:`Flask.add_url_rule` but for a blueprint. The endpoint for
- the :func:`url_for` function is prefixed with the name of the blueprint.
- """
- if endpoint:
- assert '.' not in endpoint, "Blueprint endpoints should not contain dots"
- if view_func and hasattr(view_func, '__name__'):
- assert '.' not in view_func.__name__, "Blueprint view function name should not contain dots"
- self.record(lambda s:
- s.add_url_rule(rule, endpoint, view_func, **options))
-
- def endpoint(self, endpoint):
- """Like :meth:`Flask.endpoint` but for a blueprint. This does not
- prefix the endpoint with the blueprint name, this has to be done
- explicitly by the user of this method. If the endpoint is prefixed
- with a `.` it will be registered to the current blueprint, otherwise
- it's an application independent endpoint.
- """
- def decorator(f):
- def register_endpoint(state):
- state.app.view_functions[endpoint] = f
- self.record_once(register_endpoint)
- return f
- return decorator
-
- def app_template_filter(self, name=None):
- """Register a custom template filter, available application wide. Like
- :meth:`Flask.template_filter` but for a blueprint.
-
- :param name: the optional name of the filter, otherwise the
- function name will be used.
- """
- def decorator(f):
- self.add_app_template_filter(f, name=name)
- return f
- return decorator
-
- def add_app_template_filter(self, f, name=None):
- """Register a custom template filter, available application wide. Like
- :meth:`Flask.add_template_filter` but for a blueprint. Works exactly
- like the :meth:`app_template_filter` decorator.
-
- :param name: the optional name of the filter, otherwise the
- function name will be used.
- """
- def register_template(state):
- state.app.jinja_env.filters[name or f.__name__] = f
- self.record_once(register_template)
-
- def app_template_test(self, name=None):
- """Register a custom template test, available application wide. Like
- :meth:`Flask.template_test` but for a blueprint.
-
- .. versionadded:: 0.10
-
- :param name: the optional name of the test, otherwise the
- function name will be used.
- """
- def decorator(f):
- self.add_app_template_test(f, name=name)
- return f
- return decorator
-
- def add_app_template_test(self, f, name=None):
- """Register a custom template test, available application wide. Like
- :meth:`Flask.add_template_test` but for a blueprint. Works exactly
- like the :meth:`app_template_test` decorator.
-
- .. versionadded:: 0.10
-
- :param name: the optional name of the test, otherwise the
- function name will be used.
- """
- def register_template(state):
- state.app.jinja_env.tests[name or f.__name__] = f
- self.record_once(register_template)
-
- def app_template_global(self, name=None):
- """Register a custom template global, available application wide. Like
- :meth:`Flask.template_global` but for a blueprint.
-
- .. versionadded:: 0.10
-
- :param name: the optional name of the global, otherwise the
- function name will be used.
- """
- def decorator(f):
- self.add_app_template_global(f, name=name)
- return f
- return decorator
-
- def add_app_template_global(self, f, name=None):
- """Register a custom template global, available application wide. Like
- :meth:`Flask.add_template_global` but for a blueprint. Works exactly
- like the :meth:`app_template_global` decorator.
-
- .. versionadded:: 0.10
-
- :param name: the optional name of the global, otherwise the
- function name will be used.
- """
- def register_template(state):
- state.app.jinja_env.globals[name or f.__name__] = f
- self.record_once(register_template)
-
- def before_request(self, f):
- """Like :meth:`Flask.before_request` but for a blueprint. This function
- is only executed before each request that is handled by a function of
- that blueprint.
- """
- self.record_once(lambda s: s.app.before_request_funcs
- .setdefault(self.name, []).append(f))
- return f
-
- def before_app_request(self, f):
- """Like :meth:`Flask.before_request`. Such a function is executed
- before each request, even if outside of a blueprint.
- """
- self.record_once(lambda s: s.app.before_request_funcs
- .setdefault(None, []).append(f))
- return f
-
- def before_app_first_request(self, f):
- """Like :meth:`Flask.before_first_request`. Such a function is
- executed before the first request to the application.
- """
- self.record_once(lambda s: s.app.before_first_request_funcs.append(f))
- return f
-
- def after_request(self, f):
- """Like :meth:`Flask.after_request` but for a blueprint. This function
- is only executed after each request that is handled by a function of
- that blueprint.
- """
- self.record_once(lambda s: s.app.after_request_funcs
- .setdefault(self.name, []).append(f))
- return f
-
- def after_app_request(self, f):
- """Like :meth:`Flask.after_request` but for a blueprint. Such a function
- is executed after each request, even if outside of the blueprint.
- """
- self.record_once(lambda s: s.app.after_request_funcs
- .setdefault(None, []).append(f))
- return f
-
- def teardown_request(self, f):
- """Like :meth:`Flask.teardown_request` but for a blueprint. This
- function is only executed when tearing down requests handled by a
- function of that blueprint. Teardown request functions are executed
- when the request context is popped, even when no actual request was
- performed.
- """
- self.record_once(lambda s: s.app.teardown_request_funcs
- .setdefault(self.name, []).append(f))
- return f
-
- def teardown_app_request(self, f):
- """Like :meth:`Flask.teardown_request` but for a blueprint. Such a
- function is executed when tearing down each request, even if outside of
- the blueprint.
- """
- self.record_once(lambda s: s.app.teardown_request_funcs
- .setdefault(None, []).append(f))
- return f
-
- def context_processor(self, f):
- """Like :meth:`Flask.context_processor` but for a blueprint. This
- function is only executed for requests handled by a blueprint.
- """
- self.record_once(lambda s: s.app.template_context_processors
- .setdefault(self.name, []).append(f))
- return f
-
- def app_context_processor(self, f):
- """Like :meth:`Flask.context_processor` but for a blueprint. Such a
- function is executed each request, even if outside of the blueprint.
- """
- self.record_once(lambda s: s.app.template_context_processors
- .setdefault(None, []).append(f))
- return f
-
- def app_errorhandler(self, code):
- """Like :meth:`Flask.errorhandler` but for a blueprint. This
- handler is used for all requests, even if outside of the blueprint.
- """
- def decorator(f):
- self.record_once(lambda s: s.app.errorhandler(code)(f))
- return f
- return decorator
-
- def url_value_preprocessor(self, f):
- """Registers a function as URL value preprocessor for this
- blueprint. It's called before the view functions are called and
- can modify the url values provided.
- """
- self.record_once(lambda s: s.app.url_value_preprocessors
- .setdefault(self.name, []).append(f))
- return f
-
- def url_defaults(self, f):
- """Callback function for URL defaults for this blueprint. It's called
- with the endpoint and values and should update the values passed
- in place.
- """
- self.record_once(lambda s: s.app.url_default_functions
- .setdefault(self.name, []).append(f))
- return f
-
- def app_url_value_preprocessor(self, f):
- """Same as :meth:`url_value_preprocessor` but application wide.
- """
- self.record_once(lambda s: s.app.url_value_preprocessors
- .setdefault(None, []).append(f))
- return f
-
- def app_url_defaults(self, f):
- """Same as :meth:`url_defaults` but application wide.
- """
- self.record_once(lambda s: s.app.url_default_functions
- .setdefault(None, []).append(f))
- return f
-
- def errorhandler(self, code_or_exception):
- """Registers an error handler that becomes active for this blueprint
- only. Please be aware that routing does not happen local to a
- blueprint so an error handler for 404 usually is not handled by
- a blueprint unless it is caused inside a view function. Another
- special case is the 500 internal server error which is always looked
- up from the application.
-
- Otherwise works as the :meth:`~flask.Flask.errorhandler` decorator
- of the :class:`~flask.Flask` object.
- """
- def decorator(f):
- self.record_once(lambda s: s.app._register_error_handler(
- self.name, code_or_exception, f))
- return f
- return decorator
-
- def register_error_handler(self, code_or_exception, f):
- """Non-decorator version of the :meth:`errorhandler` error attach
- function, akin to the :meth:`~flask.Flask.register_error_handler`
- application-wide function of the :class:`~flask.Flask` object but
- for error handlers limited to this blueprint.
-
- .. versionadded:: 0.11
- """
- self.record_once(lambda s: s.app._register_error_handler(
- self.name, code_or_exception, f))
diff --git a/lib/flask/cli.py b/lib/flask/cli.py
deleted file mode 100644
index efc1733e29..0000000000
--- a/lib/flask/cli.py
+++ /dev/null
@@ -1,898 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- flask.cli
- ~~~~~~~~~
-
- A simple command line application to run flask apps.
-
- :copyright: © 2010 by the Pallets team.
- :license: BSD, see LICENSE for more details.
-"""
-
-from __future__ import print_function
-
-import ast
-import inspect
-import os
-import re
-import ssl
-import sys
-import traceback
-from functools import update_wrapper
-from operator import attrgetter
-from threading import Lock, Thread
-
-import click
-from werkzeug.utils import import_string
-
-from . import __version__
-from ._compat import getargspec, iteritems, reraise, text_type
-from .globals import current_app
-from .helpers import get_debug_flag, get_env, get_load_dotenv
-
-try:
- import dotenv
-except ImportError:
- dotenv = None
-
-
-class NoAppException(click.UsageError):
- """Raised if an application cannot be found or loaded."""
-
-
-def find_best_app(script_info, module):
- """Given a module instance this tries to find the best possible
- application in the module or raises an exception.
- """
- from . import Flask
-
- # Search for the most common names first.
- for attr_name in ('app', 'application'):
- app = getattr(module, attr_name, None)
-
- if isinstance(app, Flask):
- return app
-
- # Otherwise find the only object that is a Flask instance.
- matches = [
- v for k, v in iteritems(module.__dict__) if isinstance(v, Flask)
- ]
-
- if len(matches) == 1:
- return matches[0]
- elif len(matches) > 1:
- raise NoAppException(
- 'Detected multiple Flask applications in module "{module}". Use '
- '"FLASK_APP={module}:name" to specify the correct '
- 'one.'.format(module=module.__name__)
- )
-
- # Search for app factory functions.
- for attr_name in ('create_app', 'make_app'):
- app_factory = getattr(module, attr_name, None)
-
- if inspect.isfunction(app_factory):
- try:
- app = call_factory(script_info, app_factory)
-
- if isinstance(app, Flask):
- return app
- except TypeError:
- if not _called_with_wrong_args(app_factory):
- raise
- raise NoAppException(
- 'Detected factory "{factory}" in module "{module}", but '
- 'could not call it without arguments. Use '
- '"FLASK_APP=\'{module}:{factory}(args)\'" to specify '
- 'arguments.'.format(
- factory=attr_name, module=module.__name__
- )
- )
-
- raise NoAppException(
- 'Failed to find Flask application or factory in module "{module}". '
- 'Use "FLASK_APP={module}:name to specify one.'.format(
- module=module.__name__
- )
- )
-
-
-def call_factory(script_info, app_factory, arguments=()):
- """Takes an app factory, a ``script_info` object and optionally a tuple
- of arguments. Checks for the existence of a script_info argument and calls
- the app_factory depending on that and the arguments provided.
- """
- args_spec = getargspec(app_factory)
- arg_names = args_spec.args
- arg_defaults = args_spec.defaults
-
- if 'script_info' in arg_names:
- return app_factory(*arguments, script_info=script_info)
- elif arguments:
- return app_factory(*arguments)
- elif not arguments and len(arg_names) == 1 and arg_defaults is None:
- return app_factory(script_info)
-
- return app_factory()
-
-
-def _called_with_wrong_args(factory):
- """Check whether calling a function raised a ``TypeError`` because
- the call failed or because something in the factory raised the
- error.
-
- :param factory: the factory function that was called
- :return: true if the call failed
- """
- tb = sys.exc_info()[2]
-
- try:
- while tb is not None:
- if tb.tb_frame.f_code is factory.__code__:
- # in the factory, it was called successfully
- return False
-
- tb = tb.tb_next
-
- # didn't reach the factory
- return True
- finally:
- del tb
-
-
-def find_app_by_string(script_info, module, app_name):
- """Checks if the given string is a variable name or a function. If it is a
- function, it checks for specified arguments and whether it takes a
- ``script_info`` argument and calls the function with the appropriate
- arguments.
- """
- from flask import Flask
- match = re.match(r'^ *([^ ()]+) *(?:\((.*?) *,? *\))? *$', app_name)
-
- if not match:
- raise NoAppException(
- '"{name}" is not a valid variable name or function '
- 'expression.'.format(name=app_name)
- )
-
- name, args = match.groups()
-
- try:
- attr = getattr(module, name)
- except AttributeError as e:
- raise NoAppException(e.args[0])
-
- if inspect.isfunction(attr):
- if args:
- try:
- args = ast.literal_eval('({args},)'.format(args=args))
- except (ValueError, SyntaxError)as e:
- raise NoAppException(
- 'Could not parse the arguments in '
- '"{app_name}".'.format(e=e, app_name=app_name)
- )
- else:
- args = ()
-
- try:
- app = call_factory(script_info, attr, args)
- except TypeError as e:
- if not _called_with_wrong_args(attr):
- raise
-
- raise NoAppException(
- '{e}\nThe factory "{app_name}" in module "{module}" could not '
- 'be called with the specified arguments.'.format(
- e=e, app_name=app_name, module=module.__name__
- )
- )
- else:
- app = attr
-
- if isinstance(app, Flask):
- return app
-
- raise NoAppException(
- 'A valid Flask application was not obtained from '
- '"{module}:{app_name}".'.format(
- module=module.__name__, app_name=app_name
- )
- )
-
-
-def prepare_import(path):
- """Given a filename this will try to calculate the python path, add it
- to the search path and return the actual module name that is expected.
- """
- path = os.path.realpath(path)
-
- if os.path.splitext(path)[1] == '.py':
- path = os.path.splitext(path)[0]
-
- if os.path.basename(path) == '__init__':
- path = os.path.dirname(path)
-
- module_name = []
-
- # move up until outside package structure (no __init__.py)
- while True:
- path, name = os.path.split(path)
- module_name.append(name)
-
- if not os.path.exists(os.path.join(path, '__init__.py')):
- break
-
- if sys.path[0] != path:
- sys.path.insert(0, path)
-
- return '.'.join(module_name[::-1])
-
-
-def locate_app(script_info, module_name, app_name, raise_if_not_found=True):
- __traceback_hide__ = True
-
- try:
- __import__(module_name)
- except ImportError:
- # Reraise the ImportError if it occurred within the imported module.
- # Determine this by checking whether the trace has a depth > 1.
- if sys.exc_info()[-1].tb_next:
- raise NoAppException(
- 'While importing "{name}", an ImportError was raised:'
- '\n\n{tb}'.format(name=module_name, tb=traceback.format_exc())
- )
- elif raise_if_not_found:
- raise NoAppException(
- 'Could not import "{name}".'.format(name=module_name)
- )
- else:
- return
-
- module = sys.modules[module_name]
-
- if app_name is None:
- return find_best_app(script_info, module)
- else:
- return find_app_by_string(script_info, module, app_name)
-
-
-def get_version(ctx, param, value):
- if not value or ctx.resilient_parsing:
- return
- message = 'Flask %(version)s\nPython %(python_version)s'
- click.echo(message % {
- 'version': __version__,
- 'python_version': sys.version,
- }, color=ctx.color)
- ctx.exit()
-
-
-version_option = click.Option(
- ['--version'],
- help='Show the flask version',
- expose_value=False,
- callback=get_version,
- is_flag=True,
- is_eager=True
-)
-
-
-class DispatchingApp(object):
- """Special application that dispatches to a Flask application which
- is imported by name in a background thread. If an error happens
- it is recorded and shown as part of the WSGI handling which in case
- of the Werkzeug debugger means that it shows up in the browser.
- """
-
- def __init__(self, loader, use_eager_loading=False):
- self.loader = loader
- self._app = None
- self._lock = Lock()
- self._bg_loading_exc_info = None
- if use_eager_loading:
- self._load_unlocked()
- else:
- self._load_in_background()
-
- def _load_in_background(self):
- def _load_app():
- __traceback_hide__ = True
- with self._lock:
- try:
- self._load_unlocked()
- except Exception:
- self._bg_loading_exc_info = sys.exc_info()
- t = Thread(target=_load_app, args=())
- t.start()
-
- def _flush_bg_loading_exception(self):
- __traceback_hide__ = True
- exc_info = self._bg_loading_exc_info
- if exc_info is not None:
- self._bg_loading_exc_info = None
- reraise(*exc_info)
-
- def _load_unlocked(self):
- __traceback_hide__ = True
- self._app = rv = self.loader()
- self._bg_loading_exc_info = None
- return rv
-
- def __call__(self, environ, start_response):
- __traceback_hide__ = True
- if self._app is not None:
- return self._app(environ, start_response)
- self._flush_bg_loading_exception()
- with self._lock:
- if self._app is not None:
- rv = self._app
- else:
- rv = self._load_unlocked()
- return rv(environ, start_response)
-
-
-class ScriptInfo(object):
- """Help object to deal with Flask applications. This is usually not
- necessary to interface with as it's used internally in the dispatching
- to click. In future versions of Flask this object will most likely play
- a bigger role. Typically it's created automatically by the
- :class:`FlaskGroup` but you can also manually create it and pass it
- onwards as click object.
- """
-
- def __init__(self, app_import_path=None, create_app=None):
- #: Optionally the import path for the Flask application.
- self.app_import_path = app_import_path or os.environ.get('FLASK_APP')
- #: Optionally a function that is passed the script info to create
- #: the instance of the application.
- self.create_app = create_app
- #: A dictionary with arbitrary data that can be associated with
- #: this script info.
- self.data = {}
- self._loaded_app = None
-
- def load_app(self):
- """Loads the Flask app (if not yet loaded) and returns it. Calling
- this multiple times will just result in the already loaded app to
- be returned.
- """
- __traceback_hide__ = True
-
- if self._loaded_app is not None:
- return self._loaded_app
-
- app = None
-
- if self.create_app is not None:
- app = call_factory(self, self.create_app)
- else:
- if self.app_import_path:
- path, name = (self.app_import_path.split(':', 1) + [None])[:2]
- import_name = prepare_import(path)
- app = locate_app(self, import_name, name)
- else:
- for path in ('wsgi.py', 'app.py'):
- import_name = prepare_import(path)
- app = locate_app(self, import_name, None,
- raise_if_not_found=False)
-
- if app:
- break
-
- if not app:
- raise NoAppException(
- 'Could not locate a Flask application. You did not provide '
- 'the "FLASK_APP" environment variable, and a "wsgi.py" or '
- '"app.py" module was not found in the current directory.'
- )
-
- debug = get_debug_flag()
-
- # Update the app's debug flag through the descriptor so that other
- # values repopulate as well.
- if debug is not None:
- app.debug = debug
-
- self._loaded_app = app
- return app
-
-
-pass_script_info = click.make_pass_decorator(ScriptInfo, ensure=True)
-
-
-def with_appcontext(f):
- """Wraps a callback so that it's guaranteed to be executed with the
- script's application context. If callbacks are registered directly
- to the ``app.cli`` object then they are wrapped with this function
- by default unless it's disabled.
- """
- @click.pass_context
- def decorator(__ctx, *args, **kwargs):
- with __ctx.ensure_object(ScriptInfo).load_app().app_context():
- return __ctx.invoke(f, *args, **kwargs)
- return update_wrapper(decorator, f)
-
-
-class AppGroup(click.Group):
- """This works similar to a regular click :class:`~click.Group` but it
- changes the behavior of the :meth:`command` decorator so that it
- automatically wraps the functions in :func:`with_appcontext`.
-
- Not to be confused with :class:`FlaskGroup`.
- """
-
- def command(self, *args, **kwargs):
- """This works exactly like the method of the same name on a regular
- :class:`click.Group` but it wraps callbacks in :func:`with_appcontext`
- unless it's disabled by passing ``with_appcontext=False``.
- """
- wrap_for_ctx = kwargs.pop('with_appcontext', True)
- def decorator(f):
- if wrap_for_ctx:
- f = with_appcontext(f)
- return click.Group.command(self, *args, **kwargs)(f)
- return decorator
-
- def group(self, *args, **kwargs):
- """This works exactly like the method of the same name on a regular
- :class:`click.Group` but it defaults the group class to
- :class:`AppGroup`.
- """
- kwargs.setdefault('cls', AppGroup)
- return click.Group.group(self, *args, **kwargs)
-
-
-class FlaskGroup(AppGroup):
- """Special subclass of the :class:`AppGroup` group that supports
- loading more commands from the configured Flask app. Normally a
- developer does not have to interface with this class but there are
- some very advanced use cases for which it makes sense to create an
- instance of this.
-
- For information as of why this is useful see :ref:`custom-scripts`.
-
- :param add_default_commands: if this is True then the default run and
- shell commands wil be added.
- :param add_version_option: adds the ``--version`` option.
- :param create_app: an optional callback that is passed the script info and
- returns the loaded app.
- :param load_dotenv: Load the nearest :file:`.env` and :file:`.flaskenv`
- files to set environment variables. Will also change the working
- directory to the directory containing the first file found.
-
- .. versionchanged:: 1.0
- If installed, python-dotenv will be used to load environment variables
- from :file:`.env` and :file:`.flaskenv` files.
- """
-
- def __init__(self, add_default_commands=True, create_app=None,
- add_version_option=True, load_dotenv=True, **extra):
- params = list(extra.pop('params', None) or ())
-
- if add_version_option:
- params.append(version_option)
-
- AppGroup.__init__(self, params=params, **extra)
- self.create_app = create_app
- self.load_dotenv = load_dotenv
-
- if add_default_commands:
- self.add_command(run_command)
- self.add_command(shell_command)
- self.add_command(routes_command)
-
- self._loaded_plugin_commands = False
-
- def _load_plugin_commands(self):
- if self._loaded_plugin_commands:
- return
- try:
- import pkg_resources
- except ImportError:
- self._loaded_plugin_commands = True
- return
-
- for ep in pkg_resources.iter_entry_points('flask.commands'):
- self.add_command(ep.load(), ep.name)
- self._loaded_plugin_commands = True
-
- def get_command(self, ctx, name):
- self._load_plugin_commands()
-
- # We load built-in commands first as these should always be the
- # same no matter what the app does. If the app does want to
- # override this it needs to make a custom instance of this group
- # and not attach the default commands.
- #
- # This also means that the script stays functional in case the
- # application completely fails.
- rv = AppGroup.get_command(self, ctx, name)
- if rv is not None:
- return rv
-
- info = ctx.ensure_object(ScriptInfo)
- try:
- rv = info.load_app().cli.get_command(ctx, name)
- if rv is not None:
- return rv
- except NoAppException:
- pass
-
- def list_commands(self, ctx):
- self._load_plugin_commands()
-
- # The commands available is the list of both the application (if
- # available) plus the builtin commands.
- rv = set(click.Group.list_commands(self, ctx))
- info = ctx.ensure_object(ScriptInfo)
- try:
- rv.update(info.load_app().cli.list_commands(ctx))
- except Exception:
- # Here we intentionally swallow all exceptions as we don't
- # want the help page to break if the app does not exist.
- # If someone attempts to use the command we try to create
- # the app again and this will give us the error.
- # However, we will not do so silently because that would confuse
- # users.
- traceback.print_exc()
- return sorted(rv)
-
- def main(self, *args, **kwargs):
- # Set a global flag that indicates that we were invoked from the
- # command line interface. This is detected by Flask.run to make the
- # call into a no-op. This is necessary to avoid ugly errors when the
- # script that is loaded here also attempts to start a server.
- os.environ['FLASK_RUN_FROM_CLI'] = 'true'
-
- if get_load_dotenv(self.load_dotenv):
- load_dotenv()
-
- obj = kwargs.get('obj')
-
- if obj is None:
- obj = ScriptInfo(create_app=self.create_app)
-
- kwargs['obj'] = obj
- kwargs.setdefault('auto_envvar_prefix', 'FLASK')
- return super(FlaskGroup, self).main(*args, **kwargs)
-
-
-def _path_is_ancestor(path, other):
- """Take ``other`` and remove the length of ``path`` from it. Then join it
- to ``path``. If it is the original value, ``path`` is an ancestor of
- ``other``."""
- return os.path.join(path, other[len(path):].lstrip(os.sep)) == other
-
-
-def load_dotenv(path=None):
- """Load "dotenv" files in order of precedence to set environment variables.
-
- If an env var is already set it is not overwritten, so earlier files in the
- list are preferred over later files.
-
- Changes the current working directory to the location of the first file
- found, with the assumption that it is in the top level project directory
- and will be where the Python path should import local packages from.
-
- This is a no-op if `python-dotenv`_ is not installed.
-
- .. _python-dotenv: https://github.com/theskumar/python-dotenv#readme
-
- :param path: Load the file at this location instead of searching.
- :return: ``True`` if a file was loaded.
-
- .. versionadded:: 1.0
- """
- if dotenv is None:
- if path or os.path.exists('.env') or os.path.exists('.flaskenv'):
- click.secho(
- ' * Tip: There are .env files present.'
- ' Do "pip install python-dotenv" to use them.',
- fg='yellow')
- return
-
- if path is not None:
- return dotenv.load_dotenv(path)
-
- new_dir = None
-
- for name in ('.env', '.flaskenv'):
- path = dotenv.find_dotenv(name, usecwd=True)
-
- if not path:
- continue
-
- if new_dir is None:
- new_dir = os.path.dirname(path)
-
- dotenv.load_dotenv(path)
-
- if new_dir and os.getcwd() != new_dir:
- os.chdir(new_dir)
-
- return new_dir is not None # at least one file was located and loaded
-
-
-def show_server_banner(env, debug, app_import_path, eager_loading):
- """Show extra startup messages the first time the server is run,
- ignoring the reloader.
- """
- if os.environ.get('WERKZEUG_RUN_MAIN') == 'true':
- return
-
- if app_import_path is not None:
- message = ' * Serving Flask app "{0}"'.format(app_import_path)
-
- if not eager_loading:
- message += ' (lazy loading)'
-
- click.echo(message)
-
- click.echo(' * Environment: {0}'.format(env))
-
- if env == 'production':
- click.secho(
- ' WARNING: Do not use the development server in a production'
- ' environment.', fg='red')
- click.secho(' Use a production WSGI server instead.', dim=True)
-
- if debug is not None:
- click.echo(' * Debug mode: {0}'.format('on' if debug else 'off'))
-
-
-class CertParamType(click.ParamType):
- """Click option type for the ``--cert`` option. Allows either an
- existing file, the string ``'adhoc'``, or an import for a
- :class:`~ssl.SSLContext` object.
- """
-
- name = 'path'
-
- def __init__(self):
- self.path_type = click.Path(
- exists=True, dir_okay=False, resolve_path=True)
-
- def convert(self, value, param, ctx):
- try:
- return self.path_type(value, param, ctx)
- except click.BadParameter:
- value = click.STRING(value, param, ctx).lower()
-
- if value == 'adhoc':
- try:
- import OpenSSL
- except ImportError:
- raise click.BadParameter(
- 'Using ad-hoc certificates requires pyOpenSSL.',
- ctx, param)
-
- return value
-
- obj = import_string(value, silent=True)
-
- if sys.version_info < (2, 7):
- if obj:
- return obj
- else:
- if isinstance(obj, ssl.SSLContext):
- return obj
-
- raise
-
-
-def _validate_key(ctx, param, value):
- """The ``--key`` option must be specified when ``--cert`` is a file.
- Modifies the ``cert`` param to be a ``(cert, key)`` pair if needed.
- """
- cert = ctx.params.get('cert')
- is_adhoc = cert == 'adhoc'
-
- if sys.version_info < (2, 7):
- is_context = cert and not isinstance(cert, (text_type, bytes))
- else:
- is_context = isinstance(cert, ssl.SSLContext)
-
- if value is not None:
- if is_adhoc:
- raise click.BadParameter(
- 'When "--cert" is "adhoc", "--key" is not used.',
- ctx, param)
-
- if is_context:
- raise click.BadParameter(
- 'When "--cert" is an SSLContext object, "--key is not used.',
- ctx, param)
-
- if not cert:
- raise click.BadParameter(
- '"--cert" must also be specified.',
- ctx, param)
-
- ctx.params['cert'] = cert, value
-
- else:
- if cert and not (is_adhoc or is_context):
- raise click.BadParameter(
- 'Required when using "--cert".',
- ctx, param)
-
- return value
-
-
-@click.command('run', short_help='Runs a development server.')
-@click.option('--host', '-h', default='127.0.0.1',
- help='The interface to bind to.')
-@click.option('--port', '-p', default=5000,
- help='The port to bind to.')
-@click.option('--cert', type=CertParamType(),
- help='Specify a certificate file to use HTTPS.')
-@click.option('--key',
- type=click.Path(exists=True, dir_okay=False, resolve_path=True),
- callback=_validate_key, expose_value=False,
- help='The key file to use when specifying a certificate.')
-@click.option('--reload/--no-reload', default=None,
- help='Enable or disable the reloader. By default the reloader '
- 'is active if debug is enabled.')
-@click.option('--debugger/--no-debugger', default=None,
- help='Enable or disable the debugger. By default the debugger '
- 'is active if debug is enabled.')
-@click.option('--eager-loading/--lazy-loader', default=None,
- help='Enable or disable eager loading. By default eager '
- 'loading is enabled if the reloader is disabled.')
-@click.option('--with-threads/--without-threads', default=True,
- help='Enable or disable multithreading.')
-@pass_script_info
-def run_command(info, host, port, reload, debugger, eager_loading,
- with_threads, cert):
- """Run a local development server.
-
- This server is for development purposes only. It does not provide
- the stability, security, or performance of production WSGI servers.
-
- The reloader and debugger are enabled by default if
- FLASK_ENV=development or FLASK_DEBUG=1.
- """
- debug = get_debug_flag()
-
- if reload is None:
- reload = debug
-
- if debugger is None:
- debugger = debug
-
- if eager_loading is None:
- eager_loading = not reload
-
- show_server_banner(get_env(), debug, info.app_import_path, eager_loading)
- app = DispatchingApp(info.load_app, use_eager_loading=eager_loading)
-
- from werkzeug.serving import run_simple
- run_simple(host, port, app, use_reloader=reload, use_debugger=debugger,
- threaded=with_threads, ssl_context=cert)
-
-
-@click.command('shell', short_help='Runs a shell in the app context.')
-@with_appcontext
-def shell_command():
- """Runs an interactive Python shell in the context of a given
- Flask application. The application will populate the default
- namespace of this shell according to it's configuration.
-
- This is useful for executing small snippets of management code
- without having to manually configure the application.
- """
- import code
- from flask.globals import _app_ctx_stack
- app = _app_ctx_stack.top.app
- banner = 'Python %s on %s\nApp: %s [%s]\nInstance: %s' % (
- sys.version,
- sys.platform,
- app.import_name,
- app.env,
- app.instance_path,
- )
- ctx = {}
-
- # Support the regular Python interpreter startup script if someone
- # is using it.
- startup = os.environ.get('PYTHONSTARTUP')
- if startup and os.path.isfile(startup):
- with open(startup, 'r') as f:
- eval(compile(f.read(), startup, 'exec'), ctx)
-
- ctx.update(app.make_shell_context())
-
- code.interact(banner=banner, local=ctx)
-
-
-@click.command('routes', short_help='Show the routes for the app.')
-@click.option(
- '--sort', '-s',
- type=click.Choice(('endpoint', 'methods', 'rule', 'match')),
- default='endpoint',
- help=(
- 'Method to sort routes by. "match" is the order that Flask will match '
- 'routes when dispatching a request.'
- )
-)
-@click.option(
- '--all-methods',
- is_flag=True,
- help="Show HEAD and OPTIONS methods."
-)
-@with_appcontext
-def routes_command(sort, all_methods):
- """Show all registered routes with endpoints and methods."""
-
- rules = list(current_app.url_map.iter_rules())
- if not rules:
- click.echo('No routes were registered.')
- return
-
- ignored_methods = set(() if all_methods else ('HEAD', 'OPTIONS'))
-
- if sort in ('endpoint', 'rule'):
- rules = sorted(rules, key=attrgetter(sort))
- elif sort == 'methods':
- rules = sorted(rules, key=lambda rule: sorted(rule.methods))
-
- rule_methods = [
- ', '.join(sorted(rule.methods - ignored_methods)) for rule in rules
- ]
-
- headers = ('Endpoint', 'Methods', 'Rule')
- widths = (
- max(len(rule.endpoint) for rule in rules),
- max(len(methods) for methods in rule_methods),
- max(len(rule.rule) for rule in rules),
- )
- widths = [max(len(h), w) for h, w in zip(headers, widths)]
- row = '{{0:<{0}}} {{1:<{1}}} {{2:<{2}}}'.format(*widths)
-
- click.echo(row.format(*headers).strip())
- click.echo(row.format(*('-' * width for width in widths)))
-
- for rule, methods in zip(rules, rule_methods):
- click.echo(row.format(rule.endpoint, methods, rule.rule).rstrip())
-
-
-cli = FlaskGroup(help="""\
-A general utility script for Flask applications.
-
-Provides commands from Flask, extensions, and the application. Loads the
-application defined in the FLASK_APP environment variable, or from a wsgi.py
-file. Setting the FLASK_ENV environment variable to 'development' will enable
-debug mode.
-
-\b
- {prefix}{cmd} FLASK_APP=hello.py
- {prefix}{cmd} FLASK_ENV=development
- {prefix}flask run
-""".format(
- cmd='export' if os.name == 'posix' else 'set',
- prefix='$ ' if os.name == 'posix' else '> '
-))
-
-
-def main(as_module=False):
- args = sys.argv[1:]
-
- if as_module:
- this_module = 'flask'
-
- if sys.version_info < (2, 7):
- this_module += '.cli'
-
- name = 'python -m ' + this_module
-
- # Python rewrites "python -m flask" to the path to the file in argv.
- # Restore the original command so that the reloader works.
- sys.argv = ['-m', this_module] + args
- else:
- name = None
-
- cli.main(args=args, prog_name=name)
-
-
-if __name__ == '__main__':
- main(as_module=True)
diff --git a/lib/flask/config.py b/lib/flask/config.py
deleted file mode 100644
index d6074baa85..0000000000
--- a/lib/flask/config.py
+++ /dev/null
@@ -1,265 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- flask.config
- ~~~~~~~~~~~~
-
- Implements the configuration related objects.
-
- :copyright: © 2010 by the Pallets team.
- :license: BSD, see LICENSE for more details.
-"""
-
-import os
-import types
-import errno
-
-from werkzeug.utils import import_string
-from ._compat import string_types, iteritems
-from . import json
-
-
-class ConfigAttribute(object):
- """Makes an attribute forward to the config"""
-
- def __init__(self, name, get_converter=None):
- self.__name__ = name
- self.get_converter = get_converter
-
- def __get__(self, obj, type=None):
- if obj is None:
- return self
- rv = obj.config[self.__name__]
- if self.get_converter is not None:
- rv = self.get_converter(rv)
- return rv
-
- def __set__(self, obj, value):
- obj.config[self.__name__] = value
-
-
-class Config(dict):
- """Works exactly like a dict but provides ways to fill it from files
- or special dictionaries. There are two common patterns to populate the
- config.
-
- Either you can fill the config from a config file::
-
- app.config.from_pyfile('yourconfig.cfg')
-
- Or alternatively you can define the configuration options in the
- module that calls :meth:`from_object` or provide an import path to
- a module that should be loaded. It is also possible to tell it to
- use the same module and with that provide the configuration values
- just before the call::
-
- DEBUG = True
- SECRET_KEY = 'development key'
- app.config.from_object(__name__)
-
- In both cases (loading from any Python file or loading from modules),
- only uppercase keys are added to the config. This makes it possible to use
- lowercase values in the config file for temporary values that are not added
- to the config or to define the config keys in the same file that implements
- the application.
-
- Probably the most interesting way to load configurations is from an
- environment variable pointing to a file::
-
- app.config.from_envvar('YOURAPPLICATION_SETTINGS')
-
- In this case before launching the application you have to set this
- environment variable to the file you want to use. On Linux and OS X
- use the export statement::
-
- export YOURAPPLICATION_SETTINGS='/path/to/config/file'
-
- On windows use `set` instead.
-
- :param root_path: path to which files are read relative from. When the
- config object is created by the application, this is
- the application's :attr:`~flask.Flask.root_path`.
- :param defaults: an optional dictionary of default values
- """
-
- def __init__(self, root_path, defaults=None):
- dict.__init__(self, defaults or {})
- self.root_path = root_path
-
- def from_envvar(self, variable_name, silent=False):
- """Loads a configuration from an environment variable pointing to
- a configuration file. This is basically just a shortcut with nicer
- error messages for this line of code::
-
- app.config.from_pyfile(os.environ['YOURAPPLICATION_SETTINGS'])
-
- :param variable_name: name of the environment variable
- :param silent: set to ``True`` if you want silent failure for missing
- files.
- :return: bool. ``True`` if able to load config, ``False`` otherwise.
- """
- rv = os.environ.get(variable_name)
- if not rv:
- if silent:
- return False
- raise RuntimeError('The environment variable %r is not set '
- 'and as such configuration could not be '
- 'loaded. Set this variable and make it '
- 'point to a configuration file' %
- variable_name)
- return self.from_pyfile(rv, silent=silent)
-
- def from_pyfile(self, filename, silent=False):
- """Updates the values in the config from a Python file. This function
- behaves as if the file was imported as module with the
- :meth:`from_object` function.
-
- :param filename: the filename of the config. This can either be an
- absolute filename or a filename relative to the
- root path.
- :param silent: set to ``True`` if you want silent failure for missing
- files.
-
- .. versionadded:: 0.7
- `silent` parameter.
- """
- filename = os.path.join(self.root_path, filename)
- d = types.ModuleType('config')
- d.__file__ = filename
- try:
- with open(filename, mode='rb') as config_file:
- exec(compile(config_file.read(), filename, 'exec'), d.__dict__)
- except IOError as e:
- if silent and e.errno in (
- errno.ENOENT, errno.EISDIR, errno.ENOTDIR
- ):
- return False
- e.strerror = 'Unable to load configuration file (%s)' % e.strerror
- raise
- self.from_object(d)
- return True
-
- def from_object(self, obj):
- """Updates the values from the given object. An object can be of one
- of the following two types:
-
- - a string: in this case the object with that name will be imported
- - an actual object reference: that object is used directly
-
- Objects are usually either modules or classes. :meth:`from_object`
- loads only the uppercase attributes of the module/class. A ``dict``
- object will not work with :meth:`from_object` because the keys of a
- ``dict`` are not attributes of the ``dict`` class.
-
- Example of module-based configuration::
-
- app.config.from_object('yourapplication.default_config')
- from yourapplication import default_config
- app.config.from_object(default_config)
-
- You should not use this function to load the actual configuration but
- rather configuration defaults. The actual config should be loaded
- with :meth:`from_pyfile` and ideally from a location not within the
- package because the package might be installed system wide.
-
- See :ref:`config-dev-prod` for an example of class-based configuration
- using :meth:`from_object`.
-
- :param obj: an import name or object
- """
- if isinstance(obj, string_types):
- obj = import_string(obj)
- for key in dir(obj):
- if key.isupper():
- self[key] = getattr(obj, key)
-
- def from_json(self, filename, silent=False):
- """Updates the values in the config from a JSON file. This function
- behaves as if the JSON object was a dictionary and passed to the
- :meth:`from_mapping` function.
-
- :param filename: the filename of the JSON file. This can either be an
- absolute filename or a filename relative to the
- root path.
- :param silent: set to ``True`` if you want silent failure for missing
- files.
-
- .. versionadded:: 0.11
- """
- filename = os.path.join(self.root_path, filename)
-
- try:
- with open(filename) as json_file:
- obj = json.loads(json_file.read())
- except IOError as e:
- if silent and e.errno in (errno.ENOENT, errno.EISDIR):
- return False
- e.strerror = 'Unable to load configuration file (%s)' % e.strerror
- raise
- return self.from_mapping(obj)
-
- def from_mapping(self, *mapping, **kwargs):
- """Updates the config like :meth:`update` ignoring items with non-upper
- keys.
-
- .. versionadded:: 0.11
- """
- mappings = []
- if len(mapping) == 1:
- if hasattr(mapping[0], 'items'):
- mappings.append(mapping[0].items())
- else:
- mappings.append(mapping[0])
- elif len(mapping) > 1:
- raise TypeError(
- 'expected at most 1 positional argument, got %d' % len(mapping)
- )
- mappings.append(kwargs.items())
- for mapping in mappings:
- for (key, value) in mapping:
- if key.isupper():
- self[key] = value
- return True
-
- def get_namespace(self, namespace, lowercase=True, trim_namespace=True):
- """Returns a dictionary containing a subset of configuration options
- that match the specified namespace/prefix. Example usage::
-
- app.config['IMAGE_STORE_TYPE'] = 'fs'
- app.config['IMAGE_STORE_PATH'] = '/var/app/images'
- app.config['IMAGE_STORE_BASE_URL'] = 'http://img.website.com'
- image_store_config = app.config.get_namespace('IMAGE_STORE_')
-
- The resulting dictionary `image_store_config` would look like::
-
- {
- 'type': 'fs',
- 'path': '/var/app/images',
- 'base_url': 'http://img.website.com'
- }
-
- This is often useful when configuration options map directly to
- keyword arguments in functions or class constructors.
-
- :param namespace: a configuration namespace
- :param lowercase: a flag indicating if the keys of the resulting
- dictionary should be lowercase
- :param trim_namespace: a flag indicating if the keys of the resulting
- dictionary should not include the namespace
-
- .. versionadded:: 0.11
- """
- rv = {}
- for k, v in iteritems(self):
- if not k.startswith(namespace):
- continue
- if trim_namespace:
- key = k[len(namespace):]
- else:
- key = k
- if lowercase:
- key = key.lower()
- rv[key] = v
- return rv
-
- def __repr__(self):
- return '<%s %s>' % (self.__class__.__name__, dict.__repr__(self))
diff --git a/lib/flask/ctx.py b/lib/flask/ctx.py
deleted file mode 100644
index 8472c920c2..0000000000
--- a/lib/flask/ctx.py
+++ /dev/null
@@ -1,457 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- flask.ctx
- ~~~~~~~~~
-
- Implements the objects required to keep the context.
-
- :copyright: © 2010 by the Pallets team.
- :license: BSD, see LICENSE for more details.
-"""
-
-import sys
-from functools import update_wrapper
-
-from werkzeug.exceptions import HTTPException
-
-from .globals import _request_ctx_stack, _app_ctx_stack
-from .signals import appcontext_pushed, appcontext_popped
-from ._compat import BROKEN_PYPY_CTXMGR_EXIT, reraise
-
-
-# a singleton sentinel value for parameter defaults
-_sentinel = object()
-
-
-class _AppCtxGlobals(object):
- """A plain object. Used as a namespace for storing data during an
- application context.
-
- Creating an app context automatically creates this object, which is
- made available as the :data:`g` proxy.
-
- .. describe:: 'key' in g
-
- Check whether an attribute is present.
-
- .. versionadded:: 0.10
-
- .. describe:: iter(g)
-
- Return an iterator over the attribute names.
-
- .. versionadded:: 0.10
- """
-
- def get(self, name, default=None):
- """Get an attribute by name, or a default value. Like
- :meth:`dict.get`.
-
- :param name: Name of attribute to get.
- :param default: Value to return if the attribute is not present.
-
- .. versionadded:: 0.10
- """
- return self.__dict__.get(name, default)
-
- def pop(self, name, default=_sentinel):
- """Get and remove an attribute by name. Like :meth:`dict.pop`.
-
- :param name: Name of attribute to pop.
- :param default: Value to return if the attribute is not present,
- instead of raise a ``KeyError``.
-
- .. versionadded:: 0.11
- """
- if default is _sentinel:
- return self.__dict__.pop(name)
- else:
- return self.__dict__.pop(name, default)
-
- def setdefault(self, name, default=None):
- """Get the value of an attribute if it is present, otherwise
- set and return a default value. Like :meth:`dict.setdefault`.
-
- :param name: Name of attribute to get.
- :param: default: Value to set and return if the attribute is not
- present.
-
- .. versionadded:: 0.11
- """
- return self.__dict__.setdefault(name, default)
-
- def __contains__(self, item):
- return item in self.__dict__
-
- def __iter__(self):
- return iter(self.__dict__)
-
- def __repr__(self):
- top = _app_ctx_stack.top
- if top is not None:
- return '' % top.app.name
- return object.__repr__(self)
-
-
-def after_this_request(f):
- """Executes a function after this request. This is useful to modify
- response objects. The function is passed the response object and has
- to return the same or a new one.
-
- Example::
-
- @app.route('/')
- def index():
- @after_this_request
- def add_header(response):
- response.headers['X-Foo'] = 'Parachute'
- return response
- return 'Hello World!'
-
- This is more useful if a function other than the view function wants to
- modify a response. For instance think of a decorator that wants to add
- some headers without converting the return value into a response object.
-
- .. versionadded:: 0.9
- """
- _request_ctx_stack.top._after_request_functions.append(f)
- return f
-
-
-def copy_current_request_context(f):
- """A helper function that decorates a function to retain the current
- request context. This is useful when working with greenlets. The moment
- the function is decorated a copy of the request context is created and
- then pushed when the function is called.
-
- Example::
-
- import gevent
- from flask import copy_current_request_context
-
- @app.route('/')
- def index():
- @copy_current_request_context
- def do_some_work():
- # do some work here, it can access flask.request like you
- # would otherwise in the view function.
- ...
- gevent.spawn(do_some_work)
- return 'Regular response'
-
- .. versionadded:: 0.10
- """
- top = _request_ctx_stack.top
- if top is None:
- raise RuntimeError('This decorator can only be used at local scopes '
- 'when a request context is on the stack. For instance within '
- 'view functions.')
- reqctx = top.copy()
- def wrapper(*args, **kwargs):
- with reqctx:
- return f(*args, **kwargs)
- return update_wrapper(wrapper, f)
-
-
-def has_request_context():
- """If you have code that wants to test if a request context is there or
- not this function can be used. For instance, you may want to take advantage
- of request information if the request object is available, but fail
- silently if it is unavailable.
-
- ::
-
- class User(db.Model):
-
- def __init__(self, username, remote_addr=None):
- self.username = username
- if remote_addr is None and has_request_context():
- remote_addr = request.remote_addr
- self.remote_addr = remote_addr
-
- Alternatively you can also just test any of the context bound objects
- (such as :class:`request` or :class:`g` for truthness)::
-
- class User(db.Model):
-
- def __init__(self, username, remote_addr=None):
- self.username = username
- if remote_addr is None and request:
- remote_addr = request.remote_addr
- self.remote_addr = remote_addr
-
- .. versionadded:: 0.7
- """
- return _request_ctx_stack.top is not None
-
-
-def has_app_context():
- """Works like :func:`has_request_context` but for the application
- context. You can also just do a boolean check on the
- :data:`current_app` object instead.
-
- .. versionadded:: 0.9
- """
- return _app_ctx_stack.top is not None
-
-
-class AppContext(object):
- """The application context binds an application object implicitly
- to the current thread or greenlet, similar to how the
- :class:`RequestContext` binds request information. The application
- context is also implicitly created if a request context is created
- but the application is not on top of the individual application
- context.
- """
-
- def __init__(self, app):
- self.app = app
- self.url_adapter = app.create_url_adapter(None)
- self.g = app.app_ctx_globals_class()
-
- # Like request context, app contexts can be pushed multiple times
- # but there a basic "refcount" is enough to track them.
- self._refcnt = 0
-
- def push(self):
- """Binds the app context to the current context."""
- self._refcnt += 1
- if hasattr(sys, 'exc_clear'):
- sys.exc_clear()
- _app_ctx_stack.push(self)
- appcontext_pushed.send(self.app)
-
- def pop(self, exc=_sentinel):
- """Pops the app context."""
- try:
- self._refcnt -= 1
- if self._refcnt <= 0:
- if exc is _sentinel:
- exc = sys.exc_info()[1]
- self.app.do_teardown_appcontext(exc)
- finally:
- rv = _app_ctx_stack.pop()
- assert rv is self, 'Popped wrong app context. (%r instead of %r)' \
- % (rv, self)
- appcontext_popped.send(self.app)
-
- def __enter__(self):
- self.push()
- return self
-
- def __exit__(self, exc_type, exc_value, tb):
- self.pop(exc_value)
-
- if BROKEN_PYPY_CTXMGR_EXIT and exc_type is not None:
- reraise(exc_type, exc_value, tb)
-
-
-class RequestContext(object):
- """The request context contains all request relevant information. It is
- created at the beginning of the request and pushed to the
- `_request_ctx_stack` and removed at the end of it. It will create the
- URL adapter and request object for the WSGI environment provided.
-
- Do not attempt to use this class directly, instead use
- :meth:`~flask.Flask.test_request_context` and
- :meth:`~flask.Flask.request_context` to create this object.
-
- When the request context is popped, it will evaluate all the
- functions registered on the application for teardown execution
- (:meth:`~flask.Flask.teardown_request`).
-
- The request context is automatically popped at the end of the request
- for you. In debug mode the request context is kept around if
- exceptions happen so that interactive debuggers have a chance to
- introspect the data. With 0.4 this can also be forced for requests
- that did not fail and outside of ``DEBUG`` mode. By setting
- ``'flask._preserve_context'`` to ``True`` on the WSGI environment the
- context will not pop itself at the end of the request. This is used by
- the :meth:`~flask.Flask.test_client` for example to implement the
- deferred cleanup functionality.
-
- You might find this helpful for unittests where you need the
- information from the context local around for a little longer. Make
- sure to properly :meth:`~werkzeug.LocalStack.pop` the stack yourself in
- that situation, otherwise your unittests will leak memory.
- """
-
- def __init__(self, app, environ, request=None):
- self.app = app
- if request is None:
- request = app.request_class(environ)
- self.request = request
- self.url_adapter = app.create_url_adapter(self.request)
- self.flashes = None
- self.session = None
-
- # Request contexts can be pushed multiple times and interleaved with
- # other request contexts. Now only if the last level is popped we
- # get rid of them. Additionally if an application context is missing
- # one is created implicitly so for each level we add this information
- self._implicit_app_ctx_stack = []
-
- # indicator if the context was preserved. Next time another context
- # is pushed the preserved context is popped.
- self.preserved = False
-
- # remembers the exception for pop if there is one in case the context
- # preservation kicks in.
- self._preserved_exc = None
-
- # Functions that should be executed after the request on the response
- # object. These will be called before the regular "after_request"
- # functions.
- self._after_request_functions = []
-
- self.match_request()
-
- def _get_g(self):
- return _app_ctx_stack.top.g
- def _set_g(self, value):
- _app_ctx_stack.top.g = value
- g = property(_get_g, _set_g)
- del _get_g, _set_g
-
- def copy(self):
- """Creates a copy of this request context with the same request object.
- This can be used to move a request context to a different greenlet.
- Because the actual request object is the same this cannot be used to
- move a request context to a different thread unless access to the
- request object is locked.
-
- .. versionadded:: 0.10
- """
- return self.__class__(self.app,
- environ=self.request.environ,
- request=self.request
- )
-
- def match_request(self):
- """Can be overridden by a subclass to hook into the matching
- of the request.
- """
- try:
- url_rule, self.request.view_args = \
- self.url_adapter.match(return_rule=True)
- self.request.url_rule = url_rule
- except HTTPException as e:
- self.request.routing_exception = e
-
- def push(self):
- """Binds the request context to the current context."""
- # If an exception occurs in debug mode or if context preservation is
- # activated under exception situations exactly one context stays
- # on the stack. The rationale is that you want to access that
- # information under debug situations. However if someone forgets to
- # pop that context again we want to make sure that on the next push
- # it's invalidated, otherwise we run at risk that something leaks
- # memory. This is usually only a problem in test suite since this
- # functionality is not active in production environments.
- top = _request_ctx_stack.top
- if top is not None and top.preserved:
- top.pop(top._preserved_exc)
-
- # Before we push the request context we have to ensure that there
- # is an application context.
- app_ctx = _app_ctx_stack.top
- if app_ctx is None or app_ctx.app != self.app:
- app_ctx = self.app.app_context()
- app_ctx.push()
- self._implicit_app_ctx_stack.append(app_ctx)
- else:
- self._implicit_app_ctx_stack.append(None)
-
- if hasattr(sys, 'exc_clear'):
- sys.exc_clear()
-
- _request_ctx_stack.push(self)
-
- # Open the session at the moment that the request context is available.
- # This allows a custom open_session method to use the request context.
- # Only open a new session if this is the first time the request was
- # pushed, otherwise stream_with_context loses the session.
- if self.session is None:
- session_interface = self.app.session_interface
- self.session = session_interface.open_session(
- self.app, self.request
- )
-
- if self.session is None:
- self.session = session_interface.make_null_session(self.app)
-
- def pop(self, exc=_sentinel):
- """Pops the request context and unbinds it by doing that. This will
- also trigger the execution of functions registered by the
- :meth:`~flask.Flask.teardown_request` decorator.
-
- .. versionchanged:: 0.9
- Added the `exc` argument.
- """
- app_ctx = self._implicit_app_ctx_stack.pop()
-
- try:
- clear_request = False
- if not self._implicit_app_ctx_stack:
- self.preserved = False
- self._preserved_exc = None
- if exc is _sentinel:
- exc = sys.exc_info()[1]
- self.app.do_teardown_request(exc)
-
- # If this interpreter supports clearing the exception information
- # we do that now. This will only go into effect on Python 2.x,
- # on 3.x it disappears automatically at the end of the exception
- # stack.
- if hasattr(sys, 'exc_clear'):
- sys.exc_clear()
-
- request_close = getattr(self.request, 'close', None)
- if request_close is not None:
- request_close()
- clear_request = True
- finally:
- rv = _request_ctx_stack.pop()
-
- # get rid of circular dependencies at the end of the request
- # so that we don't require the GC to be active.
- if clear_request:
- rv.request.environ['werkzeug.request'] = None
-
- # Get rid of the app as well if necessary.
- if app_ctx is not None:
- app_ctx.pop(exc)
-
- assert rv is self, 'Popped wrong request context. ' \
- '(%r instead of %r)' % (rv, self)
-
- def auto_pop(self, exc):
- if self.request.environ.get('flask._preserve_context') or \
- (exc is not None and self.app.preserve_context_on_exception):
- self.preserved = True
- self._preserved_exc = exc
- else:
- self.pop(exc)
-
- def __enter__(self):
- self.push()
- return self
-
- def __exit__(self, exc_type, exc_value, tb):
- # do not pop the request stack if we are in debug mode and an
- # exception happened. This will allow the debugger to still
- # access the request object in the interactive shell. Furthermore
- # the context can be force kept alive for the test client.
- # See flask.testing for how this works.
- self.auto_pop(exc_value)
-
- if BROKEN_PYPY_CTXMGR_EXIT and exc_type is not None:
- reraise(exc_type, exc_value, tb)
-
- def __repr__(self):
- return '<%s \'%s\' [%s] of %s>' % (
- self.__class__.__name__,
- self.request.url,
- self.request.method,
- self.app.name,
- )
diff --git a/lib/flask/debughelpers.py b/lib/flask/debughelpers.py
deleted file mode 100644
index e9765f20d0..0000000000
--- a/lib/flask/debughelpers.py
+++ /dev/null
@@ -1,168 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- flask.debughelpers
- ~~~~~~~~~~~~~~~~~~
-
- Various helpers to make the development experience better.
-
- :copyright: © 2010 by the Pallets team.
- :license: BSD, see LICENSE for more details.
-"""
-
-import os
-from warnings import warn
-
-from ._compat import implements_to_string, text_type
-from .app import Flask
-from .blueprints import Blueprint
-from .globals import _request_ctx_stack
-
-
-class UnexpectedUnicodeError(AssertionError, UnicodeError):
- """Raised in places where we want some better error reporting for
- unexpected unicode or binary data.
- """
-
-
-@implements_to_string
-class DebugFilesKeyError(KeyError, AssertionError):
- """Raised from request.files during debugging. The idea is that it can
- provide a better error message than just a generic KeyError/BadRequest.
- """
-
- def __init__(self, request, key):
- form_matches = request.form.getlist(key)
- buf = ['You tried to access the file "%s" in the request.files '
- 'dictionary but it does not exist. The mimetype for the request '
- 'is "%s" instead of "multipart/form-data" which means that no '
- 'file contents were transmitted. To fix this error you should '
- 'provide enctype="multipart/form-data" in your form.' %
- (key, request.mimetype)]
- if form_matches:
- buf.append('\n\nThe browser instead transmitted some file names. '
- 'This was submitted: %s' % ', '.join('"%s"' % x
- for x in form_matches))
- self.msg = ''.join(buf)
-
- def __str__(self):
- return self.msg
-
-
-class FormDataRoutingRedirect(AssertionError):
- """This exception is raised by Flask in debug mode if it detects a
- redirect caused by the routing system when the request method is not
- GET, HEAD or OPTIONS. Reasoning: form data will be dropped.
- """
-
- def __init__(self, request):
- exc = request.routing_exception
- buf = ['A request was sent to this URL (%s) but a redirect was '
- 'issued automatically by the routing system to "%s".'
- % (request.url, exc.new_url)]
-
- # In case just a slash was appended we can be extra helpful
- if request.base_url + '/' == exc.new_url.split('?')[0]:
- buf.append(' The URL was defined with a trailing slash so '
- 'Flask will automatically redirect to the URL '
- 'with the trailing slash if it was accessed '
- 'without one.')
-
- buf.append(' Make sure to directly send your %s-request to this URL '
- 'since we can\'t make browsers or HTTP clients redirect '
- 'with form data reliably or without user interaction.' %
- request.method)
- buf.append('\n\nNote: this exception is only raised in debug mode')
- AssertionError.__init__(self, ''.join(buf).encode('utf-8'))
-
-
-def attach_enctype_error_multidict(request):
- """Since Flask 0.8 we're monkeypatching the files object in case a
- request is detected that does not use multipart form data but the files
- object is accessed.
- """
- oldcls = request.files.__class__
- class newcls(oldcls):
- def __getitem__(self, key):
- try:
- return oldcls.__getitem__(self, key)
- except KeyError:
- if key not in request.form:
- raise
- raise DebugFilesKeyError(request, key)
- newcls.__name__ = oldcls.__name__
- newcls.__module__ = oldcls.__module__
- request.files.__class__ = newcls
-
-
-def _dump_loader_info(loader):
- yield 'class: %s.%s' % (type(loader).__module__, type(loader).__name__)
- for key, value in sorted(loader.__dict__.items()):
- if key.startswith('_'):
- continue
- if isinstance(value, (tuple, list)):
- if not all(isinstance(x, (str, text_type)) for x in value):
- continue
- yield '%s:' % key
- for item in value:
- yield ' - %s' % item
- continue
- elif not isinstance(value, (str, text_type, int, float, bool)):
- continue
- yield '%s: %r' % (key, value)
-
-
-def explain_template_loading_attempts(app, template, attempts):
- """This should help developers understand what failed"""
- info = ['Locating template "%s":' % template]
- total_found = 0
- blueprint = None
- reqctx = _request_ctx_stack.top
- if reqctx is not None and reqctx.request.blueprint is not None:
- blueprint = reqctx.request.blueprint
-
- for idx, (loader, srcobj, triple) in enumerate(attempts):
- if isinstance(srcobj, Flask):
- src_info = 'application "%s"' % srcobj.import_name
- elif isinstance(srcobj, Blueprint):
- src_info = 'blueprint "%s" (%s)' % (srcobj.name,
- srcobj.import_name)
- else:
- src_info = repr(srcobj)
-
- info.append('% 5d: trying loader of %s' % (
- idx + 1, src_info))
-
- for line in _dump_loader_info(loader):
- info.append(' %s' % line)
-
- if triple is None:
- detail = 'no match'
- else:
- detail = 'found (%r)' % (triple[1] or '')
- total_found += 1
- info.append(' -> %s' % detail)
-
- seems_fishy = False
- if total_found == 0:
- info.append('Error: the template could not be found.')
- seems_fishy = True
- elif total_found > 1:
- info.append('Warning: multiple loaders returned a match for the template.')
- seems_fishy = True
-
- if blueprint is not None and seems_fishy:
- info.append(' The template was looked up from an endpoint that '
- 'belongs to the blueprint "%s".' % blueprint)
- info.append(' Maybe you did not place a template in the right folder?')
- info.append(' See http://flask.pocoo.org/docs/blueprints/#templates')
-
- app.logger.info('\n'.join(info))
-
-
-def explain_ignored_app_run():
- if os.environ.get('WERKZEUG_RUN_MAIN') != 'true':
- warn(Warning('Silently ignoring app.run() because the '
- 'application is run from the flask command line '
- 'executable. Consider putting app.run() behind an '
- 'if __name__ == "__main__" guard to silence this '
- 'warning.'), stacklevel=3)
diff --git a/lib/flask/globals.py b/lib/flask/globals.py
deleted file mode 100644
index 7d50a6f6d4..0000000000
--- a/lib/flask/globals.py
+++ /dev/null
@@ -1,61 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- flask.globals
- ~~~~~~~~~~~~~
-
- Defines all the global objects that are proxies to the current
- active context.
-
- :copyright: © 2010 by the Pallets team.
- :license: BSD, see LICENSE for more details.
-"""
-
-from functools import partial
-from werkzeug.local import LocalStack, LocalProxy
-
-
-_request_ctx_err_msg = '''\
-Working outside of request context.
-
-This typically means that you attempted to use functionality that needed
-an active HTTP request. Consult the documentation on testing for
-information about how to avoid this problem.\
-'''
-_app_ctx_err_msg = '''\
-Working outside of application context.
-
-This typically means that you attempted to use functionality that needed
-to interface with the current application object in some way. To solve
-this, set up an application context with app.app_context(). See the
-documentation for more information.\
-'''
-
-
-def _lookup_req_object(name):
- top = _request_ctx_stack.top
- if top is None:
- raise RuntimeError(_request_ctx_err_msg)
- return getattr(top, name)
-
-
-def _lookup_app_object(name):
- top = _app_ctx_stack.top
- if top is None:
- raise RuntimeError(_app_ctx_err_msg)
- return getattr(top, name)
-
-
-def _find_app():
- top = _app_ctx_stack.top
- if top is None:
- raise RuntimeError(_app_ctx_err_msg)
- return top.app
-
-
-# context locals
-_request_ctx_stack = LocalStack()
-_app_ctx_stack = LocalStack()
-current_app = LocalProxy(_find_app)
-request = LocalProxy(partial(_lookup_req_object, 'request'))
-session = LocalProxy(partial(_lookup_req_object, 'session'))
-g = LocalProxy(partial(_lookup_app_object, 'g'))
diff --git a/lib/flask/helpers.py b/lib/flask/helpers.py
deleted file mode 100644
index df0b91fc55..0000000000
--- a/lib/flask/helpers.py
+++ /dev/null
@@ -1,1044 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- flask.helpers
- ~~~~~~~~~~~~~
-
- Implements various helpers.
-
- :copyright: © 2010 by the Pallets team.
- :license: BSD, see LICENSE for more details.
-"""
-
-import os
-import socket
-import sys
-import pkgutil
-import posixpath
-import mimetypes
-from time import time
-from zlib import adler32
-from threading import RLock
-import unicodedata
-from werkzeug.routing import BuildError
-from functools import update_wrapper
-
-from werkzeug.urls import url_quote
-from werkzeug.datastructures import Headers, Range
-from werkzeug.exceptions import BadRequest, NotFound, \
- RequestedRangeNotSatisfiable
-
-from werkzeug.wsgi import wrap_file
-from jinja2 import FileSystemLoader
-
-from .signals import message_flashed
-from .globals import session, _request_ctx_stack, _app_ctx_stack, \
- current_app, request
-from ._compat import string_types, text_type, PY2
-
-# sentinel
-_missing = object()
-
-
-# what separators does this operating system provide that are not a slash?
-# this is used by the send_from_directory function to ensure that nobody is
-# able to access files from outside the filesystem.
-_os_alt_seps = list(sep for sep in [os.path.sep, os.path.altsep]
- if sep not in (None, '/'))
-
-
-def get_env():
- """Get the environment the app is running in, indicated by the
- :envvar:`FLASK_ENV` environment variable. The default is
- ``'production'``.
- """
- return os.environ.get('FLASK_ENV') or 'production'
-
-
-def get_debug_flag():
- """Get whether debug mode should be enabled for the app, indicated
- by the :envvar:`FLASK_DEBUG` environment variable. The default is
- ``True`` if :func:`.get_env` returns ``'development'``, or ``False``
- otherwise.
- """
- val = os.environ.get('FLASK_DEBUG')
-
- if not val:
- return get_env() == 'development'
-
- return val.lower() not in ('0', 'false', 'no')
-
-
-def get_load_dotenv(default=True):
- """Get whether the user has disabled loading dotenv files by setting
- :envvar:`FLASK_SKIP_DOTENV`. The default is ``True``, load the
- files.
-
- :param default: What to return if the env var isn't set.
- """
- val = os.environ.get('FLASK_SKIP_DOTENV')
-
- if not val:
- return default
-
- return val.lower() in ('0', 'false', 'no')
-
-
-def _endpoint_from_view_func(view_func):
- """Internal helper that returns the default endpoint for a given
- function. This always is the function name.
- """
- assert view_func is not None, 'expected view func if endpoint ' \
- 'is not provided.'
- return view_func.__name__
-
-
-def stream_with_context(generator_or_function):
- """Request contexts disappear when the response is started on the server.
- This is done for efficiency reasons and to make it less likely to encounter
- memory leaks with badly written WSGI middlewares. The downside is that if
- you are using streamed responses, the generator cannot access request bound
- information any more.
-
- This function however can help you keep the context around for longer::
-
- from flask import stream_with_context, request, Response
-
- @app.route('/stream')
- def streamed_response():
- @stream_with_context
- def generate():
- yield 'Hello '
- yield request.args['name']
- yield '!'
- return Response(generate())
-
- Alternatively it can also be used around a specific generator::
-
- from flask import stream_with_context, request, Response
-
- @app.route('/stream')
- def streamed_response():
- def generate():
- yield 'Hello '
- yield request.args['name']
- yield '!'
- return Response(stream_with_context(generate()))
-
- .. versionadded:: 0.9
- """
- try:
- gen = iter(generator_or_function)
- except TypeError:
- def decorator(*args, **kwargs):
- gen = generator_or_function(*args, **kwargs)
- return stream_with_context(gen)
- return update_wrapper(decorator, generator_or_function)
-
- def generator():
- ctx = _request_ctx_stack.top
- if ctx is None:
- raise RuntimeError('Attempted to stream with context but '
- 'there was no context in the first place to keep around.')
- with ctx:
- # Dummy sentinel. Has to be inside the context block or we're
- # not actually keeping the context around.
- yield None
-
- # The try/finally is here so that if someone passes a WSGI level
- # iterator in we're still running the cleanup logic. Generators
- # don't need that because they are closed on their destruction
- # automatically.
- try:
- for item in gen:
- yield item
- finally:
- if hasattr(gen, 'close'):
- gen.close()
-
- # The trick is to start the generator. Then the code execution runs until
- # the first dummy None is yielded at which point the context was already
- # pushed. This item is discarded. Then when the iteration continues the
- # real generator is executed.
- wrapped_g = generator()
- next(wrapped_g)
- return wrapped_g
-
-
-def make_response(*args):
- """Sometimes it is necessary to set additional headers in a view. Because
- views do not have to return response objects but can return a value that
- is converted into a response object by Flask itself, it becomes tricky to
- add headers to it. This function can be called instead of using a return
- and you will get a response object which you can use to attach headers.
-
- If view looked like this and you want to add a new header::
-
- def index():
- return render_template('index.html', foo=42)
-
- You can now do something like this::
-
- def index():
- response = make_response(render_template('index.html', foo=42))
- response.headers['X-Parachutes'] = 'parachutes are cool'
- return response
-
- This function accepts the very same arguments you can return from a
- view function. This for example creates a response with a 404 error
- code::
-
- response = make_response(render_template('not_found.html'), 404)
-
- The other use case of this function is to force the return value of a
- view function into a response which is helpful with view
- decorators::
-
- response = make_response(view_function())
- response.headers['X-Parachutes'] = 'parachutes are cool'
-
- Internally this function does the following things:
-
- - if no arguments are passed, it creates a new response argument
- - if one argument is passed, :meth:`flask.Flask.make_response`
- is invoked with it.
- - if more than one argument is passed, the arguments are passed
- to the :meth:`flask.Flask.make_response` function as tuple.
-
- .. versionadded:: 0.6
- """
- if not args:
- return current_app.response_class()
- if len(args) == 1:
- args = args[0]
- return current_app.make_response(args)
-
-
-def url_for(endpoint, **values):
- """Generates a URL to the given endpoint with the method provided.
-
- Variable arguments that are unknown to the target endpoint are appended
- to the generated URL as query arguments. If the value of a query argument
- is ``None``, the whole pair is skipped. In case blueprints are active
- you can shortcut references to the same blueprint by prefixing the
- local endpoint with a dot (``.``).
-
- This will reference the index function local to the current blueprint::
-
- url_for('.index')
-
- For more information, head over to the :ref:`Quickstart `.
-
- To integrate applications, :class:`Flask` has a hook to intercept URL build
- errors through :attr:`Flask.url_build_error_handlers`. The `url_for`
- function results in a :exc:`~werkzeug.routing.BuildError` when the current
- app does not have a URL for the given endpoint and values. When it does, the
- :data:`~flask.current_app` calls its :attr:`~Flask.url_build_error_handlers` if
- it is not ``None``, which can return a string to use as the result of
- `url_for` (instead of `url_for`'s default to raise the
- :exc:`~werkzeug.routing.BuildError` exception) or re-raise the exception.
- An example::
-
- def external_url_handler(error, endpoint, values):
- "Looks up an external URL when `url_for` cannot build a URL."
- # This is an example of hooking the build_error_handler.
- # Here, lookup_url is some utility function you've built
- # which looks up the endpoint in some external URL registry.
- url = lookup_url(endpoint, **values)
- if url is None:
- # External lookup did not have a URL.
- # Re-raise the BuildError, in context of original traceback.
- exc_type, exc_value, tb = sys.exc_info()
- if exc_value is error:
- raise exc_type, exc_value, tb
- else:
- raise error
- # url_for will use this result, instead of raising BuildError.
- return url
-
- app.url_build_error_handlers.append(external_url_handler)
-
- Here, `error` is the instance of :exc:`~werkzeug.routing.BuildError`, and
- `endpoint` and `values` are the arguments passed into `url_for`. Note
- that this is for building URLs outside the current application, and not for
- handling 404 NotFound errors.
-
- .. versionadded:: 0.10
- The `_scheme` parameter was added.
-
- .. versionadded:: 0.9
- The `_anchor` and `_method` parameters were added.
-
- .. versionadded:: 0.9
- Calls :meth:`Flask.handle_build_error` on
- :exc:`~werkzeug.routing.BuildError`.
-
- :param endpoint: the endpoint of the URL (name of the function)
- :param values: the variable arguments of the URL rule
- :param _external: if set to ``True``, an absolute URL is generated. Server
- address can be changed via ``SERVER_NAME`` configuration variable which
- defaults to `localhost`.
- :param _scheme: a string specifying the desired URL scheme. The `_external`
- parameter must be set to ``True`` or a :exc:`ValueError` is raised. The default
- behavior uses the same scheme as the current request, or
- ``PREFERRED_URL_SCHEME`` from the :ref:`app configuration ` if no
- request context is available. As of Werkzeug 0.10, this also can be set
- to an empty string to build protocol-relative URLs.
- :param _anchor: if provided this is added as anchor to the URL.
- :param _method: if provided this explicitly specifies an HTTP method.
- """
- appctx = _app_ctx_stack.top
- reqctx = _request_ctx_stack.top
-
- if appctx is None:
- raise RuntimeError(
- 'Attempted to generate a URL without the application context being'
- ' pushed. This has to be executed when application context is'
- ' available.'
- )
-
- # If request specific information is available we have some extra
- # features that support "relative" URLs.
- if reqctx is not None:
- url_adapter = reqctx.url_adapter
- blueprint_name = request.blueprint
-
- if endpoint[:1] == '.':
- if blueprint_name is not None:
- endpoint = blueprint_name + endpoint
- else:
- endpoint = endpoint[1:]
-
- external = values.pop('_external', False)
-
- # Otherwise go with the url adapter from the appctx and make
- # the URLs external by default.
- else:
- url_adapter = appctx.url_adapter
-
- if url_adapter is None:
- raise RuntimeError(
- 'Application was not able to create a URL adapter for request'
- ' independent URL generation. You might be able to fix this by'
- ' setting the SERVER_NAME config variable.'
- )
-
- external = values.pop('_external', True)
-
- anchor = values.pop('_anchor', None)
- method = values.pop('_method', None)
- scheme = values.pop('_scheme', None)
- appctx.app.inject_url_defaults(endpoint, values)
-
- # This is not the best way to deal with this but currently the
- # underlying Werkzeug router does not support overriding the scheme on
- # a per build call basis.
- old_scheme = None
- if scheme is not None:
- if not external:
- raise ValueError('When specifying _scheme, _external must be True')
- old_scheme = url_adapter.url_scheme
- url_adapter.url_scheme = scheme
-
- try:
- try:
- rv = url_adapter.build(endpoint, values, method=method,
- force_external=external)
- finally:
- if old_scheme is not None:
- url_adapter.url_scheme = old_scheme
- except BuildError as error:
- # We need to inject the values again so that the app callback can
- # deal with that sort of stuff.
- values['_external'] = external
- values['_anchor'] = anchor
- values['_method'] = method
- values['_scheme'] = scheme
- return appctx.app.handle_url_build_error(error, endpoint, values)
-
- if anchor is not None:
- rv += '#' + url_quote(anchor)
- return rv
-
-
-def get_template_attribute(template_name, attribute):
- """Loads a macro (or variable) a template exports. This can be used to
- invoke a macro from within Python code. If you for example have a
- template named :file:`_cider.html` with the following contents:
-
- .. sourcecode:: html+jinja
-
- {% macro hello(name) %}Hello {{ name }}!{% endmacro %}
-
- You can access this from Python code like this::
-
- hello = get_template_attribute('_cider.html', 'hello')
- return hello('World')
-
- .. versionadded:: 0.2
-
- :param template_name: the name of the template
- :param attribute: the name of the variable of macro to access
- """
- return getattr(current_app.jinja_env.get_template(template_name).module,
- attribute)
-
-
-def flash(message, category='message'):
- """Flashes a message to the next request. In order to remove the
- flashed message from the session and to display it to the user,
- the template has to call :func:`get_flashed_messages`.
-
- .. versionchanged:: 0.3
- `category` parameter added.
-
- :param message: the message to be flashed.
- :param category: the category for the message. The following values
- are recommended: ``'message'`` for any kind of message,
- ``'error'`` for errors, ``'info'`` for information
- messages and ``'warning'`` for warnings. However any
- kind of string can be used as category.
- """
- # Original implementation:
- #
- # session.setdefault('_flashes', []).append((category, message))
- #
- # This assumed that changes made to mutable structures in the session are
- # always in sync with the session object, which is not true for session
- # implementations that use external storage for keeping their keys/values.
- flashes = session.get('_flashes', [])
- flashes.append((category, message))
- session['_flashes'] = flashes
- message_flashed.send(current_app._get_current_object(),
- message=message, category=category)
-
-
-def get_flashed_messages(with_categories=False, category_filter=[]):
- """Pulls all flashed messages from the session and returns them.
- Further calls in the same request to the function will return
- the same messages. By default just the messages are returned,
- but when `with_categories` is set to ``True``, the return value will
- be a list of tuples in the form ``(category, message)`` instead.
-
- Filter the flashed messages to one or more categories by providing those
- categories in `category_filter`. This allows rendering categories in
- separate html blocks. The `with_categories` and `category_filter`
- arguments are distinct:
-
- * `with_categories` controls whether categories are returned with message
- text (``True`` gives a tuple, where ``False`` gives just the message text).
- * `category_filter` filters the messages down to only those matching the
- provided categories.
-
- See :ref:`message-flashing-pattern` for examples.
-
- .. versionchanged:: 0.3
- `with_categories` parameter added.
-
- .. versionchanged:: 0.9
- `category_filter` parameter added.
-
- :param with_categories: set to ``True`` to also receive categories.
- :param category_filter: whitelist of categories to limit return values
- """
- flashes = _request_ctx_stack.top.flashes
- if flashes is None:
- _request_ctx_stack.top.flashes = flashes = session.pop('_flashes') \
- if '_flashes' in session else []
- if category_filter:
- flashes = list(filter(lambda f: f[0] in category_filter, flashes))
- if not with_categories:
- return [x[1] for x in flashes]
- return flashes
-
-
-def send_file(filename_or_fp, mimetype=None, as_attachment=False,
- attachment_filename=None, add_etags=True,
- cache_timeout=None, conditional=False, last_modified=None):
- """Sends the contents of a file to the client. This will use the
- most efficient method available and configured. By default it will
- try to use the WSGI server's file_wrapper support. Alternatively
- you can set the application's :attr:`~Flask.use_x_sendfile` attribute
- to ``True`` to directly emit an ``X-Sendfile`` header. This however
- requires support of the underlying webserver for ``X-Sendfile``.
-
- By default it will try to guess the mimetype for you, but you can
- also explicitly provide one. For extra security you probably want
- to send certain files as attachment (HTML for instance). The mimetype
- guessing requires a `filename` or an `attachment_filename` to be
- provided.
-
- ETags will also be attached automatically if a `filename` is provided. You
- can turn this off by setting `add_etags=False`.
-
- If `conditional=True` and `filename` is provided, this method will try to
- upgrade the response stream to support range requests. This will allow
- the request to be answered with partial content response.
-
- Please never pass filenames to this function from user sources;
- you should use :func:`send_from_directory` instead.
-
- .. versionadded:: 0.2
-
- .. versionadded:: 0.5
- The `add_etags`, `cache_timeout` and `conditional` parameters were
- added. The default behavior is now to attach etags.
-
- .. versionchanged:: 0.7
- mimetype guessing and etag support for file objects was
- deprecated because it was unreliable. Pass a filename if you are
- able to, otherwise attach an etag yourself. This functionality
- will be removed in Flask 1.0
-
- .. versionchanged:: 0.9
- cache_timeout pulls its default from application config, when None.
-
- .. versionchanged:: 0.12
- The filename is no longer automatically inferred from file objects. If
- you want to use automatic mimetype and etag support, pass a filepath via
- `filename_or_fp` or `attachment_filename`.
-
- .. versionchanged:: 0.12
- The `attachment_filename` is preferred over `filename` for MIME-type
- detection.
-
- .. versionchanged:: 1.0
- UTF-8 filenames, as specified in `RFC 2231`_, are supported.
-
- .. _RFC 2231: https://tools.ietf.org/html/rfc2231#section-4
-
- :param filename_or_fp: the filename of the file to send.
- This is relative to the :attr:`~Flask.root_path`
- if a relative path is specified.
- Alternatively a file object might be provided in
- which case ``X-Sendfile`` might not work and fall
- back to the traditional method. Make sure that the
- file pointer is positioned at the start of data to
- send before calling :func:`send_file`.
- :param mimetype: the mimetype of the file if provided. If a file path is
- given, auto detection happens as fallback, otherwise an
- error will be raised.
- :param as_attachment: set to ``True`` if you want to send this file with
- a ``Content-Disposition: attachment`` header.
- :param attachment_filename: the filename for the attachment if it
- differs from the file's filename.
- :param add_etags: set to ``False`` to disable attaching of etags.
- :param conditional: set to ``True`` to enable conditional responses.
-
- :param cache_timeout: the timeout in seconds for the headers. When ``None``
- (default), this value is set by
- :meth:`~Flask.get_send_file_max_age` of
- :data:`~flask.current_app`.
- :param last_modified: set the ``Last-Modified`` header to this value,
- a :class:`~datetime.datetime` or timestamp.
- If a file was passed, this overrides its mtime.
- """
- mtime = None
- fsize = None
- if isinstance(filename_or_fp, string_types):
- filename = filename_or_fp
- if not os.path.isabs(filename):
- filename = os.path.join(current_app.root_path, filename)
- file = None
- if attachment_filename is None:
- attachment_filename = os.path.basename(filename)
- else:
- file = filename_or_fp
- filename = None
-
- if mimetype is None:
- if attachment_filename is not None:
- mimetype = mimetypes.guess_type(attachment_filename)[0] \
- or 'application/octet-stream'
-
- if mimetype is None:
- raise ValueError(
- 'Unable to infer MIME-type because no filename is available. '
- 'Please set either `attachment_filename`, pass a filepath to '
- '`filename_or_fp` or set your own MIME-type via `mimetype`.'
- )
-
- headers = Headers()
- if as_attachment:
- if attachment_filename is None:
- raise TypeError('filename unavailable, required for '
- 'sending as attachment')
-
- try:
- attachment_filename = attachment_filename.encode('latin-1')
- except UnicodeEncodeError:
- filenames = {
- 'filename': unicodedata.normalize(
- 'NFKD', attachment_filename).encode('latin-1', 'ignore'),
- 'filename*': "UTF-8''%s" % url_quote(attachment_filename),
- }
- else:
- filenames = {'filename': attachment_filename}
-
- headers.add('Content-Disposition', 'attachment', **filenames)
-
- if current_app.use_x_sendfile and filename:
- if file is not None:
- file.close()
- headers['X-Sendfile'] = filename
- fsize = os.path.getsize(filename)
- headers['Content-Length'] = fsize
- data = None
- else:
- if file is None:
- file = open(filename, 'rb')
- mtime = os.path.getmtime(filename)
- fsize = os.path.getsize(filename)
- headers['Content-Length'] = fsize
- data = wrap_file(request.environ, file)
-
- rv = current_app.response_class(data, mimetype=mimetype, headers=headers,
- direct_passthrough=True)
-
- if last_modified is not None:
- rv.last_modified = last_modified
- elif mtime is not None:
- rv.last_modified = mtime
-
- rv.cache_control.public = True
- if cache_timeout is None:
- cache_timeout = current_app.get_send_file_max_age(filename)
- if cache_timeout is not None:
- rv.cache_control.max_age = cache_timeout
- rv.expires = int(time() + cache_timeout)
-
- if add_etags and filename is not None:
- from warnings import warn
-
- try:
- rv.set_etag('%s-%s-%s' % (
- os.path.getmtime(filename),
- os.path.getsize(filename),
- adler32(
- filename.encode('utf-8') if isinstance(filename, text_type)
- else filename
- ) & 0xffffffff
- ))
- except OSError:
- warn('Access %s failed, maybe it does not exist, so ignore etags in '
- 'headers' % filename, stacklevel=2)
-
- if conditional:
- try:
- rv = rv.make_conditional(request, accept_ranges=True,
- complete_length=fsize)
- except RequestedRangeNotSatisfiable:
- if file is not None:
- file.close()
- raise
- # make sure we don't send x-sendfile for servers that
- # ignore the 304 status code for x-sendfile.
- if rv.status_code == 304:
- rv.headers.pop('x-sendfile', None)
- return rv
-
-
-def safe_join(directory, *pathnames):
- """Safely join `directory` and zero or more untrusted `pathnames`
- components.
-
- Example usage::
-
- @app.route('/wiki/')
- def wiki_page(filename):
- filename = safe_join(app.config['WIKI_FOLDER'], filename)
- with open(filename, 'rb') as fd:
- content = fd.read() # Read and process the file content...
-
- :param directory: the trusted base directory.
- :param pathnames: the untrusted pathnames relative to that directory.
- :raises: :class:`~werkzeug.exceptions.NotFound` if one or more passed
- paths fall out of its boundaries.
- """
-
- parts = [directory]
-
- for filename in pathnames:
- if filename != '':
- filename = posixpath.normpath(filename)
-
- if (
- any(sep in filename for sep in _os_alt_seps)
- or os.path.isabs(filename)
- or filename == '..'
- or filename.startswith('../')
- ):
- raise NotFound()
-
- parts.append(filename)
-
- return posixpath.join(*parts)
-
-
-def send_from_directory(directory, filename, **options):
- """Send a file from a given directory with :func:`send_file`. This
- is a secure way to quickly expose static files from an upload folder
- or something similar.
-
- Example usage::
-
- @app.route('/uploads/')
- def download_file(filename):
- return send_from_directory(app.config['UPLOAD_FOLDER'],
- filename, as_attachment=True)
-
- .. admonition:: Sending files and Performance
-
- It is strongly recommended to activate either ``X-Sendfile`` support in
- your webserver or (if no authentication happens) to tell the webserver
- to serve files for the given path on its own without calling into the
- web application for improved performance.
-
- .. versionadded:: 0.5
-
- :param directory: the directory where all the files are stored.
- :param filename: the filename relative to that directory to
- download.
- :param options: optional keyword arguments that are directly
- forwarded to :func:`send_file`.
- """
- filename = safe_join(directory, filename)
- if not os.path.isabs(filename):
- filename = os.path.join(current_app.root_path, filename)
- try:
- if not os.path.isfile(filename):
- raise NotFound()
- except (TypeError, ValueError):
- raise BadRequest()
- options.setdefault('conditional', True)
- return send_file(filename, **options)
-
-
-def get_root_path(import_name):
- """Returns the path to a package or cwd if that cannot be found. This
- returns the path of a package or the folder that contains a module.
-
- Not to be confused with the package path returned by :func:`find_package`.
- """
- # Module already imported and has a file attribute. Use that first.
- mod = sys.modules.get(import_name)
- if mod is not None and hasattr(mod, '__file__'):
- return os.path.dirname(os.path.abspath(mod.__file__))
-
- # Next attempt: check the loader.
- loader = pkgutil.get_loader(import_name)
-
- # Loader does not exist or we're referring to an unloaded main module
- # or a main module without path (interactive sessions), go with the
- # current working directory.
- if loader is None or import_name == '__main__':
- return os.getcwd()
-
- # For .egg, zipimporter does not have get_filename until Python 2.7.
- # Some other loaders might exhibit the same behavior.
- if hasattr(loader, 'get_filename'):
- filepath = loader.get_filename(import_name)
- else:
- # Fall back to imports.
- __import__(import_name)
- mod = sys.modules[import_name]
- filepath = getattr(mod, '__file__', None)
-
- # If we don't have a filepath it might be because we are a
- # namespace package. In this case we pick the root path from the
- # first module that is contained in our package.
- if filepath is None:
- raise RuntimeError('No root path can be found for the provided '
- 'module "%s". This can happen because the '
- 'module came from an import hook that does '
- 'not provide file name information or because '
- 'it\'s a namespace package. In this case '
- 'the root path needs to be explicitly '
- 'provided.' % import_name)
-
- # filepath is import_name.py for a module, or __init__.py for a package.
- return os.path.dirname(os.path.abspath(filepath))
-
-
-def _matching_loader_thinks_module_is_package(loader, mod_name):
- """Given the loader that loaded a module and the module this function
- attempts to figure out if the given module is actually a package.
- """
- # If the loader can tell us if something is a package, we can
- # directly ask the loader.
- if hasattr(loader, 'is_package'):
- return loader.is_package(mod_name)
- # importlib's namespace loaders do not have this functionality but
- # all the modules it loads are packages, so we can take advantage of
- # this information.
- elif (loader.__class__.__module__ == '_frozen_importlib' and
- loader.__class__.__name__ == 'NamespaceLoader'):
- return True
- # Otherwise we need to fail with an error that explains what went
- # wrong.
- raise AttributeError(
- ('%s.is_package() method is missing but is required by Flask of '
- 'PEP 302 import hooks. If you do not use import hooks and '
- 'you encounter this error please file a bug against Flask.') %
- loader.__class__.__name__)
-
-
-def find_package(import_name):
- """Finds a package and returns the prefix (or None if the package is
- not installed) as well as the folder that contains the package or
- module as a tuple. The package path returned is the module that would
- have to be added to the pythonpath in order to make it possible to
- import the module. The prefix is the path below which a UNIX like
- folder structure exists (lib, share etc.).
- """
- root_mod_name = import_name.split('.')[0]
- loader = pkgutil.get_loader(root_mod_name)
- if loader is None or import_name == '__main__':
- # import name is not found, or interactive/main module
- package_path = os.getcwd()
- else:
- # For .egg, zipimporter does not have get_filename until Python 2.7.
- if hasattr(loader, 'get_filename'):
- filename = loader.get_filename(root_mod_name)
- elif hasattr(loader, 'archive'):
- # zipimporter's loader.archive points to the .egg or .zip
- # archive filename is dropped in call to dirname below.
- filename = loader.archive
- else:
- # At least one loader is missing both get_filename and archive:
- # Google App Engine's HardenedModulesHook
- #
- # Fall back to imports.
- __import__(import_name)
- filename = sys.modules[import_name].__file__
- package_path = os.path.abspath(os.path.dirname(filename))
-
- # In case the root module is a package we need to chop of the
- # rightmost part. This needs to go through a helper function
- # because of python 3.3 namespace packages.
- if _matching_loader_thinks_module_is_package(
- loader, root_mod_name):
- package_path = os.path.dirname(package_path)
-
- site_parent, site_folder = os.path.split(package_path)
- py_prefix = os.path.abspath(sys.prefix)
- if package_path.startswith(py_prefix):
- return py_prefix, package_path
- elif site_folder.lower() == 'site-packages':
- parent, folder = os.path.split(site_parent)
- # Windows like installations
- if folder.lower() == 'lib':
- base_dir = parent
- # UNIX like installations
- elif os.path.basename(parent).lower() == 'lib':
- base_dir = os.path.dirname(parent)
- else:
- base_dir = site_parent
- return base_dir, package_path
- return None, package_path
-
-
-class locked_cached_property(object):
- """A decorator that converts a function into a lazy property. The
- function wrapped is called the first time to retrieve the result
- and then that calculated result is used the next time you access
- the value. Works like the one in Werkzeug but has a lock for
- thread safety.
- """
-
- def __init__(self, func, name=None, doc=None):
- self.__name__ = name or func.__name__
- self.__module__ = func.__module__
- self.__doc__ = doc or func.__doc__
- self.func = func
- self.lock = RLock()
-
- def __get__(self, obj, type=None):
- if obj is None:
- return self
- with self.lock:
- value = obj.__dict__.get(self.__name__, _missing)
- if value is _missing:
- value = self.func(obj)
- obj.__dict__[self.__name__] = value
- return value
-
-
-class _PackageBoundObject(object):
- #: The name of the package or module that this app belongs to. Do not
- #: change this once it is set by the constructor.
- import_name = None
-
- #: Location of the template files to be added to the template lookup.
- #: ``None`` if templates should not be added.
- template_folder = None
-
- #: Absolute path to the package on the filesystem. Used to look up
- #: resources contained in the package.
- root_path = None
-
- def __init__(self, import_name, template_folder=None, root_path=None):
- self.import_name = import_name
- self.template_folder = template_folder
-
- if root_path is None:
- root_path = get_root_path(self.import_name)
-
- self.root_path = root_path
- self._static_folder = None
- self._static_url_path = None
-
- def _get_static_folder(self):
- if self._static_folder is not None:
- return os.path.join(self.root_path, self._static_folder)
-
- def _set_static_folder(self, value):
- self._static_folder = value
-
- static_folder = property(
- _get_static_folder, _set_static_folder,
- doc='The absolute path to the configured static folder.'
- )
- del _get_static_folder, _set_static_folder
-
- def _get_static_url_path(self):
- if self._static_url_path is not None:
- return self._static_url_path
-
- if self.static_folder is not None:
- return '/' + os.path.basename(self.static_folder)
-
- def _set_static_url_path(self, value):
- self._static_url_path = value
-
- static_url_path = property(
- _get_static_url_path, _set_static_url_path,
- doc='The URL prefix that the static route will be registered for.'
- )
- del _get_static_url_path, _set_static_url_path
-
- @property
- def has_static_folder(self):
- """This is ``True`` if the package bound object's container has a
- folder for static files.
-
- .. versionadded:: 0.5
- """
- return self.static_folder is not None
-
- @locked_cached_property
- def jinja_loader(self):
- """The Jinja loader for this package bound object.
-
- .. versionadded:: 0.5
- """
- if self.template_folder is not None:
- return FileSystemLoader(os.path.join(self.root_path,
- self.template_folder))
-
- def get_send_file_max_age(self, filename):
- """Provides default cache_timeout for the :func:`send_file` functions.
-
- By default, this function returns ``SEND_FILE_MAX_AGE_DEFAULT`` from
- the configuration of :data:`~flask.current_app`.
-
- Static file functions such as :func:`send_from_directory` use this
- function, and :func:`send_file` calls this function on
- :data:`~flask.current_app` when the given cache_timeout is ``None``. If a
- cache_timeout is given in :func:`send_file`, that timeout is used;
- otherwise, this method is called.
-
- This allows subclasses to change the behavior when sending files based
- on the filename. For example, to set the cache timeout for .js files
- to 60 seconds::
-
- class MyFlask(flask.Flask):
- def get_send_file_max_age(self, name):
- if name.lower().endswith('.js'):
- return 60
- return flask.Flask.get_send_file_max_age(self, name)
-
- .. versionadded:: 0.9
- """
- return total_seconds(current_app.send_file_max_age_default)
-
- def send_static_file(self, filename):
- """Function used internally to send static files from the static
- folder to the browser.
-
- .. versionadded:: 0.5
- """
- if not self.has_static_folder:
- raise RuntimeError('No static folder for this object')
- # Ensure get_send_file_max_age is called in all cases.
- # Here, we ensure get_send_file_max_age is called for Blueprints.
- cache_timeout = self.get_send_file_max_age(filename)
- return send_from_directory(self.static_folder, filename,
- cache_timeout=cache_timeout)
-
- def open_resource(self, resource, mode='rb'):
- """Opens a resource from the application's resource folder. To see
- how this works, consider the following folder structure::
-
- /myapplication.py
- /schema.sql
- /static
- /style.css
- /templates
- /layout.html
- /index.html
-
- If you want to open the :file:`schema.sql` file you would do the
- following::
-
- with app.open_resource('schema.sql') as f:
- contents = f.read()
- do_something_with(contents)
-
- :param resource: the name of the resource. To access resources within
- subfolders use forward slashes as separator.
- :param mode: resource file opening mode, default is 'rb'.
- """
- if mode not in ('r', 'rb'):
- raise ValueError('Resources can only be opened for reading')
- return open(os.path.join(self.root_path, resource), mode)
-
-
-def total_seconds(td):
- """Returns the total seconds from a timedelta object.
-
- :param timedelta td: the timedelta to be converted in seconds
-
- :returns: number of seconds
- :rtype: int
- """
- return td.days * 60 * 60 * 24 + td.seconds
-
-
-def is_ip(value):
- """Determine if the given string is an IP address.
-
- Python 2 on Windows doesn't provide ``inet_pton``, so this only
- checks IPv4 addresses in that environment.
-
- :param value: value to check
- :type value: str
-
- :return: True if string is an IP address
- :rtype: bool
- """
- if PY2 and os.name == 'nt':
- try:
- socket.inet_aton(value)
- return True
- except socket.error:
- return False
-
- for family in (socket.AF_INET, socket.AF_INET6):
- try:
- socket.inet_pton(family, value)
- except socket.error:
- pass
- else:
- return True
-
- return False
diff --git a/lib/flask/json/__init__.py b/lib/flask/json/__init__.py
deleted file mode 100644
index fbe6b92f0a..0000000000
--- a/lib/flask/json/__init__.py
+++ /dev/null
@@ -1,327 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
-flask.json
-~~~~~~~~~~
-
-:copyright: © 2010 by the Pallets team.
-:license: BSD, see LICENSE for more details.
-"""
-import codecs
-import io
-import uuid
-from datetime import date, datetime
-from flask.globals import current_app, request
-from flask._compat import text_type, PY2
-
-from werkzeug.http import http_date
-from jinja2 import Markup
-
-# Use the same json implementation as itsdangerous on which we
-# depend anyways.
-from itsdangerous import json as _json
-
-
-# Figure out if simplejson escapes slashes. This behavior was changed
-# from one version to another without reason.
-_slash_escape = '\\/' not in _json.dumps('/')
-
-
-__all__ = ['dump', 'dumps', 'load', 'loads', 'htmlsafe_dump',
- 'htmlsafe_dumps', 'JSONDecoder', 'JSONEncoder',
- 'jsonify']
-
-
-def _wrap_reader_for_text(fp, encoding):
- if isinstance(fp.read(0), bytes):
- fp = io.TextIOWrapper(io.BufferedReader(fp), encoding)
- return fp
-
-
-def _wrap_writer_for_text(fp, encoding):
- try:
- fp.write('')
- except TypeError:
- fp = io.TextIOWrapper(fp, encoding)
- return fp
-
-
-class JSONEncoder(_json.JSONEncoder):
- """The default Flask JSON encoder. This one extends the default simplejson
- encoder by also supporting ``datetime`` objects, ``UUID`` as well as
- ``Markup`` objects which are serialized as RFC 822 datetime strings (same
- as the HTTP date format). In order to support more data types override the
- :meth:`default` method.
- """
-
- def default(self, o):
- """Implement this method in a subclass such that it returns a
- serializable object for ``o``, or calls the base implementation (to
- raise a :exc:`TypeError`).
-
- For example, to support arbitrary iterators, you could implement
- default like this::
-
- def default(self, o):
- try:
- iterable = iter(o)
- except TypeError:
- pass
- else:
- return list(iterable)
- return JSONEncoder.default(self, o)
- """
- if isinstance(o, datetime):
- return http_date(o.utctimetuple())
- if isinstance(o, date):
- return http_date(o.timetuple())
- if isinstance(o, uuid.UUID):
- return str(o)
- if hasattr(o, '__html__'):
- return text_type(o.__html__())
- return _json.JSONEncoder.default(self, o)
-
-
-class JSONDecoder(_json.JSONDecoder):
- """The default JSON decoder. This one does not change the behavior from
- the default simplejson decoder. Consult the :mod:`json` documentation
- for more information. This decoder is not only used for the load
- functions of this module but also :attr:`~flask.Request`.
- """
-
-
-def _dump_arg_defaults(kwargs):
- """Inject default arguments for dump functions."""
- if current_app:
- bp = current_app.blueprints.get(request.blueprint) if request else None
- kwargs.setdefault(
- 'cls',
- bp.json_encoder if bp and bp.json_encoder
- else current_app.json_encoder
- )
-
- if not current_app.config['JSON_AS_ASCII']:
- kwargs.setdefault('ensure_ascii', False)
-
- kwargs.setdefault('sort_keys', current_app.config['JSON_SORT_KEYS'])
- else:
- kwargs.setdefault('sort_keys', True)
- kwargs.setdefault('cls', JSONEncoder)
-
-
-def _load_arg_defaults(kwargs):
- """Inject default arguments for load functions."""
- if current_app:
- bp = current_app.blueprints.get(request.blueprint) if request else None
- kwargs.setdefault(
- 'cls',
- bp.json_decoder if bp and bp.json_decoder
- else current_app.json_decoder
- )
- else:
- kwargs.setdefault('cls', JSONDecoder)
-
-
-def detect_encoding(data):
- """Detect which UTF codec was used to encode the given bytes.
-
- The latest JSON standard (:rfc:`8259`) suggests that only UTF-8 is
- accepted. Older documents allowed 8, 16, or 32. 16 and 32 can be big
- or little endian. Some editors or libraries may prepend a BOM.
-
- :param data: Bytes in unknown UTF encoding.
- :return: UTF encoding name
- """
- head = data[:4]
-
- if head[:3] == codecs.BOM_UTF8:
- return 'utf-8-sig'
-
- if b'\x00' not in head:
- return 'utf-8'
-
- if head in (codecs.BOM_UTF32_BE, codecs.BOM_UTF32_LE):
- return 'utf-32'
-
- if head[:2] in (codecs.BOM_UTF16_BE, codecs.BOM_UTF16_LE):
- return 'utf-16'
-
- if len(head) == 4:
- if head[:3] == b'\x00\x00\x00':
- return 'utf-32-be'
-
- if head[::2] == b'\x00\x00':
- return 'utf-16-be'
-
- if head[1:] == b'\x00\x00\x00':
- return 'utf-32-le'
-
- if head[1::2] == b'\x00\x00':
- return 'utf-16-le'
-
- if len(head) == 2:
- return 'utf-16-be' if head.startswith(b'\x00') else 'utf-16-le'
-
- return 'utf-8'
-
-
-def dumps(obj, **kwargs):
- """Serialize ``obj`` to a JSON formatted ``str`` by using the application's
- configured encoder (:attr:`~flask.Flask.json_encoder`) if there is an
- application on the stack.
-
- This function can return ``unicode`` strings or ascii-only bytestrings by
- default which coerce into unicode strings automatically. That behavior by
- default is controlled by the ``JSON_AS_ASCII`` configuration variable
- and can be overridden by the simplejson ``ensure_ascii`` parameter.
- """
- _dump_arg_defaults(kwargs)
- encoding = kwargs.pop('encoding', None)
- rv = _json.dumps(obj, **kwargs)
- if encoding is not None and isinstance(rv, text_type):
- rv = rv.encode(encoding)
- return rv
-
-
-def dump(obj, fp, **kwargs):
- """Like :func:`dumps` but writes into a file object."""
- _dump_arg_defaults(kwargs)
- encoding = kwargs.pop('encoding', None)
- if encoding is not None:
- fp = _wrap_writer_for_text(fp, encoding)
- _json.dump(obj, fp, **kwargs)
-
-
-def loads(s, **kwargs):
- """Unserialize a JSON object from a string ``s`` by using the application's
- configured decoder (:attr:`~flask.Flask.json_decoder`) if there is an
- application on the stack.
- """
- _load_arg_defaults(kwargs)
- if isinstance(s, bytes):
- encoding = kwargs.pop('encoding', None)
- if encoding is None:
- encoding = detect_encoding(s)
- s = s.decode(encoding)
- return _json.loads(s, **kwargs)
-
-
-def load(fp, **kwargs):
- """Like :func:`loads` but reads from a file object.
- """
- _load_arg_defaults(kwargs)
- if not PY2:
- fp = _wrap_reader_for_text(fp, kwargs.pop('encoding', None) or 'utf-8')
- return _json.load(fp, **kwargs)
-
-
-def htmlsafe_dumps(obj, **kwargs):
- """Works exactly like :func:`dumps` but is safe for use in ``