diff --git a/oqsprov/oqs_prov.h b/oqsprov/oqs_prov.h index 7192f60e..10119939 100644 --- a/oqsprov/oqs_prov.h +++ b/oqsprov/oqs_prov.h @@ -93,7 +93,7 @@ void oqsx_freeprovctx(PROV_OQS_CTX *ctx); #endif /* helper structure for classic key components in hybrid keys. - * Actual tables in oqsprov_keys.ce + * Actual tables in oqsprov_keys.c */ struct oqsx_evp_info_st { int keytype; diff --git a/oqsprov/oqsprov.c b/oqsprov/oqsprov.c index 47f34c8a..30d09b60 100644 --- a/oqsprov/oqsprov.c +++ b/oqsprov/oqsprov.c @@ -973,7 +973,11 @@ int get_composite_idx(int idx) for (i = 0; i <= 7; i++) { // 7 dots in composite OID token = strtok_r(NULL, ".", &s); } - i = atoi(token); + if (token != NULL) { + i = atoi(token); + } else { + i = -1; + } OPENSSL_free(first_token); return i; } diff --git a/oqsprov/oqsprov_keys.c b/oqsprov/oqsprov_keys.c index 20fb3049..740702ef 100644 --- a/oqsprov/oqsprov_keys.c +++ b/oqsprov/oqsprov_keys.c @@ -419,10 +419,12 @@ EVP_PKEY *setECParams(EVP_PKEY *eck, int nid) return d2i_KeyParams(EVP_PKEY_EC, &eck, ¶ms, sizeof(bp384params)); case NID_ED25519: params = ed25519params; - return d2i_KeyParams(EVP_PKEY_EC, &eck, ¶ms, sizeof(ed25519params)); + return d2i_KeyParams(EVP_PKEY_ED25519, &eck, ¶ms, + sizeof(ed25519params)); case NID_ED448: params = ed448params; - return d2i_KeyParams(EVP_PKEY_EC, &eck, ¶ms, sizeof(ed448params)); + return d2i_KeyParams(EVP_PKEY_ED448, &eck, ¶ms, + sizeof(ed448params)); default: return NULL; }