summaryrefslogtreecommitdiff
path: root/lib/gnutls_privkey.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2011-05-23 22:42:35 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2011-05-23 22:42:35 +0200
commitfc2b813d1a6034e45906ed014c6a1babe8555bd5 (patch)
treee177bb3f779dee3a7413ad47cde998a2cee022d8 /lib/gnutls_privkey.c
parent69a52e9050c2d18f024b94f058b8d1a0f340e9a1 (diff)
downloadgnutls-fc2b813d1a6034e45906ed014c6a1babe8555bd5.tar.gz
Several updates to allow generation and signing of an ECC certificate.
Diffstat (limited to 'lib/gnutls_privkey.c')
-rw-r--r--lib/gnutls_privkey.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/gnutls_privkey.c b/lib/gnutls_privkey.c
index b71e04a224..f1737c0754 100644
--- a/lib/gnutls_privkey.c
+++ b/lib/gnutls_privkey.c
@@ -144,6 +144,29 @@ privkey_to_pubkey (gnutls_pk_algorithm_t pk,
}
break;
+ case GNUTLS_PK_ECC:
+ pub->params[0] = _gnutls_mpi_copy (priv->params[0]);
+ pub->params[1] = _gnutls_mpi_copy (priv->params[1]);
+ pub->params[2] = _gnutls_mpi_copy (priv->params[2]);
+ pub->params[3] = _gnutls_mpi_copy (priv->params[3]);
+ pub->params[4] = _gnutls_mpi_copy (priv->params[4]);
+ pub->params[5] = _gnutls_mpi_copy (priv->params[5]);
+ pub->params[6] = _gnutls_mpi_copy (priv->params[6]);
+
+ pub->params_nr = ECC_PUBLIC_PARAMS;
+ pub->flags = priv->flags;
+
+ if (pub->params[0] == NULL || pub->params[1] == NULL ||
+ pub->params[2] == NULL || pub->params[3] == NULL ||
+ pub->params[4] == NULL || pub->params[5] == NULL ||
+ pub->params[6] == NULL)
+ {
+ gnutls_assert ();
+ ret = GNUTLS_E_MEMORY_ERROR;
+ goto cleanup;
+ }
+
+ break;
default:
gnutls_assert ();
return GNUTLS_E_INVALID_REQUEST;