~ubuntu-branches/ubuntu/raring/gnome-online-accounts/raring-proposed

« back to all changes in this revision

Viewing changes to src/goabackend/goautils.c

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2013-03-21 13:22:10 UTC
  • Revision ID: package-import@ubuntu.com-20130321132210-9gouq9rhdvlrm4g7
Tags: 3.6.2-1ubuntu1
* SECURITY UPDATE: incorrect ssl cert validation (LP: #1117411)
  - debian/patches/CVE-2013-0240.patch: properly validate ssl certs and
    fix cancellation in src/goa/goaenums.h, src/goa/goaerror.c,
    src/goabackend/goaewsclient.c, src/goabackend/goaewsclient.h,
    src/goabackend/goaexchangeprovider.c,
    src/goabackend/goagoogleprovider.c,
    src/goabackend/goahttpclient.*, src/goabackend/goautils.*,
    src/goabackend/goawebview.c.
  - debian/libgoa-1.0-0.symbols: updated with new symbol.
  - CVE-2013-0240
  - CVE-2013-1799

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
2
2
/*
3
 
 * Copyright (C) 2012 Red Hat, Inc.
 
3
 * Copyright (C) 2012, 2013 Red Hat, Inc.
4
4
 *
5
5
 * This library is free software; you can redistribute it and/or
6
6
 * modify it under the terms of the GNU Lesser General Public
442
442
  g_free (group);
443
443
  g_free (path);
444
444
}
 
445
 
 
446
void
 
447
goa_utils_set_error_ssl (GError **err, GTlsCertificateFlags flags)
 
448
{
 
449
  const gchar *error_msg;
 
450
 
 
451
  switch (flags)
 
452
    {
 
453
    case G_TLS_CERTIFICATE_UNKNOWN_CA:
 
454
      error_msg = _("The signing certificate authority is not known.");
 
455
      break;
 
456
 
 
457
    case G_TLS_CERTIFICATE_BAD_IDENTITY:
 
458
      error_msg = _("The certificate does not match the expected identity of the site that it was "
 
459
                    "retrieved from.");
 
460
      break;
 
461
 
 
462
    case G_TLS_CERTIFICATE_NOT_ACTIVATED:
 
463
      error_msg = _("The certificate's activation time is still in the future.");
 
464
      break;
 
465
 
 
466
    case G_TLS_CERTIFICATE_EXPIRED:
 
467
      error_msg = _("The certificate has expired.");
 
468
      break;
 
469
 
 
470
    case G_TLS_CERTIFICATE_REVOKED:
 
471
      error_msg = _("The certificate has been revoked.");
 
472
      break;
 
473
 
 
474
    case G_TLS_CERTIFICATE_INSECURE:
 
475
      error_msg = _("The certificate's algorithm is considered insecure.");
 
476
      break;
 
477
 
 
478
    default:
 
479
      error_msg = _("Invalid certificate.");
 
480
      break;
 
481
    }
 
482
 
 
483
  g_set_error_literal (err, GOA_ERROR, GOA_ERROR_SSL, error_msg);
 
484
}