static char des_outpkt[2*RCMD_BUFSIZ+4]; /* needs to be > largest write size */
static krb5_data desinbuf;
static krb5_data desoutbuf;
-static krb5_keyblock keyblock; /* key for encrypt/decrypt */
+static krb5_keyblock *keyblock; /* key for encrypt/decrypt */
static int (*input)();
static int (*output)();
static char storage[2*RCMD_BUFSIZ]; /* storage for the decryption */
int cc;
unsigned char c;
krb5_error_code ret;
- krb5_data cipher, plain;
+ krb5_data plain;
+ krb5_enc_data cipher;
if (nstored >= len) {
memcpy(buf, store_ptr, len);
if ((cc = krb5_net_read(bsd_context, fd, &c, 1)) != 1) return 0;
rd_len = (rd_len << 8) | c;
- if (ret = krb5_encrypt_length(bsd_context, keyblock->enctype,
+ if (ret = krb5_c_encrypt_length(bsd_context, keyblock->enctype,
rd_len, &net_len)) {
errno = ret;
return(-1);
return(-1);
}
- cipher.length = net_len;
- cipher.data = desinbuf.data;
+ cipher.enctype = ENCTYPE_UNKNOWN;
+ cipher.ciphertext.length = net_len;
+ cipher.ciphertext.data = desinbuf.data;
plain.length = sizeof(storage);
plain.data = storage;
{
unsigned char *len_buf = (unsigned char *) des_outpkt;
krb5_data plain;
+ krb5_enc_data cipher;
plain.data = buf;
plain.length = len;
- desoutbuf.length = sizeof(des_outpkt)-4;
+ cipher.ciphertext.length = sizeof(des_outpkt)-4;
+ cipher.ciphertext.data = desoutbuf.data;
- if (krb5_encrypt(bsd_context, keyblock, KCMD_KEYUSAGE, 0,
- &plain, &desoutbuf)) {
+ if (krb5_c_encrypt(bsd_context, keyblock, KCMD_KEYUSAGE, 0,
+ &plain, &cipher)) {
errno = EIO;
return(-1);
}
+ desoutbuf.length = cipher.ciphertext.length;
+
len_buf[0] = (len & 0xff000000) >> 24;
len_buf[1] = (len & 0xff0000) >> 16;
len_buf[2] = (len & 0xff00) >> 8;