|
Lines 17-27
Link Here
|
| 17 |
|
17 |
|
| 18 |
#include <errno.h> |
18 |
#include <errno.h> |
| 19 |
#include <string.h> |
19 |
#include <string.h> |
|
|
20 |
#include <openssl/err.h> |
| 20 |
#include "ssherr.h" |
21 |
#include "ssherr.h" |
| 21 |
|
22 |
|
| 22 |
const char * |
23 |
const char * |
| 23 |
ssh_err(int n) |
24 |
ssh_err(int n) |
| 24 |
{ |
25 |
{ |
|
|
26 |
static char err_str[256]; |
| 25 |
switch (n) { |
27 |
switch (n) { |
| 26 |
case SSH_ERR_SUCCESS: |
28 |
case SSH_ERR_SUCCESS: |
| 27 |
return "success"; |
29 |
return "success"; |
|
Lines 68-74
ssh_err(int n)
Link Here
|
| 68 |
case SSH_ERR_SIGNATURE_INVALID: |
70 |
case SSH_ERR_SIGNATURE_INVALID: |
| 69 |
return "incorrect signature"; |
71 |
return "incorrect signature"; |
| 70 |
case SSH_ERR_LIBCRYPTO_ERROR: |
72 |
case SSH_ERR_LIBCRYPTO_ERROR: |
| 71 |
return "error in libcrypto"; /* XXX fetch and return */ |
73 |
ERR_error_string_n(ERR_get_error(), err_str, sizeof (err_str)); |
|
|
74 |
return err_str; |
| 72 |
case SSH_ERR_UNEXPECTED_TRAILING_DATA: |
75 |
case SSH_ERR_UNEXPECTED_TRAILING_DATA: |
| 73 |
return "unexpected bytes remain after decoding"; |
76 |
return "unexpected bytes remain after decoding"; |
| 74 |
case SSH_ERR_SYSTEM_ERROR: |
77 |
case SSH_ERR_SYSTEM_ERROR: |