mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-22 22:23:38 -07:00
rsa init
This commit is contained in:
parent
f7aa808d09
commit
1aa6adddef
1 changed files with 15 additions and 13 deletions
|
@ -89,21 +89,23 @@ struct crypto_pk_polarssl {
|
||||||
static struct crypto_pk *crypto_pk_polarssl_open_rsa(va_list vl)
|
static struct crypto_pk *crypto_pk_polarssl_open_rsa(va_list vl)
|
||||||
{
|
{
|
||||||
struct crypto_pk_polarssl *cp = malloc(sizeof(*cp));
|
struct crypto_pk_polarssl *cp = malloc(sizeof(*cp));
|
||||||
//gcry_error_t err;
|
|
||||||
/* char *mod = va_arg(vl, char *);
|
char *mod = va_arg(vl, char *); // N
|
||||||
int modlen = va_arg(vl, size_t);
|
int modlen = va_arg(vl, size_t);
|
||||||
char *exp = va_arg(vl, char *);
|
char *exp = va_arg(vl, char *); // E
|
||||||
int explen = va_arg(vl, size_t);
|
int explen = va_arg(vl, size_t);
|
||||||
*/
|
|
||||||
/* err = gcry_sexp_build(&cp->pk, NULL, "(public-key (rsa (n %b) (e %b)))",
|
rsa_init(&(cp->ctx), RSA_PKCS_V15, 0);
|
||||||
modlen, mod, explen, exp);
|
|
||||||
if (err) {
|
cp->ctx.len = modlen * 2; // size(N) in chars
|
||||||
fprintf(stderr, "LibGCrypt error %s/%s\n",
|
mpi_read_binary(&cp->ctx.N, (const unsigned char *)mod, modlen);
|
||||||
gcry_strsource (err),
|
mpi_read_binary(&cp->ctx.E, (const unsigned char *)exp, explen);
|
||||||
gcry_strerror (err));
|
|
||||||
free(cp);
|
if(rsa_check_privkey(&(cp->ctx)) != 0) {
|
||||||
|
fprintf(stderr, "PolarSSL key error.\n");
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}*/
|
}
|
||||||
|
|
||||||
return &cp->cp;
|
return &cp->cp;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue