Skip to content

SSL: add OID / NID lookup #63647

Closed
Closed

Description

@tiran
BPO 19448
Nosy @pitrou, @giampaolo, @tiran, @dstufft
Files
  • ssl_asn1obj.patch
  • ssl_asn1obj2.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/tiran'
    closed_at = <Date 2013-11-17.19:10:22.637>
    created_at = <Date 2013-10-30.09:55:08.439>
    labels = ['type-feature']
    title = 'SSL: add OID / NID lookup'
    updated_at = <Date 2013-11-22.15:21:03.639>
    user = 'https://github.com/tiran'

    bugs.python.org fields:

    activity = <Date 2013-11-22.15:21:03.639>
    actor = 'python-dev'
    assignee = 'christian.heimes'
    closed = True
    closed_date = <Date 2013-11-17.19:10:22.637>
    closer = 'christian.heimes'
    components = []
    creation = <Date 2013-10-30.09:55:08.439>
    creator = 'christian.heimes'
    dependencies = []
    files = ['32423', '32451']
    hgrepos = []
    issue_num = 19448
    keywords = ['patch']
    message_count = 9.0
    messages = ['201724', '201916', '203151', '203154', '203199', '203200', '203208', '203209', '203784']
    nosy_count = 6.0
    nosy_names = ['janssen', 'pitrou', 'giampaolo.rodola', 'christian.heimes', 'python-dev', 'dstufft']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue19448'
    versions = ['Python 3.4']

    Activity

    1. tiran commented on Oct 30, 2013

      @tiran
      MemberAuthor

      For bpo-17134 I need a decent way to map OIDs to human readable strings and vice versa. OpenSSL has a couple of method for the task, e.g. http://www.openssl.org/docs/crypto/OBJ_nid2obj.html

      The patch implements three ways to lookup NID, SN, LN and OID: by OpenSSL's internal numeric id (NID), by OID or by name:

      >>> ssl.txt2obj("MD5", name=True)
      ASN1Object(nid=4, shortname='MD5', longname='md5', oid='1.2.840.113549.2.5')
      >>> ssl.txt2obj("clientAuth", name=True)
      ASN1Object(nid=130, shortname='clientAuth', longname='TLS Web Client Authentication', oid='1.3.6.1.5.5.7.3.2')
      >>> ssl.txt2obj("1.3.6.1.5.5.7.3.1")
      ASN1Object(nid=129, shortname='serverAuth', longname='TLS Web Server Authentication', oid='1.3.6.1.5.5.7.3.1')
    2. tiran commented on Nov 1, 2013

      @tiran
      MemberAuthor

      Thanks for the feed back! The new patch implements a class with two additional class methods. The low level functions are no longer part of the public API.

    3. tiran commented on Nov 17, 2013

      @tiran
      MemberAuthor

      Does anybody want to do a review of the patch?

    4. pitrou commented on Nov 17, 2013

      @pitrou
      Member

      If it's for bpo-17134, couldn't it remain a private API?

      I'm rather uncomfortable about exposing such things unless we make the ssl module a full-fledged toolbox to handle X509 certificates (and perhaps think a bit more about the APIs). Are there any common use cases?

    5. tiran commented on Nov 17, 2013

      @tiran
      MemberAuthor

      OK, let's keep it as private API for now and maybe make it public in 3.5. I'm going to rename ASN1Object to _ASN1Object, remove the docs and adjust the tests. Agreed?

    6. pitrou commented on Nov 17, 2013

      @pitrou
      Member

      OK, let's keep it as private API for now and maybe make it public in
      3.5. I'm going to rename ASN1Object to _ASN1Object, remove the docs
      and adjust the tests. Agreed?

      Yup.

    7. self-assigned this
      on Nov 17, 2013
    8. python-dev commented on Nov 17, 2013

      python-devmannequin
      Mannequin

      New changeset f43f65038e2a by Christian Heimes in branch 'default':
      Issue bpo-19448: Add private API to SSL module to lookup ASN.1 objects by OID, NID, short name and long name.
      http://hg.python.org/cpython/rev/f43f65038e2a

    9. tiran commented on Nov 17, 2013

      @tiran
      MemberAuthor

      Thanks!

    10. python-dev commented on Nov 22, 2013

      python-devmannequin
      Mannequin

      New changeset 7d914d4b05fe by Christian Heimes in branch 'default':
      Issue bpo-19448: report name / NID in exception message of ASN1Object
      http://hg.python.org/cpython/rev/7d914d4b05fe

    11. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    type-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions