Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark P11KitIter interface stable #589

Open
ueno opened this issue Oct 17, 2023 · 5 comments
Open

Mark P11KitIter interface stable #589

ueno opened this issue Oct 17, 2023 · 5 comments

Comments

@ueno
Copy link
Member

ueno commented Oct 17, 2023

Currently the P11KitIter interface is only exposed when P11_KIT_FUTURE_UNSTABLE_API is defined. Since the interface has been there for many years, it might make sense to declare it to be stable.

A couple of things to consider before doing so:

  • P11_KIT_ITER_WITHOUT_OBJECTS was added as a compatibility measure in 3d54011, as P11KitIter previously only supported enumerating objects. Maybe we could make it no-op
  • There is a recent behavior change (not part of any release yet) regarding the timing to stop iteration when P11_KIT_ITER_WITH_TOKENS is specified; previously we stopped before opening a session, now we stop after that. If we consider this is an ABI break, we might want to bump SONAME
@ZoltanFridrich
Copy link
Contributor

ZoltanFridrich commented Oct 19, 2023

P11_KIT_ITER_WITHOUT_OBJECTS was added as a compatibility measure in 3d54011, as P11KitIter previously only supported enumerating objects. Maybe we could make it no-op

Why would we make it no-op? I thought that when I specify something like WITH_TOKENS it will enumerate both objects and tokens. What if I dont want to enumerate the objects but only the tokens? Unless I imagined this behavior and actually it works differently.

There is a recent behavior change (not part of any release yet) regarding the timing to stop iteration when P11_KIT_ITER_WITH_TOKENS is specified; previously we stopped before opening a session, now we stop after that. If we consider this is an ABI break, we might want to bump SONAME

Is it an ABI break though? The session is opened automatically now but that shouldnt break anything. I believe that anyone who uses such iterator and manually opens the session, their program should still work.

@ueno
Copy link
Member Author

ueno commented Oct 19, 2023

Why would we make it no-op? I thought that when I specify something like WITH_TOKENS it will enumerate both objects and tokens. What if I dont want to enumerate the objects but only the tokens? Unless I imagined this behavior and actually it works differently.

If we don't care about backward compatibility, we could have WITH_OBJECTS instead of WITHOUT_OBJECTS, which would be more intuitive.

Is it an ABI break though? The session is opened automatically now but that shouldnt break anything. I believe that anyone who uses such iterator and manually opens the session, their program should still work.

What if an existing program is written in a way it manually opens a session when stopped at a token and it doesn't support parallel sessions (i.e., CKR_SESSION_PARALLEL_NOT_SUPPORTED will be returned).

@ZoltanFridrich
Copy link
Contributor

If we don't care about backward compatibility, we could have WITH_OBJECTS instead of WITHOUT_OBJECTS, which would be more intuitive.

But WITH_OBJECTS is the default behavior. I see nothing wrong having WITHOUT_OBJECTS. And introducing WITH_OBJECTS would definitely break majority of code using p11_iter. If we would like to do this (which I dont see the reason to) I could do it in a 0.26.0 maybe.

What if an existing program is written in a way it manually opens a session when stopped at a token and it doesn't support parallel sessions (i.e., CKR_SESSION_PARALLEL_NOT_SUPPORTED will be returned).

Alright, it breaks the ABI then.

@ueno
Copy link
Member Author

ueno commented Oct 19, 2023

Well, I'm talking about using this opportunity (i.e., removing P11_KIT_FUTURE_UNSTABLE_API guard) to introduce backward incompatible changes. Currently it's user's responsibility to define the macro to access the unstable API. Once we remove P11_KIT_FUTURE_UNSTABLE_API it would become our responsibility to maintain the compatibility.

@ueno
Copy link
Member Author

ueno commented Oct 19, 2023

So my suggestion here is like this: for 0.25.1, include a compatibility measure (like #590); in the future, when we bump the SONAME, remove it and WITHOUT_OBJECTS altogether.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants