Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upIssue #704, module `dh` #742
Conversation
This comment has been minimized.
This comment has been minimized.
|
Deleted comments about failed tests due to |
sfackler
requested changes
Sep 29, 2017
| //! | ||
| //! summary: bindings for dh library of OpenSSL | ||
| //! author: steven fackler | ||
| //! version: |
This comment has been minimized.
This comment has been minimized.
sfackler
Sep 29, 2017
Owner
I don't think the first couple of lines here are really relevant for someone reading this documentation.
This comment has been minimized.
This comment has been minimized.
| fn drop = ffi::DH_free; | ||
|
|
||
| /// Diffie-Hellman Key agreement object | ||
| /// A key object that is based on the diffie-hellman algorithm |
This comment has been minimized.
This comment has been minimized.
| impl Dh { | ||
|
|
||
| /// This method will set the c pointers for the DH object, p, q, and g. If the parameters have | ||
| /// not been set, they will default to NULL. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
ejmg
Oct 2, 2017
Author
@sfackler When I read the code, I read it as we're taking values in, regardless of what they are, and setting them as the ptrs. Do we not inherit the behavior of defaulting to NULL when someone calls this function and provides nothing for the actual values for p, g, and q?
This comment has been minimized.
This comment has been minimized.
| //! author: steven fackler | ||
| //! version: | ||
| //! | ||
| //! dh is the diffie-hellman (dh) algorithm which allows for two parties to derive the key used for |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| //! communication. in dh, the two parties agree to some large prime, `p`, and a generator, `g`, | ||
| //! where 0 < g < p. | ||
| //! | ||
| //! For a full summary of the algo, please read https://wiki.openssl.org/index.php/Diffie_Hellman |
This comment has been minimized.
This comment has been minimized.
sfackler
Sep 29, 2017
Owner
Can the links be shortened up instead of being raw URLs in the documentation? I.e. For a full summary of Diffie-Hellman, refer to the [OpenSSL wiki](https://wiki.openssl.org/index.php/Diffie_Hellman).
This comment has been minimized.
This comment has been minimized.
| /// This method will set the c pointers for the DH object, p, q, and g. If the parameters have | ||
| /// not been set, they will default to NULL. | ||
| /// | ||
| /// This calls DH_get0_pqg() on OpenSSL 1.1.0 and inits DH's fields manually in 1.1.x. |
This comment has been minimized.
This comment has been minimized.
| from_pem!(Dh, ffi::PEM_read_bio_DHparams); | ||
| from_der!(Dh, ffi::d2i_DHparams); | ||
|
|
||
| /// return a DH object for the IETF RFC 5114 value. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
sfackler
Sep 29, 2017
Owner
The phrasing here could be a bit more clear - maybe something like "Returns the standard 1024 bit MODP group with 160-bit prime order subgroup specified in RFC 5114"
This comment has been minimized.
This comment has been minimized.
ejmg
Oct 2, 2017
Author
Does the following work?
/// Return a DH object for the standard 1024 bit MODP group with 160-bit prime order subgroup
/// specified in [IETF RFC 5114](https://tools.ietf.org/html/rfc5114#section-2.1).
///
/// get_1024_160 corresponds to DH_get_1024_160() in 1.0.2 and 1.1.x
///
/// Requires the `v102` or `v110` features and OpenSSL 1.0.2 or OpenSSL 1.1.0.
/// [OpenSSL Documentation](https://www.openssl.org/docs/man1.1.0/crypto/DH_get_1024_160.html).
This comment has been minimized.
This comment has been minimized.
| @@ -48,7 +84,11 @@ impl Dh { | |||
| } | |||
| } | |||
|
|
|||
| /// return a DH object for the IETF RFC 5114 value. | |||
This comment has been minimized.
This comment has been minimized.
| @@ -57,7 +97,11 @@ impl Dh { | |||
| } | |||
| } | |||
|
|
|||
| /// return a DH object for the IETF RFC 5114 value. | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
ejmg
Oct 2, 2017
Author
Am I to assume this method is for the 2047 bit MODP group with 224-bit prime order subgroup (and so on)? I want to be sure since this is well outside of my realm of knowledge right now.
This comment has been minimized.
This comment has been minimized.
| @@ -67,11 +111,13 @@ impl Dh { | |||
| } | |||
| } | |||
|
|
|||
| /// sets rust-openssl to call DH_set0_pqg as defined by fn from_params if using openSSL 1.1.x | |||
This comment has been minimized.
This comment has been minimized.
sfackler
Sep 29, 2017
Owner
These docs won't be rendered anywhere since this is a private module, FYI.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Hey, @sfackler I'm sorry for failing on standards. I'll fix them first thing tomorrow morning. Thanks for the feedback. |
This comment has been minimized.
This comment has been minimized.
|
Any update here? |
ejmg
added some commits
Sep 28, 2017
This comment has been minimized.
This comment has been minimized.
|
@sfackler sorry for completely ghosting on you. Classes have not been the easiest on me so far this semester. I rebased and pushed my changes. Please let me know if all is well this time round. I can get back to you quicker this time if something is awry again. |
ejmg commentedSep 28, 2017
closes #704