kopia lustrzana https://github.com/Hamlib/Hamlib
Merge branch 'master' of https://github.com/Hamlib/Hamlib
commit
d54b541c0d
|
@ -3,5 +3,5 @@ EXTRA_DIST = sctest.c
|
|||
|
||||
noinst_LTLIBRARIES = libsecurity.la
|
||||
|
||||
libsecurity_la_SOURCES = aes.c AESStringCrypt.c password.c security.c sha256.c md5.c
|
||||
libsecurity_la_SOURCES = aes.c AESStringCrypt.c password.c security.c sha256.c md5.c aes.h AESStringCrypt.h password.h security.h sha256.h md5.h
|
||||
LDADD = $(top_builddir)/src/libhamlib.la
|
||||
|
|
|
@ -291,7 +291,7 @@ unsigned char *make_hash(char *arg)
|
|||
return digest;
|
||||
}
|
||||
|
||||
char *make_md5(char *pass)
|
||||
char *rig_make_md5(char *pass)
|
||||
{
|
||||
unsigned char *hash = make_hash("password");
|
||||
char *md5str = make_digest(hash, 16);
|
||||
|
|
|
@ -27,6 +27,9 @@
|
|||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "hamlib/rig.h"
|
||||
|
||||
extern HAMLIB_EXPORT(char*) rig_make_md5(char *pass);
|
||||
|
||||
typedef unsigned long MD5_u32plus;
|
||||
|
||||
|
|
|
@ -26,11 +26,10 @@
|
|||
#include <errno.h>
|
||||
#include "hamlib/rig.h"
|
||||
#include "password.h"
|
||||
#include "md5.h"
|
||||
|
||||
#define HAMLIB_SECRET_LENGTH 32
|
||||
|
||||
extern char *make_md5(char *password);
|
||||
|
||||
// makes a 32-byte secret key from password using MD5
|
||||
// yes -- this is security-by-obscurity
|
||||
// but password hacking software doesn't use this type of logic
|
||||
|
@ -52,7 +51,7 @@ HAMLIB_EXPORT(void) rig_password_generate_secret(char *pass,
|
|||
|
||||
snprintf(newpass, sizeof(newpass) - 1, "%s\t%lu\n", pass, (long)rand());
|
||||
printf("debug=%s\n", newpass);
|
||||
char *md5str = make_md5(newpass);
|
||||
char *md5str = rig_make_md5(newpass);
|
||||
|
||||
strncpy(result, md5str, HAMLIB_SECRET_LENGTH);
|
||||
|
||||
|
|
|
@ -38,18 +38,18 @@ if HAVE_LIBUSB
|
|||
endif
|
||||
|
||||
# include generated include files ahead of any in sources
|
||||
rigctl_CPPFLAGS = -I$(top_builddir)/tests -I$(top_builddir)/src -I$(srcdir) -I$(top_srcdir)/security $(AM_CPPFLAGS)
|
||||
rigctl_CPPFLAGS = -I$(top_builddir)/tests -I$(top_builddir)/src -I$(srcdir) -I$(top_builddir)/security $(AM_CPPFLAGS)
|
||||
|
||||
# all the programs need this
|
||||
LDADD = $(top_builddir)/src/libhamlib.la $(top_builddir)/lib/libmisc.la $(DL_LIBS)
|
||||
|
||||
rigmem_CFLAGS = $(AM_CFLAGS) $(LIBXML2_CFLAGS) -I$(top_builddir)/src
|
||||
rigctld_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/src
|
||||
rigctld_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/src -I$(top_builddir)/security
|
||||
rotctl_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/src
|
||||
rotctld_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/src
|
||||
ampctl_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/src
|
||||
ampctld_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/src
|
||||
rigctlcom_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS)
|
||||
rigctlcom_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) -I$(top_builddir)/security
|
||||
if HAVE_LIBUSB
|
||||
rigtestlibusb_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) $(LIBUSB_CFLAGS)
|
||||
endif
|
||||
|
|
|
@ -67,6 +67,7 @@ extern int read_history();
|
|||
#include "misc.h"
|
||||
#include "iofunc.h"
|
||||
#include "sprintflst.h"
|
||||
#include "md5.h"
|
||||
|
||||
#include "rigctl_parse.h"
|
||||
|
||||
|
@ -4945,7 +4946,7 @@ int rigctld_password_check(RIG *rig, const char *md5)
|
|||
rig_debug(RIG_DEBUG_TRACE, "%s: %s == %s\n", __func__, md5, rigctld_password);
|
||||
is_passwordOK = 0;
|
||||
|
||||
char *mymd5 = make_md5(rigctld_password);
|
||||
char *mymd5 = rig_make_md5(rigctld_password);
|
||||
|
||||
if (strcmp(md5, mymd5) == 0)
|
||||
{
|
||||
|
|
|
@ -75,6 +75,7 @@
|
|||
#include "serial.h"
|
||||
#include "sprintflst.h"
|
||||
#include "network.h"
|
||||
#include "md5.h"
|
||||
|
||||
#include "rigctl_parse.h"
|
||||
|
||||
|
@ -305,7 +306,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
case 'A':
|
||||
strncpy(rigctld_password, optarg, sizeof(rigctld_password) - 1);
|
||||
char *md5 = make_md5(rigctld_password);
|
||||
char *md5 = rig_make_md5(rigctld_password);
|
||||
printf("Secret key: %s\n", md5);
|
||||
break;
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue