Skip to content

Commit

Permalink
Remove the 'name' property from the curve info
Browse files Browse the repository at this point in the history
  • Loading branch information
Legrandin committed Aug 17, 2024
1 parent aca0117 commit d2526ee
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 15 deletions.
2 changes: 1 addition & 1 deletion lib/Crypto/PublicKey/ECC.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ def _export_openssh(self, compress):
desc = self._curve.openssh

if desc is None:
raise ValueError("Cannot export %s keys as OpenSSH" % self._curve.name)
raise ValueError("Cannot export %s keys as OpenSSH" % self.curve)
elif desc == "ssh-ed25519":
public_key = self._export_eddsa_public()
comps = (tobytes(desc), tobytes(public_key))
Expand Down
4 changes: 1 addition & 3 deletions lib/Crypto/PublicKey/_curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@
# - context a raw pointer to memory holding a context for all curve operations (can be None)
# - canonical the canonical name of the curve
# - openssh the ASCII string used in OpenSSH id files for public keys on this curve
# - name the ASCII string which is also a valid key in _curves
# - rawlib the reference to the dynamic libary with the low-level functions

class _Curve(object):

def __init__(self, p, b, order, Gx, Gy, G, modulus_bits, oid, context,
canonical, openssh, name, rawlib):
canonical, openssh, rawlib):
self.p = p
self.b = b
self.order = order
Expand All @@ -33,5 +32,4 @@ def __init__(self, p, b, order, Gx, Gy, G, modulus_bits, oid, context,
self.context = context
self.canonical = canonical
self.openssh = openssh
self.name = name
self.rawlib = rawlib
6 changes: 2 additions & 4 deletions lib/Crypto/PublicKey/_edwards.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,8 @@ class EcLib(object):
255,
"1.3.101.112", # RFC8410
None,
"Ed25519", # Used throughout; do not change
"Ed25519",
"ssh-ed25519",
"ed25519",
EcLib)
return ed25519

Expand Down Expand Up @@ -111,8 +110,7 @@ class EcLib(object):
448,
"1.3.101.113", # RFC8410
context,
"Ed448", # Used throughout; do not change
"Ed448",
None,
"ed448",
EcLib)
return ed448
3 changes: 1 addition & 2 deletions lib/Crypto/PublicKey/_montgomery.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ class EcLib(object):
255,
"1.3.101.110", # RFC8410
None,
"Curve25519", # desc: used throughout; do not change
"Curve25519",
None,
"curve25519",
EcLib)
return curve25519
5 changes: 0 additions & 5 deletions lib/Crypto/PublicKey/_nist_ecc.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ def p192_curve():
context,
"NIST P-192",
"ecdsa-sha2-nistp192",
"p192",
EcLib)
return p192

Expand Down Expand Up @@ -129,7 +128,6 @@ def p224_curve():
context,
"NIST P-224",
"ecdsa-sha2-nistp224",
"p224",
EcLib)
return p224

Expand Down Expand Up @@ -168,7 +166,6 @@ def p256_curve():
context,
"NIST P-256",
"ecdsa-sha2-nistp256",
"p256",
EcLib)
return p256

Expand Down Expand Up @@ -207,7 +204,6 @@ def p384_curve():
context,
"NIST P-384",
"ecdsa-sha2-nistp384",
"p384",
EcLib)
return p384

Expand Down Expand Up @@ -246,6 +242,5 @@ def p521_curve():
context,
"NIST P-521",
"ecdsa-sha2-nistp521",
"p521",
EcLib)
return p521

0 comments on commit d2526ee

Please sign in to comment.