Skip to content
This repository was archived by the owner on Apr 20, 2025. It is now read-only.

remove overlapping slots from AbstractKey subclasses #189

Closed
wants to merge 1 commit into from

Conversation

ariebovenberg
Copy link
Contributor

Hi there!

PublicKey and PrivateKey both define the n and e slots, which are already present in their base class. This reduces the benefits of having slots.

$ slotscheck -m rsa -v
ERROR: 'rsa.key:PrivateKey' defines overlapping slots.
       - e (rsa.key:AbstractKey)
       - n (rsa.key:AbstractKey)
ERROR: 'rsa.key:PublicKey' defines overlapping slots.
       - e (rsa.key:AbstractKey)
       - n (rsa.key:AbstractKey)

The Python docs say:

If a class defines a slot also defined in a base class, the instance variable defined by the base class slot is inaccessible (except by retrieving its descriptor directly from the base class). This renders the meaning of the program undefined.

@sybrenstuvel
Copy link
Owner

Thanks! This was merged in 3b31182

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Jul 24, 2022
## Version 4.9 - release 2022-07-20

- Remove debug logging from `rsa/key.py`
  ([#194](sybrenstuvel/python-rsa#194)).
- Remove overlapping slots in `PrivateKey` and `PublicKey`.
  ([#189](sybrenstuvel/python-rsa#189)).
- Do not include CHANGELOG/LICENSE/README.md in wheel
  ([#191](sybrenstuvel/python-rsa#191)).
- Fixed Key Generation Unittest: Public and Private keys are assigned the wrong way around
  ([#188](sybrenstuvel/python-rsa#188)).
mtremer pushed a commit to ipfire/ipfire-2.x that referenced this pull request Nov 11, 2022
- Updated from version 4.8 to 4.9
- Update of rootfile
- Changelog
    ## Version 4.9 - release 2022-07-20
	- Remove debug logging from `rsa/key.py`
	  ([#194](sybrenstuvel/python-rsa#194)).
	- Remove overlapping slots in `PrivateKey` and `PublicKey`.
	  ([#189](sybrenstuvel/python-rsa#189)).
	- Do not include CHANGELOG/LICENSE/README.md in wheel
	  ([#191](sybrenstuvel/python-rsa#191)).
	- Fixed Key Generation Unittest: Public and Private keys are assigned the wrong way around
	  ([#188](sybrenstuvel/python-rsa#188)).

Tested-by: Adolf Belka <[email protected]>
Signed-off-by: Adolf Belka <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants