41 Commits

Author SHA1 Message Date
jdennis%redhat.com
caf62c0df9 commit for release 0.12, see doc/Changelog for details.
Major enhancement is PKCS12 support.


git-svn-id: svn://10.0.0.236/trunk@262367 18797224-902f-48f8-a5cc-f745e15eee43
2011-06-06 15:21:13 +00:00
jdennis%redhat.com
a3e2518d59 Resolves Red Hat bugzilla #689059
Add family parameter to Socket constructors in examples and doc.
Mark implicit family parameter as deprecated.
Raise exception if Socket family does not match NetworkAddress family.
Add --server-subject to setup_certs.py (made testing IPv6 easier without DNS)


git-svn-id: svn://10.0.0.236/trunk@262177 18797224-902f-48f8-a5cc-f745e15eee43
2011-04-10 15:21:57 +00:00
jdennis%redhat.com
d31afe8969 remove debug flags
git-svn-id: svn://10.0.0.236/trunk@261956 18797224-902f-48f8-a5cc-f745e15eee43
2011-02-21 17:12:53 +00:00
jdennis%redhat.com
98ff5efb56 Version 0.11.0, add support for IPv6
git-svn-id: svn://10.0.0.236/trunk@261955 18797224-902f-48f8-a5cc-f745e15eee43
2011-02-21 17:09:30 +00:00
jdennis%redhat.com
5c1db556f4 remove dangling reference to deleted file lib/httplib.py
git-svn-id: svn://10.0.0.236/trunk@261265 18797224-902f-48f8-a5cc-f745e15eee43
2010-09-22 18:57:57 +00:00
jdennis%redhat.com
d14eae3582 add test/setup_certs.py to MANIFEST
git-svn-id: svn://10.0.0.236/trunk@261042 18797224-902f-48f8-a5cc-f745e15eee43
2010-08-13 18:33:20 +00:00
jdennis%redhat.com
73ad46b56e Minor cleanup before 0.10 release
git-svn-id: svn://10.0.0.236/trunk@261041 18797224-902f-48f8-a5cc-f745e15eee43
2010-08-13 18:29:28 +00:00
jdennis%redhat.com
41342251f1 Add utility program to setup the certificate database
with test certificates


git-svn-id: svn://10.0.0.236/trunk@260945 18797224-902f-48f8-a5cc-f745e15eee43
2010-08-03 14:39:47 +00:00
jdennis%redhat.com
b084a3bc39 * The following classes were added:
InitParameters
      InitContext

  * The following module functions were added:
      nss.nss.nss_initialize()
      nss.nss.nss_init_context()
      nss.nss.nss_shutdown_context()
      nss.nss.nss_init_flags()

  * The following constants were added:
      NSS_INIT_READONLY
      NSS_INIT_NOCERTDB
      NSS_INIT_NOMODDB
      NSS_INIT_FORCEOPEN
      NSS_INIT_NOROOTINIT
      NSS_INIT_OPTIMIZESPACE
      NSS_INIT_PK11THREADSAFE
      NSS_INIT_PK11RELOAD
      NSS_INIT_NOPK11FINALIZE
      NSS_INIT_RESERVED
      NSS_INIT_COOPERATE


git-svn-id: svn://10.0.0.236/trunk@260885 18797224-902f-48f8-a5cc-f745e15eee43
2010-07-25 22:40:38 +00:00
jdennis%redhat.com
d638d129e0 add nss_is_initialized()
git-svn-id: svn://10.0.0.236/trunk@260802 18797224-902f-48f8-a5cc-f745e15eee43
2010-07-16 15:47:06 +00:00
jdennis%redhat.com
cbd6b189a3 add comments to ChangeLog
git-svn-id: svn://10.0.0.236/trunk@260787 18797224-902f-48f8-a5cc-f745e15eee43
2010-07-15 20:41:50 +00:00
jdennis%redhat.com
fc1c96ae60 Remove nss_init_nodb() from nss/__init__.py becuase it was preventing
subsequent calls to nss_init() with a database from opening the database
and using it.

Clean up cruft in verify_server.py


git-svn-id: svn://10.0.0.236/trunk@260672 18797224-902f-48f8-a5cc-f745e15eee43
2010-07-08 15:30:05 +00:00
jdennis%redhat.com
ebf8a069d5 fix doc so DN is linked to definition
git-svn-id: svn://10.0.0.236/trunk@260595 18797224-902f-48f8-a5cc-f745e15eee43
2010-06-29 15:10:49 +00:00
jdennis%redhat.com
d60083d124 Invoke nss_init_nodb() when nss modules loads, this prevents segfaults
in NSS if Python programmer forgot to call one of the NSS
initialization routines.

