LoginSignup
2
1

More than 3 years have passed since last update.

openssl1.1は鍵長を最後に求めるようになった

Last updated at Posted at 2019-12-05

備忘録

問題

Macのopensslのバージョンを1.0.2kから1.1.1dに変えたら秘密鍵の生成にこけるようになった

$ openssl version
OpenSSL 1.1.1d  10 Sep 2019
$ openssl genrsa -des3 2048 -rand rand.dat
Extra arguments given.
genrsa: Use -help for summary.

今まで

別のサーバにopenssl1.0.1eだが存在したので、同じコマンドを実行したところ行ける

$ openssl version
OpenSSL 1.0.1e-fips 11 Feb 2013
$ openssl genrsa -des3 2048 -rand rand.dat
Generating RSA private key, 2048 bit long modulus
..........+++
.....+++
e is 65537 (0x10001)
Enter pass phrase:

解決

今までは鍵長は最後に指定しなくてもいけたが、1.1.1dは最後ではないとこけるらしい。
厳密にはどこのバージョンから厳密になったのかは不明。

$ openssl genrsa -des3 -rand rand.dat 2048
Generating RSA private key, 2048 bit long modulus (2 primes)
...................................+++++
....+++++
e is 65537 (0x010001)
Enter pass phrase:

補足

マニュアルに順番書いてあるから守ろうねって話と言いたいけど
-がつかないnumbitsのみ最後の必要がある。他は順番適当でも行ける。
多分直前のoptionに対する引数みたいな扱いになるのかな(詳しくは見ていない)

openssl genrsa [-help] [-out filename] [-passout arg] [-aes128] [-aes192] [-aes256] [-aria128] [-aria192] [-aria256] [-camellia128] [-camellia192] [-camellia256] [-des] [-des3] [-idea] [-f4] [-3] [-rand file...] [-writerand file] [-engine id] [-primes num] [numbits]
https://www.openssl.org/docs/man1.1.1/man1/genrsa.html

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1