Hey Richard,
thanks so much. I try to distinct between private and public key by
using different methods for decoding:
{PROV_NAMES_ED25519PH,
"provider=myprov,input=der,structure=SubjectPublicKeyInfo",
dispatch_decoder_ed25519_der_pub, PROV_DESCS_ED25519}, //
,input=der,structure=pkcs8
{PROV_NAMES_ED25519PH,
"provider=myprov,input=der,structure=PrivateKeyInfo",
dispatch_decoder_ed25519_der, PROV_DESCS_ED25519}, //
,input=der,structure=pkcs8
May I have a problem with the callbacks? How would I distinct between
returning a reference to a public and/or private key in the callback params:
OSSL_PARAM params[4];
int object_type = OSSL_OBJECT_PKEY;
params[0] = OSSL_PARAM_construct_int(OSSL_OBJECT_PARAM_TYPE,
&object_type);
params[1] =
OSSL_PARAM_construct_utf8_string(OSSL_OBJECT_PARAM_DATA_TYPE, (char
*)KEYNAME_MYKEY, 12);
params[2] =
OSSL_PARAM_construct_octet_string(OSSL_OBJECT_PARAM_REFERENCE,
(void*)data, data_len);
params[3] = OSSL_PARAM_construct_end();
But anyhow when calling openssl verify, my decoder is not matching. The
dispatcher seems to toggle between KeyManagement and Decoding:
openssl pkeyutl -provider-path build -provider default -provider
lib_ed25519ph -propquery ?provider=myprov -verify -inkey example-pub.pem
-pubin -in message.txt -rawin -sigfile message.txt.sigp
operating switch: 22 (1=DIGEST, 2=CIPHER, 5=RAND, 10=KEYMGMT, 12=SIG,
20=ENC, 21=DEC, 22=STOR), 0x61019a917c90
operating switch: 21 (1=DIGEST, 2=CIPHER, 5=RAND, 10=KEYMGMT, 12=SIG,
20=ENC, 21=DEC, 22=STOR), 0x61019a917c90
operating switch: 10 (1=DIGEST, 2=CIPHER, 5=RAND, 10=KEYMGMT, 12=SIG,
20=ENC, 21=DEC, 22=STOR), 0x61019a917c90
operating switch: 21 (1=DIGEST, 2=CIPHER, 5=RAND, 10=KEYMGMT, 12=SIG,
20=ENC, 21=DEC, 22=STOR), 0x61019a917c90
ed25519ph-provider/src/ed25519ph_decoder.c - Decoder context new
0x61019a92ce20
ed25519ph-provider/src/ed25519ph_decoder.c - Decoder context new
0x61019a92ce70
operating switch: 21 (1=DIGEST, 2=CIPHER, 5=RAND, 10=KEYMGMT, 12=SIG,
20=ENC, 21=DEC, 22=STOR), 0x61019a917c90
ed25519ph-provider/src/ed25519ph_decoder.c - Decoder context new
0x61019a92e6c0
ed25519ph-provider/src/ed25519ph_decoder.c - Decoder context new
0x61019a92e710
ed25519ph-provider/src/ed25519ph_decoder.c - Decoder context free
0x61019a92e6c0
ed25519ph-provider/src/ed25519ph_decoder.c - Decoder context free
0x61019a92e710
operating switch: 10 (1=DIGEST, 2=CIPHER, 5=RAND, 10=KEYMGMT, 12=SIG,
20=ENC, 21=DEC, 22=STOR), 0x61019a917c90
operating switch: 21 (1=DIGEST, 2=CIPHER, 5=RAND, 10=KEYMGMT, 12=SIG,
20=ENC, 21=DEC, 22=STOR), 0x61019a917c90
operating switch: 10 (1=DIGEST, 2=CIPHER, 5=RAND, 10=KEYMGMT, 12=SIG,
20=ENC, 21=DEC, 22=STOR), 0x61019a917c90
operating switch: 21 (1=DIGEST, 2=CIPHER, 5=RAND, 10=KEYMGMT, 12=SIG,
20=ENC, 21=DEC, 22=STOR), 0x61019a917c90
operating switch: 21 (1=DIGEST, 2=CIPHER, 5=RAND, 10=KEYMGMT, 12=SIG,
20=ENC, 21=DEC, 22=STOR), 0x61019a917c90
operating switch: 10 (1=DIGEST, 2=CIPHER, 5=RAND, 10=KEYMGMT, 12=SIG,
20=ENC, 21=DEC, 22=STOR), 0x61019a917c90
operating switch: 21 (1=DIGEST, 2=CIPHER, 5=RAND, 10=KEYMGMT, 12=SIG,
20=ENC, 21=DEC, 22=STOR), 0x61019a917c90
ed25519ph-provider/src/ed25519ph_decoder.c - Decoder context new
0x61019a931280
ed25519ph-provider/src/ed25519ph_decoder.c - Decoder context new
0x61019a9313f0
operating switch: 21 (1=DIGEST, 2=CIPHER, 5=RAND, 10=KEYMGMT, 12=SIG,
20=ENC, 21=DEC, 22=STOR), 0x61019a917c90
ed25519ph-provider/src/ed25519ph_decoder.c - Decoder context new
ed25519ph-provider/src/ed25519ph_decoder.c - Decoder context new
0x61019a933400
ed25519ph-provider/src/ed25519ph_decoder.c - Decoder context free
0x61019a9333b0
ed25519ph-provider/src/ed25519ph_decoder.c - Decoder context free
0x61019a933400
operating switch: 10 (1=DIGEST, 2=CIPHER, 5=RAND, 10=KEYMGMT, 12=SIG,
20=ENC, 21=DEC, 22=STOR), 0x61019a917c90
operating switch: 21 (1=DIGEST, 2=CIPHER, 5=RAND, 10=KEYMGMT, 12=SIG,
20=ENC, 21=DEC, 22=STOR), 0x61019a917c90
Could not find private key of public key from example-pub.pem
80FBC83E5A780000:error:1608010C:STORE
routines:ossl_store_handle_load_result:unsupported:crypto/store/store_result.c:151:
80FBC83E5A780000:error:1608010C:STORE
routines:ossl_store_handle_load_result:unsupported:crypto/store/store_result.c:151:
pkeyutl: Error initializing context
ed25519ph-provider/src/ed25519ph_decoder.c - Decoder context free
0x61019a931280
ed25519ph-provider/src/ed25519ph_decoder.c - Decoder context free
0x61019a9313f0
ed25519ph-provider/src/ed25519ph_decoder.c - Decoder context free
0x61019a92ce20
ed25519ph-provider/src/ed25519ph_decoder.c - Decoder context free
0x61019a92ce70
All the best,
Bernd
Am 03.09.24 um 15:36 schrieb Richard Levitte:
> Mail:
rit...@b1-systems.de <mailto:
rit...@b1-systems.de>
>
> B1 Systems GmbH
> Osterfeldstraße 7 / 85088 Vohburg /
http://www.b1-systems.de
> <
http://www.b1-systems.de>
> GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt, HRB 3537
>
> --
> You received this message because you are subscribed to the Google
> Groups "openssl-users" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to
openssl-user...@openssl.org
> <mailto:
openssl-users%2Bunsu...@openssl.org>.
> To view this discussion on the web visit