Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/crypto/external/bsd/netpgp/dist/src/lib also calculate the l...
details: https://anonhg.NetBSD.org/src/rev/586ec8a82d67
branches: trunk
changeset: 755956:586ec8a82d67
user: agc <agc%NetBSD.org@localhost>
date: Wed Jun 30 15:18:10 2010 +0000
description:
also calculate the length of DSA keys as well as RSA ones
diffstat:
crypto/external/bsd/netpgp/dist/src/lib/create.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diffs (32 lines):
diff -r 462e22e5b440 -r 586ec8a82d67 crypto/external/bsd/netpgp/dist/src/lib/create.c
--- a/crypto/external/bsd/netpgp/dist/src/lib/create.c Wed Jun 30 15:17:40 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/src/lib/create.c Wed Jun 30 15:18:10 2010 +0000
@@ -57,7 +57,7 @@
#if defined(__NetBSD__)
__COPYRIGHT("@(#) Copyright (c) 2009 The NetBSD Foundation, Inc. All rights reserved.");
-__RCSID("$NetBSD: create.c,v 1.29 2010/06/25 03:37:27 agc Exp $");
+__RCSID("$NetBSD: create.c,v 1.30 2010/06/30 15:18:10 agc Exp $");
#endif
#include <sys/types.h>
@@ -169,6 +169,10 @@
pubkey_length(const __ops_pubkey_t *key)
{
switch (key->alg) {
+ case OPS_PKA_DSA:
+ return mpi_length(key->key.dsa.p) + mpi_length(key->key.dsa.q) +
+ mpi_length(key->key.dsa.g) + mpi_length(key->key.dsa.y);
+
case OPS_PKA_RSA:
return mpi_length(key->key.rsa.n) + mpi_length(key->key.rsa.e);
@@ -186,6 +190,8 @@
len = 0;
switch (key->pubkey.alg) {
+ case OPS_PKA_DSA:
+ return (unsigned)(mpi_length(key->key.dsa.x) + pubkey_length(&key->pubkey));
case OPS_PKA_RSA:
len = mpi_length(key->key.rsa.d) + mpi_length(key->key.rsa.p) +
mpi_length(key->key.rsa.q) + mpi_length(key->key.rsa.u);
Home |
Main Index |
Thread Index |
Old Index