Commit Graph

250 Commits

Author SHA1 Message Date
Ivan Nikulin a6f5beeb33 Remove decrepit and unavaliable API and fix signatures 2020-11-10 00:18:28 +00:00
Steven Fackler 8c02f30444
Update mod.rs 2020-08-11 10:04:38 -04:00
marcelbuesing 4849ac0aab
Cast to u32 2020-08-11 14:34:46 +02:00
marcelbuesing 1cffc2b575
Expose subject_name_hash 2020-08-11 11:47:28 +02:00
Jacob Hoffman-Andrews cbfdaa516d Fix test. 2020-06-03 23:32:03 -07:00
Jacob Hoffman-Andrews aedbe6537b Make tests narrower.
Evidently the behavior on different platforms is different with regards
to whether the final element in a list gets a comma or not, so we can't
do a fully-string comparison of the debug output.
2020-06-03 21:30:15 -07:00
Jacob Hoffman-Andrews 1aff5b9198 Fixes in response to review feedback. 2020-05-31 20:03:37 -07:00
Jacob Hoffman-Andrews 6482f419b8 Add Debug trait for X509 and other types.
This currently leaves out at least two useful things:
 - The detailed SubjectPublicKeyInfo, e.g. the modulus of RSA keys.
 - Extensions.
2020-05-30 17:20:55 -07:00
Steven Fackler f401ba2ec1 Run clippy 2020-05-24 16:31:04 -07:00
Steven Fackler 29f62786ff
Update openssl/src/x509/store.rs 2020-03-24 17:20:54 -04:00
Noah 41162e27ab
Add a shim for X509_STORE_get0_objects and X509_OBJECT_free 2020-03-24 12:33:54 -05:00
Noah e268a5ac7e
Check null ptr for non-x509 X509Object 2020-03-23 10:20:30 -05:00
Noah 8cfb59b9ea
Add a way to get the certificates stored in an X509Store 2020-03-22 23:20:59 -05:00
Adrian Budau e7d0e69c74
Fix the memory leak in `X509Builder::append_extension`.
Also add an alternative method that takes a `X509ExtensionRef`.
2020-02-26 16:23:46 +02:00
Andrii Radyk fc3c0a93d5 remove deprecated Error::description, replace deprecated cause with source 2019-12-21 23:53:49 +01:00
Alexey Galakhov a0e5b31799 X.509: add verify methods 2019-03-11 22:35:43 +01:00
Steven Fackler 7eee39f1ec Rustfmt 2019-02-22 10:14:15 -07:00
Steven Fackler 1392b006e2
Merge pull request #937 from marcoh00/iterable-x509names
X509NameRef: Provide an iterator over all entries
2018-07-07 20:20:45 -07:00
Steven Fackler 07c49e517e
Only grab the name entry count when needed 2018-06-26 22:31:10 -07:00
Steven Fackler 115cb730b0 Switch to accessors in libressl where possible
Some accessors are mysteriously still macros so we can't make everything
opaque yet, unfortunately.

cc #909
2018-06-09 21:49:36 -07:00
Marco Huenseler 14b5439347 Rename X509NameRef::all_entries and refactor end-of-iterator checks 2018-06-03 15:38:46 +02:00
Marco Huenseler f5e6d57c47 Provide an Asn1Object getter method for X509NameEntryRef 2018-06-03 15:38:46 +02:00
Marco Huenseler 2afdc16fc9 Make X509NameRef provide an iterator over all X509NameEntries 2018-06-03 15:38:46 +02:00
Steven Fackler 3456add537 Add SslRef::verified_chain 2018-05-29 21:53:22 -07:00
Steven Fackler a774c0c5f2 Rename X509Ref::fingerprint to X509Ref::digest and avoid allocating 2018-05-24 21:07:36 -07:00
Steven Fackler a6fcef01c0 Overhaul openssl cfgs
Also expose hostname verification on libressl
2018-05-20 12:33:02 -07:00
Steven Fackler d991566f2b Support min/max version in LibreSSL
Their implementations of the accessors don't behave expected with no
bounds, so we ignore those bits of the tests.
2018-05-19 19:57:12 -07:00
René Richter 5bb89d7552 Add functions to X509Req to obtain public key and extensions
This allows for basic CSR signing.
2018-04-21 23:14:48 +02:00
Steven Fackler ac950b28aa Fix a flag name 2018-03-29 10:26:43 +02:00
Steven Fackler 1bbe1b6a8f Clean up a couple of holdovers from old features 2018-03-29 10:20:18 +02:00
Steven Fackler c82a87a18e Add Asn1IntegerRef::to_bn
Also deprecate Asn1IntegerRef since it's just asking for trouble.
2018-03-28 20:48:28 +02:00
Steven Fackler 7890672725 Add X509Ref::serial_number 2018-03-28 20:41:28 +02:00
Steven Fackler 7c33346960 Remove version-specific features
Closes #852
2018-03-19 00:41:33 -07:00
Steven Fackler 4ee7e0d3a9 Tweak verify_cert's signature
The call can fail either due to an invalid cert or an internal error,
and we should distinguish between the two.
2018-03-11 14:08:34 -07:00
Bastian Köcher d7a7c379a8 Changes `init` to take a closure which is called with the initialized context
After calling the closure, we automatically cleanup the context. This is
required, because otherwise we could have dangling references in the context.
2018-03-11 11:34:36 +01:00
Bastian Köcher a5d7f8a718 Moves store context init into its own function 2018-03-10 00:15:03 +01:00
Bastian Köcher 1a0b085377 Extends the test to verify the certificate two times 2018-03-08 12:10:29 +01:00
Bastian Köcher 810ddeb4ca Moves `cleanup` into its own function 2018-03-08 12:08:39 +01:00
Bastian Köcher 888f4ccaab Fixes the implementation of `X509StoreContextRef::verify_cert`
The certificate, the store and the certificates chain does not need to be
consumed by `verify_cert` and instead are taken as references. We also call
`X509_STORE_CTX_cleanup`, after the verification succeeded.
2018-03-07 16:07:57 +01:00
Benjamin Fry 53adf0e6a4 delay return until after forgets 2018-03-07 13:54:35 +01:00
Benjamin Fry 6abac82f13 cleanup and add negative test 2018-03-07 13:54:35 +01:00
Benjamin Fry a1cfde765a add cleanup ffi to store context 2018-03-07 13:54:15 +01:00
Benjamin Fry 3187366cc5 restructure to self contained function 2018-03-07 13:53:29 +01:00
Steven Fackler 2251a6f2b6 Little tweaks 2018-03-07 13:51:58 +01:00
Benjamin Fry d8a11973e2 convert to raw pass-through methods 2018-03-07 13:51:58 +01:00
Benjamin Fry 910386027d add comment about consuming self in verify_cert 2018-03-07 13:50:12 +01:00
Benjamin Fry 35cad33d51 fix error check 2018-03-07 13:50:12 +01:00
Benjamin Fry 847fac25f8 properly version library functions 2018-03-07 13:48:09 +01:00
Benjamin Fry 3595ff9e51 Fix memory mgmt 2018-03-07 13:42:39 +01:00
Benjamin Fry eb6296e892 add verify_cert and store_context_builder 2018-03-07 13:41:44 +01:00