Closed Bug 480076 Opened 17 years ago Closed 13 years ago

need sample source: how to avoid hard coding SSL cipher suite info

Categories

(NSS :: Documentation, enhancement, P4)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: nelson, Assigned: elio.maldonado.batiz)

Details

Attachments

(2 files, 2 obsolete files)

For years, libSSL has has functions that enable an application to dynamically adjust to new cipher suites as they become available in newer NSS releases, without needing to modify or recompile application source code. This obviates hard coded application tables of attributes for SSL cipher suites. But there has been no code that demonstrates how to use it, so the feature has gone largely (perhaps totally) unused. We need sample code for it. That's the purpose of the attachment. I'd actually like to commit this in a new subdirectory of mozilla/security/nss/cmd. Any objections?
Attachment #364026 - Flags: review?
1 minor correction. The line that reads: ((info.cipherSuite & 0xff00) == 0xff00 ? "SSL2" : ""), should instead read: (SSL_IS_SSL2_CIPHER(info.cipherSuite) ? "SSL2" : ""), I meant to fix that before attaching it.
Attachment #364026 - Flags: review? → review?(emaldona)
Line 45 includes secutil.h a non-public header. This is currently needed because Lines 70 and 79 call SECU_Strerror, from sectools, a tools support library that we don't yet ship and support. Once this dependency is removed the sample should build stand-alone via as simple a makefile target as: listsuites: listsuites.c gcc -Wall -Werror -g $^ -o $@ \ -lnspr4 -lnss3 -lssl3 -I/usr/include/nspr4 -I/usr/include/nss3
Priority: -- → P3
Elio, Was your comment 2 meant to be interpreted as an R- ? If so, please set the review- flag. Thanks.
Assignee: nobody → nelson
Attachment #364026 - Flags: review?(emaldona) → review-
Assignee: nelson → nobody
Since nss 3.13 we have support for localizeable error strings via PORT_ErrorToString. So with these changes $ diff ~/Downloads/listsuites.c ./listsuites.c 45c45 < #include "secutil.h" --- > #include "secport.h" 70c70 < suite, i, SECU_Strerror(err)); --- > suite, i, PORT_ErrorToString(err)); 79c79 < suite, i, SECU_Strerror(err)); --- > suite, i, PORT_ErrorToString(err)); the sample will rely on public headers and only.
Assignee: nobody → emaldona
Attachment #364026 - Attachment is obsolete: true
Attachment #647260 - Flags: review?(kaie)
Attachment #647260 - Attachment description: Source file that demonstrates use if SSL_GetCipherSuiteInfo → Source file that demonstrates use of SSL_GetCipherSuiteInfo
Attachment #647260 - Attachment is obsolete: true
Attachment #647260 - Flags: review?(kaie)
Attachment #647642 - Flags: review?(kaie)
Priority: P3 → P4
Attachment #647642 - Attachment is patch: true
Attachment #647642 - Attachment mime type: text/x-csrc → text/plain
Attachment #647642 - Attachment is patch: false
Please make the replacement that Nelson suggested in comment 1. I read the code and it looks find to me. But this isn't a patch, where do you want this code to live? Without makefile changes this work isn't complete.
Attached patch Patch v4Splinter Review
Attachment #656087 - Flags: review?(emaldona)
Comment on attachment 647642 [details] Demonstrates use of SSL_GetCipherSuiteInfo - updated license r+ but please make the requested changes. I attached a new patch, please feel free to r+ and check it in if you think this is OK. (remember to use "cvs add" on the directory and all new files.)
Attachment #647642 - Flags: review?(kaie) → review+
Attachment #656087 - Flags: review?(emaldona) → review+
Checked in to the trunk: Checking in mozilla/security/nss/cmd/manifest.mn; /cvsroot/mozilla/security/nss/cmd/manifest.mn,v <-- manifest.mn new revision: 1.38; previous revision: 1.37 done RCS file: /cvsroot/mozilla/security/nss/cmd/listsuites/Makefile,v done Checking in mozilla/security/nss/cmd/listsuites/Makefile; /cvsroot/mozilla/security/nss/cmd/listsuites/Makefile,v <-- Makefile initial revision: 1.1 done RCS file: /cvsroot/mozilla/security/nss/cmd/listsuites/listsuites.c,v done Checking in mozilla/security/nss/cmd/listsuites/listsuites.c; /cvsroot/mozilla/security/nss/cmd/listsuites/listsuites.c,v <-- listsuites.c initial revision: 1.1 done RCS file: /cvsroot/mozilla/security/nss/cmd/listsuites/manifest.mn,v done Checking in mozilla/security/nss/cmd/listsuites/manifest.mn; /cvsroot/mozilla/security/nss/cmd/listsuites/manifest.mn,v <-- manifest.mn initial revision: 1.1 done
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: