Mercurial > dropbear
comparison dss.c @ 150:82fcf3185616
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/
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Mon, 20 Dec 2004 14:24:57 +0000 |
parents | 29a5c7c62350 |
children | 0cfba3034be5 |
comparison
equal
deleted
inserted
replaced
149:ed9ca2a9705c | 150:82fcf3185616 |
---|---|
259 return ret; | 259 return ret; |
260 | 260 |
261 } | 261 } |
262 #endif /* DROPBEAR_SIGNKEY_VERIFY */ | 262 #endif /* DROPBEAR_SIGNKEY_VERIFY */ |
263 | 263 |
264 /* convert an unsigned mp into an array of bytes, malloced. | |
265 * This array must be freed after use, len contains the length of the array, | |
266 * if len != NULL */ | |
267 static unsigned char* mptobytes(mp_int *mp, int *len) { | |
268 | |
269 unsigned char* ret; | |
270 int size; | |
271 | |
272 size = mp_unsigned_bin_size(mp); | |
273 ret = m_malloc(size); | |
274 if (mp_to_unsigned_bin(mp, ret) != MP_OKAY) { | |
275 dropbear_exit("mem alloc error"); | |
276 } | |
277 if (len != NULL) { | |
278 *len = size; | |
279 } | |
280 return ret; | |
281 } | |
282 | |
264 /* Sign the data presented with key, writing the signature contents | 283 /* Sign the data presented with key, writing the signature contents |
265 * to the buffer | 284 * to the buffer |
266 * | 285 * |
267 * When DSS_PROTOK is #defined: | 286 * When DSS_PROTOK is #defined: |
268 * The alternate k generation method is based on the method used in PuTTY. | 287 * The alternate k generation method is based on the method used in PuTTY. |