Skip to content

Commit

Permalink
新增-q参数显示解密后的SuConfig.dat以便选择DHCP方式。
Browse files Browse the repository at this point in the history
  • Loading branch information
wallproxy authored and updateing committed Jan 22, 2016
1 parent 197d3bf commit a53dee9
Show file tree
Hide file tree
Showing 19 changed files with 336 additions and 286 deletions.
20 changes: 9 additions & 11 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,16 @@ dist_doc_DATA = README

dist_man_MANS = mentohust.1

SPEC = mentohust.spec
EXTRA_DIST = @PACKAGE_NAME@.spec.in m4 debian/changelog debian/compat debian/control debian/copyright debian/rules debian/watch

EXTRA_DIST = $(SPEC) debian/changelog debian/compat debian/control debian/copyright debian/rules debian/watch

rpm: dist-gzip
mkdir -p ~/rpmbuild/SOURCES/
mv mentohust-*.tar.gz ~/rpmbuild/SOURCES/
if [ -z "$(TARGET)" ] ;then \
rpmbuild -bb $(top_srcdir)/$(SPEC) ; \
else rpmbuild -bb $(top_srcdir)/$(SPEC) --target=$(TARGET) ; fi
mv ~/rpmbuild/RPMS/*$(TARGET)/mentohust-*$(TARGET).rpm ./
rm ~/rpmbuild/SOURCES/mentohust*
rpm: dist @[email protected]
rpmbuild -bb \
--define "_sourcedir `pwd`" \
--define "_builddir `pwd`" \
--define "_specdir `pwd`" \
--define "_rpmdir `pwd`" \
--define "_srcrpmdir `pwd`" \
@[email protected]

deb: debian/rules
dpkg-buildpackage -rfakeroot -uc -b -d
20 changes: 18 additions & 2 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,30 @@
#安装mentohust:建议Ubuntu用户使用Deb包安装,Fedora用户使用RPM包安装

#如果确定自己可以使用xrgsu认证成功,打开终端输入sudo mentohust运行即可
#如果不确定,切换到锐捷所在目录,然后输入以下命令:
如果不确定,切换到锐捷所在目录,然后输入以下命令:
sudo mkdir /etc/mentohust
sudo cp ./8021x.exe /etc/mentohust
#如果准确按以上步骤操作后还是认证失败,请下载MentoHUSTTool,在Windows下抓包并保存为data.mpf,
sudo cp ./W32N55.dll /etc/mentohust
然后打开终端输入sudo mentohust运行。如果认证失败,再切换到锐捷所在目录,输入以下命令:
sudo cp ./SuConfig.dat /etc/mentohust
然后打开终端输入sudo mentohust运行即可。
如果准确按以上步骤操作后还是认证失败,请下载MentoHUSTTool,在Windows下抓包并保存为data.mpf,
然后回到Linux,切换到data.mpf所在目录,输入以下命令:
sudo cp ./data.mpf /etc/mentohust
然后打开终端输入sudo mentohust -f/etc/mentohust/data.mpf -w运行即可。以后也只需输入sudo mentohust。

#您也可以按下面的方法操作:
1、静态IP用户请事先设置好IP;
2、打开终端,输入sudo mentohust,回车;
3、[正确]输入相应信息,如果认证成功,跳到第8步;如果提示“不允许使用的客户端类型”,按Ctrl+C结束认证;
4、打开终端,输入sudo mentohust -w -f'锐捷目录下任意文件路径',回车;
5、如果认证成功,跳到第8步;如果提示“客户端完整性被破坏”,按Ctrl+C结束认证;
6、将锐捷安装目录下的SuConfig.dat重命名为其他名字;
7、打开终端,输入sudo mentohust,回车;
8、如果是动态IP且不是Linux,打开相应设置去更新IP。
9、以后认证只需打开终端,输入sudo mentohust,回车。
10、要修改某些参数请输入mentohust -h查看帮助信息并据此修改,例如修改密码sudo mentohust -pNewPassword -w,要临时修改则不加-w参数。

#如何退出:不以后台模式运行mentohust时,按Ctrl+C即可退出;后台运行时使用sudo mentohust -k退出认证。

#查看帮助信息请输入:mentohust -h
Expand Down
24 changes: 11 additions & 13 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([src/myconfig.h])
AC_CONFIG_HEADERS([config.h])

m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

# Checks for programs.
AS_IF([test "x$prefix" = "xNONE"], [prefix="/usr"])
AC_ARG_ENABLE([debug], [AC_HELP_STRING([ --enable-debug], [Build a debug version])],
Expand Down Expand Up @@ -48,29 +50,25 @@ AC_ARG_ENABLE([notify], [AC_HELP_STRING([ --disable-notify], [Don't show notific
AS_IF([test "x$enable_notify" = "xno"],
[AC_DEFINE(NO_NOTIFY, [], [Define NO_NOTIFY to disable notification])],
[AC_CHECK_LIB([dl], [dlsym])])

# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T

# define GETTEXT_* variables
AS_IF([test -z "$enable_nls"], [enable_nls="yes"])

GETTEXT_PACKAGE="$PACKAGE_NAME"
AC_SUBST(GETTEXT_PACKAGE)
AC_SUBST(prefix)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Define to the read-only architecture-independent data directory.])

AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Package name for gettext.])
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION(0.16.1)


# Checks for header files.
AC_CHECK_HEADERS([iconv.h arpa/inet.h fcntl.h netinet/in.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h])

AC_CHECK_HEADERS([iconv.h arpa/inet.h fcntl.h netinet/in.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h libintl.h locale.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SIZE_T

# Checks for library functions.
AC_CHECK_FUNCS([atexit memmove memset socket strrchr])
AC_CHECK_FUNCS([atexit memmove memset socket strrchr setlocale])

AC_CONFIG_FILES([Makefile po/Makefile.in src/Makefile])
AC_CONFIG_FILES([Makefile src/Makefile po/Makefile.in mentohust.spec])

AC_MSG_RESULT([config result: host($host_os) pcap($with_pcap) notify($enable_notify) encode($enable_encodepass) arp($enable_arp)])
AC_MSG_RESULT([config result: host($host_os) pcap($with_pcap) notify($enable_notify) encode($enable_encodepass) arp($enable_arp) nls($enable_nls)])
AC_OUTPUT
3 changes: 1 addition & 2 deletions po/LINGUAS
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
zh_CN

en
2 changes: 0 additions & 2 deletions po/POTFILES.in
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# List of source files which contain translatable strings.
src/dlfunc.c
src/mentohust.c
src/mycheck.c
src/myconfig.c
src/myfunc.c
src/myini.c
src/mystate.c
27 changes: 0 additions & 27 deletions po/zh_CN.po

This file was deleted.

2 changes: 1 addition & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dist_sysconf_DATA = mentohust.conf

mentohust_SOURCES = myini.c md5.c mycheck.c dlfunc.c myfunc.c mystate.c myconfig.c mentohust.c byte_order.c checkV4.c rjmd5.c rjripemd128.c rjsha1.c rjtiger.c rjtiger_sbox.c rjwhirlpool.c rjwhirlpool_sbox.c

mentohust_SOURCES += types.h myini.h md5.h mycheck.h dlfunc.h myfunc.h mystate.h myconfig.h byte_order.h checkV4.h rjmd5.h rjripemd128.h rjsha1.h rjtiger.h rjwhirlpool.h ustd.h
mentohust_SOURCES += i18n.h types.h myini.h md5.h mycheck.h dlfunc.h myfunc.h mystate.h myconfig.h byte_order.h checkV4.h rjmd5.h rjripemd128.h rjsha1.h rjtiger.h rjwhirlpool.h ustd.h

mentohust_LDADD = $(LDADD)

18 changes: 6 additions & 12 deletions src/dlfunc.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,8 @@
* 邮 箱:[email protected]
* 日 期:2009.11.11
*/

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "i18n.h"
#include "dlfunc.h"
#include "i18n.h"

