summaryrefslogtreecommitdiff
path: root/source3/include
diff options
context:
space:
mode:
Diffstat (limited to 'source3/include')
-rw-r--r--source3/include/hmacmd5.h33
-rw-r--r--source3/include/md5.h32
-rw-r--r--source3/include/proto.h14
-rw-r--r--source3/include/smb.h3
4 files changed, 82 insertions, 0 deletions
diff --git a/source3/include/hmacmd5.h b/source3/include/hmacmd5.h
new file mode 100644
index 0000000000..adb52058a8
--- /dev/null
+++ b/source3/include/hmacmd5.h
@@ -0,0 +1,33 @@
+/*
+ Unix SMB/Netbios implementation.
+ Version 1.9.
+ Interface header: Scheduler service
+ Copyright (C) Luke Kenneth Casson Leighton 1996-1999
+ Copyright (C) Andrew Tridgell 1992-1999
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#ifndef _HMAC_MD5_H
+
+typedef struct
+{
+ struct MD5Context ctx;
+ uchar k_ipad[65];
+ uchar k_opad[65];
+
+} HMACMD5Context;
+
+#endif /* _HMAC_MD5_H */
diff --git a/source3/include/md5.h b/source3/include/md5.h
new file mode 100644
index 0000000000..070d8c307d
--- /dev/null
+++ b/source3/include/md5.h
@@ -0,0 +1,32 @@
+/*
+ Unix SMB/Netbios implementation.
+ Version 1.9.
+ Copyright (C) Andrew Tridgell 1992-1999
+ Copyright (C) Luke Kenneth Casson Leighton 1996-1999
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#ifndef MD5_H
+#define MD5_H
+
+struct MD5Context
+{
+ uint32 buf[4];
+ uint32 bits[2];
+ uchar in[64];
+};
+
+#endif /* !MD5_H */
diff --git a/source3/include/proto.h b/source3/include/proto.h
index e528505d43..f61d8e3ca8 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -226,6 +226,13 @@ void generate_random_buffer( unsigned char *out, int len, BOOL re_seed);
char *getsmbpass(char *prompt) ;
+/*The following definitions come from lib/hmacmd5.c */
+
+void hmac_md5_init_rfc2104(uchar* key, int key_len, HMACMD5Context *ctx);
+void hmac_md5_init_limK_to_64(uchar* key, int key_len, HMACMD5Context *ctx);
+void hmac_md5_update(uchar* text, int text_len, HMACMD5Context *ctx);
+void hmac_md5_final(caddr_t digest, HMACMD5Context *ctx);
+
/*The following definitions come from lib/interface.c */
void load_interfaces(void);
@@ -250,6 +257,13 @@ void initialize_multibyte_vectors( int client_codepage);
void mdfour(unsigned char *out, unsigned char *in, int n);
+/*The following definitions come from lib/md5.c */
+
+void MD5Init(struct MD5Context *ctx);
+void MD5Update(struct MD5Context *ctx, uchar const *buf, unsigned len);
+void MD5Final(uchar digest[16], struct MD5Context *ctx);
+void MD5Transform(uint32 buf[4], const uchar inext[64]);
+
/*The following definitions come from lib/membuffer.c */
void mem_init(struct mem_buf *buf, int margin);
diff --git a/source3/include/smb.h b/source3/include/smb.h
index 6d9bcb479b..24f95baaa5 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -24,6 +24,9 @@
#ifndef _SMB_H
#define _SMB_H
+#include "md5.h"
+#include "hmacmd5.h"
+
#define BUFFER_SIZE (0xFFFF)
#define SAFETY_MARGIN 1024