Rename the classes X500Name, X500RDN, X500AVA to DN, RDN, AVA
respectively.

DN and RDN objects now return a list of their contents when indexed by
type, this is to support multi-valued items.

Fix bug where AVA object's string representation did not include it's
type.

Enhance test/test_cert_components.py unit test to test for above
changes.


git-svn-id: svn://10.0.0.236/trunk@260568 18797224-902f-48f8-a5cc-f745e15eee43
2010-06-24 19:26:08 +00:00
jdennis%redhat.com
a51c2e22e5 update ChangeLog
git-svn-id: svn://10.0.0.236/trunk@260468 18797224-902f-48f8-a5cc-f745e15eee43
2010-06-14 14:47:21 +00:00
jdennis%redhat.com
b9dad8631c - Fix incomplete read bug (due to read ahead buffer bookkeeping).
- Remove python-nss specific httplib.py, no longer needed
  python-nss now compatible with standard library
- Rewrite httplib_example.py to use standard library and illustrate
  ssl, non-ssl, connection class, http class usage


git-svn-id: svn://10.0.0.236/trunk@260467 18797224-902f-48f8-a5cc-f745e15eee43
2010-06-14 14:41:33 +00:00
jdennis%redhat.com
e7ec94eeab add nss.cert_usage_flags(), remove local implementation in ssl_example.py
cert_dump.py now takes command line arg for cert format


git-svn-id: svn://10.0.0.236/trunk@260450 18797224-902f-48f8-a5cc-f745e15eee43
2010-06-09 20:04:36 +00:00
jdennis%redhat.com
95bd77f2c1 Add format_lines() & format() methods to the new certificate extension objects.
Add printing of certificate extensions.
Add BasicContstraints certificate extension.
Fix several reference counting and memory problems discovered with valgrind.


git-svn-id: svn://10.0.0.236/trunk@260430 18797224-902f-48f8-a5cc-f745e15eee43
2010-06-06 15:05:51 +00:00
jdennis%redhat.com
a931bd8272 remove BasicConstraints_new_from_CERTBasicConstraints(), not used
fix static declaration on NewType_new_from_NSSType template


git-svn-id: svn://10.0.0.236/trunk@260413 18797224-902f-48f8-a5cc-f745e15eee43
2010-06-02 21:38:15 +00:00
jdennis%redhat.com
d5999800c2 add BasicContstraints extension object
git-svn-id: svn://10.0.0.236/trunk@260412 18797224-902f-48f8-a5cc-f745e15eee43
2010-06-02 21:29:50 +00:00
jdennis%redhat.com
b8f7de9c41 Add attribution for Miloslav's patches and help to ChangeLog
git-svn-id: svn://10.0.0.236/trunk@260411 18797224-902f-48f8-a5cc-f745e15eee43
2010-06-02 19:43:03 +00:00
jdennis%redhat.com
ca1713d6a9 - apply patch from Miloslav Trmač for further ref counting and other clean-up
- remove following unused functions:
  ascii_encoded_strlen()
  escape_ascii_string()
  der_integer_secitem_to_pylong()
  bitstr_table_to_tuple_all()
  crl_reason_bitstr_to_tuple_all()
  key_usage_bitstr_to_tuple_all()
  decode_bit_string()


git-svn-id: svn://10.0.0.236/trunk@260406 18797224-902f-48f8-a5cc-f745e15eee43
2010-06-01 18:59:42 +00:00
jdennis%redhat.com
d4b062db40 Modify install_doc to include ChangeLog, test scripts and lib files.
Some of this logic had been in the spec file, but that requires more
manual maintenance of the spec file than is prudent.


git-svn-id: svn://10.0.0.236/trunk@260405 18797224-902f-48f8-a5cc-f745e15eee43
2010-06-01 16:44:35 +00:00
jdennis%redhat.com
bcb28d2637 add doc/examples/cert_dump.py to MANIFEST
add additional comments to Changelog