#ifndef NO_DYLOAD
#include <dlfcn.h>
Expand Down Expand Up @@ -47,7 +42,7 @@ int load_libpcap(void) {
error = dlerror();
}
if (libpcap == NULL) {
printf("!! 打开libpcap失败,请检查是否已安装该库文件。\n");
printf(_("!! 打开libpcap失败,请检查是否已安装该库文件。\n"));
return -1;
}
if ((pcap_findalldevs = dlsym(libpcap, "pcap_findalldevs"), error = dlerror()) != NULL
Expand All @@ -61,7 +56,7 @@ int load_libpcap(void) {
|| (pcap_close = dlsym(libpcap, "pcap_close"), error = dlerror()) != NULL
|| (pcap_breakloop = dlsym(libpcap, "pcap_breakloop"), error = dlerror()) != NULL
|| (pcap_sendpacket = dlsym(libpcap, "pcap_sendpacket"), error = dlerror()) != NULL) {
printf("!! 从libpcap获取函数失败: %s\n", error);
printf(_("!! 从libpcap获取函数失败: %s\n"), error);
free_libpcap();
return -1;
}
Expand Down Expand Up @@ -110,20 +105,20 @@ int load_libnotify(void) {
error = dlerror();
}
if (libnotify == NULL) {
printf("!! 打开libnotify失败,请检查是否已安装该库文件。\n");
printf(_("!! 打开libnotify失败,请检查是否已安装该库文件。\n"));
return -1;
}
if ((notify_init = dlsym(libnotify, "notify_init"), error = dlerror()) != NULL
|| (notify_notification_new = dlsym(libnotify, "notify_notification_new"), error = dlerror()) != NULL
|| (notify_notification_show = dlsym(libnotify, "notify_notification_show"), error = dlerror()) != NULL
|| (notify_notification_update = dlsym(libnotify, "notify_notification_update"), error = dlerror()) != NULL
|| (notify_notification_set_timeout = dlsym(libnotify, "notify_notification_set_timeout"), error = dlerror()) != NULL) {
printf("!! 从libnotify获取函数失败: %s\n", error);
printf(_("!! 从libnotify获取函数失败: %s\n"), error);
free_libnotify();
return -1;
}
if (!notify_init("mentohust")) {
printf("!! 初始化libnotify失败。\n");
printf(_("!! 初始化libnotify失败。\n"));
free_libnotify();
return -1;
}
Expand Down Expand Up @@ -156,4 +151,3 @@ void show_notify(const char *summary, char *body) {
}

#endif /* NO_NOTIFY */

4 changes: 3 additions & 1 deletion src/dlfunc.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
#ifndef HUSTMOON_DLFUNC_H
#define HUSTMOON_DLFUNC_H

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <sys/time.h>

Expand Down Expand Up @@ -71,4 +74,3 @@ void show_notify(const char *summary, char *body); /* 显示通知:概要、正
#endif /* NO_NOTIFY */

#endif /* HUSTMOON_DLFUNC_H */

Loading

0 comments on commit a53dee9

Please sign in to comment.