26
26
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27
27
* SUCH DAMAGE.
28
28
*
29
- * $Id: px.c,v 1.1 2001/08/21 01:32:01 momjian Exp $
29
+ * $Id: px.c,v 1.2 2001/09/06 03:21:39 momjian Exp $
30
30
*/
31
31
32
32
#include <postgres.h>
@@ -208,7 +208,7 @@ combo_free(PX_Combo *cx)
208
208
209
209
/* PARSER */
210
210
211
- static void
211
+ static int
212
212
parse_cipher_name (char * full ,char * * cipher ,char * * pad )
213
213
{
214
214
char * p ,* p2 ,* q ;
@@ -229,14 +229,16 @@ parse_cipher_name(char *full, char **cipher, char **pad)
229
229
p2 = strchr (p ,':' );
230
230
if (p2 != NULL ) {
231
231
* p2 ++ = 0 ;
232
- if (!strcmp (p ,"pad" )) {
232
+ if (!strcmp (p ,"pad" ))
233
233
* pad = p2 ;
234
- }else {
235
- elog (ERROR ,"Unknown component: '%s'" ,p );
236
- }
237
- }
234
+ else
235
+ return -1 ;
236
+ }else
237
+ return -1 ;
238
+
238
239
p = q ;
239
240
}
241
+ return 0 ;
240
242
}
241
243
242
244
/* provider */
@@ -255,11 +257,11 @@ px_find_combo(const char *name, PX_Combo **res)
255
257
buf = px_alloc (strlen (name )+ 1 );
256
258
strcpy (buf ,name );
257
259
258
- parse_cipher_name (buf ,& s_cipher ,& s_pad );
259
- if (s_cipher == NULL ) {
260
+ err = parse_cipher_name (buf ,& s_cipher ,& s_pad );
261
+ if (err ) {
260
262
px_free (buf );
261
263
px_free (cx );
262
- return -1 ;
264
+ return err ;
263
265
}
264
266
265
267
err = px_find_cipher (s_cipher ,& cx -> cipher );