git-svn-id: svn://10.0.0.236/trunk@260391 18797224-902f-48f8-a5cc-f745e15eee43
2010-05-28 15:13:30 +00:00
jdennis%redhat.com
1a8c91dea8 add test/test_cert_components.py to MANIFEST
git-svn-id: svn://10.0.0.236/trunk@260390 18797224-902f-48f8-a5cc-f745e15eee43
2010-05-28 14:57:51 +00:00
jdennis%redhat.com
a79a3d94c5 update digest_test
replace sec_oid_tag_str() with oid_str() due to API cleanup
data_to_hex() API changed to use default separator, explicitly set it to None
change string quotes from double to single for consistency


git-svn-id: svn://10.0.0.236/trunk@260389 18797224-902f-48f8-a5cc-f745e15eee43
2010-05-28 13:31:11 +00:00
jdennis%redhat.com
be7c7f7a1e Clean up reference counting problems.
Add support for cyclic garbage collection.
Use thread local storage.
General clean up for names, parameters, etc.


git-svn-id: svn://10.0.0.236/trunk@260384 18797224-902f-48f8-a5cc-f745e15eee43
2010-05-27 21:59:26 +00:00
jdennis%redhat.com
8e16474f20 * Unicode objects now accepted as well as str objects for
interfaces expecting a string.

  * Sockets were enhanced thusly:
      - Threads will now yield during blocking IO.
      - Socket.makefile() reimplemented
	  file object methods that had been missing (readlines(), sendall(),
	  and iteration) were implemented, makefile now just returns the same
	  Socket object but increments an "open" ref count. Thus a Socket
	  object behaves like a file object and must be closed once for each
	  makefile() call before it's actually closed.
      - Sockets now support the iter protocol
      - Add Socket.readlines(), Socket.sendall()

  * The following classes were added:
      AuthKeyID
      CRLDistributionPoint
      CRLDistributionPts
      CertificateExtension
      GeneralName
      SignedCRL
      X500AVA
      X500Name
      X500RDN

  * The following module functions were added:
      nss.nss.cert_crl_reason_from_name()
      nss.nss.cert_crl_reason_name()
      nss.nss.cert_general_name_type_from_name()
      nss.nss.cert_general_name_type_name()
      nss.nss.decode_der_crl()
      nss.nss.der_universal_secitem_fmt_lines()
      nss.nss.import_crl()
      nss.nss.make_line_pairs()
      nss.nss.oid_dotted_decimal()
      nss.nss.oid_str()
      nss.nss.oid_tag()
      nss.nss.oid_tag_name()
      nss.nss.read_der_from_file()
      nss.nss.x509_alt_name()
      nss.nss.x509_ext_key_usage()
      nss.nss.x509_key_usage()

  * The following class methods and properties were added:
    Note: it's a method if the name is suffixed with (), a propety otherwise
      Socket.next()
      Socket.readlines()
      Socket.sendall()
      SSLSocket.next()
      SSLSocket.readlines()
      SSLSocket.sendall()
      AuthKeyID.key_id
      AuthKeyID.serial_number
      AuthKeyID.get_general_names()
      CRLDistributionPoint.issuer
      CRLDistributionPoint.get_general_names()
      CRLDistributionPoint.get_reasons()
      CertDB.find_crl_by_cert()
      CertDB.find_crl_by_name()
      Certificate.extensions
      CertificateExtension.critical
      CertificateExtension.name
      CertificateExtension.oid
      CertificateExtension.oid_tag
      CertificateExtension.value
      GeneralName.type_enum
      GeneralName.type_name
      GeneralName.type_string
      SecItem.der_to_hex()
      SecItem.get_oid_sequence()
      SecItem.to_hex()
      SignedCRL.delete_permanently()
      X500AVA.oid
      X500AVA.oid_tag
      X500AVA.value
      X500AVA.value_str
      X500Name.cert_uid
      X500Name.common_name
      X500Name.country_name
      X500Name.dc_name
      X500Name.email_address
      X500Name.locality_name
      X500Name.org_name
      X500Name.org_unit_name
      X500Name.state_name
      X500Name.add_rdn()
      X500Name.has_key()
      X500RDN.has_key()

  * The following module functions were removed:
    Note: use nss.nss.oid_tag() instead
      nss.nss.sec_oid_tag_from_name()
      nss.nss.sec_oid_tag_name()
      nss.nss.sec_oid_tag_str()

  * The following files were added:
      doc/examples/cert_dump.py
      test/test_cert_components.py


