[ActiveLock-Development] CVS: activelock/src ActiveLock.cls,1.1,1.2 IActiveLock.cls,1.1,1.2 ActiveLo
Brought to you by:
ialkan
From: Thanh H. T. <th...@us...> - 2003-09-22 02:11:25
|
Update of /cvsroot/activelock/activelock/src In directory sc8-pr-cvs1:/tmp/cvs-serv2007 Modified Files: ActiveLock.cls IActiveLock.cls ActiveLock2.dll Log Message: Required Changes to support ALUGEN. Index: ActiveLock.cls =================================================================== RCS file: /cvsroot/activelock/activelock/src/ActiveLock.cls,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ActiveLock.cls 7 Aug 2003 17:30:59 -0000 1.1 +++ ActiveLock.cls 22 Sep 2003 02:11:21 -0000 1.2 @@ -69,6 +69,9 @@ ' 07.28.03 - wizzardme2000 - Implemented lockComp, lockHD, and lockWindows ' 07.31.03 - th2tran - Perform checksum on ALCrypto.dll on Init() ' - ValidateKey() to bypass checking expiry if there's no expiration date. +' 08.21.03 - th2tran - Added #If directive in IActiveLock_Init() to bypass dll authentication when +' running from inside VB. This makes debugging a bit easier. +' - Refactored IActiveLock_LockCode() ' </pre> ' /////////////////////////////////////////////////////////////////////// @@ -108,14 +111,19 @@ End Property Private Sub IActiveLock_Init(Arg1 As Variant, ParamArray OtherArgs() As Variant) +' If running in Debug mode, don't bother with dll authentication +#If AL_DEBUG = 1 Then + GoTo Done +#End If ' Checksum ALCrypto.dll - Const ALCRYPTO_MD5$ = "e30f9189d9feb4eb222386c7c294f45e" + Const ALCRYPTO_MD5$ = "67874c0aabab26ec19f5a2cad84595ef" Dim strdata As String, strMD5 As String Call modActiveLock.ReadFile(App.path & "\ALCrypto.Dll", strdata) strMD5 = modMD5.Hash(strdata) ' use our own MD5 hashing routine instead of ALCrypto's md5_hash() function. If strMD5 <> ALCRYPTO_MD5 Then Err.Raise ActiveLockErrCodeConstants.alerrFileTampered, "IActiveLock_Acquire", "ALCrypto.dll has been tampered." End If +Done: mfInit = True End Sub @@ -158,9 +166,21 @@ strPubKey = mSoftwareCode Dim strSig As String Dim strLic As String + Dim strLicKey As String + strLic = IActiveLock_LockCode(Lic) + strLicKey = Lic.LicenseKey + ' decode the license key - strSig = MyGlobals.Base64Decode(Lic.LicenseKey) + strSig = MyGlobals.Base64Decode(strLicKey) +' Print out some info for debugging purposes +Debug.Print "Code1: " & strPubKey +Debug.Print "Lic: " & strLic +Debug.Print "Lic hash: " & MyGlobals.MD5Hash(strLic) +Debug.Print "LicKey: " & strLicKey +Debug.Print "Sig: " & strSig +Debug.Print "Verify: " & MyGlobals.RSAVerify(strPubKey, strLic, strSig) +Debug.Print "====================================================" ' validate the key Dim rc& rc = MyGlobals.RSAVerify(strPubKey, strLic, strSig) @@ -269,7 +289,10 @@ End Property -Private Sub IActiveLock_Register(Lic As ProductLicense) +Private Sub IActiveLock_Register(ByVal LibKey As String) + Dim Lic As New ActiveLock2.ProductLicense + Lic.Load LibKey + ' Validate that the license key. ' - registered user ' - expiry date @@ -309,26 +332,36 @@ Dim strLock As String If (mLockTypes And lockMAC) = lockMAC Then - strLock = strLock & vbLf & modMACAddress.GetMACAddress() + AppendLockString strLock, modMACAddress.GetMACAddress() End If If mLockTypes And lockComp Then - strLock = strLock & vbLf & modComputerName.GetComputerName() + AppendLockString strLock, modComputerName.GetComputerName() End If If mLockTypes And lockHD Then - strLock = strLock & vbLf & modHDSerial.GetHDSerial() + AppendLockString strLock, modHDSerial.GetHDSerial() End If If mLockTypes And lockWindows Then - strLock = strLock & vbLf & modWindowsSerial.GetWindowsSerial() + AppendLockString strLock, modWindowsSerial.GetWindowsSerial() End If If Left(strLock, 1) = vbLf Then strLock = Mid(strLock, 2) If Lic Is Nothing Then IActiveLock_LockCode = strLock + ElseIf strLock <> "" Then + IActiveLock_LockCode = Lic.ToString() & vbLf & strLock Else - IActiveLock_LockCode = Lic.ToString() & vbCrLf & strLock + IActiveLock_LockCode = Lic.ToString() End If End Function + +Private Sub AppendLockString(ByRef strLock As String, ByVal NewSubString As String) + If strLock = "" Then + strLock = NewSubString + Else + strLock = strLock & vbLf & NewSubString + End If +End Sub Private Property Let IActiveLock_SoftwareVersion(RHS As String) mSoftwareVer = RHS Index: IActiveLock.cls =================================================================== RCS file: /cvsroot/activelock/activelock/src/IActiveLock.cls,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- IActiveLock.cls 7 Aug 2003 17:30:59 -0000 1.1 +++ IActiveLock.cls 22 Sep 2003 02:11:21 -0000 1.2 @@ -263,6 +263,7 @@ ' 07.07.03 - mcrute - Updated the header comments for this file. ' 07.20.03 - th2tran - Added EventNotifier used for firing COM events. ' 08.03.03 - th2tran - VBDox'ed this interface. +' 09.21.03 - th2tran - Changed Register(Lic As ProductLicense) subroutine to Register(ByVal LibKey As String) ' ' </pre> @@ -428,8 +429,8 @@ '' ' Registers the following product license. -' @param Lic Product License with which to register. -Public Sub Register(Lic As ProductLicense) +' @param LibKey Liberation Key. +Public Sub Register(ByVal LibKey As String) End Sub Index: ActiveLock2.dll =================================================================== RCS file: /cvsroot/activelock/activelock/src/ActiveLock2.dll,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsW8CGfM and /tmp/cvsMtQnZq differ |