diff options
author | Brian Somers <brian@FreeBSD.org> | 2002-06-12 00:21:07 +0000 |
---|---|---|
committer | Brian Somers <brian@FreeBSD.org> | 2002-06-12 00:21:07 +0000 |
commit | 628e6cd45f03e625c2a48a645533ea28745c60d4 (patch) | |
tree | 79d1bcfaed665df1da22adebe3ca6d09c471e256 /lib/libradius/radlib.c | |
parent | 963d43d4da98d2671542f41db0cede4267ce0852 (diff) | |
download | src-628e6cd45f03e625c2a48a645533ea28745c60d4.tar.gz src-628e6cd45f03e625c2a48a645533ea28745c60d4.zip |
Add the following functions:
rad_request_authenticator()
Returns the Request-Authenticator relevant to the most recently received
RADIUS response.
rad_server_secret()
Returns the Shared Secret relevant to the most recently received
RADIUS response.
Neither of these functions should be necessary, however, the
MS-MPPE-Recv-Key and MS-MPPE-Send-Key Microsoft Vendor Specific
attributes are supplied in a mangled (encrypted) format, requiring
this information to demangle.
It's not clear whether these functions should be replaced with a
rad_demangle() function or whether these attributes are one-offs.
Sponsored by: Monzoon
Notes
Notes:
svn path=/head/; revision=98131
Diffstat (limited to 'lib/libradius/radlib.c')
-rw-r--r-- | lib/libradius/radlib.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/libradius/radlib.c b/lib/libradius/radlib.c index bc3679e06674..702b06f12fe9 100644 --- a/lib/libradius/radlib.c +++ b/lib/libradius/radlib.c @@ -928,3 +928,20 @@ rad_put_vendor_string(struct rad_handle *h, int vendor, int type, { return (rad_put_vendor_attr(h, vendor, type, str, strlen(str))); } + +ssize_t +rad_request_authenticator(struct rad_handle *h, char *buf, size_t len) +{ + if (len < LEN_AUTH) + return (-1); + memcpy(buf, h->request + POS_AUTH, LEN_AUTH); + if (len > LEN_AUTH) + buf[LEN_AUTH] = '\0'; + return (LEN_AUTH); +} + +const char * +rad_server_secret(struct rad_handle *h) +{ + return (h->servers[h->srv].secret); +} |