Migrating from BareboneThunks to cTlsSocket #2 #64
Replies: 5 comments 5 replies
-
msgbox had no content |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
I think issue is related to version difference between mdThunks and cTlsSocket |
Beta Was this translation helpful? Give feedback.
-
I have fixed both your code AND VBWebSocket. Public Function pvCryptoHashSha1(baRetVal() As Byte, baInput() As Byte, Optional ByVal Pos As Long, Optional ByVal Size As Long = -1) As Boolean
Const FUNC_NAME As String = "CryptoHashSha256"
Dim lPtr As Long
Dim hHash As Long
If Size < 0 Then
Size = pvArraySize(baInput) - Pos
Else
Debug.Assert pvArraySize(baInput) >= Pos + Size
End If
If Size > 0 Then
lPtr = VarPtr(baInput(Pos))
End If
pvArrayAllocate baRetVal, LNG_SHA1_HASHSZ, FUNC_NAME & ".baRetVal"
If CryptCreateHash(m_uData.hRandomProv, CALG_SHA1, 0, 0, hHash) = 0 Then
GoTo QH
End If
If CryptHashData(hHash, ByVal lPtr, Size, 0) = 0 Then
GoTo QH
End If
If CryptGetHashParam(hHash, HP_HASHVAL, baRetVal(0), LNG_SHA1_HASHSZ, 0) = 0 Then
GoTo QH
End If
'--- success
pvCryptoHashSha1 = True
QH:
If hHash <> 0 Then
Call CryptDestroyHash(hHash)
End If
End Function I made the SHA1 function public in your code. and rest is with VBWebSocket, unrelated to you. |
Beta Was this translation helpful? Give feedback.
-
I would have to copy and paste a new function, but I can just find the function from the dropbox and make it public. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I just had a blank response
-Windows XP Service Pack 3 SSE2 enabled x86
Beta Was this translation helpful? Give feedback.
All reactions