Quantcast
Channel: Bashタグが付けられた新着記事 - Qiita
Viewing all articles
Browse latest Browse all 2833

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

$
0
0

備忘録

問題

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 -helpfor 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


Viewing all articles
Browse latest Browse all 2833

Latest Images

Trending Articles