Skip to content

Commit

Permalink
We don't use these functions
Browse files Browse the repository at this point in the history
  • Loading branch information
beldmit committed Oct 20, 2023
1 parent 5b36041 commit 97b792d
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 51 deletions.
28 changes: 0 additions & 28 deletions ssh-pkcs11-client.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,36 +430,8 @@ ecdsa_do_finish(EC_KEY *ec)
if (helper->nrsa == 0 && helper->nec == 0)
helper_terminate(helper);
}

int
is_ecdsa_pkcs11(EC_KEY *ecdsa)
{
const EC_KEY_METHOD *meth;
ECDSA_SIG *(*sign_sig)(const unsigned char *dgst, int dgstlen,
const BIGNUM *kinv, const BIGNUM *rp, EC_KEY *eckey) = NULL;

meth = EC_KEY_get_method(ecdsa);
EC_KEY_METHOD_get_sign(meth, NULL, NULL, &sign_sig);
if (sign_sig == ecdsa_do_sign)
return 1;
return 0;
}
#endif /* defined(OPENSSL_HAS_ECC) && defined(HAVE_EC_KEY_METHOD_NEW) */

int
is_rsa_pkcs11(RSA *rsa)
{
const RSA_METHOD *meth;
int (*priv_enc)(int flen, const unsigned char *from,
unsigned char *to, RSA *rsa, int padding) = NULL;

meth = RSA_get_method(rsa);
priv_enc = RSA_meth_get_priv_enc(meth);
if (priv_enc == rsa_encrypt)
return 1;
return 0;
}

/* redirect private key crypto operations to the ssh-pkcs11-helper */
static void
wrap_key(struct helper *helper, struct sshkey *k)
Expand Down
16 changes: 0 additions & 16 deletions ssh-pkcs11.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,14 +620,6 @@ pkcs11_ecdsa_wrap(struct pkcs11_provider *provider, CK_ULONG slotidx,

return (0);
}

int
is_ecdsa_pkcs11(EC_KEY *ecdsa)
{
if (EC_KEY_get_ex_data(ecdsa, ec_key_idx) != NULL)
return 1;
return 0;
}
#endif /* OPENSSL_HAS_ECC && HAVE_EC_KEY_METHOD_NEW */

/* remove trailing spaces */
Expand Down Expand Up @@ -846,14 +838,6 @@ pkcs11_fetch_ecdsa_pubkey(struct pkcs11_provider *p, CK_ULONG slotidx,
}
#endif /* OPENSSL_HAS_ECC && HAVE_EC_KEY_METHOD_NEW */

int
is_rsa_pkcs11(RSA *rsa)
{
if (RSA_get_ex_data(rsa, rsa_idx) != NULL)
return 1;
return 0;
}

static struct sshkey *
pkcs11_fetch_rsa_pubkey(struct pkcs11_provider *p, CK_ULONG slotidx,
CK_OBJECT_HANDLE *obj)
Expand Down
7 changes: 0 additions & 7 deletions ssh-pkcs11.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,6 @@ struct sshkey *
u_int32_t *);
#endif

#if defined WITH_OPENSSL
#ifdef HAVE_EC_KEY_METHOD_NEW
int is_ecdsa_pkcs11(EC_KEY *ecdsa);
#endif
int is_rsa_pkcs11(RSA *rsa);
#endif

#if !defined(WITH_OPENSSL) && defined(ENABLE_PKCS11)
#undef ENABLE_PKCS11
#endif

0 comments on commit 97b792d

Please sign in to comment.