Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d10912e

Browse files
Working on password access for rigctld -- not fully implmented yet
Need to check on security audit and cross-platform compilation first
1 parent d04f4b6 commit d10912e

File tree

25 files changed

+2624
-26
lines changed

25 files changed

+2624
-26
lines changed

‎Makefile.am‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ EXTRA_DIST = PLAN LICENSE hamlib.m4 hamlib.pc.in README.developer \
1313
doc_DATA = ChangeLog COPYING COPYING.LIB LICENSE \
1414
README README.betatester README.developer
1515

16-
SUBDIRS = macros include lib \
16+
SUBDIRS = macros include lib security \
1717
$(BACKEND_LIST) \
1818
$(RIG_BACKEND_LIST) \
1919
$(ROT_BACKEND_LIST) \
@@ -24,7 +24,7 @@ SUBDIRS = macros include lib \
2424

2525
## Static list of distributed directories.
2626
DIST_SUBDIRS = macros include lib src c++ bindings tests doc android scripts rotators/indi simulators\
27-
$(BACKEND_LIST) $(RIG_BACKEND_LIST) $(ROT_BACKEND_LIST) $(AMP_BACKEND_LIST)
27+
security $(BACKEND_LIST) $(RIG_BACKEND_LIST) $(ROT_BACKEND_LIST) $(AMP_BACKEND_LIST)
2828

2929
# Install any third party macros into our tree for distribution
3030
ACLOCAL_AMFLAGS = -I macros --install

‎configure.ac‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -814,6 +814,7 @@ macros/Makefile
814814
include/Makefile
815815
lib/Makefile
816816
src/Makefile
817+
security/Makefile
817818
c++/Makefile
818819
bindings/Makefile
819820
doc/Makefile

‎include/hamlib/rig.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2041,6 +2041,7 @@ struct rig_caps {
20412041
// this will be used to check rigcaps structure is compatible with client
20422042
char *hamlib_check_rig_caps; // a constant value we can check for hamlib integrity
20432043
int (*get_conf2)(RIG *rig, token_t token, char *val, int val_len);
2044+
int (*password)(RIG *rig, unsigned char *key1, unsigned char *key2); /*< Send encrypted password if rigctld is secured with -A/--password */
20442045
};
20452046
//! @endcond
20462047

@@ -3378,6 +3379,8 @@ extern HAMLIB_EXPORT(int) hl_usleep(rig_useconds_t msec);
33783379

33793380
extern HAMLIB_EXPORT(int) rig_cookie(RIG *rig, enum cookie_e cookie_cmd, char *cookie, int cookie_len);
33803381

3382+
extern HAMLIB_EXPORT(int) rig_password(RIG *rig, const unsigned char *key1, const unsigned char *key2);
3383+
33813384
//extern HAMLIB_EXPORT(int)
33823385
int longlat2locator HAMLIB_PARAMS((double longitude,
33833386
double latitude,

‎rigs/dummy/netrigctl.c‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2630,7 +2630,18 @@ static int netrigctl_power2mW(RIG *rig, unsigned int *mwpower, float power,
26302630
RETURNFUNC(RIG_OK);
26312631
}
26322632

2633+
int netrigctl_password(RIG *rig, unsigned char *key1, unsigned char *key2)
2634+
{
2635+
char cmdbuf[256];
2636+
char buf[256];
2637+
int retval;
26332638

2639+
ENTERFUNC;
2640+
rig_debug(RIG_DEBUG_VERBOSE, "%s: key1=%s, key2=%s\n", __func__, key1, key2);
2641+
SNPRINTF(cmdbuf, sizeof(cmdbuf), "\\password %s\n", key1);
2642+
retval = netrigctl_transaction(rig, cmdbuf, strlen(cmdbuf), buf);
2643+
RETURNFUNC(retval);
2644+
}
26342645

26352646
/*
26362647
* Netrigctl rig capabilities.
@@ -2746,6 +2757,7 @@ struct rig_caps netrigctl_caps =
27462757
//.get_trn = netrigctl_get_trn,
27472758
.power2mW = netrigctl_power2mW,
27482759
.mW2power = netrigctl_mW2power,
2760+
.password = netrigctl_password,
27492761

27502762
.hamlib_check_rig_caps = HAMLIB_CHECK_RIG_CAPS
27512763
};

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /