print $F $pubkey;
close $F;
#3. Прочитать публичный и напечать его в виде текста
- is(`openssl pkey -pubin -noout -in tmp.pem -text`,$pubtext,
+ is(`openssl pkey -pubin -noout -in tmp.pem -text_pub`,$pubtext,
"Read and print public key $alg:$paramset");
}
- unlink "tmp.pem";
+ #unlink "tmp.pem";
};
#4. Сгенерировать ключ два раза (для всех алгоритов и параметров).
# Bob: derive
system("openssl pkeyutl -derive -inkey bob.prv -keyform PEM -peerkey alice.pub.der -peerform DER -pkeyopt ukmhex:0100000000000000 -out secret_b.bin");
like(`openssl dgst -sha256 -r secret_b.bin`, qr/^$secrethash/, "Compute shared key:$id:Bob");
- if ($malice ne "") {
+ if (defined $malice && $malice ne "") {
# Malice: negative test -- this PEM is in the small subgroup
open $F,">",'malice.pub';
print $F $malice;