Ticket #815: dict.patch
File dict.patch, 3.5 KB (added by , 13 years ago) |
---|
-
dict.meta
5 5 (category net) 6 6 (license "MIT") 7 7 (doc-from-wiki) 8 (depends defstruct md5utf8)8 (depends defstruct (md5 3.0.0) (message-digest 3.0.0) utf8) 9 9 (test-depends test) 10 10 (files "dict.release-info" "dict.meta" "dict.scm" "tests/example.scm" "tests/run.scm" "dict.setup")) -
tests/run.scm
30 30 ;; 31 31 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 32 32 33 (use test utf8 dict md5 )33 (use test utf8 dict md5 message-digest) 34 34 35 35 ;;some helpers 36 36 (define (with-stubbed-io input proc) … … 224 224 (receive (s r) (!status con) 225 225 (list s r))))) 226 226 ;;enable this once md5 has been ported to chicken 4 227 (define test-password (m d5-digest(string-append "<test@example.org>" "test")))227 (define test-password (message-digest-string (md5-primitive) (string-append "<test@example.org>" "test"))) 228 228 229 229 (test "authenticate success" 230 230 `((output . ,(conc "AUTH test " test-password "\r\n")) -
dict.scm
43 43 !help !status !quit !announce-client !authenticate) 44 44 45 45 (import scheme chicken) 46 (require-library tcp defstruct srfi-13 srfi-14 md5)47 46 48 47 (cond-expand 49 48 (total-irregex 50 49 (use irregex)) 51 50 (else 52 (require-library regex) 53 (import (rename irregex 54 (irregex-match-start irregex-match-start-index) 55 (irregex-match-end irregex-match-end-index))) 51 (use (rename irregex 52 (irregex-match-start irregex-match-start-index) 53 (irregex-match-end irregex-match-end-index))) 56 54 (define irregex-num-submatches irregex-submatches) 57 55 (define irregex-match-num-submatches irregex-submatches) 58 56 (define (irregex-match-valid-index? m i) … … 78 76 (define (maybe-string->sre obj) 79 77 (if (string? obj) (string->sre obj) obj)))) 80 78 81 (import tcp defstruct 82 (only md5 md5-digest) 83 (only srfi-14 char-set:digit) 84 (only srfi-13 string-join string-index string-trim-right string-trim-both string-trim string-skip string-take string-drop) 85 ; (only regex string-split-fields) 86 (only extras fprintf read-line) 87 (only data-structures alist-ref alist-update!)) 79 (use tcp defstruct 80 (only md5 md5-primitive) 81 (only message-digest message-digest-string) 82 (only srfi-14 char-set:digit) 83 (only srfi-13 string-join string-index string-trim-right string-trim-both string-trim string-skip string-take string-drop) 84 ; (only regex string-split-fields) 85 (only extras fprintf read-line) 86 (only data-structures alist-ref alist-update!)) 88 87 89 88 90 89 ;;add support for parsing mime-headers … … 454 453 (status:authentication-successful? status))) 455 454 456 455 (define (compute-password con password) 457 (m d5-digest(string-append (connection-msg-id con) password)))456 (message-digest-string (md5-primitive) (string-append (connection-msg-id con) password))) 458 457 459 458 460 459 (define (connect server #!key (port (*default-port*)) (client "dict.egg for chicken scheme") (timeout #f))