diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2015-09-12 15:47:38 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2015-09-12 16:22:48 +0200 |
commit | 6c8702587943c426e06d5b545af4f143ae17c670 (patch) | |
tree | 8a8184b82ccd40564456390f4ab580970a431763 /lib/pk.c | |
parent | 9b89f76fc789fd8f8e3bb3c418f25b97b9e71920 (diff) | |
download | gnutls-6c8702587943c426e06d5b545af4f143ae17c670.tar.gz |
Added API to generate private keys from a given seed
Currently it is restricted to RSA and FIPS 186-4 key generation with SHA384.
Relates to #34
Diffstat (limited to 'lib/pk.c')
-rw-r--r-- | lib/pk.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -186,6 +186,11 @@ int _gnutls_pk_params_copy(gnutls_pk_params_st * dst, dst->params_nr++; } + if (src->seed_size) { + dst->seed_size = src->seed_size; + memcpy(dst->seed, src->seed, src->seed_size); + } + return 0; fail: @@ -215,6 +220,8 @@ void gnutls_pk_params_clear(gnutls_pk_params_st * p) if (p->params[i] != NULL) _gnutls_mpi_clear(p->params[i]); } + gnutls_memset(p->seed, 0, p->seed_size); + p->seed_size = 0; } /* Writes the digest information and the digest in a DER encoded |