util/sasl_cyrus.lua

changeset 3298
94087ee7587b
parent 3187
f22248192c3e
child 3299
4448789c19ca
equal deleted inserted replaced
3297:aa3725bbcde5 3298:94087ee7587b
24 local keys = keys; 24 local keys = keys;
25 25
26 local print = print 26 local print = print
27 local pcall = pcall 27 local pcall = pcall
28 local s_match, s_gmatch = string.match, string.gmatch 28 local s_match, s_gmatch = string.match, string.gmatch
29
30 local sasl_errstring = {
31 -- SASL result codes --
32 [1] = "another step is needed in authentication";
33 [0] = "successful result";
34 [-1] = "generic failure";
35 [-2] = "memory shortage failure";
36 [-3] = "overflowed buffer";
37 [-4] = "mechanism not supported";
38 [-5] = "bad protocol / cancel";
39 [-6] = "can't request info until later in exchange";
40 [-7] = "invalid parameter supplied";
41 [-8] = "transient failure (e.g., weak key)";
42 [-9] = "integrity check failed";
43 [-12] = "SASL library not initialized";
44
45 -- client only codes --
46 [2] = "needs user interaction";
47 [-10] = "server failed mutual authentication step";
48 [-11] = "mechanism doesn't support requested feature";
49
50 -- server only codes --
51 [-13] = "authentication failure";
52 [-14] = "authorization failure";
53 [-15] = "mechanism too weak for this user";
54 [-16] = "encryption needed to use mechanism";
55 [-17] = "One time use of a plaintext password will enable requested mechanism for user";
56 [-18] = "passphrase expired, has to be reset";
57 [-19] = "account disabled";
58 [-20] = "user not found";
59 [-23] = "version mismatch with plug-in";
60 [-24] = "remote authentication server unavailable";
61 [-26] = "user exists, but no verifier for user";
62
63 -- codes for password setting --
64 [-21] = "passphrase locked";
65 [-22] = "requested change was not needed";
66 [-27] = "passphrase is too weak for security policy";
67 [-28] = "user supplied passwords not permitted";
68 };
69 setmetatable(sasl_errstring, { __index = function() return "undefined error!" end });
29 70
30 module "sasl_cyrus" 71 module "sasl_cyrus"
31 72
32 local method = {}; 73 local method = {};
33 method.__index = method; 74 method.__index = method;

mercurial