On Sun, May 28, 2017 at 4:43 PM, Nikos Mavrogiannopoulos
<[email protected]> wrote:
> Could you catch this fpe using gdb and send if along with the contents of
> /proc/cpuinfo?
>

Hello Nikos,
I've attached the sample program, gdb output and cpuinfo as you requested.
Please have a look.

Regards
Mandar Joshi
Processor       : ARMv7 Processor rev 1 (v7l)
processor       : 0
BogoMIPS        : 3.27

processor       : 1
BogoMIPS        : 3.27

processor       : 2
BogoMIPS        : 3.27

processor       : 3
BogoMIPS        : 3.27

Features        : swp half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xc05
CPU revision    : 1

Hardware        : ODROIDC
Revision        : 000a
Serial          : 1b00000000000000
#include <glib.h>
#include <string.h>
#include <gnutls/gnutls.h>
#include <gnutls/crypto.h>
int main (int argc, char *argv[]) {
  gchar *input = argv[1];
  gchar encrypted[1024];
  memset (encrypted, 0, 1024);
  gsize size;
  gnutls_cipher_hd_t handle;
  gnutls_datum_t key;
  gsize length;
  key.data = "abcdabcdabcdabcdabcdabcdabcdabcd";
  key.size = 32;
  g_message ("Init: %d", gnutls_cipher_init (&handle, GNUTLS_CIPHER_AES_256_CBC, &key, NULL));
  g_message ("Encrypt: %d", gnutls_cipher_encrypt2 (handle, (void *) input, strlen(input), encrypted, strlen(input)));
  g_message ("%s", g_base64_encode (encrypted, strlen(input)));
  return 0;
}

(gdb) r 1234123412341234
The program being debugged has been started already.
Start it from the beginning? (y or n) r
Please answer y or n.
The program being debugged has been started already.
Start it from the beginning? (y or n) y
`/home/surveillance/code/060817/php/encrypttest' has changed; re-reading 
symbols.
(no debugging symbols found)
Starting program: /home/surveillance/code/060817/php/encrypttest 
1234123412341234
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
** Message: Init: 0

Program received signal SIGFPE, Arithmetic exception.
0xb6c5e1b4 in raise () from /lib/libc.so.6
(gdb) bt
#0  0xb6c5e1b4 in raise () from /lib/libc.so.6
#1  0xb69eb7e0 in __aeabi_ldiv0 () from /usr/lib/libnettle.so.6
#2  0xb69d41b8 in nettle_cbc_encrypt (ctx=0x3b490, 
    f=0xb69cc2a0 <nettle_aes256_encrypt>, block_size=block_size@entry=0, 
    iv=0x3b470 "", length=16, dst=0xbeffee2c "", 
    src=0xbefff50d "1234123412341234") at cbc.c:53
#3  0xb6f9044c in _cbc_encrypt (ctx=<optimized out>, length=<optimized out>, 
    dst=<optimized out>, src=<optimized out>) at cipher.c:119
#4  0xb6f90c94 in wrap_nettle_cipher_encrypt (_ctx=<optimized out>, 
    plain=0xbefff50d, plain_size=<optimized out>, encr=<optimized out>, 
    encr_size=16) at cipher.c:612
#5  0x00010924 in main ()
(gdb) 
_______________________________________________
Gnutls-help mailing list
[email protected]
http://lists.gnupg.org/mailman/listinfo/gnutls-help

Reply via email to