- err = gcry_cipher_setkey( h, &key, sizeof(key) );
- if ( err == 0 ) {
- err = gcry_cipher_encrypt( h, &hbuf[0], sizeof(key), &StdText, sizeof(key) );
- if ( err == 0 ) {
- gcry_cipher_reset( h );
- lmPasswd_to_key( &UcasePassword[7], &key );
- err = gcry_cipher_setkey( h, &key, sizeof(key) );
- if ( err == 0 ) {
- err = gcry_cipher_encrypt( h, &hbuf[1], sizeof(key), &StdText, sizeof(key) );
- }
- }
- gcry_cipher_close( h );
- }
+ des_set_key( &ctx, &key );
+ des_encrypt( &ctx, sizeof(key), &hbuf[0], &StdText );
+
+ lmPasswd_to_key( &UcasePassword[7], &key );
+ des_set_key( &ctx, &key );
+ des_encrypt( &ctx, sizeof(key), &hbuf[1], &StdText );