Dan McDonald wrote: > Hello. > > I *know* that one is suppoed to have one open PKCS#11 session per slot and > per thread if you have a multithreaded PKCS#11 app. What's less clear to me > is if: > > Its been a long time since I worked on the *implementation* of PKCS#11, but...
> - C_Initialize() is done per-thread or prior to thread creation. > (I'd suspect once prior to threads, but I'm not sure, hence I'm > asking.) > I think once per app. I suspect doing it more than once might be incredibly destructive -- I believe part of the intention here is that C_Initialize can be used to initialize global locks, and such. > - What about C_GetSlotList()? My inituition says this is safe either > way, but there are no clear docs. > I think its safe either way. And for the record, I don't recall any rule about one session per thread in the PKCS#11 specs. I *do* think that it would be incorrect for an MT app to issue multiple simultaneous operations against a single session, however. That said, I also have a hard time imagining a situation where you'd use multiple threads with just a single session. > And if someone says, "Go read PKCS#11 v2.20", I will shoot you. :) > I won't say it, you already have. :-) -- Garrett > Seriously, I was hoping to avoid reading that tome, but I will begrudgingly. > > Thanks, > Dan > _______________________________________________ > crypto-discuss mailing list > crypto-discuss at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/crypto-discuss >