internal static CountedOctetString Decode(KeytabDecodeBuffer buffer) { CountedOctetString octStr = new CountedOctetString(); octStr.Length = buffer.DecodeUInt16(); octStr.Data = buffer.DecodeByteArray(octStr.Length); return(octStr); }
public static KeyBlock Decode(KeytabDecodeBuffer buffer) { KeyBlock keyBlock = new KeyBlock(); keyBlock.type = buffer.DecodeUInt16(); keyBlock.Data = CountedOctetString.Decode(buffer); return(keyBlock); }
/// <summary> /// Reference: http://www.gnu.org/software/shishi/manual/html_node/The-Keytab-Binary-File-Format.html /// </summary> public static KeytabEntry Decode(KeytabDecodeBuffer buffer, ushort formatVersion) { KeytabEntry entry = new KeytabEntry(); entry.Size = buffer.DecodeInt32(); buffer.EntrySize = entry.Size; //* sub 1 if version 0x501 * entry.NumComponents = buffer.DecodeUInt16(); if (formatVersion == 0x501) { entry.NumComponents--; } entry.Realm = CountedOctetString.Decode(buffer); entry.Components = new CountedOctetString[entry.NumComponents]; for (int i = 0; i < entry.NumComponents; i++) { entry.Components[i] = CountedOctetString.Decode(buffer); } // not present if version 0x501 if (formatVersion != 0x501) { entry.NameType = buffer.DecodeUInt32(); } entry.TimeStamp = buffer.DecodeUInt32(); entry.Vno8 = buffer.DecodeByte(); entry.Key = KeyBlock.Decode(buffer); if (buffer.EntrySize >= 4) { entry.Vno = buffer.DecodeUInt32(); } if (buffer.EntrySize > 0) { buffer.MoveIndexToNext(); } return(entry); }
internal static CountedOctetString Decode(KeytabDecodeBuffer buffer) { CountedOctetString octStr = new CountedOctetString(); octStr.Length = buffer.DecodeUInt16(); octStr.Data = buffer.DecodeByteArray(octStr.Length); return octStr; }