Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #704, module `dh` #742

Open
wants to merge 5 commits into
base: master
from

Conversation

Projects
None yet
2 participants
@ejmg
Copy link

ejmg commented Sep 28, 2017

closes #704

@ejmg

This comment has been minimized.

Copy link
Author

ejmg commented Sep 28, 2017

Deleted comments about failed tests due to #![deny(missing_docs)] and whether to include #![deny(missing_docs)] after finishing documenting and whether to even document Dh and DhRef. Fackler answered in Gitter.

//!
//! summary: bindings for dh library of OpenSSL
//! author: steven fackler
//! version:

This comment has been minimized.

@sfackler

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.

@ejmg
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.

@sfackler

sfackler Sep 29, 2017

Owner

This line will be folded up to the first line by Markdown.

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.

@sfackler

sfackler Sep 29, 2017

Owner

The second sentence doesn't seem super relevant - we are setting them.

This comment has been minimized.

@ejmg

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.

@sfackler

sfackler Oct 3, 2017

Owner

The user can't provide nothing for those values.

//! 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.

@sfackler

sfackler Sep 29, 2017

Owner

Capitalization

This comment has been minimized.

@ejmg
//! 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.

@sfackler

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.

@ejmg

ejmg Sep 29, 2017

Author

+1, didn't even know this was possible in rustdoc

/// 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.

@sfackler

sfackler Sep 29, 2017

Owner

"initializes"

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.

@sfackler

sfackler Sep 29, 2017

Owner

Capitalization

This comment has been minimized.

@sfackler

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.

@ejmg

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.

@sfackler
@@ -48,7 +84,11 @@ impl Dh {
}
}

/// return a DH object for the IETF RFC 5114 value.

This comment has been minimized.

@sfackler

sfackler Sep 29, 2017

Owner

See above

@@ -57,7 +97,11 @@ impl Dh {
}
}

/// return a DH object for the IETF RFC 5114 value.

This comment has been minimized.

@sfackler

sfackler Sep 29, 2017

Owner

See above

This comment has been minimized.

@ejmg

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.

@sfackler

sfackler Oct 3, 2017

Owner

Yeah, they all come from that same RFC, just with different sizes.

@@ -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.

@sfackler

sfackler Sep 29, 2017

Owner

These docs won't be rendered anywhere since this is a private module, FYI.

This comment has been minimized.

@ejmg

ejmg Oct 2, 2017

Author

Okay, pulled.

@ejmg

This comment has been minimized.

Copy link
Author

ejmg commented Sep 29, 2017

Hey, @sfackler I'm sorry for failing on standards. I'll fix them first thing tomorrow morning. Thanks for the feedback.

@sfackler

This comment has been minimized.

Copy link
Owner

sfackler commented Oct 9, 2017

Any update here?

@ejmg

This comment has been minimized.

Copy link
Author

ejmg commented Oct 21, 2017

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.