2016-04-20 02:10:43 +00:00
|
|
|
#! /usr/bin/env perl
|
|
|
|
# Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
|
|
|
|
#
|
|
|
|
# Licensed under the OpenSSL license (the "License"). You may not use
|
|
|
|
# this file except in compliance with the License. You can obtain a copy
|
|
|
|
# in the file LICENSE in the source distribution or at
|
|
|
|
# https://www.openssl.org/source/license.html
|
1998-12-21 10:52:47 +00:00
|
|
|
|
|
|
|
$NUMBER=0x01;
|
|
|
|
$UPPER=0x02;
|
|
|
|
$LOWER=0x04;
|
I've always wanted to make the CONF library more adaptable. Here's
the result.
I have retained the old behavior of the CONF_* functions, and have
added a more "object oriented" interface through NCONF_* functions
(New CONF, you see :-)), working the same way as, for example, the
BIO interface. Really, the CONF_* are rewritten so they use the
NCONF_* functions internally.
In addition to that, I've split the old conf.c code into two files,
conf_def.c and conf_api.c. conf_def.c contains the default config
object that reads a configuration file the standard OpenSSL way, as
well as configuration file with Win32 registry file syntax (I'm not
sure I got that one right). conf_api.c provides an API to build other
configuration file readers around (can you see a configuraion file in
XML? I can :-)).
Finally, I've changed the name conf_lcl.h to conf_def.h, since it's
made specifically for that "class" and none others.
2000-04-09 12:04:35 +00:00
|
|
|
$UNDER=0x100;
|
|
|
|
$PUNCTUATION=0x200;
|
1998-12-21 10:52:47 +00:00
|
|
|
$WS=0x10;
|
|
|
|
$ESC=0x20;
|
|
|
|
$QUOTE=0x40;
|
I've always wanted to make the CONF library more adaptable. Here's
the result.
I have retained the old behavior of the CONF_* functions, and have
added a more "object oriented" interface through NCONF_* functions
(New CONF, you see :-)), working the same way as, for example, the
BIO interface. Really, the CONF_* are rewritten so they use the
NCONF_* functions internally.
In addition to that, I've split the old conf.c code into two files,
conf_def.c and conf_api.c. conf_def.c contains the default config
object that reads a configuration file the standard OpenSSL way, as
well as configuration file with Win32 registry file syntax (I'm not
sure I got that one right). conf_api.c provides an API to build other
configuration file readers around (can you see a configuraion file in
XML? I can :-)).
Finally, I've changed the name conf_lcl.h to conf_def.h, since it's
made specifically for that "class" and none others.
2000-04-09 12:04:35 +00:00
|
|
|
$DQUOTE=0x400;
|
1998-12-21 10:52:47 +00:00
|
|
|
$COMMENT=0x80;
|
I've always wanted to make the CONF library more adaptable. Here's
the result.
I have retained the old behavior of the CONF_* functions, and have
added a more "object oriented" interface through NCONF_* functions
(New CONF, you see :-)), working the same way as, for example, the
BIO interface. Really, the CONF_* are rewritten so they use the
NCONF_* functions internally.
In addition to that, I've split the old conf.c code into two files,
conf_def.c and conf_api.c. conf_def.c contains the default config
object that reads a configuration file the standard OpenSSL way, as
well as configuration file with Win32 registry file syntax (I'm not
sure I got that one right). conf_api.c provides an API to build other
configuration file readers around (can you see a configuraion file in
XML? I can :-)).
Finally, I've changed the name conf_lcl.h to conf_def.h, since it's
made specifically for that "class" and none others.
2000-04-09 12:04:35 +00:00
|
|
|
$FCOMMENT=0x800;
|
|
|
|
$EOF=0x08;
|
2002-01-02 11:06:02 +00:00
|
|
|
$HIGHBIT=0x1000;
|
1998-12-21 10:52:47 +00:00
|
|
|
|
2002-01-02 11:06:02 +00:00
|
|
|
foreach (0 .. 255)
|
1998-12-21 10:52:47 +00:00
|
|
|
{
|
|
|
|
$v=0;
|
|
|
|
$c=sprintf("%c",$_);
|
|
|
|
$v|=$NUMBER if ($c =~ /[0-9]/);
|
|
|
|
$v|=$UPPER if ($c =~ /[A-Z]/);
|
|
|
|
$v|=$LOWER if ($c =~ /[a-z]/);
|
|
|
|
$v|=$UNDER if ($c =~ /_/);
|
I've always wanted to make the CONF library more adaptable. Here's
the result.
I have retained the old behavior of the CONF_* functions, and have
added a more "object oriented" interface through NCONF_* functions
(New CONF, you see :-)), working the same way as, for example, the
BIO interface. Really, the CONF_* are rewritten so they use the
NCONF_* functions internally.
In addition to that, I've split the old conf.c code into two files,
conf_def.c and conf_api.c. conf_def.c contains the default config
object that reads a configuration file the standard OpenSSL way, as
well as configuration file with Win32 registry file syntax (I'm not
sure I got that one right). conf_api.c provides an API to build other
configuration file readers around (can you see a configuraion file in
XML? I can :-)).
Finally, I've changed the name conf_lcl.h to conf_def.h, since it's
made specifically for that "class" and none others.
2000-04-09 12:04:35 +00:00
|
|
|
$v|=$PUNCTUATION if ($c =~ /[!\.%&\*\+,\/;\?\@\^\~\|-]/);
|
|
|
|
$v|=$WS if ($c =~ /[ \t\r\n]/);
|
1998-12-21 10:52:47 +00:00
|
|
|
$v|=$ESC if ($c =~ /\\/);
|
I've always wanted to make the CONF library more adaptable. Here's
the result.
I have retained the old behavior of the CONF_* functions, and have
added a more "object oriented" interface through NCONF_* functions
(New CONF, you see :-)), working the same way as, for example, the
BIO interface. Really, the CONF_* are rewritten so they use the
NCONF_* functions internally.
In addition to that, I've split the old conf.c code into two files,
conf_def.c and conf_api.c. conf_def.c contains the default config
object that reads a configuration file the standard OpenSSL way, as
well as configuration file with Win32 registry file syntax (I'm not
sure I got that one right). conf_api.c provides an API to build other
configuration file readers around (can you see a configuraion file in
XML? I can :-)).
Finally, I've changed the name conf_lcl.h to conf_def.h, since it's
made specifically for that "class" and none others.
2000-04-09 12:04:35 +00:00
|
|
|
$v|=$QUOTE if ($c =~ /['`"]/); # for emacs: "`'}/)
|
1998-12-21 10:52:47 +00:00
|
|
|
$v|=$COMMENT if ($c =~ /\#/);
|
|
|
|
$v|=$EOF if ($c =~ /\0/);
|
2002-01-02 11:06:02 +00:00
|
|
|
$v|=$HIGHBIT if ($c =~/[\x80-\xff]/);
|
1998-12-21 10:52:47 +00:00
|
|
|
|
I've always wanted to make the CONF library more adaptable. Here's
the result.
I have retained the old behavior of the CONF_* functions, and have
added a more "object oriented" interface through NCONF_* functions
(New CONF, you see :-)), working the same way as, for example, the
BIO interface. Really, the CONF_* are rewritten so they use the
NCONF_* functions internally.
In addition to that, I've split the old conf.c code into two files,
conf_def.c and conf_api.c. conf_def.c contains the default config
object that reads a configuration file the standard OpenSSL way, as
well as configuration file with Win32 registry file syntax (I'm not
sure I got that one right). conf_api.c provides an API to build other
configuration file readers around (can you see a configuraion file in
XML? I can :-)).
Finally, I've changed the name conf_lcl.h to conf_def.h, since it's
made specifically for that "class" and none others.
2000-04-09 12:04:35 +00:00
|
|
|
push(@V_def,$v);
|
|
|
|
}
|
|
|
|
|
2002-01-02 11:06:02 +00:00
|
|
|
foreach (0 .. 255)
|
I've always wanted to make the CONF library more adaptable. Here's
the result.
I have retained the old behavior of the CONF_* functions, and have
added a more "object oriented" interface through NCONF_* functions
(New CONF, you see :-)), working the same way as, for example, the
BIO interface. Really, the CONF_* are rewritten so they use the
NCONF_* functions internally.
In addition to that, I've split the old conf.c code into two files,
conf_def.c and conf_api.c. conf_def.c contains the default config
object that reads a configuration file the standard OpenSSL way, as
well as configuration file with Win32 registry file syntax (I'm not
sure I got that one right). conf_api.c provides an API to build other
configuration file readers around (can you see a configuraion file in
XML? I can :-)).
Finally, I've changed the name conf_lcl.h to conf_def.h, since it's
made specifically for that "class" and none others.
2000-04-09 12:04:35 +00:00
|
|
|
{
|
|
|
|
$v=0;
|
|
|
|
$c=sprintf("%c",$_);
|
|
|
|
$v|=$NUMBER if ($c =~ /[0-9]/);
|
|
|
|
$v|=$UPPER if ($c =~ /[A-Z]/);
|
|
|
|
$v|=$LOWER if ($c =~ /[a-z]/);
|
|
|
|
$v|=$UNDER if ($c =~ /_/);
|
|
|
|
$v|=$PUNCTUATION if ($c =~ /[!\.%&\*\+,\/;\?\@\^\~\|-]/);
|
|
|
|
$v|=$WS if ($c =~ /[ \t\r\n]/);
|
|
|
|
$v|=$DQUOTE if ($c =~ /["]/); # for emacs: "}/)
|
|
|
|
$v|=$FCOMMENT if ($c =~ /;/);
|
|
|
|
$v|=$EOF if ($c =~ /\0/);
|
2002-01-02 11:06:02 +00:00
|
|
|
$v|=$HIGHBIT if ($c =~/[\x80-\xff]/);
|
I've always wanted to make the CONF library more adaptable. Here's
the result.
I have retained the old behavior of the CONF_* functions, and have
added a more "object oriented" interface through NCONF_* functions
(New CONF, you see :-)), working the same way as, for example, the
BIO interface. Really, the CONF_* are rewritten so they use the
NCONF_* functions internally.
In addition to that, I've split the old conf.c code into two files,
conf_def.c and conf_api.c. conf_def.c contains the default config
object that reads a configuration file the standard OpenSSL way, as
well as configuration file with Win32 registry file syntax (I'm not
sure I got that one right). conf_api.c provides an API to build other
configuration file readers around (can you see a configuraion file in
XML? I can :-)).
Finally, I've changed the name conf_lcl.h to conf_def.h, since it's
made specifically for that "class" and none others.
2000-04-09 12:04:35 +00:00
|
|
|
|
|
|
|
push(@V_w32,$v);
|
1998-12-21 10:52:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
print <<"EOF";
|
2016-03-17 18:16:09 +00:00
|
|
|
/*
|
2016-04-20 02:10:43 +00:00
|
|
|
* WARNING: do not edit!
|
|
|
|
* Generated by crypto/conf/keysets.pl
|
|
|
|
*
|
|
|
|
* Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
|
|
|
|
* Licensed under the OpenSSL license (the "License"). You may not use
|
|
|
|
* this file except in compliance with the License. You can obtain a copy
|
|
|
|
* in the file LICENSE in the source distribution or at
|
|
|
|
* https://www.openssl.org/source/license.html
|
2016-03-17 18:16:09 +00:00
|
|
|
*/
|
|
|
|
|
2016-03-21 14:49:11 +00:00
|
|
|
#define CONF_NUMBER $NUMBER
|
|
|
|
#define CONF_UPPER $UPPER
|
|
|
|
#define CONF_LOWER $LOWER
|
|
|
|
#define CONF_UNDER $UNDER
|
|
|
|
#define CONF_PUNCTUATION $PUNCTUATION
|
|
|
|
#define CONF_WS $WS
|
|
|
|
#define CONF_ESC $ESC
|
|
|
|
#define CONF_QUOTE $QUOTE
|
|
|
|
#define CONF_DQUOTE $DQUOTE
|
|
|
|
#define CONF_COMMENT $COMMENT
|
|
|
|
#define CONF_FCOMMENT $FCOMMENT
|
|
|
|
#define CONF_EOF $EOF
|
|
|
|
#define CONF_HIGHBIT $HIGHBIT
|
2016-03-17 18:16:09 +00:00
|
|
|
#define CONF_ALPHA (CONF_UPPER|CONF_LOWER)
|
|
|
|
#define CONF_ALPHA_NUMERIC (CONF_ALPHA|CONF_NUMBER|CONF_UNDER)
|
I've always wanted to make the CONF library more adaptable. Here's
the result.
I have retained the old behavior of the CONF_* functions, and have
added a more "object oriented" interface through NCONF_* functions
(New CONF, you see :-)), working the same way as, for example, the
BIO interface. Really, the CONF_* are rewritten so they use the
NCONF_* functions internally.
In addition to that, I've split the old conf.c code into two files,
conf_def.c and conf_api.c. conf_def.c contains the default config
object that reads a configuration file the standard OpenSSL way, as
well as configuration file with Win32 registry file syntax (I'm not
sure I got that one right). conf_api.c provides an API to build other
configuration file readers around (can you see a configuraion file in
XML? I can :-)).
Finally, I've changed the name conf_lcl.h to conf_def.h, since it's
made specifically for that "class" and none others.
2000-04-09 12:04:35 +00:00
|
|
|
#define CONF_ALPHA_NUMERIC_PUNCT (CONF_ALPHA|CONF_NUMBER|CONF_UNDER| \\
|
2016-03-17 18:16:09 +00:00
|
|
|
CONF_PUNCTUATION)
|
I've always wanted to make the CONF library more adaptable. Here's
the result.
I have retained the old behavior of the CONF_* functions, and have
added a more "object oriented" interface through NCONF_* functions
(New CONF, you see :-)), working the same way as, for example, the
BIO interface. Really, the CONF_* are rewritten so they use the
NCONF_* functions internally.
In addition to that, I've split the old conf.c code into two files,
conf_def.c and conf_api.c. conf_def.c contains the default config
object that reads a configuration file the standard OpenSSL way, as
well as configuration file with Win32 registry file syntax (I'm not
sure I got that one right). conf_api.c provides an API to build other
configuration file readers around (can you see a configuraion file in
XML? I can :-)).
Finally, I've changed the name conf_lcl.h to conf_def.h, since it's
made specifically for that "class" and none others.
2000-04-09 12:04:35 +00:00
|
|
|
|
2016-03-17 18:16:09 +00:00
|
|
|
#define KEYTYPES(c) ((const unsigned short *)((c)->meth_data))
|
I've always wanted to make the CONF library more adaptable. Here's
the result.
I have retained the old behavior of the CONF_* functions, and have
added a more "object oriented" interface through NCONF_* functions
(New CONF, you see :-)), working the same way as, for example, the
BIO interface. Really, the CONF_* are rewritten so they use the
NCONF_* functions internally.
In addition to that, I've split the old conf.c code into two files,
conf_def.c and conf_api.c. conf_def.c contains the default config
object that reads a configuration file the standard OpenSSL way, as
well as configuration file with Win32 registry file syntax (I'm not
sure I got that one right). conf_api.c provides an API to build other
configuration file readers around (can you see a configuraion file in
XML? I can :-)).
Finally, I've changed the name conf_lcl.h to conf_def.h, since it's
made specifically for that "class" and none others.
2000-04-09 12:04:35 +00:00
|
|
|
#ifndef CHARSET_EBCDIC
|
2016-03-17 18:16:09 +00:00
|
|
|
# define IS_COMMENT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_COMMENT)
|
|
|
|
# define IS_FCOMMENT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_FCOMMENT)
|
|
|
|
# define IS_EOF(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_EOF)
|
|
|
|
# define IS_ESC(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_ESC)
|
|
|
|
# define IS_NUMBER(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_NUMBER)
|
|
|
|
# define IS_WS(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_WS)
|
|
|
|
# define IS_ALPHA_NUMERIC(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_ALPHA_NUMERIC)
|
|
|
|
# define IS_ALPHA_NUMERIC_PUNCT(c,a) \\
|
|
|
|
(KEYTYPES(c)[(a)&0xff]&CONF_ALPHA_NUMERIC_PUNCT)
|
|
|
|
# define IS_QUOTE(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_QUOTE)
|
|
|
|
# define IS_DQUOTE(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_DQUOTE)
|
|
|
|
# define IS_HIGHBIT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_HIGHBIT)
|
|
|
|
|
|
|
|
#else /* CHARSET_EBCDIC */
|
|
|
|
|
2016-05-01 13:08:34 +00:00
|
|
|
# define IS_COMMENT(c,a) (KEYTYPES(c)[os_toascii[a & 0xff]]&CONF_COMMENT)
|
|
|
|
# define IS_FCOMMENT(c,a) (KEYTYPES(c)[os_toascii[a & 0xff]]&CONF_FCOMMENT)
|
|
|
|
# define IS_EOF(c,a) (KEYTYPES(c)[os_toascii[a & 0xff]]&CONF_EOF)
|
|
|
|
# define IS_ESC(c,a) (KEYTYPES(c)[os_toascii[a & 0xff]]&CONF_ESC)
|
|
|
|
# define IS_NUMBER(c,a) (KEYTYPES(c)[os_toascii[a & 0xff]]&CONF_NUMBER)
|
|
|
|
# define IS_WS(c,a) (KEYTYPES(c)[os_toascii[a & 0xff]]&CONF_WS)
|
|
|
|
# define IS_ALPHA_NUMERIC(c,a) (KEYTYPES(c)[os_toascii[a & 0xff]]&CONF_ALPHA_NUMERIC)
|
2016-03-17 18:16:09 +00:00
|
|
|
# define IS_ALPHA_NUMERIC_PUNCT(c,a) \\
|
2016-05-01 13:08:34 +00:00
|
|
|
(KEYTYPES(c)[os_toascii[a & 0xff]]&CONF_ALPHA_NUMERIC_PUNCT)
|
|
|
|
# define IS_QUOTE(c,a) (KEYTYPES(c)[os_toascii[a & 0xff]]&CONF_QUOTE)
|
|
|
|
# define IS_DQUOTE(c,a) (KEYTYPES(c)[os_toascii[a & 0xff]]&CONF_DQUOTE)
|
|
|
|
# define IS_HIGHBIT(c,a) (KEYTYPES(c)[os_toascii[a & 0xff]]&CONF_HIGHBIT)
|
2016-03-17 18:16:09 +00:00
|
|
|
#endif /* CHARSET_EBCDIC */
|
1998-12-21 10:52:47 +00:00
|
|
|
|
|
|
|
EOF
|
|
|
|
|
2016-03-17 18:16:09 +00:00
|
|
|
print "static const unsigned short CONF_type_default[256] = {";
|
I've always wanted to make the CONF library more adaptable. Here's
the result.
I have retained the old behavior of the CONF_* functions, and have
added a more "object oriented" interface through NCONF_* functions
(New CONF, you see :-)), working the same way as, for example, the
BIO interface. Really, the CONF_* are rewritten so they use the
NCONF_* functions internally.
In addition to that, I've split the old conf.c code into two files,
conf_def.c and conf_api.c. conf_def.c contains the default config
object that reads a configuration file the standard OpenSSL way, as
well as configuration file with Win32 registry file syntax (I'm not
sure I got that one right). conf_api.c provides an API to build other
configuration file readers around (can you see a configuraion file in
XML? I can :-)).
Finally, I've changed the name conf_lcl.h to conf_def.h, since it's
made specifically for that "class" and none others.
2000-04-09 12:04:35 +00:00
|
|
|
|
2002-01-02 11:06:02 +00:00
|
|
|
for ($i=0; $i<256; $i++)
|
I've always wanted to make the CONF library more adaptable. Here's
the result.
I have retained the old behavior of the CONF_* functions, and have
added a more "object oriented" interface through NCONF_* functions
(New CONF, you see :-)), working the same way as, for example, the
BIO interface. Really, the CONF_* are rewritten so they use the
NCONF_* functions internally.
In addition to that, I've split the old conf.c code into two files,
conf_def.c and conf_api.c. conf_def.c contains the default config
object that reads a configuration file the standard OpenSSL way, as
well as configuration file with Win32 registry file syntax (I'm not
sure I got that one right). conf_api.c provides an API to build other
configuration file readers around (can you see a configuraion file in
XML? I can :-)).
Finally, I've changed the name conf_lcl.h to conf_def.h, since it's
made specifically for that "class" and none others.
2000-04-09 12:04:35 +00:00
|
|
|
{
|
2016-03-17 18:16:09 +00:00
|
|
|
print "\n " if ($i % 8) == 0;
|
|
|
|
printf " 0x%04X,",$V_def[$i];
|
I've always wanted to make the CONF library more adaptable. Here's
the result.
I have retained the old behavior of the CONF_* functions, and have
added a more "object oriented" interface through NCONF_* functions
(New CONF, you see :-)), working the same way as, for example, the
BIO interface. Really, the CONF_* are rewritten so they use the
NCONF_* functions internally.
In addition to that, I've split the old conf.c code into two files,
conf_def.c and conf_api.c. conf_def.c contains the default config
object that reads a configuration file the standard OpenSSL way, as
well as configuration file with Win32 registry file syntax (I'm not
sure I got that one right). conf_api.c provides an API to build other
configuration file readers around (can you see a configuraion file in
XML? I can :-)).
Finally, I've changed the name conf_lcl.h to conf_def.h, since it's
made specifically for that "class" and none others.
2000-04-09 12:04:35 +00:00
|
|
|
}
|
|
|
|
|
2016-03-17 18:16:09 +00:00
|
|
|
print "\n};\n\n";
|
I've always wanted to make the CONF library more adaptable. Here's
the result.
I have retained the old behavior of the CONF_* functions, and have
added a more "object oriented" interface through NCONF_* functions
(New CONF, you see :-)), working the same way as, for example, the
BIO interface. Really, the CONF_* are rewritten so they use the
NCONF_* functions internally.
In addition to that, I've split the old conf.c code into two files,
conf_def.c and conf_api.c. conf_def.c contains the default config
object that reads a configuration file the standard OpenSSL way, as
well as configuration file with Win32 registry file syntax (I'm not
sure I got that one right). conf_api.c provides an API to build other
configuration file readers around (can you see a configuraion file in
XML? I can :-)).
Finally, I've changed the name conf_lcl.h to conf_def.h, since it's
made specifically for that "class" and none others.
2000-04-09 12:04:35 +00:00
|
|
|
|
2016-03-17 18:16:09 +00:00
|
|
|
print "static const unsigned short CONF_type_win32[256] = {";
|
1998-12-21 10:52:47 +00:00
|
|
|
|
2002-01-02 11:06:02 +00:00
|
|
|
for ($i=0; $i<256; $i++)
|
1998-12-21 10:52:47 +00:00
|
|
|
{
|
2016-03-17 18:16:09 +00:00
|
|
|
print "\n " if ($i % 8) == 0;
|
|
|
|
printf " 0x%04X,",$V_w32[$i];
|
1998-12-21 10:52:47 +00:00
|
|
|
}
|
|
|
|
|
2016-03-17 18:16:09 +00:00
|
|
|
print "\n};\n";
|