6 -#include <openssl/sha.h>
10 static uint8_t m_peer_id[20];
11 @@ -114,7 +114,7 @@ btpd_init(void)
12 idcon[sizeof(idcon) - 1] = '\0';
15 - SHA1(idcon, n, m_peer_id);
16 + sha1_buffer(idcon, n, m_peer_id);
17 bcopy(m_peer_id, &seed, sizeof(seed));
18 bcopy(BTPD_VERSION, m_peer_id, sizeof(BTPD_VERSION) - 1);
19 m_peer_id[sizeof(BTPD_VERSION) - 1] = '|';
25 -#include <openssl/sha.h>
30 @@ -60,16 +60,16 @@ static struct timeout m_workev;
32 test_hash(struct torrent *tp, uint8_t *hash, uint32_t piece)
34 - char piece_hash[SHA_DIGEST_LENGTH];
35 + char piece_hash[SHA1_DIGEST_SIZE];
36 tlib_read_hash(tp->tl, tp->pieces_off, piece, piece_hash);
37 - return bcmp(hash, piece_hash, SHA_DIGEST_LENGTH);
38 + return bcmp(hash, piece_hash, SHA1_DIGEST_SIZE);
42 test_piece(struct torrent *tp, uint32_t piece, int *ok)
45 - uint8_t hash[SHA_DIGEST_LENGTH];
46 + uint8_t hash[SHA1_DIGEST_SIZE];
47 if ((err = bts_sha(tp->cm->rds, piece * tp->piece_length,
48 torrent_piece_size(tp, piece), hash)) != 0) {
49 btpd_log(BTPD_L_ERROR, "io error on '%s' (%s).\n",
50 --- a/btpd/download_subr.c
51 +++ b/btpd/download_subr.c
56 -#include <openssl/sha.h>
61 @@ -42,7 +42,7 @@ piece_log_hashes(struct piece *pc)
62 for (unsigned i = 0; i < pc->nblocks; i++) {
63 uint32_t bsize = torrent_block_size(tp, pc->index, pc->nblocks, i);
64 cm_get_bytes(tp, pc->index, i * PIECE_BLOCKLEN, bsize, &buf);
65 - SHA1(buf, bsize, &log->hashes[i * 20]);
66 + sha1_buffer(buf, bsize, &log->hashes[i * 20]);
75 -#include <openssl/sha.h>
77 #define SAVE_INTERVAL 300
79 static unsigned m_nghosts;
82 @@ -29,13 +29,6 @@ rm -f conftest.c conftest.$OBJEXT
83 rm -f conftest.c conftest.$OBJEXT
87 -[ --with-openssl=dir use openssl installed in dir],
89 - AC_SUBST(openssl_LDFLAGS,["-L${withval}/lib -Wl,-R,${withval}/lib"])
90 - AC_SUBST(openssl_CPPFLAGS,"-I${withval}/include")
93 AC_ARG_WITH(evloop-method,
94 [ --with-evloop-method select evloop method (epoll,poll,kqueue)],
95 evloop_methods=$withval,
96 @@ -76,11 +69,6 @@ CC_ARGS_OK_IFELSE(-Wno-pointer-sign,
100 -old_LDFLAGS="$LDFLAGS"
101 -LDFLAGS="$LDFLAGS $openssl_LDFLAGS"
102 -AC_CHECK_LIB(crypto, SHA1_Final,:,AC_MSG_FAILURE(btpd needs openssl's libraries and headers))
103 -LDFLAGS=$old_LDFLAGS
105 for m in $evloop_methods; do
108 --- a/misc/metainfo.c
109 +++ b/misc/metainfo.c
114 -#include <openssl/sha.h>
118 #include "metainfo.h"
120 @@ -159,7 +158,7 @@ mi_info_hash(const char *p, uint8_t *has
122 if ((hash = malloc(20)) == NULL)
124 - return SHA1(info, benc_length(info), hash);
125 + return (uint8_t *)sha1_buffer(info, benc_length(info), hash);
132 +/* sha1.c - Functions to compute SHA1 message digest of files or
133 + memory blocks according to the NIST specification FIPS-180-1.
135 + Copyright (C) 2000, 2001, 2003, 2004, 2005, 2006, 2008, 2009, 2010 Free
136 + Software Foundation, Inc.
138 + This program is free software; you can redistribute it and/or modify it
139 + under the terms of the GNU General Public License as published by the
140 + Free Software Foundation; either version 2, or (at your option) any
143 + This program is distributed in the hope that it will be useful,
144 + but WITHOUT ANY WARRANTY; without even the implied warranty of
145 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
146 + GNU General Public License for more details.
148 + You should have received a copy of the GNU General Public License
149 + along with this program; if not, write to the Free Software Foundation,
150 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
152 +/* Written by Scott G. Miller
154 + Robert Klep <robert@ilse.nl> -- Expansion function fix
166 +# include "unlocked-io.h"
169 +#ifdef WORDS_BIGENDIAN
170 +# define SWAP(n) (n)
173 + (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24))
176 +#define BLOCKSIZE 32768
177 +#if BLOCKSIZE % 64 != 0
178 +# error "invalid BLOCKSIZE"
181 +/* This array contains the bytes used to pad the buffer to the next
182 + 64-byte boundary. (RFC 1321, 3.1: Step 1) */
183 +static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ };
186 +/* Take a pointer to a 160 bit block of data (five 32 bit ints) and
187 + initialize it to the start constants of the SHA1 algorithm. This
188 + must be called before using hash in the call to sha1_hash. */
190 +sha1_init_ctx (struct sha1_ctx *ctx)
192 + ctx->A = 0x67452301;
193 + ctx->B = 0xefcdab89;
194 + ctx->C = 0x98badcfe;
195 + ctx->D = 0x10325476;
196 + ctx->E = 0xc3d2e1f0;
198 + ctx->total[0] = ctx->total[1] = 0;
202 +/* Copy the 4 byte value from v into the memory location pointed to by *cp,
203 + If your architecture allows unaligned access this is equivalent to
204 + * (uint32_t *) cp = v */
206 +set_uint32 (char *cp, uint32_t v)
208 + memcpy (cp, &v, sizeof v);
211 +/* Put result from CTX in first 20 bytes following RESBUF. The result
212 + must be in little endian byte order. */
214 +sha1_read_ctx (const struct sha1_ctx *ctx, void *resbuf)
217 + set_uint32 (r + 0 * sizeof ctx->A, SWAP (ctx->A));
218 + set_uint32 (r + 1 * sizeof ctx->B, SWAP (ctx->B));
219 + set_uint32 (r + 2 * sizeof ctx->C, SWAP (ctx->C));
220 + set_uint32 (r + 3 * sizeof ctx->D, SWAP (ctx->D));
221 + set_uint32 (r + 4 * sizeof ctx->E, SWAP (ctx->E));
226 +/* Process the remaining bytes in the internal buffer and the usual
227 + prolog according to the standard and write the result to RESBUF. */
229 +sha1_finish_ctx (struct sha1_ctx *ctx, void *resbuf)
231 + /* Take yet unprocessed bytes into account. */
232 + uint32_t bytes = ctx->buflen;
233 + size_t size = (bytes < 56) ? 64 / 4 : 64 * 2 / 4;
235 + /* Now count remaining bytes. */
236 + ctx->total[0] += bytes;
237 + if (ctx->total[0] < bytes)
240 + /* Put the 64-bit file length in *bits* at the end of the buffer. */
241 + ctx->buffer[size - 2] = SWAP ((ctx->total[1] << 3) | (ctx->total[0] >> 29));
242 + ctx->buffer[size - 1] = SWAP (ctx->total[0] << 3);
244 + memcpy (&((char *) ctx->buffer)[bytes], fillbuf, (size - 2) * 4 - bytes);
246 + /* Process last bytes. */
247 + sha1_process_block (ctx->buffer, size * 4, ctx);
249 + return sha1_read_ctx (ctx, resbuf);
252 +/* Compute SHA1 message digest for bytes read from STREAM. The
253 + resulting message digest number will be written into the 16 bytes
254 + beginning at RESBLOCK. */
256 +sha1_stream (FILE *stream, void *resblock)
258 + struct sha1_ctx ctx;
261 + char *buffer = malloc (BLOCKSIZE + 72);
265 + /* Initialize the computation context. */
266 + sha1_init_ctx (&ctx);
268 + /* Iterate over full file contents. */
271 + /* We read the file in blocks of BLOCKSIZE bytes. One call of the
272 + computation function processes the whole buffer so that with the
273 + next round of the loop another block can be read. */
277 + /* Read block. Take care for partial reads. */
280 + n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream);
284 + if (sum == BLOCKSIZE)
289 + /* Check for the error flag IFF N == 0, so that we don't
290 + exit the loop after a partial read due to e.g., EAGAIN
292 + if (ferror (stream))
297 + goto process_partial_block;
300 + /* We've read at least one byte, so ignore errors. But always
301 + check for EOF, since feof may be true even though N > 0.
302 + Otherwise, we could end up calling fread after EOF. */
304 + goto process_partial_block;
307 + /* Process buffer with BLOCKSIZE bytes. Note that
308 + BLOCKSIZE % 64 == 0
310 + sha1_process_block (buffer, BLOCKSIZE, &ctx);
313 + process_partial_block:;
315 + /* Process any remaining bytes. */
317 + sha1_process_bytes (buffer, sum, &ctx);
319 + /* Construct result in desired memory. */
320 + sha1_finish_ctx (&ctx, resblock);
325 +/* Compute SHA1 message digest for LEN bytes beginning at BUFFER. The
326 + result is always in little endian byte order, so that a byte-wise
327 + output yields to the wanted ASCII representation of the message
330 +sha1_buffer (const char *buffer, size_t len, void *resblock)
332 + struct sha1_ctx ctx;
334 + /* Initialize the computation context. */
335 + sha1_init_ctx (&ctx);
337 + /* Process whole buffer but last len % 64 bytes. */
338 + sha1_process_bytes (buffer, len, &ctx);
340 + /* Put result in desired memory area. */
341 + return sha1_finish_ctx (&ctx, resblock);
345 +sha1_process_bytes (const void *buffer, size_t len, struct sha1_ctx *ctx)
347 + /* When we already have some bits in our internal buffer concatenate
348 + both inputs first. */
349 + if (ctx->buflen != 0)
351 + size_t left_over = ctx->buflen;
352 + size_t add = 128 - left_over > len ? len : 128 - left_over;
354 + memcpy (&((char *) ctx->buffer)[left_over], buffer, add);
355 + ctx->buflen += add;
357 + if (ctx->buflen > 64)
359 + sha1_process_block (ctx->buffer, ctx->buflen & ~63, ctx);
362 + /* The regions in the following copy operation cannot overlap. */
363 + memcpy (ctx->buffer,
364 + &((char *) ctx->buffer)[(left_over + add) & ~63],
368 + buffer = (const char *) buffer + add;
372 + /* Process available complete blocks. */
375 +#if !_STRING_ARCH_unaligned
376 +# define alignof(type) offsetof (struct { char c; type x; }, x)
377 +# define UNALIGNED_P(p) (((size_t) p) % alignof (uint32_t) != 0)
378 + if (UNALIGNED_P (buffer))
381 + sha1_process_block (memcpy (ctx->buffer, buffer, 64), 64, ctx);
382 + buffer = (const char *) buffer + 64;
388 + sha1_process_block (buffer, len & ~63, ctx);
389 + buffer = (const char *) buffer + (len & ~63);
394 + /* Move remaining bytes in internal buffer. */
397 + size_t left_over = ctx->buflen;
399 + memcpy (&((char *) ctx->buffer)[left_over], buffer, len);
401 + if (left_over >= 64)
403 + sha1_process_block (ctx->buffer, 64, ctx);
405 + memcpy (ctx->buffer, &ctx->buffer[16], left_over);
407 + ctx->buflen = left_over;
411 +/* --- Code below is the primary difference between md5.c and sha1.c --- */
413 +/* SHA1 round constants */
414 +#define K1 0x5a827999
415 +#define K2 0x6ed9eba1
416 +#define K3 0x8f1bbcdc
417 +#define K4 0xca62c1d6
419 +/* Round functions. Note that F2 is the same as F4. */
420 +#define F1(B,C,D) ( D ^ ( B & ( C ^ D ) ) )
421 +#define F2(B,C,D) (B ^ C ^ D)
422 +#define F3(B,C,D) ( ( B & C ) | ( D & ( B | C ) ) )
423 +#define F4(B,C,D) (B ^ C ^ D)
425 +/* Process LEN bytes of BUFFER, accumulating context into CTX.
426 + It is assumed that LEN % 64 == 0.
427 + Most of this code comes from GnuPG's cipher/sha1.c. */
430 +sha1_process_block (const void *buffer, size_t len, struct sha1_ctx *ctx)
432 + const uint32_t *words = buffer;
433 + size_t nwords = len / sizeof (uint32_t);
434 + const uint32_t *endp = words + nwords;
436 + uint32_t a = ctx->A;
437 + uint32_t b = ctx->B;
438 + uint32_t c = ctx->C;
439 + uint32_t d = ctx->D;
440 + uint32_t e = ctx->E;
442 + /* First increment the byte count. RFC 1321 specifies the possible
443 + length of the file up to 2^64 bits. Here we only compute the
444 + number of bytes. Do a double word increment. */
445 + ctx->total[0] += len;
446 + if (ctx->total[0] < len)
449 +#define rol(x, n) (((x) << (n)) | ((uint32_t) (x) >> (32 - (n))))
451 +#define M(I) ( tm = x[I&0x0f] ^ x[(I-14)&0x0f] \
452 + ^ x[(I-8)&0x0f] ^ x[(I-3)&0x0f] \
453 + , (x[I&0x0f] = rol(tm, 1)) )
455 +#define R(A,B,C,D,E,F,K,M) do { E += rol( A, 5 ) \
459 + B = rol( B, 30 ); \
462 + while (words < endp)
466 + for (t = 0; t < 16; t++)
468 + x[t] = SWAP (*words);
472 + R( a, b, c, d, e, F1, K1, x[ 0] );
473 + R( e, a, b, c, d, F1, K1, x[ 1] );
474 + R( d, e, a, b, c, F1, K1, x[ 2] );
475 + R( c, d, e, a, b, F1, K1, x[ 3] );
476 + R( b, c, d, e, a, F1, K1, x[ 4] );
477 + R( a, b, c, d, e, F1, K1, x[ 5] );
478 + R( e, a, b, c, d, F1, K1, x[ 6] );
479 + R( d, e, a, b, c, F1, K1, x[ 7] );
480 + R( c, d, e, a, b, F1, K1, x[ 8] );
481 + R( b, c, d, e, a, F1, K1, x[ 9] );
482 + R( a, b, c, d, e, F1, K1, x[10] );
483 + R( e, a, b, c, d, F1, K1, x[11] );
484 + R( d, e, a, b, c, F1, K1, x[12] );
485 + R( c, d, e, a, b, F1, K1, x[13] );
486 + R( b, c, d, e, a, F1, K1, x[14] );
487 + R( a, b, c, d, e, F1, K1, x[15] );
488 + R( e, a, b, c, d, F1, K1, M(16) );
489 + R( d, e, a, b, c, F1, K1, M(17) );
490 + R( c, d, e, a, b, F1, K1, M(18) );
491 + R( b, c, d, e, a, F1, K1, M(19) );
492 + R( a, b, c, d, e, F2, K2, M(20) );
493 + R( e, a, b, c, d, F2, K2, M(21) );
494 + R( d, e, a, b, c, F2, K2, M(22) );
495 + R( c, d, e, a, b, F2, K2, M(23) );
496 + R( b, c, d, e, a, F2, K2, M(24) );
497 + R( a, b, c, d, e, F2, K2, M(25) );
498 + R( e, a, b, c, d, F2, K2, M(26) );
499 + R( d, e, a, b, c, F2, K2, M(27) );
500 + R( c, d, e, a, b, F2, K2, M(28) );
501 + R( b, c, d, e, a, F2, K2, M(29) );
502 + R( a, b, c, d, e, F2, K2, M(30) );
503 + R( e, a, b, c, d, F2, K2, M(31) );
504 + R( d, e, a, b, c, F2, K2, M(32) );
505 + R( c, d, e, a, b, F2, K2, M(33) );
506 + R( b, c, d, e, a, F2, K2, M(34) );
507 + R( a, b, c, d, e, F2, K2, M(35) );
508 + R( e, a, b, c, d, F2, K2, M(36) );
509 + R( d, e, a, b, c, F2, K2, M(37) );
510 + R( c, d, e, a, b, F2, K2, M(38) );
511 + R( b, c, d, e, a, F2, K2, M(39) );
512 + R( a, b, c, d, e, F3, K3, M(40) );
513 + R( e, a, b, c, d, F3, K3, M(41) );
514 + R( d, e, a, b, c, F3, K3, M(42) );
515 + R( c, d, e, a, b, F3, K3, M(43) );
516 + R( b, c, d, e, a, F3, K3, M(44) );
517 + R( a, b, c, d, e, F3, K3, M(45) );
518 + R( e, a, b, c, d, F3, K3, M(46) );
519 + R( d, e, a, b, c, F3, K3, M(47) );
520 + R( c, d, e, a, b, F3, K3, M(48) );
521 + R( b, c, d, e, a, F3, K3, M(49) );
522 + R( a, b, c, d, e, F3, K3, M(50) );
523 + R( e, a, b, c, d, F3, K3, M(51) );
524 + R( d, e, a, b, c, F3, K3, M(52) );
525 + R( c, d, e, a, b, F3, K3, M(53) );
526 + R( b, c, d, e, a, F3, K3, M(54) );
527 + R( a, b, c, d, e, F3, K3, M(55) );
528 + R( e, a, b, c, d, F3, K3, M(56) );
529 + R( d, e, a, b, c, F3, K3, M(57) );
530 + R( c, d, e, a, b, F3, K3, M(58) );
531 + R( b, c, d, e, a, F3, K3, M(59) );
532 + R( a, b, c, d, e, F4, K4, M(60) );
533 + R( e, a, b, c, d, F4, K4, M(61) );
534 + R( d, e, a, b, c, F4, K4, M(62) );
535 + R( c, d, e, a, b, F4, K4, M(63) );
536 + R( b, c, d, e, a, F4, K4, M(64) );
537 + R( a, b, c, d, e, F4, K4, M(65) );
538 + R( e, a, b, c, d, F4, K4, M(66) );
539 + R( d, e, a, b, c, F4, K4, M(67) );
540 + R( c, d, e, a, b, F4, K4, M(68) );
541 + R( b, c, d, e, a, F4, K4, M(69) );
542 + R( a, b, c, d, e, F4, K4, M(70) );
543 + R( e, a, b, c, d, F4, K4, M(71) );
544 + R( d, e, a, b, c, F4, K4, M(72) );
545 + R( c, d, e, a, b, F4, K4, M(73) );
546 + R( b, c, d, e, a, F4, K4, M(74) );
547 + R( a, b, c, d, e, F4, K4, M(75) );
548 + R( e, a, b, c, d, F4, K4, M(76) );
549 + R( d, e, a, b, c, F4, K4, M(77) );
550 + R( c, d, e, a, b, F4, K4, M(78) );
551 + R( b, c, d, e, a, F4, K4, M(79) );
563 +/* Declarations of functions and data types used for SHA1 sum
565 + Copyright (C) 2000, 2001, 2003, 2005, 2006, 2008, 2009, 2010 Free Software
568 + This program is free software; you can redistribute it and/or modify it
569 + under the terms of the GNU General Public License as published by the
570 + Free Software Foundation; either version 2, or (at your option) any
573 + This program is distributed in the hope that it will be useful,
574 + but WITHOUT ANY WARRANTY; without even the implied warranty of
575 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
576 + GNU General Public License for more details.
578 + You should have received a copy of the GNU General Public License
579 + along with this program; if not, write to the Free Software Foundation,
580 + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
586 +# include <stdint.h>
592 +#define SHA1_DIGEST_SIZE 20
594 +/* Structure to save state of computation between the single steps. */
605 + uint32_t buffer[32];
609 +/* Initialize structure containing state of computation. */
610 +extern void sha1_init_ctx (struct sha1_ctx *ctx);
612 +/* Starting with the result of former calls of this function (or the
613 + initialization function update the context for the next LEN bytes
614 + starting at BUFFER.
615 + It is necessary that LEN is a multiple of 64!!! */
616 +extern void sha1_process_block (const void *buffer, size_t len,
617 + struct sha1_ctx *ctx);
619 +/* Starting with the result of former calls of this function (or the
620 + initialization function update the context for the next LEN bytes
621 + starting at BUFFER.
622 + It is NOT required that LEN is a multiple of 64. */
623 +extern void sha1_process_bytes (const void *buffer, size_t len,
624 + struct sha1_ctx *ctx);
626 +/* Process the remaining bytes in the buffer and put result from CTX
627 + in first 20 bytes following RESBUF. The result is always in little
628 + endian byte order, so that a byte-wise output yields to the wanted
629 + ASCII representation of the message digest. */
630 +extern void *sha1_finish_ctx (struct sha1_ctx *ctx, void *resbuf);
633 +/* Put result from CTX in first 20 bytes following RESBUF. The result is
634 + always in little endian byte order, so that a byte-wise output yields
635 + to the wanted ASCII representation of the message digest. */
636 +extern void *sha1_read_ctx (const struct sha1_ctx *ctx, void *resbuf);
639 +/* Compute SHA1 message digest for bytes read from STREAM. The
640 + resulting message digest number will be written into the 20 bytes
641 + beginning at RESBLOCK. */
642 +extern int sha1_stream (FILE *stream, void *resblock);
644 +/* Compute SHA1 message digest for LEN bytes beginning at BUFFER. The
645 + result is always in little endian byte order, so that a byte-wise
646 + output yields to the wanted ASCII representation of the message
648 +extern void *sha1_buffer (const char *buffer, size_t len, void *resblock);
661 -#include <openssl/sha.h>
664 #include "metainfo.h"
666 @@ -161,21 +161,21 @@ bts_put(struct bt_stream *bts, off_t off
668 bts_sha(struct bt_stream *bts, off_t start, off_t length, uint8_t *hash)
671 + struct sha1_ctx ctx;
672 char buf[SHAFILEBUF];
677 + sha1_init_ctx(&ctx);
679 wantread = min(length, SHAFILEBUF);
680 if ((err = bts_get(bts, start, buf, wantread)) != 0)
684 - SHA1_Update(&ctx, buf, wantread);
685 + sha1_process_bytes(buf, wantread, &ctx);
687 - SHA1_Final(hash, &ctx);
688 + sha1_finish_ctx(&ctx, hash);
695 AM_CFLAGS=-std=c99 -Wall @WARNNPS@
696 -AM_CPPFLAGS=-D_FILE_OFFSET_BITS=64 -D@EVLOOP_METHOD@ -I$(top_srcdir)/misc -I$(top_srcdir)/evloop @openssl_CPPFLAGS@
697 -AM_LDFLAGS=@openssl_LDFLAGS@
698 +AM_CPPFLAGS=-D_FILE_OFFSET_BITS=64 -D@EVLOOP_METHOD@ -I$(top_srcdir)/misc -I$(top_srcdir)/evloop
701 bin_PROGRAMS=btpd/btpd cli/btcli cli/btinfo
702 noinst_LIBRARIES=misc/libmisc.a evloop/libevloop.a
703 @@ -25,15 +25,15 @@ btpd_btpd_SOURCES=\
704 btpd/upload.c btpd/upload.h\
706 btpd_btpd_CFLAGS=@TD_CFLAGS@ $(AM_CFLAGS)
707 -btpd_btpd_LDADD=@TD_LIBS@ misc/libmisc.a evloop/libevloop.a -lcrypto -lm @CLOCKLIB@ @INETLIBS@
708 +btpd_btpd_LDADD=@TD_LIBS@ misc/libmisc.a evloop/libevloop.a -lm @CLOCKLIB@ @INETLIBS@
711 cli_btinfo_SOURCES=cli/btinfo.c
712 -cli_btinfo_LDADD=misc/libmisc.a -lcrypto -lm
713 +cli_btinfo_LDADD=misc/libmisc.a -lm
716 cli_btcli_SOURCES=cli/btcli.c cli/btcli.h cli/add.c cli/del.c cli/list.c cli/kill.c cli/start.c cli/stop.c cli/stat.c
717 -cli_btcli_LDADD=misc/libmisc.a -lcrypto -lm @INETLIBS@
718 +cli_btcli_LDADD=misc/libmisc.a -lm @INETLIBS@
721 misc_libmisc_a_SOURCES=\
722 @@ -45,7 +45,8 @@ misc_libmisc_a_SOURCES=\
723 misc/iobuf.c misc/iobuf.h\
725 misc/stream.c misc/stream.h\
726 - misc/subr.c misc/subr.h
727 + misc/subr.c misc/subr.h\
728 + misc/sha1.c misc/sha1.h
731 EXTRA_evloop_libevloop_a_SOURCES=evloop/epoll.c evloop/kqueue.c evloop/poll.c