|
I am working on IAS extension authential dll.I want to get Username and Passowrd.When PAP is used ,I get radius attributes like RADIUS_ATTRIBUTE_TYPE username and password in ratUserName , ratUserPassword.But if radius client sends request using ms-chap,I get username in ratUserName in structure member,but I do not get password in ratPassWord or ratCHAPPassword structure.
It seems that there is no member for ms-chap password in RADIUS_ATTRIBUTE_TYPE structure.
How do i get password information sent by user if ms-chap encryption is used?
If you want to say that ms-chap password is contained in access-request packet,how to get and use the packet?
Can any body help me ?
thanks
|
|
|
|
|
A quick Google for "RADIUS_ATTRIBUTE_TYPE chap" leads to the relevant RFC[^], which tells us that you won't see the plain-text password in ratCHAPPassword. Rather, you'll see the encrypted password. Maybe that's what you're missing?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Stuart Dootson wrote: A quick Google for "RADIUS_ATTRIBUTE_TYPE chap" leads to the relevant RFC[^], which tells us that you won't see the plain-text password in ratCHAPPassword. Rather, you'll see the encrypted password. Maybe that's what you're missing?
Can you tell me how to get the encrypted password?
The ratPassWord and ratCHAPPassword structure can not been got in extension dll if radius client sends request using ms-chap.
|
|
|
|
|
Have you seen this page[^]. You need to send a challenge first, then the client should respond with a response (that'll be in the CHAP password field, I guess).
The response should be the MD5 of the CHAP ID octet, the password that the user entered and the CHAP challenge that you sent. If it is, you send back an Access-Accept, otherwise you send back an Access-Reject.
That's all documented in the RFC that I posted to you first time. Take the time and trouble to work out what your specs require you to do. I know nothing about this subject, but with some Googling, I've managed to work this out.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
In this page:http://technet.microsoft.com/en-us/library/cc757302.aspx[^]
There is something about ratClearTextPassword:
'ratClearTextPassword. To support third-party user database use with PEAP-MS-CHAP v2, the IAS extension authentication DLL, this attribute retrieves the user password from the third-party user accounts database and sends this information back to IAS.'
I think if i can get the ClearTextPassword in my database,and then add a _RADIUS_ATTRIBUTE struct in the end of attributes array with 'DWORD WINAPI RadiusExtensionProcess2'.
I think maybe IAS will generate a hash of the ClearTextPassword and then check if it matches the hash sent by client.
|
|
|
|
|
If i do like what i said, that client will get a error :' error 778: It was not possible to verify the identity of the server. '.
Maybe i will add another member into the RADIUS_ATTRIBUTE attributes array but not only one attribute with ratClearTextPassword??
modified on Monday, February 16, 2009 3:28 AM
|
|
|
|
|
Stuart Dootson wrote: Have you seen this page[^]. You need to send a challenge first, then the client should respond with a response (that'll be in the CHAP password field, I guess).
The response should be the MD5 of the CHAP ID octet, the password that the user entered and the CHAP challenge that you sent. If it is, you send back an Access-Accept, otherwise you send back an Access-Reject.
That's all documented in the RFC that I posted to you first time. Take the time and trouble to work out what your specs require you to do. I know nothing about this subject, but with some Googling, I've managed to work this out.
In this function : (http://msdn.microsoft.com/en-us/libr...03(VS.85).aspx)
DWORD WINAPI RadiusExtensionProcess(
__in const RADIUS_ATTRIBUTE *pAttrs,
__out PRADIUS_ACTION pfAction
);
Parameters
pAttrs [in]
Pointer to an array of attributes from the request. The array is terminated by an attribute with dwAttrType set to ratMinimum. These attributes should be treated as read-only; they should not be modified by RadiusExtensionProcess. Also, these attributes should not be referenced in any way after RadiusExtensionProcess returns.
pfAction [out]
Pointer to a value of type RADIUS_ACTION, initially set to raContinue. This parameter specifies the action that NPS should take in response to an Access-Request.
I can get all attributes by parameter 'pAttrs [in]'.The attributes include ratUserName,ratNASPort anf so on ,but no ratUserPassword or ratCHAPPassword.
When ratUserPassword and ratCHAPPassword are not in the an array of attributes from the request,how can i get the hash sent by the CHAP client??
Please help me.
|
|
|
|
|
I can get encrypted password in ratCHAPPassword if radius client sends request using CHAP, and also I get ratCHAPChallenge.
But if radius client sends request using MS-CHAP,I can not get ratCHAPPassword and ratCHAPChallenge.Why?
Can anybody help me?
|
|
|
|
|
In the extension dll, I do not accept or reject the pocket.I just get the attributes to txt file,and let IAS deal whit the pocket.In this way,I also can not get the ratUserPassword or ratChapPassword.
I can not understand why.
|
|
|
|
|
hi every body,
I need a multi-bit trie algorithme coded on C++
can any one help?
|
|
|
|
|
Now, how on earth could you possibly find anything like that on the internet....
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Stuart Dootson wrote: how on earth could you possibly find anything like that on the internet
Does it involve chalk markings on the floor, candles, eggs and red brick dust?
|
|
|
|
|
Damn - you found me out!
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hello everybody,
i need some help with my code. The program seems to work,the problem is that it only outputs the result for the last pair of numbers and repeat it for 5 times.
Could you please help me to understand what i'm doing wrong?
Thanks a lot,
raeiko
<br />
<br />
<br />
#include <stdio.h><br />
<br />
int multiple ( int j, int z); <br />
<br />
int main( void ) <br />
{<br />
int num1, num2, x, i; <br />
<br />
for ( x = 1; x <= 5; x++ ){ <br />
printf( "Enter the first number:" ); <br />
scanf_s("%d", &num1 ); <br />
<br />
if ( num1 != 0){<br />
printf( "Enter the second number:" ); <br />
scanf_s("%d", &num2 ); <br />
} <br />
else {<br />
break;<br />
printf( "\nBroke from loop because num1 must be greater than 0\n" ); <br />
}<br />
}<br />
<br />
<br />
multiple( num1, num2);<br />
<br />
<br />
return 0;<br />
}<br />
<br />
int multiple ( int j, int z ) <br />
{ <br />
int y; <br />
<br />
int result;<br />
<br />
result = z % j;<br />
<br />
for ( y = 1; y <= 5; y++ ) <br />
if( result == 0){<br />
printf( "%d is multiple of %d\n", z, j );<br />
}<br />
else {<br />
printf( "%d is not multiple of %d\n", z, j );<br />
}<br />
<br />
return result;<br />
}
|
|
|
|
|
You need to put the multiple( num1, num2); call in the for loop - it's not in the loop in the code you've posted.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
If i don't ask too much,could you please show me? This thing has been driving me crazy for one week...and i guess this is still nothing in comparison to advanced C...I feel a bit stupid...
Thanks again,
raeiko
|
|
|
|
|
I see what you've done. You've got the loop in main and multiple, but you're passing single integers into multiple. There are two solutions (both built & tested under darwin-gcc-4.0.1):
- Call
multiple in the loop and remove the loop in multiple :
#include <stdio.h>
int multiple ( int j, int z);
int main( void )
{
int num1, num2, x, i;
for ( x = 1; x <= 5; x++ )
{
printf( "Enter the first number:" );
scanf("%d", &num1 );
if ( num1 != 0)
{
printf( "Enter the second number:" );
scanf("%d", &num2 );
}
else
{
break;
printf( "\nBroke from loop because num1 must be greater than 0\n" );
}
multiple( num1, num2);
}
return 0;
}
int multiple ( int j, int z )
{
int result;
result = z % j;
if( result == 0)
{
printf( "%d is multiple of %d\n", z, j );
}
else
{
printf( "%d is not multiple of %d\n", z, j );
}
return result;
} - Gather the numbers into two arrays and process them in one call to
multiple :
#include <stdio.h>
int multiple ( int* j, int* z, int n);
int main( void )
{
int num1[5] = {0};
int num2[5] = {0};
int x, i;
for ( x = 1; x <= 5; x++ )
{
printf( "Enter the first number:" );
scanf("%d", &(num1[x-1]) );
if ( num1[x-1] != 0)
{
printf( "Enter the second number:" );
scanf("%d", &(num2[x-1]) );
}
else
{
break;
printf( "\nBroke from loop because num1 must be greater than 0\n" );
}
}
multiple( num1, num2, x-1);
return 0;
}
int multiple ( int* j, int* z, int numValues)
{
int y;
int result;
for (y=0;y<numValues;++y)
{
result = z[y] % j[y];
if( result == 0)
{
printf( "%d is multiple of %d\n", z[y], j[y] );
}
else
{
printf( "%d is not multiple of %d\n", z[y], j[y] );
}
}
return result;
} Personally, I prefer the first one - why mess with arrays when you don't have to?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thank you so much!!! Now i see what was wrong
raeiko
|
|
|
|
|
IMHO your code has several flaws.
- you're treating
num1 and num2 in main (as well as j and z in multiple ) like they where array elements, but, in fact, they aren't. - in the array-like scenario, the
break on num1==0 is inappropriate, that 'exceptional' input would be better handled inside the multiple function (possibly with a continue ). - the line
raeiko wrote: printf( "\nBroke from loop because num1 must be greater than 0\n" );
is wrong: you're simply rejecting num1==0 , i.e. you code accepts negative num1 values. As already suggested by Stuart Dootson, would be probably better abandoning the array-like design: make multiply function acting on just two operands and call it inside the input loop.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Check out your multiple() function. Notice that it is called outside of the loop, so it is only going to work on the last two values of num1 and num2 .
Also, why does the multiple() function have a for loop?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
I have come across a program that displays a jpg
image, which can be opened in the usual manner.
However I noticed at start up it displays a default image loaded
from memory(resoucres).
The statement
m_pict.Load(IDR_MAINFRAME);
I thought that this sort of method could
work well,in effect with a program that plays sounds
(waveBox - from the articles), I have looked in the
resources and it allows you to load 'wave' files into it.
can anybody explain maybe why this is not working.
I have also tried including the resource.h
is there any oversite in my part
many thanks
Simon
|
|
|
|
|
simon alec smith wrote: can anybody explain maybe why this is not working.
Why what isn't working?
You can load any file type from resources - this page[^] describes the process reasonably well under the 'Creating a Resource List' heading:
- call FindResource or FindResourceEx with the resource name to get the resource handle;
- call LoadResource with the resource handle to get the global handle;
- call LockResource with the global handle to get a pointer to the resource data.
I've done this several times - it works really well.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi, Is it possible to avoid the Microsoft Visual c++ Runtimes when running a program compiled with Visual Studio 2008?
My program is dynamically linked to msvcr90.dll and msvcp90.dll and I would like to not having to redistribute these files. Thanks in advance.
|
|
|
|
|
santiageitorx wrote: Is it possible to avoid the Microsoft Visual c++ Runtimes when running a program compiled with Visual Studio 2008?
Check this out[^]
|
|
|
|
|
To paraphrase led mike - link statically with the CRT!!!
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|