Skip to content

Commit

Permalink
Handle older versions of openssl
Browse files Browse the repository at this point in the history
On Ubuntu openssl's genpkey does not have -outpubkey as a genpkey
option. So avoid using it for now and just get the pubkey out in a
second step.

Signed-off-by: Simo Sorce <[email protected]>
  • Loading branch information
simo5 committed Sep 5, 2024
1 parent 0c69ac1 commit f4cd8b7
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/timported
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,16 @@ source "${TESTSSRCDIR}/helpers.sh"
title PARA "Test imported key in token session"

title LINE "Generate keypair in files"
# older versions of openssl don't support -outpubkey ...
#ossl 'genpkey -algorithm EC -out ${TMPPDIR}/file.ec.key.pem
# -pkeyopt ec_paramgen_curve:P-256
# -pkeyopt ec_param_enc:named_curve
# -outpubkey ${TMPPDIR}/file.ec.pub.key.pem'
# .. so we'll use two steps
ossl 'genpkey -algorithm EC -out ${TMPPDIR}/file.ec.key.pem
-pkeyopt ec_paramgen_curve:P-256
-pkeyopt ec_param_enc:named_curve
-outpubkey ${TMPPDIR}/file.ec.pub.key.pem'
-pkeyopt ec_paramgen_curve:P-256'
ossl 'pkey -in ${TMPPDIR}/file.ec.key.pem
-pubout -out ${TMPPDIR}/file.ec.pub.key.pem'

#After key generation force all operations to happen on the token
ORIG_OPENSSL_CONF=${OPENSSL_CONF}
Expand Down

0 comments on commit f4cd8b7

Please sign in to comment.