git-svn-id: svn://10.0.0.236/trunk@260296 18797224-902f-48f8-a5cc-f745e15eee43
2010-05-13 14:48:02 +00:00
jdennis%redhat.com
514d140fd0 Fix several problems in auth_certificate_callback().
Add utility to print out SSLUsage flags.
Set the auth_certificate_callback in the client to verify the server,
it was a big problem that had been failing to verify the server cert.
Add new utility to verify a server based on the auth_certificate_callback().


git-svn-id: svn://10.0.0.236/trunk@260027 18797224-902f-48f8-a5cc-f745e15eee43
2010-03-24 16:53:07 +00:00
jdennis%redhat.com
b148275e0b allow building with older versions of python (e.g. 2.4)
and older versions of NSS


git-svn-id: svn://10.0.0.236/trunk@258989 18797224-902f-48f8-a5cc-f745e15eee43
2009-11-14 00:08:32 +00:00
jdennis%redhat.com
a227bd2394 Remove hardcoded names from Trace* macros, use __FUNCTION__ instead
git-svn-id: svn://10.0.0.236/trunk@258452 18797224-902f-48f8-a5cc-f745e15eee43
2009-09-22 14:05:38 +00:00
jdennis%redhat.com
1c53881cc7 make all *_new_from_* names canonical (PythonType _new_from_ NSSType)
git-svn-id: svn://10.0.0.236/trunk@258451 18797224-902f-48f8-a5cc-f745e15eee43
2009-09-22 13:46:22 +00:00
jdennis%redhat.com
534bfca231 * The following methods, properties and functions were added:
SecItem.type SecItem.len, SecItem.data
  PK11SymKey.key_data, PK11SymKey.key_length, PK11SymKey.slot
  create_context_by_sym_key
  param_from_iv
  generate_new_param
  get_iv_length
  get_block_size
  get_pad_mechanism
* SecItem's now support indexing and slicing on their data
* Clean up parsing and parameter validation of variable arg functions


git-svn-id: svn://10.0.0.236/trunk@258428 18797224-902f-48f8-a5cc-f745e15eee43
2009-09-21 19:48:11 +00:00
jdennis%redhat.com
ebdf144458 add wrap_sym_key() and unwrap_sym_key()
git-svn-id: svn://10.0.0.236/trunk@258422 18797224-902f-48f8-a5cc-f745e15eee43
2009-09-19 15:00:58 +00:00
jdennis%redhat.com
c548dd5070 expand support for digests (hashes)
add support for symmetric cipher encryption/decryption
add test code for above
some minor clean up in other areas


git-svn-id: svn://10.0.0.236/trunk@258418 18797224-902f-48f8-a5cc-f745e15eee43
2009-09-18 20:24:57 +00:00
jdennis%redhat.com
c6949ba1d4 fix bug #510343 client_auth_data_callback seg faults if False
is returned from callback


git-svn-id: svn://10.0.0.236/trunk@257676 18797224-902f-48f8-a5cc-f745e15eee43
2009-07-09 12:05:56 +00:00
jdennis%redhat.com
25f00cded3 restore ssl.nss_init and ssl.nss_shutdown but make them deprecated
add __version__ string to nss module


git-svn-id: svn://10.0.0.236/trunk@257618 18797224-902f-48f8-a5cc-f745e15eee43
2009-07-01 19:40:22 +00:00
jdennis%redhat.com
2928c416b8 add binding for NSS_NoDB_Init(), bug #509002
move nss_init and nss_shutdown from ssl module to nss module


git-svn-id: svn://10.0.0.236/trunk@257610 18797224-902f-48f8-a5cc-f745e15eee43
2009-06-30 21:43:30 +00:00
jdennis%redhat.com
aa3835990e Initial import of python NSS binding
git-svn-id: svn://10.0.0.236/trunk@257394 18797224-902f-48f8-a5cc-f745e15eee43
2009-06-04 18:49:50 +00:00
jdennis%redhat.com
84adbd5aad Initial import of python NSS binding code
git-svn-id: svn://10.0.0.236/trunk@257393 18797224-902f-48f8-a5cc-f745e15eee43
2009-06-04 18:48:45 +00:00
jdennis%redhat.com
d2b9456f33 Begin import of python nss binding, create initial root directory.
Add only initial build script to verify newly assigned CVS commit privs work.


git-svn-id: svn://10.0.0.236/trunk@257392 18797224-902f-48f8-a5cc-f745e15eee43
2009-06-04 15:52:25 +00:00