Skip to content

Commit 7b319d9

Browse files
committed
Merge branch 'topic/fix-rdoc-markup'
* topic/fix-rdoc-markup: Fix RDoc markup Revert r57690 except for read_nonblock [DOC] mark up literals [DOC] keyword argument _exception_ [DOC] {read,write}_nonblock with exception: false
2 parents 09e415d + c68e46f commit 7b319d9

26 files changed

+438
-427
lines changed

ext/openssl/ossl.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,8 @@ ossl_clear_error(void)
328328
*
329329
* See any remaining errors held in queue.
330330
*
331-
* Any errors you see here are probably due to a bug in ruby's OpenSSL implementation.
331+
* Any errors you see here are probably due to a bug in Ruby's OpenSSL
332+
* implementation.
332333
*/
333334
VALUE
334335
ossl_get_errors(void)
@@ -452,7 +453,7 @@ mem_check_start(VALUE self)
452453
* Prints detected memory leaks to standard error. This cleans the global state
453454
* up thus you cannot use any methods of the library after calling this.
454455
*
455-
* Returns true if leaks detected, false otherwise.
456+
* Returns +true+ if leaks detected, +false+ otherwise.
456457
*
457458
* This is available only when built with a capable OpenSSL and --enable-debug
458459
* configure option.
@@ -568,7 +569,7 @@ static void Init_ossl_locks(void)
568569

569570
/*
570571
* OpenSSL provides SSL, TLS and general purpose cryptography. It wraps the
571-
* OpenSSL[http://www.openssl.org/] library.
572+
* OpenSSL[https://www.openssl.org/] library.
572573
*
573574
* = Examples
574575
*

ext/openssl/ossl_asn1.c

Lines changed: 95 additions & 94 deletions
Large diffs are not rendered by default.

ext/openssl/ossl_bn.c

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -176,16 +176,15 @@ ossl_bn_alloc(VALUE klass)
176176
return obj;
177177
}
178178

179-
/* Document-method: OpenSSL::BN.new
180-
*
179+
/*
181180
* call-seq:
182181
* OpenSSL::BN.new => aBN
183182
* OpenSSL::BN.new(bn) => aBN
184183
* OpenSSL::BN.new(integer) => aBN
185184
* OpenSSL::BN.new(string) => aBN
186185
* OpenSSL::BN.new(string, 0 | 2 | 10 | 16) => aBN
187186
*
188-
* Construct a new OpenSSL BigNum object.
187+
* Construct a new OpenSSL BIGNUM object.
189188
*/
190189
static VALUE
191190
ossl_bn_initialize(int argc, VALUE *argv, VALUE self)
@@ -250,7 +249,7 @@ ossl_bn_initialize(int argc, VALUE *argv, VALUE self)
250249
* bn.to_s(base) => string
251250
*
252251
* === Parameters
253-
* * +base+ - integer
252+
* * _base_ - Integer
254253
* Valid values:
255254
* * 0 - MPI
256255
* * 2 - binary
@@ -513,7 +512,6 @@ BIGNUM_2c(mod_sqr)
513512
BIGNUM_2c(mod_inverse)
514513

515514
/*
516-
* Document-method: OpenSSL::BN#/
517515
* call-seq:
518516
* bn1 / bn2 => [result, remainder]
519517
*
@@ -629,12 +627,11 @@ BIGNUM_BIT(clear_bit)
629627
*/
630628
BIGNUM_BIT(mask_bits)
631629

