source: EcnlProtoTool/trunk/openssl-1.1.0e/apps/errstr.c@ 331

Last change on this file since 331 was 331, checked in by coas-nagasima, 6 years ago

prototoolに関連するプロジェクトをnewlibからmuslを使うよう変更・更新
ntshellをnewlibの下位の実装から、muslのsyscallの実装に変更・更新
以下のOSSをアップデート
・mruby-1.3.0
・musl-1.1.18
・onigmo-6.1.3
・tcc-0.9.27
以下のOSSを追加
・openssl-1.1.0e
・curl-7.57.0
・zlib-1.2.11
以下のmrbgemsを追加
・iij/mruby-digest
・iij/mruby-env
・iij/mruby-errno
・iij/mruby-iijson
・iij/mruby-ipaddr
・iij/mruby-mock
・iij/mruby-require
・iij/mruby-tls-openssl

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-csrc
File size: 1.8 KB
Line 
1/*
2 * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
3 *
4 * Licensed under the OpenSSL license (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
8 */
9
10#include <stdio.h>
11#include <stdlib.h>
12#include <string.h>
13#include "apps.h"
14#include <openssl/bio.h>
15#include <openssl/lhash.h>
16#include <openssl/err.h>
17#include <openssl/ssl.h>
18
19typedef enum OPTION_choice {
20 OPT_ERR = -1, OPT_EOF = 0, OPT_HELP
21} OPTION_CHOICE;
22
23OPTIONS errstr_options[] = {
24 {OPT_HELP_STR, 1, '-', "Usage: %s [options] errnum...\n"},
25 {OPT_HELP_STR, 1, '-', " errnum Error number\n"},
26 {"help", OPT_HELP, '-', "Display this summary"},
27 {NULL}
28};
29
30int errstr_main(int argc, char **argv)
31{
32 OPTION_CHOICE o;
33 char buf[256], *prog;
34 int ret = 1;
35 unsigned long l;
36
37 prog = opt_init(argc, argv, errstr_options);
38 while ((o = opt_next()) != OPT_EOF) {
39 switch (o) {
40 case OPT_EOF:
41 case OPT_ERR:
42 BIO_printf(bio_err, "%s: Use -help for summary.\n", prog);
43 goto end;
44 case OPT_HELP:
45 opt_help(errstr_options);
46 ret = 0;
47 goto end;
48 }
49 }
50
51 ret = 0;
52 for (argv = opt_rest(); *argv; argv++) {
53 if (sscanf(*argv, "%lx", &l) == 0)
54 ret++;
55 else {
56 /* We're not really an SSL application so this won't auto-init, but
57 * we're still interested in SSL error strings
58 */
59 OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS
60 | OPENSSL_INIT_LOAD_CRYPTO_STRINGS, NULL);
61 ERR_error_string_n(l, buf, sizeof buf);
62 BIO_printf(bio_out, "%s\n", buf);
63 }
64 }
65 end:
66 return (ret);
67}
Note: See TracBrowser for help on using the repository browser.