• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kio/kssl
 

kio/kssl

  • kio
  • kssl
ksslpemcallback.cc
1 /* This file is part of the KDE project
2  *
3  * Copyright (C) 2001 George Staikos <staikos@kde.org>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public License
16  * along with this library; see the file COPYING.LIB. If not, write to
17  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 #ifdef HAVE_CONFIG_H
22 #include <config.h>
23 #endif
24 
25 #include <kpassdlg.h>
26 #include <klocale.h>
27 #include "ksslpemcallback.h"
28 
29 int KSSLPemCallback(char *buf, int size, int rwflag, void *userdata) {
30 #ifdef KSSL_HAVE_SSL
31  TQCString pass;
32  Q_UNUSED(userdata);
33  Q_UNUSED(rwflag);
34 
35  if (!buf) return -1;
36  int rc = KPasswordDialog::getPassword(pass, i18n("Certificate password"));
37  if (rc != KPasswordDialog::Accepted) return -1;
38 
39  const uint passlen = pass.length();
40  if (passlen > (unsigned int)size-1)
41  pass.truncate((unsigned int)size-1);
42 
43  qstrncpy(buf, pass.data(), size-1);
44 
45  for (unsigned int i = 0; i < passlen; i++)
46  pass[i] = 0;
47  // To be sure that it doesn't optimise the previous loop away
48  for (unsigned int i = 0; i < passlen; i++)
49  pass[i] = pass[i];
50  buf[size-1] = 0;
51  return (int)passlen;
52 #else
53  Q_UNUSED(buf);
54  Q_UNUSED(size);
55  Q_UNUSED(rwflag);
56  Q_UNUSED(userdata);
57  return -1;
58 #endif
59 }
60 
61 

kio/kssl

Skip menu "kio/kssl"
  • Main Page
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

kio/kssl

Skip menu "kio/kssl"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kio/kssl by doxygen 1.9.1
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |