Changeset 561 for trunk/src/network/ssl/qsslerror.cpp
- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/src/network/ssl/qsslerror.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information ([email protected]) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation ([email protected]) 5 6 ** 6 7 ** This file is part of the QtNetwork module of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you 37 ** @nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 47 47 48 48 \reentrant 49 \ingroup io49 \ingroup 50 50 \ingroup ssl 51 51 \inmodule QtNetwork … … 92 92 93 93 #include "qsslerror.h" 94 94 95 #ifndef QT_NO_DEBUG_STREAM 95 96 #include <QtCore/qdebug.h> … … 106 107 107 108 /*! 108 Constructs a QSslError object. The two optional arguments specify the \a 109 Constructs a QSslError object with no error and default certificate. 110 111 */ 112 113 // RVCT compiler in debug build does not like about default values in const- 114 // So as an workaround we define all constructor overloads here explicitly 115 QSslError::QSslError() 116 : d(new QSslErrorPrivate) 117 { 118 d->error = QSslError::NoError; 119 d->certificate = QSslCertificate(); 120 } 121 122 /*! 123 Constructs a QSslError object. The argument specifies the \a 124 error that occurred. 125 126 */ 127 QSslError::QSslError(SslError error) 128 : d(new QSslErrorPrivate) 129 { 130 d->error = error; 131 d->certificate = QSslCertificate(); 132 } 133 134 /*! 135 Constructs a QSslError object. The two arguments specify the \a 109 136 error that occurred, and which \a certificate the error relates to. 110 137 … … 124 151 : d(new QSslErrorPrivate) 125 152 { 126 *d = *other.d;153 *d; 127 154 } 128 155 … … 132 159 QSslError::~QSslError() 133 160 { 134 delete d;135 161 } 136 162 … … 142 168 QSslError &QSslError::operator=(const QSslError &other) 143 169 { 144 *d = *other.d;170 *d; 145 171 return *this; 146 172 } … … 185 211 switch (d->error) { 186 212 case NoError: 187 errStr = Q Object::tr(QT_TRANSLATE_NOOP(QSslError, "No error"));213 errStr = Q); 188 214 break; 189 215 case UnableToGetIssuerCertificate: 190 errStr = Q Object::tr(QT_TRANSLATE_NOOP(QSslError, "The issuer certificate could not be found"));216 errStr = Q); 191 217 break; 192 218 case UnableToDecryptCertificateSignature: 193 errStr = Q Object::tr(QT_TRANSLATE_NOOP(QSslError, "The certificate signature could not be decrypted"));219 errStr = Q); 194 220 break; 195 221 case UnableToDecodeIssuerPublicKey: 196 errStr = Q Object::tr(QT_TRANSLATE_NOOP(QSslError, "The public key in the certificate could not be read"));222 errStr = Q); 197 223 break; 198 224 case CertificateSignatureFailed: 199 errStr = Q Object::tr(QT_TRANSLATE_NOOP(QSslError, "The signature of the certificate is invalid"));225 errStr = Q); 200 226 break; 201 227 case CertificateNotYetValid: 202 errStr = Q Object::tr(QT_TRANSLATE_NOOP(QSslError, "The certificate is not yet valid"));228 errStr = Q); 203 229 break; 204 230 case CertificateExpired: 205 errStr = Q Object::tr(QT_TRANSLATE_NOOP(QSslError, "The certificate has expired"));231 errStr = Q); 206 232 break; 207 233 case InvalidNotBeforeField: 208 errStr = Q Object::tr(QT_TRANSLATE_NOOP(QSslError, "The certificate's notBefore field contains an invalid time"));234 errStr = Q); 209 235 break; 210 236 case InvalidNotAfterField: 211 errStr = Q Object::tr(QT_TRANSLATE_NOOP(QSslError, "The certificate's notAfter field contains an invalid time"));237 errStr = Q); 212 238 break; 213 239 case SelfSignedCertificate: 214 errStr = Q Object::tr(QT_TRANSLATE_NOOP(QSslError, "The certificate is self-signed, and untrusted"));240 errStr = Q); 215 241 break; 216 242 case SelfSignedCertificateInChain: 217 errStr = Q Object::tr(QT_TRANSLATE_NOOP(QSslError, "The root certificate of the certificate chain is self-signed, and untrusted"));243 errStr = Q); 218 244 break; 219 245 case UnableToGetLocalIssuerCertificate: 220 errStr = Q Object::tr(QT_TRANSLATE_NOOP(QSslError, "The issuer certificate of a locally looked up certificate could not be found"));246 errStr = Q); 221 247 break; 222 248 case UnableToVerifyFirstCertificate: 223 errStr = Q Object::tr(QT_TRANSLATE_NOOP(QSslError, "No certificates could be verified"));249 errStr = Q); 224 250 break; 225 251 case InvalidCaCertificate: 226 errStr = Q Object::tr(QT_TRANSLATE_NOOP(QSslError, "One of the CA certificates is invalid"));252 errStr = Q); 227 253 break; 228 254 case PathLengthExceeded: 229 errStr = Q Object::tr(QT_TRANSLATE_NOOP(QSslError, "The basicConstraints pathlength parameter has been exceeded"));255 errStr = Q); 230 256 break; 231 257 case InvalidPurpose: 232 errStr = Q Object::tr(QT_TRANSLATE_NOOP(QSslError, "The supplied certificate is unsuited for this purpose"));258 errStr = Q); 233 259 break; 234 260 case CertificateUntrusted: 235 errStr = Q Object::tr(QT_TRANSLATE_NOOP(QSslError, "The root CA certificate is not trusted for this purpose"));261 errStr = Q); 236 262 break; 237 263 case CertificateRejected: 238 errStr = Q Object::tr(QT_TRANSLATE_NOOP(QSslError, "The root CA certificate is marked to reject the specified purpose"));264 errStr = Q); 239 265 break; 240 266 case SubjectIssuerMismatch: // hostname mismatch 241 errStr = QObject::tr(QT_TRANSLATE_NOOP(QSslError, 242 "The current candidate issuer certificate was rejected because its" 243 " subject name did not match the issuer name of the current certificate")); 267 errStr = QSslSocket::tr("The current candidate issuer certificate was rejected because its" 268 " subject name did not match the issuer name of the current certificate"); 244 269 break; 245 270 case AuthorityIssuerSerialNumberMismatch: 246 errStr = Q Object::tr(QT_TRANSLATE_NOOP(QSslError,"The current candidate issuer certificate was rejected because"247 248 " authority key identifier of the current certificate"));271 errStr = Q"The current candidate issuer certificate was rejected because" 272 " its issuer name and serial number was present and did not match the" 273 ); 249 274 break; 250 275 case NoPeerCertificate: 251 errStr = Q Object::tr(QT_TRANSLATE_NOOP(QSslError, "The peer did not present any certificate"));276 errStr = Q); 252 277 break; 253 278 case HostNameMismatch: 254 errStr = QObject::tr(QT_TRANSLATE_NOOP(QSslError, 255 "The host name did not match any of the valid hosts" 256 " for this certificate")); 279 errStr = QSslSocket::tr("The host name did not match any of the valid hosts" 280 " for this certificate"); 257 281 break; 258 282 case NoSslSupport: 259 283 break; 260 284 default: 261 errStr = Q Object::tr(QT_TRANSLATE_NOOP(QSslError, "Unknown error"));285 errStr = Q); 262 286 break; 263 287 }
Note:
See TracChangeset
for help on using the changeset viewer.