summaryrefslogtreecommitdiffhomepage
path: root/dss.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2004-12-20 14:24:57 +0000
committerMatt Johnston <matt@ucc.asn.au>2004-12-20 14:24:57 +0000
commit34445aa81960742691ef269b18c8db272b8449cc (patch)
tree0224a9d7257f7e4d30baaf7aa32efb1d9a7498fd /dss.c
parent42c691a051af521efa3cd74045eed7db33a38ca2 (diff)
Cleaning out various dead wood found with -dead_strip
bignum.c: mptobytes now resides in dss.c loginrec.c: remove lastlog code since it isn't used. dbutil.c: removed obselete usingsyslog variable channel.h: client channel type only defined for client compile common-algo.c: s/rijndael/aes/ --HG-- extra : convert_revision : 411ea4e70506ecb0202376f94bcf2d330603d042
Diffstat (limited to 'dss.c')
-rw-r--r--dss.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/dss.c b/dss.c
index 5bd358a..0cb437c 100644
--- a/dss.c
+++ b/dss.c
@@ -261,6 +261,25 @@ out:
}
#endif /* DROPBEAR_SIGNKEY_VERIFY */
+/* convert an unsigned mp into an array of bytes, malloced.
+ * This array must be freed after use, len contains the length of the array,
+ * if len != NULL */
+static unsigned char* mptobytes(mp_int *mp, int *len) {
+
+ unsigned char* ret;
+ int size;
+
+ size = mp_unsigned_bin_size(mp);
+ ret = m_malloc(size);
+ if (mp_to_unsigned_bin(mp, ret) != MP_OKAY) {
+ dropbear_exit("mem alloc error");
+ }
+ if (len != NULL) {
+ *len = size;
+ }
+ return ret;
+}
+
/* Sign the data presented with key, writing the signature contents
* to the buffer
*