Skip to content

Commit

Permalink
Merge pull request sfackler#1591 from nashley/misc-doc-fixes
Browse files Browse the repository at this point in the history
Some miscellaneous documentation fixes
  • Loading branch information
sfackler authored Jan 12, 2022
2 parents 16f6512 + f350b89 commit d8aa8a9
Show file tree
Hide file tree
Showing 16 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion openssl/src/aes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//! [`aes_ige`]: fn.aes_ige.html
//!
//! The [`symm`] module should be used in preference to this module in most cases.
//! The IGE block cypher is a non-traditional cipher mode. More traditional AES
//! The IGE block cipher is a non-traditional cipher mode. More traditional AES
//! encryption methods are found in the [`Crypter`] and [`Cipher`] structs.
//!
//! [`symm`]: ../symm/index.html
Expand Down
2 changes: 1 addition & 1 deletion openssl/src/asn1.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![deny(missing_docs)]

//! Defines the format of certificiates
//! Defines the format of certificates
//!
//! This module is used by [`x509`] and other certificate building functions
//! to describe time, strings, and objects.
Expand Down
2 changes: 1 addition & 1 deletion openssl/src/cipher_ctx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ impl CipherCtxRef {

/// Initializes the context to perform envelope decryption.
///
/// Normally thisis called once with all of the arguments present. However, this process may be split up by first
/// Normally this is called once with all of the arguments present. However, this process may be split up by first
/// providing the cipher alone and then after providing the rest of the arguments in a second call.
///
/// # Panics
Expand Down
2 changes: 1 addition & 1 deletion openssl/src/cms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ foreign_type_and_impl_send_sync! {
}

impl CmsContentInfoRef {
/// Given the sender's private key, `pkey` and the recipient's certificiate, `cert`,
/// Given the sender's private key, `pkey` and the recipient's certificate, `cert`,
/// decrypt the data in `self`.
#[corresponds(CMS_decrypt)]
pub fn decrypt<T>(&self, pkey: &PKeyRef<T>, cert: &X509) -> Result<Vec<u8>, ErrorStack>
Expand Down
2 changes: 1 addition & 1 deletion openssl/src/dsa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ where
T: HasPublic,
{
to_pem! {
/// Serialies the public key into a PEM-encoded SubjectPublicKeyInfo structure.
/// Serializes the public key into a PEM-encoded SubjectPublicKeyInfo structure.
///
/// The output will have a header of `-----BEGIN PUBLIC KEY-----`.
#[corresponds(PEM_write_bio_DSA_PUBKEY)]
Expand Down
16 changes: 8 additions & 8 deletions openssl/src/ec.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
//! Elliptic Curve
//!
//! Cryptology relies on the difficulty of solving mathematical problems, such as the factor
//! Cryptography relies on the difficulty of solving mathematical problems, such as the factor
//! of large integers composed of two large prime numbers and the discrete logarithm of a
//! random eliptic curve. This module provides low-level features of the latter.
//! random elliptic curve. This module provides low-level features of the latter.
//! Elliptic Curve protocols can provide the same security with smaller keys.
//!
//! There are 2 forms of elliptic curves, `Fp` and `F2^m`. These curves use irreducible
//! trinomial or pentanomial . Being a generic interface to a wide range of algorithms,
//! the cuves are generally referenced by [`EcGroup`]. There are many built in groups
//! trinomial or pentanomial. Being a generic interface to a wide range of algorithms,
//! the curves are generally referenced by [`EcGroup`]. There are many built-in groups
//! found in [`Nid`].
//!
//! OpenSSL Wiki explains the fields and curves in detail at [Eliptic Curve Cryptography].
//! OpenSSL Wiki explains the fields and curves in detail at [Elliptic Curve Cryptography].
//!
//! [`EcGroup`]: struct.EcGroup.html
//! [`Nid`]: ../nid/struct.Nid.html
Expand Down Expand Up @@ -454,7 +454,7 @@ impl EcPointRef {
}
}

/// Place affine coordinates of a curve over a prime field in the provided
/// Places affine coordinates of a curve over a prime field in the provided
/// `x` and `y` `BigNum`s
#[corresponds(EC_POINT_get_affine_coordinates_GFp)]
pub fn affine_coordinates_gfp(
Expand All @@ -476,7 +476,7 @@ impl EcPointRef {
}
}

/// Place affine coordinates of a curve over a binary field in the provided
/// Places affine coordinates of a curve over a binary field in the provided
/// `x` and `y` `BigNum`s
#[corresponds(EC_POINT_get_affine_coordinates_GF2m)]
#[cfg(not(osslconf = "OPENSSL_NO_EC2M"))]
Expand Down Expand Up @@ -613,7 +613,7 @@ where
}

to_pem! {
/// Serialies the public key into a PEM-encoded SubjectPublicKeyInfo structure.
/// Serializes the public key into a PEM-encoded SubjectPublicKeyInfo structure.
///
/// The output will have a header of `-----BEGIN PUBLIC KEY-----`.
#[corresponds(PEM_write_bio_EC_PUBKEY)]
Expand Down
4 changes: 2 additions & 2 deletions openssl/src/pkcs7.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,13 +298,13 @@ mod tests {
let mut certs = Stack::new().unwrap();
certs.push(cert.clone()).unwrap();
let message: String = String::from("foo");
let cypher = Cipher::des_ede3_cbc();
let cipher = Cipher::des_ede3_cbc();
let flags = Pkcs7Flags::STREAM;
let pkey = include_bytes!("../test/key.pem");
let pkey = PKey::private_key_from_pem(pkey).unwrap();

let pkcs7 =
Pkcs7::encrypt(&certs, message.as_bytes(), cypher, flags).expect("should succeed");
Pkcs7::encrypt(&certs, message.as_bytes(), cipher, flags).expect("should succeed");

let encrypted = pkcs7
.to_smime(message.as_bytes(), flags)
Expand Down
2 changes: 1 addition & 1 deletion openssl/src/pkey.rs
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ impl PKey<Private> {
}

/// Deserializes a DER-formatted PKCS#8 private key, using a callback to retrieve the password
/// if the key is encrpyted.
/// if the key is encrypted.
///
/// The callback should copy the password into the provided buffer and return the number of
/// bytes written.
Expand Down
2 changes: 1 addition & 1 deletion openssl/src/pkey_ctx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ where

/// Signs the contents of `data`.
///
/// If `sig` is set to `None`, an upper bound on the number of bytes required for the output buffere will be
/// If `sig` is set to `None`, an upper bound on the number of bytes required for the output buffer will be
/// returned.
///
/// # Note
Expand Down
6 changes: 3 additions & 3 deletions openssl/src/sign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,10 +343,10 @@ impl<'a> Signer<'a> {
Ok(buf)
}

/// Signs the data in data_buf and writes the signature into the buffer sig_buf, returning the
/// Signs the data in `data_buf` and writes the signature into the buffer `sig_buf`, returning the
/// number of bytes written.
///
/// For PureEdDSA (Ed25519 and Ed448 keys) this is the only way to sign data.
/// For PureEdDSA (Ed25519 and Ed448 keys), this is the only way to sign data.
///
/// This method will fail if the buffer is not large enough for the signature. Use the `len`
/// method to get an upper bound on the required size.
Expand Down Expand Up @@ -583,7 +583,7 @@ impl<'a> Verifier<'a> {
}
}

/// Determines if the data given in buf matches the provided signature.
/// Determines if the data given in `buf` matches the provided signature.
///
/// OpenSSL documentation at [`EVP_DigestVerify`].
///
Expand Down
2 changes: 1 addition & 1 deletion openssl/src/ssl/bio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub struct StreamState<S> {
pub dtls_mtu_size: c_long,
}

/// Safe wrapper for BIO_METHOD
/// Safe wrapper for `BIO_METHOD`
pub struct BioMethod(BIO_METHOD);

impl BioMethod {
Expand Down
2 changes: 1 addition & 1 deletion openssl/src/ssl/connector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ fn ctx(method: SslMethod) -> Result<SslContextBuilder, ErrorStack> {
/// OpenSSL's default configuration is highly insecure. This connector manages the OpenSSL
/// structures, configuring cipher suites, session options, hostname verification, and more.
///
/// OpenSSL's built in hostname verification is used when linking against OpenSSL 1.0.2 or 1.1.0,
/// OpenSSL's built-in hostname verification is used when linking against OpenSSL 1.0.2 or 1.1.0,
/// and a custom implementation is used when linking against OpenSSL 1.0.1.
#[derive(Clone, Debug)]
pub struct SslConnector(SslContext);
Expand Down
18 changes: 9 additions & 9 deletions openssl/src/ssl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ bitflags! {
const ENABLE_PARTIAL_WRITE = ffi::SSL_MODE_ENABLE_PARTIAL_WRITE;

/// Disables a check that the data buffer has not moved between calls when operating in a
/// nonblocking context.
/// non-blocking context.
const ACCEPT_MOVING_WRITE_BUFFER = ffi::SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER;

/// Enables automatic retries after TLS session events such as renegotiations or heartbeats.
Expand Down Expand Up @@ -1015,7 +1015,7 @@ impl SslContextBuilder {
///
/// The `set_cipher_list` method controls the cipher suites for protocols before TLSv1.3.
///
/// The format consists of TLSv1.3 ciphersuite names separated by `:` characters in order of
/// The format consists of TLSv1.3 cipher suite names separated by `:` characters in order of
/// preference.
///
/// Requires OpenSSL 1.1.1 or newer.
Expand Down Expand Up @@ -1256,7 +1256,7 @@ impl SslContextBuilder {
/// `Ok(false)` indicates that the OCSP status is invalid and the handshake should be
/// terminated.
///
/// On the server side, this callback is resopnsible for setting the OCSP status response to be
/// On the server side, this callback is responsible for setting the OCSP status response to be
/// returned to clients. The status may be set with the `SslRef::set_ocsp_status` method. A
/// response of `Ok(true)` indicates that the OCSP status should be returned to the client, and
/// `Ok(false)` indicates that the status should not be returned to the client.
Expand Down Expand Up @@ -2643,9 +2643,9 @@ impl SslRef {
}
}

/// Copies the client_random value sent by the client in the TLS handshake into a buffer.
/// Copies the `client_random` value sent by the client in the TLS handshake into a buffer.
///
/// Returns the number of bytes copied, or if the buffer is empty, the size of the client_random
/// Returns the number of bytes copied, or if the buffer is empty, the size of the `client_random`
/// value.
///
/// Requires OpenSSL 1.1.0 or newer.
Expand All @@ -2657,9 +2657,9 @@ impl SslRef {
}
}

/// Copies the server_random value sent by the server in the TLS handshake into a buffer.
/// Copies the `server_random` value sent by the server in the TLS handshake into a buffer.
///
/// Returns the number of bytes copied, or if the buffer is empty, the size of the server_random
/// Returns the number of bytes copied, or if the buffer is empty, the size of the `server_random`
/// value.
///
/// Requires OpenSSL 1.1.0 or newer.
Expand Down Expand Up @@ -3257,7 +3257,7 @@ impl<S: Read + Write> SslStream<S> {

/// Like `read`, but returns an `ssl::Error` rather than an `io::Error`.
///
/// It is particularly useful with a nonblocking socket, where the error value will identify if
/// It is particularly useful with a non-blocking socket, where the error value will identify if
/// OpenSSL is waiting on read or write readiness.
#[corresponds(SSL_read)]
pub fn ssl_read(&mut self, buf: &mut [u8]) -> Result<usize, Error> {
Expand All @@ -3280,7 +3280,7 @@ impl<S: Read + Write> SslStream<S> {

/// Like `write`, but returns an `ssl::Error` rather than an `io::Error`.
///
/// It is particularly useful with a nonblocking socket, where the error value will identify if
/// It is particularly useful with a non-blocking socket, where the error value will identify if
/// OpenSSL is waiting on read or write readiness.
#[corresponds(SSL_write)]
pub fn ssl_write(&mut self, buf: &[u8]) -> Result<usize, Error> {
Expand Down
4 changes: 2 additions & 2 deletions openssl/src/symm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ impl Crypter {
/// and initialization vector `iv`. Padding is enabled.
///
/// This is a convenient interface to `Crypter` to encrypt all data in one go. To encrypt a stream
/// of data increamentally , use `Crypter` instead.
/// of data incrementally , use `Crypter` instead.
///
/// # Examples
///
Expand Down Expand Up @@ -611,7 +611,7 @@ pub fn encrypt(
/// and initialization vector `iv`. Padding is enabled.
///
/// This is a convenient interface to `Crypter` to decrypt all data in one go. To decrypt a stream
/// of data increamentally , use `Crypter` instead.
/// of data incrementally , use `Crypter` instead.
///
/// # Examples
///
Expand Down
2 changes: 1 addition & 1 deletion openssl/src/x509/extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ impl BasicConstraints {
self
}

/// Sets the pathlen to an optional non-negative value. The pathlen is the
/// Sets the `pathlen` to an optional non-negative value. The `pathlen` is the
/// maximum number of CAs that can appear below this one in a chain.
pub fn pathlen(&mut self, pathlen: u32) -> &mut BasicConstraints {
self.pathlen = Some(pathlen);
Expand Down
2 changes: 1 addition & 1 deletion openssl/src/x509/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1323,7 +1323,7 @@ impl X509VerifyResult {
}
}

/// Successful peer certifiate verification.
/// Successful peer certificate verification.
pub const OK: X509VerifyResult = X509VerifyResult(ffi::X509_V_OK);
/// Application verification failure.
pub const APPLICATION_VERIFICATION: X509VerifyResult =
Expand Down

0 comments on commit d8aa8a9

Please sign in to comment.