Skip to content

Commit

Permalink
types: Add getOAEPSourceData
Browse files Browse the repository at this point in the history
Fixes build error triggered by miekg/pkcs11
40e115a85e0196984e45b254c509d74900738bb4
  • Loading branch information
JeremyRand committed Jun 20, 2021
1 parent 0a827eb commit 020e80f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion types.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ static inline CK_VOID_PTR getMechanismParam(CK_MECHANISM_PTR m)
return m->pParameter;
}
static inline CK_VOID_PTR getOAEPSourceData(CK_RSA_PKCS_OAEP_PARAMS_PTR params)
{
return params->pSourceData;
}
*/
import "C"

Expand Down Expand Up @@ -169,7 +174,7 @@ func toMechanism(pMechanism C.CK_MECHANISM_PTR) *pkcs11.Mechanism {
goHashAlg := uint(oaepParams.hashAlg)
goMgf := uint(oaepParams.mgf)
goSourceType := uint(oaepParams.source)
goSourceData := C.GoBytes(unsafe.Pointer(oaepParams.pSourceData), C.int(oaepParams.ulSourceDataLen))
goSourceData := C.GoBytes(unsafe.Pointer(C.getOAEPSourceData(oaepParams)), C.int(oaepParams.ulSourceDataLen))
return pkcs11.NewMechanism(uint(pMechanism.mechanism), pkcs11.NewOAEPParams(goHashAlg, goMgf, goSourceType, goSourceData))
default:
return pkcs11.NewMechanism(uint(pMechanism.mechanism), nil)
Expand Down

0 comments on commit 020e80f

Please sign in to comment.