Branch: Tag:

2006-02-10

2006-02-10 09:54:33 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Some bugfixes.
Added support for use with Pike 7.4.

Rev: lib/modules/Sql.pmod/tds.pike:1.2

1:   /* -  * $Id: tds.pike,v 1.1 2006/02/09 17:18:30 grubba Exp $ +  * $Id: tds.pike,v 1.2 2006/02/10 09:54:33 grubba Exp $    *    * A Pike implementation of the TDS protocol.    *
33:    return lines * "";   }    + #if (__REAL_MAJOR__ > 7) || ((__REAL_MAJOR__ == 7) && (__REAL_MINOR__ >= 6)) + // Static blocks affect nested classes in Pike 7.4. + // We don't want that...   static { -  + #endif /* Pike 7.6 or later */    constant DEF_MAJOR = 8;    constant DEF_MINOR = 0;    constant DEF_PORT = 1433;
486:       string ecb_encrypt(string data, string key)    { + #if constant(Crypto.DES)    Crypto.DES des = Crypto.DES();    des->set_encrypt_key(des->fix_parity(key)); -  + #else +  Crypto.des des = Crypto.des(); +  des->set_encrypt_key(Crypto.des_parity(key)); + #endif    return des->crypt(data);    }   
513:    string answer_nt_challenge(string passwd, string nonce)    {    string nt_passwd = string_to_utf16(passwd); + #if constant(Crypto.MD4)    Crypto.MD4 md4 = Crypto.MD4(); -  + #else +  Crypto.md4 md4 = Crypto.md4(); + #endif    md4->update(nt_passwd);    return encrypt_answer(md4->digest() + "\0"*16, nonce);    }
895:    default:    get_byte();    TDS_WERROR("==> FIXME: process_result_tokens\n"); +  process_default_tokens(token_type);    return 0; /***** FIXME:::::: *****/    break;    }
1278:    //case TDS_NO_MORE_RESULTS:    }    } + #if (__REAL_MAJOR__ > 7) || ((__REAL_MAJOR__ == 7) && (__REAL_MINOR__ >= 6))   }; -  + #endif /* Pike 7.6 or later */      class compile_query   {   Newline at end of file added.