merge heads IOS-1824
authorXavier Algarra <xavier@pep-project.org>
Mon, 02 Mar 2020 02:39:17 +0100
branchIOS-1824
changeset 12009fea8ae61c64e
parent 12008 2321e9beb9ec
parent 12007 c3b78d7ab9f4
child 12018 c1556ed6456e
child 12035 f2fd202a9a63
merge heads
     1.1 --- a/pEpForiOS/Error/DisplayUserError.swift	Mon Mar 02 02:38:54 2020 +0100
     1.2 +++ b/pEpForiOS/Error/DisplayUserError.swift	Mon Mar 02 02:39:17 2020 +0100
     1.3 @@ -41,6 +41,10 @@
     1.4          /// Any verification error in the login view, like "invalid email"
     1.5          case loginValidationError
     1.6  
     1.7 +        /// The server requested a client certificate, but none was provided or it did
     1.8 +        /// match the server's expectation.
     1.9 +        case clientCertificateError
    1.10 +
    1.11          /// Use this only for errors that are not known to DisplayUserError yet and thus can not
    1.12          /// be categorized
    1.13          case unknownError
    1.14 @@ -59,6 +63,7 @@
    1.15                   .brokenServerConnectionSmtp,
    1.16                   .messageNotSent,
    1.17                   .loginValidationError,
    1.18 +                 .clientCertificateError,
    1.19                   .unknownError:
    1.20                  return true
    1.21              }
    1.22 @@ -100,6 +105,8 @@
    1.23                  break
    1.24              case .badResponse(_):
    1.25                  break
    1.26 +            case .sslPeerCertUnknown:
    1.27 +                break
    1.28              }
    1.29          } else if let imapError = error as? ImapSyncOperationError {
    1.30              type = DisplayUserError.type(forError: imapError)
    1.31 @@ -120,6 +127,8 @@
    1.32                  break
    1.33              case .actionFailed:
    1.34                  break
    1.35 +            case .sslPeerCertUnknown:
    1.36 +                break
    1.37              }
    1.38          } else if let oauthInternalError = error as? OAuth2AuthViewModelError {
    1.39              type = DisplayUserError.type(forError: oauthInternalError)
    1.40 @@ -172,6 +181,8 @@
    1.41              return .brokenServerConnectionSmtp
    1.42          case .badResponse:
    1.43              return .internalError
    1.44 +        case .sslPeerCertUnknown:
    1.45 +            return .clientCertificateError
    1.46          }
    1.47      }
    1.48  
    1.49 @@ -195,6 +206,8 @@
    1.50              return .internalError
    1.51          case .actionFailed:
    1.52              return .internalError
    1.53 +        case .sslPeerCertUnknown:
    1.54 +            return .clientCertificateError
    1.55          }
    1.56      }
    1.57  
    1.58 @@ -326,6 +339,10 @@
    1.59                  "Validation Error",
    1.60                  comment:"Error title for validation errors on login screen")
    1.61  
    1.62 +        case .clientCertificateError:
    1.63 +            return NSLocalizedString("Login Failed",
    1.64 +                                     comment: "Title of error alert shown to the user for client certificate problems")
    1.65 +
    1.66          case .unknownError:
    1.67              // We have an error that is not known to us.
    1.68              // All we can do is pass its description.
    1.69 @@ -377,6 +394,9 @@
    1.70              // We have an error that is not known to us.
    1.71              // All we can do is pass its description.
    1.72              return foreignDescription
    1.73 +        case .clientCertificateError:
    1.74 +            return NSLocalizedString("The client certificate was rejected by the server",
    1.75 +                                     comment: "Error message shown to the user on problems with the client certificate")
    1.76          }
    1.77      }
    1.78  }
     2.1 --- a/pEpForiOS/UI/BaseClasses/BaseTableViewController.swift	Mon Mar 02 02:38:54 2020 +0100
     2.2 +++ b/pEpForiOS/UI/BaseClasses/BaseTableViewController.swift	Mon Mar 02 02:39:17 2020 +0100
     2.3 @@ -131,6 +131,8 @@
     2.4                  break
     2.5              case .badResponse(_):
     2.6                  break
     2.7 +            case .sslPeerCertUnknown:
     2.8 +                break
     2.9              }
    2.10          } else if let imapError = error as? ImapSyncOperationError {
    2.11              switch imapError {
    2.12 @@ -150,6 +152,8 @@
    2.13                  break
    2.14              case .actionFailed:
    2.15                  break
    2.16 +            case .sslPeerCertUnknown:
    2.17 +                break
    2.18              }
    2.19          }
    2.20          let showed = appConfig.showedAccountsError[extraInfo]
     3.1 --- a/pEpForiOS/UI/BaseClasses/BaseViewController.swift	Mon Mar 02 02:38:54 2020 +0100
     3.2 +++ b/pEpForiOS/UI/BaseClasses/BaseViewController.swift	Mon Mar 02 02:39:17 2020 +0100
     3.3 @@ -68,6 +68,8 @@
     3.4                  break
     3.5              case .badResponse(_):
     3.6                  break
     3.7 +            case .sslPeerCertUnknown:
     3.8 +                break
     3.9              }
    3.10          } else if let imapError = error as? ImapSyncOperationError {
    3.11              switch imapError {
    3.12 @@ -87,6 +89,8 @@
    3.13                  break
    3.14              case .actionFailed:
    3.15                  break
    3.16 +            case .sslPeerCertUnknown:
    3.17 +                break
    3.18              }
    3.19          }
    3.20          let showed = appConfig.showedAccountsError[extraInfo]
     4.1 --- a/pEpForiOS/UI/EmailDisplay/EmailDetailView/EmailDetailViewController.swift	Mon Mar 02 02:38:54 2020 +0100
     4.2 +++ b/pEpForiOS/UI/EmailDisplay/EmailDetailView/EmailDetailViewController.swift	Mon Mar 02 02:39:17 2020 +0100
     4.3 @@ -163,7 +163,6 @@
     4.4          viewModel?.delegate = self
     4.5          setupCollectionView()
     4.6          registerNotifications()
     4.7 -//        setupToolbar()
     4.8          doOnce = { [weak self] in
     4.9              guard let me = self else {
    4.10                  Log.shared.errorAndCrash("Lost myself")