632-
/* Document-method: OpenSSL::BN#bit_set?
630+
/*
633631
* call-seq:
634632
* bn.bit_set?(bit) => true | false
635633
*
636-
* Returns boolean of whether +bit+ is set.
637-
* Bitwise operations for openssl BIGNUMs.
634+
* Tests bit _bit_ in _bn_ and returns +true+ if set, +false+ if not set.
638635
*/
639636
static VALUE
640637
ossl_bn_is_bit_set(VALUE self, VALUE bit)
@@ -789,15 +786,15 @@ BIGNUM_RAND_RANGE(pseudo_rand)
789786
* call-seq:
790787
* BN.generate_prime(bits, [, safe [, add [, rem]]]) => bn
791788
*
792-
* Generates a random prime number of bit length +bits+. If +safe+ is true,
793-
* generates a safe prime. If +add+ is specified, generates a prime that
789+
* Generates a random prime number of bit length _bits_. If _safe_ is set to
790+
* +true+, generates a safe prime. If _add_ is specified, generates a prime that
794791
* fulfills condition <tt>p % add = rem</tt>.
795792
*
796793
* === Parameters
797-
* * +bits+ - integer
798-
* * +safe+ - boolean
799-
* * +add+ - BN
800-
* * +rem+ - BN
794+
* * _bits_ - integer
795+
* * _safe_ - boolean
796+
* * _add_ - BN
797+
* * _rem_ - BN
801798
*/
802799
static VALUE
803800
ossl_bn_s_generate_prime(int argc, VALUE *argv, VALUE klass)
@@ -934,7 +931,7 @@ BIGNUM_CMP(ucmp)
934931
* call-seq:
935932
* bn == obj => true or false
936933
*
937-
* Returns +true+ only if +obj+ has the same value as +bn+. Contrast this
934+
* Returns +true+ only if _obj_ has the same value as _bn_. Contrast this
938935
* with OpenSSL::BN#eql?, which requires obj to be OpenSSL::BN.
939936
*/
940937
static VALUE
@@ -959,7 +956,7 @@ ossl_bn_eq(VALUE self, VALUE other)
959956
* bn.eql?(obj) => true or false
960957
*
961958
* Returns <code>true</code> only if <i>obj</i> is a
962-
* <code>OpenSSL::BN</code> with the same value as <i>big</i>. Contrast this
959+
* <code>OpenSSL::BN</code> with the same value as <i>bn</i>. Contrast this
963960
* with OpenSSL::BN#==, which performs type conversions.
964961
*/
965962
static VALUE
@@ -1010,12 +1007,12 @@ ossl_bn_hash(VALUE self)
10101007
* bn.prime? => true | false
10111008
* bn.prime?(checks) => true | false
10121009
*
1013-
* Performs a Miller-Rabin probabilistic primality test with +checks+
1014-
* iterations. If +nchecks+ is not specified, a number of iterations is used
1010+
* Performs a Miller-Rabin probabilistic primality test with _checks_
1011+
* iterations. If _checks_ is not specified, a number of iterations is used
10151012
* that yields a false positive rate of at most 2^-80 for random input.
10161013
*
10171014
* === Parameters
1018-
* * +checks+ - integer
1015+
* * _checks_ - integer
10191016
*/
10201017
static VALUE
10211018
ossl_bn_is_prime(int argc, VALUE *argv, VALUE self)
@@ -1050,8 +1047,8 @@ ossl_bn_is_prime(int argc, VALUE *argv, VALUE self)
10501047
* first attempts trial divisions with some small primes.
10511048
*
10521049
* === Parameters
1053-
* * +checks+ - integer
1054-
* * +trial_div+ - boolean
1050+
* * _checks_ - integer
1051+
* * _trial_div_ - boolean
10551052
*/
10561053
static VALUE
10571054
ossl_bn_is_prime_fasttest(int argc, VALUE *argv, VALUE self)

