Skip to content

Commit 06d6764

Browse files
committed
[DOC] prefer "password" to "passphrase"
Let's consistently use the word "password". Although they are considered synonymous, the mixed usage in the rdoc can cause confusion. OpenSSL::KDF.scrypt is an exception. This is because RFC 7914 refers to the input parameter as "passphrase".
1 parent 97fb410 commit 06d6764

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

ext/openssl/ossl.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ ossl_pem_passwd_cb(char *buf, int max_len, int flag, void *pwd_)
207207

208208
while (1) {
209209
/*
210-
* when the flag is nonzero, this passphrase
210+
* when the flag is nonzero, this password
211211
* will be used to perform encryption; otherwise it will
212212
* be used to perform decryption.
213213
*/
@@ -676,12 +676,12 @@ ossl_crypto_fixed_length_secure_compare(VALUE dummy, VALUE str1, VALUE str2)
676676
*
677677
* Keys saved to disk without encryption are not secure as anyone who gets
678678
* ahold of the key may use it unless it is encrypted. In order to securely
679-
* export a key you may export it with a pass phrase.
679+
* export a key you may export it with a password.
680680
*
681681
* cipher = OpenSSL::Cipher.new 'aes-256-cbc'
682-
* pass_phrase = 'my secure pass phrase goes here'
682+
* password = 'my secure password goes here'
683683
*
684-
* key_secure = key.export cipher, pass_phrase
684+
* key_secure = key.export cipher, password
685685
*
686686
* open 'private.secure.pem', 'w' do |io|
687687
* io.write key_secure
@@ -705,13 +705,13 @@ ossl_crypto_fixed_length_secure_compare(VALUE dummy, VALUE str1, VALUE str2)
705705
*
706706
* === Loading an Encrypted Key
707707
*
708-
* OpenSSL will prompt you for your pass phrase when loading an encrypted key.
709-
* If you will not be able to type in the pass phrase you may provide it when
708+
* OpenSSL will prompt you for your password when loading an encrypted key.
709+
* If you will not be able to type in the password you may provide it when
710710
* loading the key:
711711
*
712712
* key4_pem = File.read 'private.secure.pem'
713-
* pass_phrase = 'my secure pass phrase goes here'
714-
* key4 = OpenSSL::PKey.read key4_pem, pass_phrase
713+
* password = 'my secure password goes here'
714+
* key4 = OpenSSL::PKey.read key4_pem, password
715715
*
716716
* == RSA Encryption
717717
*
@@ -943,12 +943,12 @@ ossl_crypto_fixed_length_secure_compare(VALUE dummy, VALUE str1, VALUE str2)
943943
* not readable by other users.
944944
*
945945
* ca_key = OpenSSL::PKey::RSA.new 2048
946-
* pass_phrase = 'my secure pass phrase goes here'
946+
* password = 'my secure password goes here'
947947
*
948948
* cipher = OpenSSL::Cipher.new 'aes-256-cbc'
949949
*
950950
* open 'ca_key.pem', 'w', 0400 do |io|
951-
* io.write ca_key.export(cipher, pass_phrase)
951+
* io.write ca_key.export(cipher, password)
952952
* end
953953
*
954954
* === CA Certificate

ext/openssl/ossl_kdf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ static VALUE mKDF, eKDF;
2121
* (https://tools.ietf.org/html/rfc2898#section-5.2).
2222
*
2323
* === Parameters
24-
* pass :: The passphrase.
24+
* pass :: The password.
2525
* salt :: The salt. Salts prevent attacks based on dictionaries of common
2626
* passwords and attacks based on rainbow tables. It is a public
2727
* value that can be safely stored along with the password (e.g.

ext/openssl/ossl_pkey_rsa.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ VALUE eRSAError;
5050
/*
5151
* call-seq:
5252
* RSA.new -> rsa
53-
* RSA.new(encoded_key [, passphrase]) -> rsa
54-
* RSA.new(encoded_key) { passphrase } -> rsa
53+
* RSA.new(encoded_key [, password ]) -> rsa
54+
* RSA.new(encoded_key) { password } -> rsa
5555
* RSA.new(size [, exponent]) -> rsa
5656
*
5757
* Generates or loads an \RSA keypair.
@@ -61,17 +61,17 @@ VALUE eRSAError;
6161
* #set_crt_params.
6262
*
6363
* If called with a String, tries to parse as DER or PEM encoding of an \RSA key.
64-
* Note that, if _passphrase_ is not specified but the key is encrypted with a
65-
* passphrase, \OpenSSL will prompt for it.
66-
* See also OpenSSL::PKey.read which can parse keys of any kinds.
64+
* Note that if _password_ is not specified, but the key is encrypted with a
65+
* password, \OpenSSL will prompt for it.
66+
* See also OpenSSL::PKey.read which can parse keys of any kind.
6767
*
6868
* If called with a number, generates a new key pair. This form works as an
6969
* alias of RSA.generate.
7070
*
7171
* Examples:
7272
* OpenSSL::PKey::RSA.new 2048
7373
* OpenSSL::PKey::RSA.new File.read 'rsa.pem'
74-
* OpenSSL::PKey::RSA.new File.read('rsa.pem'), 'my pass phrase'
74+
* OpenSSL::PKey::RSA.new File.read('rsa.pem'), 'my password'
7575
*/
7676
static VALUE
7777
ossl_rsa_initialize(int argc, VALUE *argv, VALUE self)
@@ -217,11 +217,11 @@ can_export_rsaprivatekey(VALUE self)
217217

218218
/*
219219
* call-seq:
220-
* rsa.export([cipher, pass_phrase]) => PEM-format String
221-
* rsa.to_pem([cipher, pass_phrase]) => PEM-format String
222-
* rsa.to_s([cipher, pass_phrase]) => PEM-format String
220+
* rsa.export([cipher, password]) => PEM-format String
221+
* rsa.to_pem([cipher, password]) => PEM-format String
222+
* rsa.to_s([cipher, password]) => PEM-format String
223223
*
224-
* Outputs this keypair in PEM encoding. If _cipher_ and _pass_phrase_ are
224+
* Outputs this keypair in PEM encoding. If _cipher_ and _password_ are
225225
* given they will be used to encrypt the key. _cipher_ must be an
226226
* OpenSSL::Cipher instance.
227227
*/

0 commit comments

Comments
 (0)