~ubuntu-branches/debian/squeeze/alpine/squeeze

« back to all changes in this revision

Viewing changes to imap/src/osdep/amiga/ssl_none.c

  • Committer: Bazaar Package Importer
  • Author(s): Asheesh Laroia
  • Date: 2007-02-17 13:17:42 UTC
  • Revision ID: james.westby@ubuntu.com-20070217131742-99x5c6cpg1pbkdhw
Tags: upstream-0.82+dfsg
ImportĀ upstreamĀ versionĀ 0.82+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* ========================================================================
 
2
 * Copyright 1988-2006 University of Washington
 
3
 *
 
4
 * Licensed under the Apache License, Version 2.0 (the "License");
 
5
 * you may not use this file except in compliance with the License.
 
6
 * You may obtain a copy of the License at
 
7
 *
 
8
 *     http://www.apache.org/licenses/LICENSE-2.0
 
9
 *
 
10
 * 
 
11
 * ========================================================================
 
12
 */
 
13
 
 
14
/*
 
15
 * Program:     Dummy (no SSL) authentication/encryption module
 
16
 *
 
17
 * Author:      Mark Crispin
 
18
 *              Networks and Distributed Computing
 
19
 *              Computing & Communications
 
20
 *              University of Washington
 
21
 *              Administration Building, AG-44
 
22
 *              Seattle, WA  98195
 
23
 *              Internet: MRC@CAC.Washington.EDU
 
24
 *
 
25
 * Date:        7 February 2001
 
26
 * Last Edited: 30 August 2006
 
27
 */
 
28
 
 
29
/* Init server for SSL
 
30
 * Accepts: server name
 
31
 */
 
32
 
 
33
void ssl_server_init (char *server)
 
34
{
 
35
  syslog (LOG_ERR,"This server does not support SSL");
 
36
  exit (1);                     /* punt this program too */
 
37
}
 
38
 
 
39
 
 
40
/* Start TLS
 
41
 * Accepts: /etc/services service name
 
42
 * Returns: cpystr'd error string if TLS failed, else NIL for success
 
43
 */
 
44
 
 
45
char *ssl_start_tls (char *server)
 
46
{
 
47
  return cpystr ("This server does not support TLS");
 
48
}
 
49
 
 
50
/* Get character
 
51
 * Returns: character or EOF
 
52
 */
 
53
 
 
54
int PBIN (void)
 
55
{
 
56
  return getchar ();
 
57
}
 
58
 
 
59
 
 
60
/* Get string
 
61
 * Accepts: destination string pointer
 
62
 *          number of bytes available
 
63
 * Returns: destination string pointer or NIL if EOF
 
64
 */
 
65
 
 
66
char *PSIN (char *s,int n)
 
67
{
 
68
  return fgets (s,n,stdin);
 
69
}
 
70
 
 
71
 
 
72
/* Get record
 
73
 * Accepts: destination string pointer
 
74
 *          number of bytes to read
 
75
 * Returns: T if success, NIL otherwise
 
76
 */
 
77
 
 
78
long PSINR (char *s,unsigned long n)
 
79
{
 
80
  unsigned long i;
 
81
  while (n && ((i = fread (s,1,n,stdin)) || (errno == EINTR))) s += i,n -= i;
 
82
  return n ? NIL : LONGT;
 
83
}
 
84
 
 
85
 
 
86
/* Wait for input
 
87
 * Accepts: timeout in seconds
 
88
 * Returns: T if have input on stdin, else NIL
 
89
 */
 
90
 
 
91
long INWAIT (long seconds)
 
92
{
 
93
  return server_input_wait (seconds);
 
94
}
 
95
 
 
96
/* Put character
 
97
 * Accepts: character
 
98
 * Returns: character written or EOF
 
99
 */
 
100
 
 
101
int PBOUT (int c)
 
102
{
 
103
  return putchar (c);
 
104
}
 
105
 
 
106
 
 
107
/* Put string
 
108
 * Accepts: source string pointer
 
109
 * Returns: 0 or EOF if error
 
110
 */
 
111
 
 
112
int PSOUT (char *s)
 
113
{
 
114
  return fputs (s,stdout);
 
115
}
 
116
 
 
117
 
 
118
/* Put record
 
119
 * Accepts: source sized text
 
120
 * Returns: 0 or EOF if error
 
121
 */
 
122
 
 
123
int PSOUTR (SIZEDTEXT *s)
 
124
{
 
125
  unsigned char *t;
 
126
  unsigned long i,j;
 
127
  for (t = s->data,i = s->size;
 
128
       (i && ((j = fwrite (t,1,i,stdout)) || (errno == EINTR)));
 
129
       t += j,i -= j);
 
130
  return i ? EOF : NIL;
 
131
}
 
132
 
 
133
 
 
134
/* Flush output
 
135
 * Returns: 0 or EOF if error
 
136
 */
 
137
 
 
138
int PFLUSH (void)
 
139
{
 
140
  return fflush (stdout);
 
141
}