test_sss_ssh.c revision 462db32918a05097652f8232cd6c8d78a826e63c
d27b1887e61f1dc53d77c37f59dbf5019242a686Christian Maeder Pavel Reichl <preichl@redhat.com>
d27b1887e61f1dc53d77c37f59dbf5019242a686Christian Maeder Copyright (C) 2014 Red Hat
d27b1887e61f1dc53d77c37f59dbf5019242a686Christian Maeder Test for the NSS Responder ID-SID mapping interface
d27b1887e61f1dc53d77c37f59dbf5019242a686Christian Maeder This program is free software; you can redistribute it and/or modify
d27b1887e61f1dc53d77c37f59dbf5019242a686Christian Maeder it under the terms of the GNU General Public License as published by
d27b1887e61f1dc53d77c37f59dbf5019242a686Christian Maeder the Free Software Foundation; either version 3 of the License, or
99b26e2ab8ba89bc9a050c1524137eb6269e2753Christian Maeder (at your option) any later version.
92ae4d5885ea837ffe3dae9b2de742f871229b94Christian Maeder This program is distributed in the hope that it will be useful,
d27b1887e61f1dc53d77c37f59dbf5019242a686Christian Maeder but WITHOUT ANY WARRANTY; without even the implied warranty of
d27b1887e61f1dc53d77c37f59dbf5019242a686Christian Maeder MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ef1c24c8229ade3ac872febebd18c181e32fb9c4Christian Maeder GNU General Public License for more details.
d27b1887e61f1dc53d77c37f59dbf5019242a686Christian Maeder You should have received a copy of the GNU General Public License
99b26e2ab8ba89bc9a050c1524137eb6269e2753Christian Maeder along with this program. If not, see <http://www.gnu.org/licenses/>.
d27b1887e61f1dc53d77c37f59dbf5019242a686Christian Maederuint8_t key_data_noLF[] = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDfymad64oZkWa6q3xLXmCt/LfCRnd6yZSDp7UK6Irx5/Dv69dEKK2kBGL9Wfn+3ZDa6ov2XZrBmUthh8KOJvTw72+axox3kcJ5HwOYZCMeKbcr10RNScGuHErA1HhjTY6M9L8d0atVH2QIxw7ZHoVVnTHC4U4+541YfJkNUiOUIj65cFFZm9ULp32ZPrK+j2wW+XZkHhrZeFMlg4x4fe5FocO6ik1eqLxBejo7tMy+1m3R2a795AIguf6vNWeE5aNMd4pcmPcZHb3JOq3ItzE/3lepXD/3wqMt36EqNykBVE7aJj+LVkcEgjP9CDDsg9j9NB+AuWYmIYqrHW/Rg/vJ developer@sssd.dev.work";
d27b1887e61f1dc53d77c37f59dbf5019242a686Christian Maederuint8_t key_data_LF[] = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDfymad64oZkWa6q3xLXmCt/LfCRnd6yZSDp7UK6Irx5/Dv69dEKK2kBGL9Wfn+3ZDa6ov2XZrBmUthh8KOJvTw72+axox3kcJ5HwOYZCMeKbcr10RNScGuHErA1HhjTY6M9L8d0atVH2QIxw7ZHoVVnTHC4U4+541YfJkNUiOUIj65cFFZm9ULp32ZPrK+j2wW+XZkHhrZeFMlg4x4fe5FocO6ik1eqLxBejo7tMy+1m3R2a795AIguf6vNWeE5aNMd4pcmPcZHb3JOq3ItzE/3lepXD/3wqMt36EqNykBVE7aJj+LVkcEgjP9CDDsg9j9NB+AuWYmIYqrHW/Rg/vJ developer@sssd.dev.work\n";
ef1c24c8229ade3ac872febebd18c181e32fb9c4Christian Maederuint8_t key_data_LFLF[] = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDfymad64oZkWa6q3xLXmCt/LfCRnd6yZSDp7UK6Irx5/Dv69dEKK2kBGL9Wfn+3ZDa6ov2XZrBmUthh8KOJvTw72+axox3kcJ5HwOYZCMeKbcr10RNScGuHErA1HhjTY6M9L8d0atVH2QIxw7ZHoVVnTHC4U4+541YfJkNUiOUIj65cFFZm9ULp32ZPrK+j2wW+XZkHhrZeFMlg4x4fe5FocO6ik1eqLxBejo7tMy+1m3R2a795AIguf6vNWeE5aNMd4pcmPcZHb3JOq3ItzE/3lepXD/3wqMt36EqNykBVE7aJj+LVkcEgjP9CDDsg9j9NB+AuWYmIYqrHW/Rg/vJ developer@sssd.dev.work\n\n";
275698320a734a6fd647ea6a461d6ce38862da1dChristian Maederuint8_t key_data_CRLF[] = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDfymad64oZkWa6q3xLXmCt/LfCRnd6yZSDp7UK6Irx5/Dv69dEKK2kBGL9Wfn+3ZDa6ov2XZrBmUthh8KOJvTw72+axox3kcJ5HwOYZCMeKbcr10RNScGuHErA1HhjTY6M9L8d0atVH2QIxw7ZHoVVnTHC4U4+541YfJkNUiOUIj65cFFZm9ULp32ZPrK+j2wW+XZkHhrZeFMlg4x4fe5FocO6ik1eqLxBejo7tMy+1m3R2a795AIguf6vNWeE5aNMd4pcmPcZHb3JOq3ItzE/3lepXD/3wqMt36EqNykBVE7aJj+LVkcEgjP9CDDsg9j9NB+AuWYmIYqrHW/Rg/vJ developer@sssd.dev.work\r\n";
275698320a734a6fd647ea6a461d6ce38862da1dChristian Maederuint8_t key_data_CR_somewhere[] = "ssh-rsa AA\rAAB3NzaC1yc2EAAAADAQABAAABAQDfymad64oZkWa6q3xLXmCt/LfCRnd6yZSDp7UK6Irx5/Dv69dEKK2kBGL9Wf+3ZDa6ov2XZrBmUthh8KOJvTw72+axox3kcJ5HwOYZCMeKbcr10RNScGuHErA1HhjTY6M9L8d0atVH2QIxw7ZHoVVnTHC4U4+541YfJkNUiOUIj65cFFZm9ULp32ZPrK+j2wW+XZkHhrZeFMlg4x4fe5FocO6ik1eqLxBejo7tMy+1m3R2a795AIguf6vNWeE5aNMd4pcmPcZHb3JOq3ItzE/3lepXD/3wqMt36EqNykBVE7aJj+LVkcEgjP9CDDsg9j9NB+AuWYmIYqrHW/Rg/vJ developer@sssd.dev.work\n";
de8eee2014437ec4020be15cd363257f87e79943Christian Maeder struct sss_ssh_pubkey pkey_null_terminated = {
473f5af6e4803fbeecc814065952396f2501039bChristian Maeder .data_len = sizeof(key_data_noLF) - 1 /* ignore trailling '\0' */
473f5af6e4803fbeecc814065952396f2501039bChristian Maeder .data_len = sizeof(key_data_LF) - 1 /* ignore trailling '\0' */
275698320a734a6fd647ea6a461d6ce38862da1dChristian Maeder .data_len = sizeof(key_data_LFLF) - 1 /* ignore trailling '\0' */
b99c9606f2faafeabb3fa8c596992143a561c787Simon Ulbricht .data_len = sizeof(key_data_CRLF) - 1 /* ignore trailling '\0' */
275698320a734a6fd647ea6a461d6ce38862da1dChristian Maeder struct sss_ssh_pubkey pkey_CR_somewhere = {
526e7f36639cb58e3c99a54bea082499a6b04a25Christian Maeder .data_len = sizeof(key_data_CR_somewhere) - 1 /* ignore traill. '\0' */
dae8246f1f55b6a85e946fc1bfb6d32d556395f1Simon Ulbricht ret = sss_ssh_format_pubkey(mem_ctx, &pkey, &res);
f56cdf11927c31495bae642a9eb383212c90ba61Christian Maeder ret = sss_ssh_format_pubkey(mem_ctx, &pkey_LF, &res);
be1ce1c2b2819ef32743136c13101f1927375311Christian Maeder ret = sss_ssh_format_pubkey(mem_ctx, &pkey_LFLF, &res);
5896f38ba2934056542cb7cb3e6359e88a622547Christian Maeder ret = sss_ssh_format_pubkey(mem_ctx, &pkey_null_terminated, &res);
526e7f36639cb58e3c99a54bea082499a6b04a25Christian Maeder ret = sss_ssh_format_pubkey(mem_ctx, &pkey_CRLF, &res);
6a6689ad6d4c70af2ce3389f39a50982f20fd939Christian Maeder ret = sss_ssh_format_pubkey(mem_ctx, &pkey_CR_somewhere, &res);