%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/share/emacs/27.2/lisp/net/
Upload File :
Create Path :
Current File : //usr/local/share/emacs/27.2/lisp/net/ntlm.elc

;ELC
;;; Compiled
;;; in Emacs version 27.2
;;; with all optimizations.

;;; This file uses dynamic docstrings, first added in Emacs 19.29.

;;; This file does not contain utf-8 non-ASCII characters,
;;; and so can be loaded in Emacs versions earlier than 23.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


(byte-code "\300\301!\210\300\302!\210\300\303!\210\304\305\306\307\310\311\312\313&\210\314\315\316\317\320DD\321\322\323%\207" [require md4 hmac-md5 calc custom-declare-group ntlm nil "NTLM (NT LanManager) authentication." :version "25.1" :group comm custom-declare-variable ntlm-compatibility-level funcall function #[0 "\300\207" [5] 1] "The NTLM compatibility level.\nOrdered from 0, the oldest, least-secure level through 5, the\nnewest, most-secure level.  Newer servers may reject lower\nlevels.  At levels 3 through 5, send LMv2 and NTLMv2 responses.\nAt levels 0, 1 and 2, send LM and NTLM responses.\n\nIn this implementation, levels 0, 1 and 2 are the same (old,\ninsecure), and levels 3, 4 and 5 are the same (new, secure).  If\nNTLM authentication isn't working at level 5, try level 0.  The\nother levels are only present because other clients have six\nlevels." :type (choice (const 0) (const 1) (const 2) (const 3) (const 4) (const 5))] 8)
#@309 Return the NTLM authentication request string for USER and DOMAIN.
USER is a string representing a user name to be authenticated and
DOMAIN is a NT domain.  USER can include a NT domain part as in
user@domain where the string after @ is used as the domain if DOMAIN
is not given.

(fn USER &optional DOMAIN)
(defalias 'ntlm-build-auth-request #[513 "\300\301\302\303\"P\301\302\211\"\301\304\303\"P\301\302\305\"\301\302\306\"\301\302\307\"\301\302\303\"R\203@\310\311\"\203@\2048\312\303\224T\"\262\312\303\211\224#\262;\203VG\303V\203V\211\302\313\302H\314\"I\210GG\315\211\\\316!\316!\317\303B!\316	!\316\n!\317\303\nB!\260\266\204\207" ["NTLMSSP" make-string 1 0 3 7 130 8 string-match "@" substring logior 16 32 md4-pack-int16 md4-pack-int32] 20 (#$ . 1367) nil])
#@169 Compute an NTLMv2 timestamp.
Return a unibyte string representing the number of tenths of a
microsecond since January 1, 1601 as a 64-bit little-endian
signed integer.
(defalias 'ntlm-compute-timestamp #[0 "\300\301\302\303\304\305\306\307\310\260\311\312\313\314\"$\313\315\316\211W\203:\211\304\317\311#B\262\304\320\311#\262\210\211T\262\202\266\303\321\237\"\207" ["mul(add(lsh($1,16),$2),10000000)" "mul($3,10)" "idiv($4,100000)" apply calc-eval "add(add(add(" "," ")," "),116444736000000000)" rawnum time-convert nil list 8 0 "and($1,16#FF)" "rsh($1,8,64)" unibyte-string] 12 (#$ . 2182)])
#@100 Generate a random nonce, not to be used more than once.
Return a random eight byte unibyte string.
(defalias 'ntlm-generate-nonce #[0 "\300\301\302!\301\302!\301\302!\301\302!\301\302!\301\302!\301\302!\301\302!&\207" [unibyte-string random 256] 10 (#$ . 2805)])
#@368 Return the response string to a challenge string CHALLENGE given by
the NTLM based server for the user USER and the password hash list
PASSWORD-HASHES.  NTLM uses two hash values which are represented
by PASSWORD-HASHES.  PASSWORD-HASHES should be a return value of
 (list (ntlm-smb-passwd-hash password) (ntlm-md4hash password))

(fn CHALLENGE USER PASSWORD-HASHES)
(defalias 'ntlm-build-auth-response #[771 "\301!\203\302\303!\210\304\305\"\202\306\307\310#\311\312\313\"\311\312\314\"\311\312\315\"\311\312\316\"R\306\310\317#\306\317\320#\321\306\322\315#!\323\211\324\325\326\327
\"\203W\306\f\316\224T\"\262\306\f\316\211\224#\262\f;\203oG\316V\203o\312\330\n\312H\331\"I\210\322\316\211W\203\217\211	\332\fHH\"I\266\211T\262\202q\266\250\203\242\316Y\203\242\333X\204\246\334\335!\210\336Y\203%\333X\203%A\337W\203\300\334\340!\210\202m\341\306\342\343#!\321\306\f\344\337#!\306\fAA\\#\345\211G\"\226\346\345\211G\"PA@\"\347 \311\350\312\"\311\350\316\"\311\322\316\"\351 \311\322\316\"	\260\346
P\"\346P\"P\262
\211P\262\f\266	\202m\332\350H\315\"\316U\204Z\347 \352\353P\323\211\354%\306\316\315#\262\311\331\316\"P\262\355
A@\"\262\266\202m\355@\"\262\355A@\"\262GG
GGG\356\211\350_\\\211\350_\\\211\350_\\\211	\\\357\360\361!\362\f!\362
!\360\316B!\362!\362!\360\316	B!\362\350_!\362\350_!\360\316\356B!\362\350_!\362\350_!\360\316B!\362\350_!\362\350_!\360\316B!\362\316!\362\316!\360\316\211B!$\345+\"\345\"\"\345\"\"%%\260\266\212\207" [ntlm-compatibility-level multibyte-string-p message "Incorrect challenge string type in ntlm-build-auth-response" encode-coding-string binary substring 12 20 make-string 1 7 130 8 0 24 32 md4-unpack-int32 4 nil "" "WORKSTATION" string-match "@" logior 16 logand 5 error "Invalid ntlm-compatibility-level value" 3 48 "Failed to find target information block" md4-unpack-int16 40 42 44 ntlm-ascii2unicode hmac-md5 ntlm-generate-nonce 2 ntlm-compute-timestamp secure-hash md5 t ntlm-smb-owf-encrypt 64 "NTLMSSP" md4-pack-int32 (0 . 3) md4-pack-int16] 49 (#$ . 3076)])
#@90 Return a pair of SMB hash and NT MD4 hash of the given password PASSWORD.

(fn PASSWORD)
(defalias 'ntlm-get-password-hashes #[257 "\300!\301!D\207" [ntlm-smb-passwd-hash ntlm-md4hash] 4 (#$ . 5248)])
#@95 Convert an ASCII string into a NT Unicode string, which is
little-endian utf16.

(fn STR LEN)
(defalias 'ntlm-ascii2unicode #[514 "\300\301_\302\"\302\303W\203/H\211\262\302U\204/\301_I\210\301_T\302I\210T\262\202\207" [make-string 2 0 nil] 8 (#$ . 5457)])
#@92 Extract 7 bits ASCII part of a little endian utf16 string STR of length LEN.

(fn STR LEN)
(defalias 'ntlm-unicode2ascii #[514 "\300\301\"\301\211W\203#\302H\303\"I\210T\262\304\\\262\202\207" [make-string 0 logand 127 2] 10 (#$ . 5738)])
#@149 Return the SMB password hash string of 16 bytes long for the given password
string PASSWD.  PASSWD is truncated to 14 bytes if longer.

(fn PASSWD)
(defalias 'ntlm-smb-passwd-hash #[257 "\211G\300^\301\302\226\303#\304\305Z\303\"P!\207" [14 ntlm-smb-des-e-p16 substring 0 make-string 15] 7 (#$ . 6000)])
#@208 Return the response string of 24 bytes long for the given password
string PASSWD based on the DES encryption.  PASSWD is of at most 14
bytes long and the challenge string C8 of 8 bytes long.

(fn PASSWD C8)
(defalias 'ntlm-smb-owf-encrypt #[514 "G\300^\301\302#\303\304Z\302\"P\305\"\207" [16 substring 0 make-string 22 ntlm-smb-des-e-p24] 7 (#$ . 6314)])
#@97 Return a 24 bytes hashed string for a 21 bytes string P22 and a 8 bytes
string C8.

(fn P22 C8)
(defalias 'ntlm-smb-des-e-p24 #[514 "\300\301#\300\302\303\"\301#\300\302\304\"\301#Q\207" [ntlm-smb-hash t substring 7 14] 9 (#$ . 6682)])
(defconst ntlm-smb-sp8 [75 71 83 33 64 35 36 37])
#@70 Return a 16 bytes hashed string for a 15 bytes string P15.

(fn P15)
(defalias 'ntlm-smb-des-e-p16 #[257 "\301\302#\301\303\304\"\302#P\207" [ntlm-smb-sp8 ntlm-smb-hash t substring 7] 7 (#$ . 6981)])
#@131 Return the hash string of length 8 for a string IN of length 8 and
a string KEY of length 8.  FORW is t or nil.

(fn IN KEY FORW)
(defalias 'ntlm-smb-hash #[771 "\300\301\302\"\300\303\302\"\300\303\302\"\304!\302\211\303W\203P\305\301\245H\306\307\310\301\246Z\"\"\302U\2040\307I\210\305\301\245H\306\307\310\301\246Z\"\"\302U\204I\307I\210\211T\262\202\311#\312\302\262\303W\203\212H\302U\204\203\301\245H\262\301\245\313\306\307\310	\301\246Z\"\"I\210T\262\202Z\266\202\207" [make-string 8 0 64 ntlm-smb-str-to-key logand ash 1 7 ntlm-smb-dohash nil logior] 19 (#$ . 7192)])
#@77 Return a string of length 8 for the given string STR of length 7.

(fn STR)
(defalias 'ntlm-smb-str-to-key #[257 "\300\301\302\"\303\302\304\302H\305\"I\210\306\307\304\310\302H\306\"\311\"\304\306H\312\"\"I\210\313\307\304\310\306H\314\"\315\"\304\313H\316\"\"I\210\314\307\304\310\313H\303\"\317\"\304\314H\320\"\"I\210\317\307\304\310\314H\321\"\314\"\304\317H\322\"\"I\210\315\307\304\310\317H\323\"\313\"\304\315H\324\"\"I\210\311\307\304\310\315H\325\"\306\"\304\311H\326\"\"I\210\303\310\311H\327\"I\210\211\302Y\203\272\304H\306\"I\210\211S\262\202\243\207" [make-string 8 0 7 ash -1 1 logior logand 6 -2 2 3 5 -3 4 -4 15 -5 31 -6 63 -7 127] 10 (#$ . 7818)])
(defconst ntlm-smb-perm1 [57 49 41 33 25 17 9 1 58 50 42 34 26 18 10 2 59 51 43 35 27 19 11 3 60 52 44 36 63 55 47 39 31 23 15 7 62 54 46 38 30 22 14 6 61 53 45 37 29 21 13 5 28 20 12 4])
(defconst ntlm-smb-perm2 [14 17 11 24 1 5 3 28 15 6 21 10 23 19 12 4 26 8 16 7 27 20 13 2 41 52 31 37 47 55 30 40 51 45 33 48 44 49 39 56 34 53 46 42 50 36 29 32])
(defconst ntlm-smb-perm3 [58 50 42 34 26 18 10 2 60 52 44 36 28 20 12 4 62 54 46 38 30 22 14 6 64 56 48 40 32 24 16 8 57 49 41 33 25 17 9 1 59 51 43 35 27 19 11 3 61 53 45 37 29 21 13 5 63 55 47 39 31 23 15 7])
(defconst ntlm-smb-perm4 [32 1 2 3 4 5 4 5 6 7 8 9 8 9 10 11 12 13 12 13 14 15 16 17 16 17 18 19 20 21 20 21 22 23 24 25 24 25 26 27 28 29 28 29 30 31 32 1])
(defconst ntlm-smb-perm5 [16 7 20 21 29 12 28 17 1 15 23 26 5 18 31 10 2 8 24 14 32 27 3 9 19 13 30 6 22 11 4 25])
(defconst ntlm-smb-perm6 [40 8 48 16 56 24 64 32 39 7 47 15 55 23 63 31 38 6 46 14 54 22 62 30 37 5 45 13 53 21 61 29 36 4 44 12 52 20 60 28 35 3 43 11 51 19 59 27 34 2 42 10 50 18 58 26 33 1 41 9 49 17 57 25])
(defconst ntlm-smb-sc [1 1 2 2 2 2 2 2 1 2 2 2 2 2 2 1])
(defconst ntlm-smb-sbox [[[14 4 13 1 2 15 11 8 3 10 6 12 5 9 0 7] [0 15 7 4 14 2 13 1 10 6 12 11 9 5 3 8] [4 1 14 8 13 6 2 11 15 12 9 7 3 10 5 0] [15 12 8 2 4 9 1 7 5 11 3 14 10 0 6 13]] [[15 1 8 14 6 11 3 4 9 7 2 13 12 0 5 10] [3 13 4 7 15 2 8 14 12 0 1 10 6 9 11 5] [0 14 7 11 10 4 13 1 5 8 12 6 9 3 2 15] [13 8 10 1 3 15 4 2 11 6 7 12 0 5 14 9]] [[10 0 9 14 6 3 15 5 1 13 12 7 11 4 2 8] [13 7 0 9 3 4 6 10 2 8 5 14 12 11 15 1] [13 6 4 9 8 15 3 0 11 1 2 12 5 10 14 7] [1 10 13 0 6 9 8 7 4 15 14 3 11 5 2 12]] [[7 13 14 3 0 6 9 10 1 2 8 5 11 12 4 15] [13 8 11 5 6 15 0 3 4 7 2 12 1 10 14 9] [10 6 9 0 12 11 7 13 15 1 3 14 5 2 8 4] [3 15 0 6 10 1 13 8 9 4 5 11 12 7 2 14]] [[2 12 4 1 7 10 11 6 8 5 3 15 13 0 14 9] [14 11 2 12 4 7 13 1 5 0 15 10 3 9 8 6] [4 2 1 11 10 13 7 8 15 9 12 5 6 3 0 14] [11 8 12 7 1 14 2 13 6 15 0 9 10 4 5 3]] [[12 1 10 15 9 2 6 8 0 13 3 4 14 7 5 11] [10 15 4 2 7 12 9 5 6 1 13 14 0 11 3 8] [9 14 15 5 2 8 12 3 7 0 4 10 1 13 11 6] [4 3 2 12 9 5 15 10 11 14 1 7 6 0 8 13]] [[4 11 2 14 15 0 8 13 3 12 9 7 5 10 6 1] [13 0 11 7 4 9 1 10 14 3 5 12 2 15 8 6] [1 4 11 13 12 3 7 14 10 15 6 8 0 5 9 2] [6 11 13 8 1 4 10 7 9 5 0 15 14 2 3 12]] [[13 2 8 4 6 15 11 1 10 9 3 14 5 0 12 7] [1 15 13 8 10 3 7 4 12 5 6 11 0 14 9 2] [7 11 4 1 9 12 14 2 0 6 10 13 15 3 5 8] [2 1 14 7 4 10 8 13 15 12 9 0 3 5 6 11]]])
#@146 Return a string of length N for a string IN and a permutation vector
PERM of size N.  The length of IN should be height of PERM.

(fn IN PERM N)
(defalias 'ntlm-string-permute #[771 "\300\301\300\"W\203\211HSHI\210T\262\202\207" [0 make-string] 10 (#$ . 10961)])
(put 'ntlm-string-permute 'byte-optimizer 'byte-compile-inline-expand)
#@117 Return a string by circularly shifting a string STR by COUNT to the left.
length of STR is LEN.

(fn STR COUNT LEN)
(defalias 'ntlm-string-lshift #[771 "\246\300#\300\301#P\207" [substring 0] 9 (#$ . 11317)])
(put 'ntlm-string-lshift 'byte-optimizer 'byte-compile-inline-expand)
#@63 Return exclusive-or of sequences in1 and in2.

(fn IN1 IN2 N)
(defalias 'ntlm-string-xor #[771 "\300\301\"\301\211W\203 \302HH\"I\210\211T\262\202\207" [make-string 0 logxor] 11 (#$ . 11609)])
(put 'ntlm-string-xor 'byte-optimizer 'byte-compile-inline-expand)
#@153 Return the hash value for a string IN and a string KEY.
Length of IN and KEY are 64.  FORW non-nil means forward, nil means
backward.

(fn IN KEY FORW)
(defalias 'ntlm-smb-dohash #[771 "\306\307\310\307\"W\203!\211HSHI\210T\262\202\266\204\311\307\312#\311\312\306#\313\314\315\307\"\313\211\211\211\307\211\211\315\307\211W\203\262\211
	H\312\246\311#\311\307#P\266\204\262\f	H\312\246\311#\311\307#P\266\204\262
\311\307\312#\311\307\312#P\262\f\n
\n\316\307\310\307\"W\203\246\211HSHI\210T\262\202\215\266\204I\266\211T\262\202;\266\317\307\310\307\"W\203\326\211HSHI\210T\262\202\275\266\204\262\311\307\320#\262\311\320\317#\262\307\262\313\211\314\321\307\"\313\211\211\211\211\211\211\211
\315W\203\f\316\307\310\307\"W\203$\211HSHI\210T\262\202\266\204\262\n\2036\202:\322ZH\316\310\307\"\307\211W\203\\\323HH\"I\210\211T\262\202A\266\205\262\n\307\262
\f\321W\203\210\324
_\262
\311\f\211\324\\#I\210\fT\262
\202d\307\262
\f\321W\203\374
H\262\325\326\307H\327\"\330H\"\262\325\326\327H\331\"\326\332H\332\"\326\331H\327\"\333H$\262\307\262\f

HHH\262\333W\203\364\f\334\326\327\331Z\"\"\307U\203\351\307\202\352\327I\210T\262\f\202\314\fT\262
\202\213\307\262
\313\262\f\321W\203\311\nH\307\333#P\262\fT\262
\202\320\307\310\307\"W\203B\211HSHI\210T\262\202)\266\204\262\320\310\307\"\307\211W\203k\323HH\"I\210\211T\262\202P\266\205\262\262\262
T\262\202\373\266P\262\317\307\310\307\"W\203\251\211HSHI\210T\262\202\220\266\204\207" [ntlm-smb-perm1 ntlm-smb-sc ntlm-smb-perm2 ntlm-smb-perm3 ntlm-smb-perm4 ntlm-smb-sbox 56 0 make-string substring 28 nil make-vector 16 48 64 32 8 15 logxor 6 logior ash 1 5 3 2 4 logand ntlm-smb-perm5 ntlm-smb-perm6] 37 (#$ . 11891)])
#@150 Return the 16 bytes MD4 hash of a string PASSWD after converting it
into a Unicode string.  PASSWD is truncated to 128 bytes if longer.

(fn PASSWD)
(defalias 'ntlm-md4hash #[257 "\211G\300^\301\"\302\303_\"\207" [128 ntlm-ascii2unicode md4 2] 7 (#$ . 13834)])
(provide 'ntlm)

Zerion Mini Shell 1.0