diff options
author | nelson%bolyard.com <devnull@localhost> | 2008-09-30 04:00:47 +0000 |
---|---|---|
committer | nelson%bolyard.com <devnull@localhost> | 2008-09-30 04:00:47 +0000 |
commit | 2c0ccc1946a59f39f9fd272cb67403637913c5da (patch) | |
tree | 6441a0158eb080471ef3a754cc05aedf05c39ecf | |
parent | cafbe1f5e2a23b10cca7bc31116c3a2d520a5b12 (diff) | |
download | nss-hg-2c0ccc1946a59f39f9fd272cb67403637913c5da.tar.gz |
Bug 453227: Client certificate installation fails.
Commit patch that was approved for trunk. r=wtc, julien
-rw-r--r-- | security/nss/lib/pkcs7/certread.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/security/nss/lib/pkcs7/certread.c b/security/nss/lib/pkcs7/certread.c index a158facfa..314220953 100644 --- a/security/nss/lib/pkcs7/certread.c +++ b/security/nss/lib/pkcs7/certread.c @@ -330,25 +330,29 @@ notder: /* find the beginning marker */ while ( cl > NS_CERT_HEADER_LEN ) { + int found = 0; if ( !PORT_Strncasecmp((char *)cp, NS_CERT_HEADER, NS_CERT_HEADER_LEN) ) { - cl -= NS_CERT_HEADER_LEN + 1; /* skip char after header */ - cp += NS_CERT_HEADER_LEN + 1; /* as all prior versions did. */ - certbegin = cp; - break; + cl -= NS_CERT_HEADER_LEN; + cp += NS_CERT_HEADER_LEN; + found = 1; } /* skip to next eol */ - do { + while ( cl && ( *cp != '\n' )) { cp++; cl--; - } while ( ( *cp != '\n') && cl ); + } /* skip all blank lines */ - while ( ( *cp == '\n') && cl ) { + while ( cl && ( *cp == '\n' || *cp == '\r' )) { cp++; cl--; } + if (cl && found) { + certbegin = cp; + break; + } } if ( certbegin ) { @@ -361,13 +365,13 @@ notder: } /* skip to next eol */ - do { + while ( cl && ( *cp != '\n' )) { cp++; cl--; - } while ( ( *cp != '\n') && cl ); + } /* skip all blank lines */ - while ( ( *cp == '\n') && cl ) { + while ( cl && ( *cp == '\n' || *cp == '\r' )) { cp++; cl--; } |