ext/openssl/ossl_cipher.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ ossl_cipher_alloc(VALUE klass)
108108
* call-seq:
109109
* Cipher.new(string) -> cipher
110110
*
111-
* The string must contain a valid cipher name like "AES-128-CBC" or "3DES".
111+
* The string must be a valid cipher name like "AES-128-CBC" or "3DES".
112112
*
113113
* A list of cipher names is available by calling OpenSSL::Cipher.ciphers.
114114
*/
@@ -296,9 +296,9 @@ ossl_cipher_decrypt(int argc, VALUE *argv, VALUE self)
296296
* OpenSSL::PKCS5 instead.
297297
*
298298
* === Parameters
299-
* * +salt+ must be an 8 byte string if provided.
300-
* * +iterations+ is an integer with a default of 2048.
301-
* * +digest+ is a Digest object that defaults to 'MD5'
299+
* * _salt_ must be an 8 byte string if provided.
300+
* * _iterations_ is an integer with a default of 2048.
301+
* * _digest_ is a Digest object that defaults to 'MD5'
302302
*
303303
* A minimum of 1000 iterations is recommended.
304304
*
@@ -365,12 +365,12 @@ ossl_cipher_update_long(EVP_CIPHER_CTX *ctx, unsigned char *out, long *out_len_p
365365
* cipher.update(data [, buffer]) -> string or buffer
366366
*
367367
* Encrypts data in a streaming fashion. Hand consecutive blocks of data
368-
* to the +update+ method in order to encrypt it. Returns the encrypted
368+
* to the #update method in order to encrypt it. Returns the encrypted
369369
* data chunk. When done, the output of Cipher#final should be additionally
370370
* added to the result.
371371
*
372-
* If +buffer+ is given, the encryption/decryption result will be written to
373-
* it. +buffer+ will be resized automatically.
372+
* If _buffer_ is given, the encryption/decryption result will be written to
373+
* it. _buffer_ will be resized automatically.
374374
*/
375375
static VALUE
376376
ossl_cipher_update(int argc, VALUE *argv, VALUE self)
@@ -587,8 +587,8 @@ ossl_cipher_set_auth_data(VALUE self, VALUE data)
587587
* Gets the authentication tag generated by Authenticated Encryption Cipher
588588
* modes (GCM for example). This tag may be stored along with the ciphertext,
589589
* then set on the decryption cipher to authenticate the contents of the
590-
* ciphertext against changes. If the optional integer parameter +tag_len+ is
591-
* given, the returned tag will be +tag_len+ bytes long. If the parameter is
590+
* ciphertext against changes. If the optional integer parameter _tag_len_ is
591+
* given, the returned tag will be _tag_len_ bytes long. If the parameter is
592592
* omitted, the default length of 16 bytes or the length previously set by
593593
* #auth_tag_len= will be used. For maximum security, the longest possible
594594
* should be chosen.
@@ -1004,9 +1004,9 @@ Init_ossl_cipher(void)
10041004
* encryption and later decryption, the OpenSSL library still requires a
10051005
* value to be set - "" may be used in case none is available.
10061006
*
1007-
* An example using the GCM (Galois/Counter Mode). You have 16 bytes +key+,
1008-
* 12 bytes (96 bits) +nonce+ and the associated data +auth_data+. Be sure
1009-
* not to reuse the +key+ and +nonce+ pair. Reusing an nonce ruins the
1007+
* An example using the GCM (Galois/Counter Mode). You have 16 bytes _key_,
1008+
* 12 bytes (96 bits) _nonce_ and the associated data _auth_data_. Be sure
1009+
* not to reuse the _key_ and _nonce_ pair. Reusing an nonce ruins the
10101010
* security gurantees of GCM mode.
10111011
*
10121012
* cipher = OpenSSL::Cipher::AES.new(128, :GCM).encrypt
@@ -1017,8 +1017,8 @@ Init_ossl_cipher(void)
10171017
* encrypted = cipher.update(data) + cipher.final
10181018
* tag = cipher.auth_tag # produces 16 bytes tag by default
10191019
*
1020-
* Now you are the receiver. You know the +key+ and have received +nonce+,
1021-
* +auth_data+, +encrypted+ and +tag+ through an untrusted network. Note
1020+
* Now you are the receiver. You know the _key_ and have received _nonce_,
1021+
* _auth_data_, _encrypted_ and _tag_ through an untrusted network. Note
10221022
* that GCM accepts an arbitrary length tag between 1 and 16 bytes. You may
10231023
* additionally need to check that the received tag has the correct length,
10241024
* or you allow attackers to forge a valid single byte tag for the tampered

ext/openssl/ossl_digest.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,15 @@ VALUE ossl_digest_update(VALUE, VALUE);
106106
* call-seq:
107107
* Digest.new(string [, data]) -> Digest
108108
*
109-
* Creates a Digest instance based on +string+, which is either the ln
109+
* Creates a Digest instance based on _string_, which is either the ln
110110
* (long name) or sn (short name) of a supported digest algorithm.
111111
*
112-
* If +data+ (a +String+) is given, it is used as the initial input to the
112+
* If _data_ (a String) is given, it is used as the initial input to the
113113
* Digest instance, i.e.
114114
*
115115
* digest = OpenSSL::Digest.new('sha256', 'digestdata')
116116
*
117-
* is equal to
117+
* is equivalent to
118118
*
119119
* digest = OpenSSL::Digest.new('sha256')
120120
* digest.update('digestdata')

0 commit comments

Comments
 (0)