#define _LRAD_MD4_H
#define _LRAD_SHA1_H
-#include <freeradius-devel/rad_assert.h>
+#include <rad_assert.h>
#include "extern.h"
#include "otp.h"
/* 0x (ID) ( ASCII("S="ASCII(auth_md))) */
char auth_octet_string[2 + 2 + (2 * sizeof(auth_md_string))];
- char *username = request->username->vp_strvalue;
+ char *username = request->username->strvalue;
int username_len = request->username->length;
/* "Magic server to client signing constant" */
/* MD1 */
SHA1_Init(&ctx);
SHA1_Update(&ctx, password_md_md, MD4_DIGEST_LENGTH);
- SHA1_Update(&ctx, rvp->vp_strvalue + 26, 24);
+ SHA1_Update(&ctx, rvp->strvalue + 26, 24);
SHA1_Update(&ctx, magic1, sizeof(magic1));
SHA1_Final(md1, &ctx);
/* MD2 */
SHA1_Init(&ctx);
- SHA1_Update(&ctx, rvp->vp_strvalue + 2, 16);
- SHA1_Update(&ctx, cvp->vp_strvalue, 16);
+ SHA1_Update(&ctx, rvp->strvalue + 2, 16);
+ SHA1_Update(&ctx, cvp->strvalue, 16);
SHA1_Update(&ctx, username, username_len);
SHA1_Final(md2, &ctx);
/* And then octet conversion. Ugh! */
auth_octet_string[0] = '0';
auth_octet_string[1] = 'x';
- (void) sprintf(&auth_octet_string[2], "%02X", rvp->vp_strvalue[0]);
+ (void) sprintf(&auth_octet_string[2], "%02X", rvp->strvalue[0]);
for (i = 0; i < sizeof(auth_md_string) - 1; ++i)
(void) sprintf(&auth_octet_string[i * 2 +4], "%02X", auth_md_string[i]);
/* Generate the master session key. */
SHA1_Init(&ctx);
SHA1_Update(&ctx, password_md_md, MD4_DIGEST_LENGTH);
- SHA1_Update(&ctx, rvp->vp_strvalue + 26, 24);
+ SHA1_Update(&ctx, rvp->strvalue + 26, 24);
SHA1_Update(&ctx, Magic1, sizeof(Magic1));
SHA1_Final(sha_md, &ctx);
(void) memcpy(MasterKey, sha_md, 16);